about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/compilers/llvm/4/clang/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/4/default.nix25
-rw-r--r--pkgs/development/compilers/llvm/4/llvm.nix2
-rw-r--r--pkgs/development/haskell-modules/configuration-common.nix7
-rw-r--r--pkgs/development/haskell-modules/hackage-packages.nix424
-rw-r--r--pkgs/development/interpreters/python/cpython/2.7/default.nix12
-rw-r--r--pkgs/development/libraries/gdbm/default.nix17
-rw-r--r--pkgs/development/libraries/gettext/default.nix29
-rw-r--r--pkgs/development/libraries/glib/default.nix4
-rw-r--r--pkgs/development/libraries/glibc/CVE-2017-1000366-rtld-LD_AUDIT.patch209
-rw-r--r--pkgs/development/libraries/glibc/CVE-2017-1000366-rtld-LD_LIBRARY_PATH.patch33
-rw-r--r--pkgs/development/libraries/glibc/CVE-2017-1000366-rtld-LD_PRELOAD.patch115
-rw-r--r--pkgs/development/libraries/glibc/common.nix10
-rw-r--r--pkgs/development/libraries/glibc/i686-fix-vectorized-strcspn.patch42
-rw-r--r--pkgs/development/libraries/gsl/default.nix4
-rw-r--r--pkgs/development/libraries/libatomic_ops/default.nix5
-rw-r--r--pkgs/development/libraries/libev/default.nix4
-rw-r--r--pkgs/development/libraries/libiconv/default.nix12
-rw-r--r--pkgs/development/libraries/libiconv/libiconv-1.14-reloc.patch269
-rw-r--r--pkgs/development/libraries/libiconv/libiconv-1.14-wchar.patch102
-rw-r--r--pkgs/development/libraries/libmicrohttpd/default.nix4
-rw-r--r--pkgs/development/libraries/libxslt/default.nix6
-rw-r--r--pkgs/development/libraries/ncurses/default.nix4
-rw-r--r--pkgs/development/libraries/opencv/3.x.nix4
-rw-r--r--pkgs/development/libraries/openldap/default.nix4
-rw-r--r--pkgs/development/libraries/openssl/1.0.1-cygwin64.patch136
-rw-r--r--pkgs/development/libraries/openssl/default.nix1
-rw-r--r--pkgs/development/libraries/sqlite/default.nix6
-rw-r--r--pkgs/development/libraries/zlib/default.nix2
-rw-r--r--pkgs/development/libraries/zlib/disable-cygwin-widechar.patch13
-rw-r--r--pkgs/development/python-modules/pip-tools/default.nix12
-rw-r--r--pkgs/development/python-modules/pylast/default.nix24
-rw-r--r--pkgs/development/python-modules/spotipy/default.nix21
-rw-r--r--pkgs/development/python-modules/uritools/default.nix20
-rw-r--r--pkgs/development/tools/continuous-integration/gitlab-runner/default.nix8
-rw-r--r--pkgs/development/tools/misc/help2man/1.40.4-cygwin-nls.patch10
-rw-r--r--pkgs/development/tools/misc/help2man/default.nix7
-rw-r--r--pkgs/development/tools/misc/pkgconfig/2.36.3-not-win32.patch13
-rw-r--r--pkgs/development/tools/misc/pkgconfig/default.nix2
-rw-r--r--pkgs/development/tools/nailgun/default.nix40
40 files changed, 984 insertions, 680 deletions
diff --git a/pkgs/development/compilers/llvm/4/clang/default.nix b/pkgs/development/compilers/llvm/4/clang/default.nix
index 64dbaa21dd429..276db7a7b4169 100644
--- a/pkgs/development/compilers/llvm/4/clang/default.nix
+++ b/pkgs/development/compilers/llvm/4/clang/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetch, cmake, libxml2, libedit, llvm, version, release_version, clang-tools-extra_src, python
 , fixDarwinDylibNames
-, enableManpages ? true
+, enableManpages ? false
 }:
 
 let
diff --git a/pkgs/development/compilers/llvm/4/default.nix b/pkgs/development/compilers/llvm/4/default.nix
index 15918f9c1ebdf..20e9d8d4d978c 100644
--- a/pkgs/development/compilers/llvm/4/default.nix
+++ b/pkgs/development/compilers/llvm/4/default.nix
@@ -1,4 +1,4 @@
-{ newScope, stdenv, cmake, libxml2, python2, isl, fetchurl, overrideCC, wrapCC, darwin, ccWrapperFun }:
+{ lowPrio, newScope, stdenv, cmake, libxml2, python2, isl, fetchurl, overrideCC, wrapCC, darwin, ccWrapperFun }:
 let
   callPackage = newScope (self // { inherit stdenv cmake libxml2 python2 isl release_version version fetch; });
 
@@ -13,14 +13,25 @@ let
   compiler-rt_src = fetch "compiler-rt" "059ipqq27gd928ay06f1ck3vw6y5h5z4zd766x8k0k7jpqimpwnk";
   clang-tools-extra_src = fetch "clang-tools-extra" "16bwckgcxfn56mbqjlxi7fxja0zm9hjfa6s3ncm3dz98n5zd7ds1";
 
+  # Add man output without introducing extra dependencies.
+  overrideManOutput = drv:
+    let drv-manpages = drv.override { enableManpages = true; }; in
+    drv // { man = drv-manpages.man; outputs = drv.outputs ++ ["man"]; };
+
+  llvm = callPackage ./llvm.nix {
+    inherit compiler-rt_src stdenv;
+  };
+
+  clang-unwrapped = callPackage ./clang {
+    inherit clang-tools-extra_src stdenv;
+  };
+
   self = {
-    llvm = callPackage ./llvm.nix {
-      inherit compiler-rt_src stdenv;
-    };
+    llvm = overrideManOutput llvm;
+    clang-unwrapped = overrideManOutput clang-unwrapped;
 
-    clang-unwrapped = callPackage ./clang {
-      inherit clang-tools-extra_src stdenv;
-    };
+    llvm-manpages = lowPrio self.llvm.man;
+    clang-manpages = lowPrio self.clang-unwrapped.man;
 
     clang = wrapCC self.clang-unwrapped;
 
diff --git a/pkgs/development/compilers/llvm/4/llvm.nix b/pkgs/development/compilers/llvm/4/llvm.nix
index 98c24495355c2..c5d22825f301f 100644
--- a/pkgs/development/compilers/llvm/4/llvm.nix
+++ b/pkgs/development/compilers/llvm/4/llvm.nix
@@ -16,7 +16,7 @@
 , compiler-rt_src
 , libcxxabi
 , debugVersion ? false
-, enableManpages ? true
+, enableManpages ? false
 , enableSharedLibraries ? true
 , darwin
 }:
diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix
index fccde7426c633..abf477189f071 100644
--- a/pkgs/development/haskell-modules/configuration-common.nix
+++ b/pkgs/development/haskell-modules/configuration-common.nix
@@ -63,18 +63,19 @@ self: super: {
 
   # The Hackage tarball is purposefully broken, because it's not intended to be, like, useful.
   # https://git-annex.branchable.com/bugs/bash_completion_file_is_missing_in_the_6.20160527_tarball_on_hackage/
-  git-annex = ((overrideCabal super.git-annex (drv: {
+  git-annex = (overrideCabal (super.git-annex.overrideScope (self: super: {
+      optparse-applicative = self.optparse-applicative_0_14_0_0;
+    })) (drv: {
     src = pkgs.fetchgit {
       name = "git-annex-${drv.version}-src";
       url = "git://git-annex.branchable.com/";
       rev = "refs/tags/" + drv.version;
       sha256 = "1psyklfyjf4zqh3qxjn11sp2jiwvp8mfxqvsi1wggqpidfmk39jx";
     };
-  }))).override {
+  })).override {
     dbus = if pkgs.stdenv.isLinux then self.dbus else null;
     fdo-notify = if pkgs.stdenv.isLinux then self.fdo-notify else null;
     hinotify = if pkgs.stdenv.isLinux then self.hinotify else self.fsnotify;
-    optparse-applicative = self.optparse-applicative_0_14_0_0;
   };
 
   # https://github.com/froozen/kademlia/issues/2
diff --git a/pkgs/development/haskell-modules/hackage-packages.nix b/pkgs/development/haskell-modules/hackage-packages.nix
index 2038bc9ba8427..65ad24320c8e4 100644
--- a/pkgs/development/haskell-modules/hackage-packages.nix
+++ b/pkgs/development/haskell-modules/hackage-packages.nix
@@ -32981,7 +32981,7 @@ self: {
        description = "Bindings to the Yices theorem prover";
        license = stdenv.lib.licenses.publicDomain;
        hydraPlatforms = stdenv.lib.platforms.none;
-     }) {inherit (pkgs) gmp; yices = null;};
+     }) {inherit (pkgs) gmp; inherit (pkgs) yices;};
 
   "bindynamic" = callPackage
     ({ mkDerivation, base, binary, bytestring, rank1dynamic }:
@@ -39795,6 +39795,29 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "cassava-conduit_0_4_0_0" = callPackage
+    ({ mkDerivation, array, base, bifunctors, bytestring, cassava
+     , conduit, conduit-extra, containers, criterion, mtl, QuickCheck
+     , text
+     }:
+     mkDerivation {
+       pname = "cassava-conduit";
+       version = "0.4.0.0";
+       sha256 = "1pl3vbkyjvgz08ijm75rdxnxx5h27mya7bgzi9jpws7v2dwxlg22";
+       libraryHaskellDepends = [
+         array base bifunctors bytestring cassava conduit conduit-extra
+         containers mtl text
+       ];
+       testHaskellDepends = [
+         base bytestring cassava conduit conduit-extra QuickCheck text
+       ];
+       benchmarkHaskellDepends = [ base criterion ];
+       homepage = "https://github.com/domdere/cassava-conduit";
+       description = "Conduit interface for cassava package";
+       license = stdenv.lib.licenses.bsd3;
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "cassava-megaparsec" = callPackage
     ({ mkDerivation, base, bytestring, cassava, containers, hspec
      , hspec-megaparsec, megaparsec, unordered-containers, vector
@@ -49024,7 +49047,7 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
-  "criterion_1_2_0_0" = callPackage
+  "criterion_1_2_1_0" = callPackage
     ({ mkDerivation, aeson, ansi-wl-pprint, base, base-compat, binary
      , bytestring, cassava, code-page, containers, deepseq, directory
      , exceptions, filepath, Glob, HUnit, js-flot, js-jquery
@@ -49035,8 +49058,8 @@ self: {
      }:
      mkDerivation {
        pname = "criterion";
-       version = "1.2.0.0";
-       sha256 = "0rbmfjgxba7qsp79lj7k00yzphmknimqh5r20nw1bc6i1v4civ6f";
+       version = "1.2.1.0";
+       sha256 = "0hbhm6fcbvh38m8hazlzjh3z09adjrzcv5jq63792bvnm24bpx6r";
        isLibrary = true;
        isExecutable = true;
        libraryHaskellDepends = [
@@ -51922,6 +51945,19 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "data-diverse" = callPackage
+    ({ mkDerivation, base, containers, ghc-prim, hspec, lens, tagged }:
+     mkDerivation {
+       pname = "data-diverse";
+       version = "0.2.0.0";
+       sha256 = "1lffgpy3pz0hyq6l4r7l4aqsldgis5wbd9jpllankhfxghxx9gvn";
+       libraryHaskellDepends = [ base containers ghc-prim lens tagged ];
+       testHaskellDepends = [ base hspec lens ];
+       homepage = "https://github.com/louispan/data-diverse#readme";
+       description = "Extensible records and polymorphic variants";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
+
   "data-dword" = callPackage
     ({ mkDerivation, base, data-bword, ghc-prim, hashable, tasty
      , tasty-quickcheck, template-haskell
@@ -62414,6 +62450,22 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "entropy_0_3_8" = callPackage
+    ({ mkDerivation, base, bytestring, Cabal, directory, filepath
+     , process, unix
+     }:
+     mkDerivation {
+       pname = "entropy";
+       version = "0.3.8";
+       sha256 = "1l3lfigqvdlmxkz1wl7zdkmc0i2r5p6z4xzhiw8xdsbsw7aljfkl";
+       setupHaskellDepends = [ base Cabal directory filepath process ];
+       libraryHaskellDepends = [ base bytestring unix ];
+       homepage = "https://github.com/TomMD/entropy";
+       description = "A platform independent entropy source";
+       license = stdenv.lib.licenses.bsd3;
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "enumerable" = callPackage
     ({ mkDerivation, base, control-monad-omega, tagged }:
      mkDerivation {
@@ -63942,21 +63994,22 @@ self: {
      }) {};
 
   "eventful-core" = callPackage
-    ({ mkDerivation, aeson, base, containers, hlint, hspec
-     , http-api-data, HUnit, path-pieces, sum-type-boilerplate
+    ({ mkDerivation, aeson, base, containers, contravariant, hlint
+     , hspec, http-api-data, HUnit, path-pieces, sum-type-boilerplate
      , template-haskell, text, transformers, uuid
      }:
      mkDerivation {
        pname = "eventful-core";
-       version = "0.1.2";
-       sha256 = "0vlhn54qiwi6cvvf9r4nwgnlp747y3i1nh9y2dxr8g9zkpj0wcyn";
+       version = "0.1.3";
+       sha256 = "1lify1ama6a479w0mcvr4qmp0mrfgwf6nsy902hrx20sn5ik02h9";
        libraryHaskellDepends = [
-         aeson base containers http-api-data path-pieces
+         aeson base containers contravariant http-api-data path-pieces
          sum-type-boilerplate template-haskell text transformers uuid
        ];
        testHaskellDepends = [
-         aeson base containers hlint hspec http-api-data HUnit path-pieces
-         sum-type-boilerplate template-haskell text transformers uuid
+         aeson base containers contravariant hlint hspec http-api-data HUnit
+         path-pieces sum-type-boilerplate template-haskell text transformers
+         uuid
        ];
        homepage = "https://github.com/jdreaver/eventful#readme";
        description = "Core module for eventful";
@@ -63971,8 +64024,8 @@ self: {
      }:
      mkDerivation {
        pname = "eventful-dynamodb";
-       version = "0.1.2";
-       sha256 = "0q8wvnxcprh4gz74d4jsia5ripgn87lb2mw037mrf817g0w63dgl";
+       version = "0.1.3";
+       sha256 = "1ymzryyz77705vwb05nhjhw6sz2ksjfpld5g569pnbdlr03m257y";
        libraryHaskellDepends = [
          aeson amazonka amazonka-dynamodb base bytestring conduit
          eventful-core lens safe text unordered-containers vector
@@ -63995,8 +64048,8 @@ self: {
      }:
      mkDerivation {
        pname = "eventful-memory";
-       version = "0.1.2";
-       sha256 = "0kq8f6x7q19vlwgfz7mwlisik0j5wi8pxwlliyv2ispa37rlmvgx";
+       version = "0.1.3";
+       sha256 = "0r35bg40j4bdpf5ibxi5acjnmdl9piaysyzswapwcjq4jyibcdk9";
        libraryHaskellDepends = [
          base containers eventful-core mtl safe stm
        ];
@@ -64016,8 +64069,8 @@ self: {
      }:
      mkDerivation {
        pname = "eventful-postgresql";
-       version = "0.1.2";
-       sha256 = "0aim6907mkjxlwiwkhmjmmfcbagkaq7z633447xr4mw931v8k84l";
+       version = "0.1.3";
+       sha256 = "0vc36qfi2q1im60nwzb9ivpsz7kk2y83rbzbbv4b2mjk3cvvjnyr";
        libraryHaskellDepends = [
          aeson base bytestring eventful-core eventful-sql-common mtl
          persistent text
@@ -64039,8 +64092,8 @@ self: {
      }:
      mkDerivation {
        pname = "eventful-sql-common";
-       version = "0.1.2";
-       sha256 = "05q1v64l007saazflvp70sz4579dpzpr08qcgzhg2b1m2ga3pwhn";
+       version = "0.1.3";
+       sha256 = "0mddqciaiq90cgf0syw0y1qvvkpvqbx0lkx8mwz3g8zf57h98awc";
        libraryHaskellDepends = [
          aeson base bytestring eventful-core mtl persistent
          persistent-template text uuid
@@ -64057,8 +64110,8 @@ self: {
      }:
      mkDerivation {
        pname = "eventful-sqlite";
-       version = "0.1.2";
-       sha256 = "191c8fcw7wyr9bvviz1h9nbwcyrh5sl31arv4s9b3rjw847zg50j";
+       version = "0.1.3";
+       sha256 = "08xk3kyxm23843kr2y9l39d9d9ykcahz2q2730c1skgnwcd3y0c2";
        libraryHaskellDepends = [
          aeson base bytestring eventful-core eventful-sql-common mtl
          persistent text uuid
@@ -64075,14 +64128,14 @@ self: {
 
   "eventful-test-helpers" = callPackage
     ({ mkDerivation, aeson, aeson-casing, base, eventful-core, extra
-     , hspec, monad-logger
+     , hspec, monad-logger, text
      }:
      mkDerivation {
        pname = "eventful-test-helpers";
-       version = "0.1.2";
-       sha256 = "17i55zi9npjj7c97lc6fzad5aak46agcr73d5lv3yycm4lk2hj1g";
+       version = "0.1.3";
+       sha256 = "16ba3184niy3dsh6h08czj7x0bd4abx7ji2aaddd5pvxra9494xl";
        libraryHaskellDepends = [
-         aeson aeson-casing base eventful-core extra hspec monad-logger
+         aeson aeson-casing base eventful-core extra hspec monad-logger text
        ];
        homepage = "https://github.com/jdreaver/eventful#readme";
        description = "Common module used for eventful tests";
@@ -87415,6 +87468,8 @@ self: {
        pname = "hashable";
        version = "1.2.6.1";
        sha256 = "0ymv2mcrrgbdc2w39rib171fwnhg7fgp0sy4h8amrh1vw64qgjll";
+       revision = "1";
+       editedCabalFile = "1saaj9izz0faj85svdd45z4iygqb9z8i130br9vlqp3py7f2ymzz";
        isLibrary = true;
        isExecutable = true;
        libraryHaskellDepends = [
@@ -98665,8 +98720,8 @@ self: {
      }:
      mkDerivation {
        pname = "hpack";
-       version = "0.18.0";
-       sha256 = "1z738mw0kzic4wx5dpihh1c1gimpjkl14wl6w2nmmdfx2bdjm5rv";
+       version = "0.18.1";
+       sha256 = "1ssawa6187m0xzn7i5hn154qajq46jlpbvz1s28qk4bigpv38m7k";
        isLibrary = true;
        isExecutable = true;
        libraryHaskellDepends = [
@@ -114698,6 +114753,42 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "katip_0_4_0_0" = callPackage
+    ({ mkDerivation, aeson, async, auto-update, base, blaze-builder
+     , bytestring, containers, criterion, deepseq, directory, either
+     , exceptions, hostname, microlens, microlens-th, monad-control, mtl
+     , old-locale, quickcheck-instances, regex-tdfa, resourcet
+     , semigroups, string-conv, tasty, tasty-golden, tasty-hunit
+     , tasty-quickcheck, template-haskell, text, time
+     , time-locale-compat, transformers, transformers-base
+     , transformers-compat, unagi-chan, unix, unordered-containers
+     }:
+     mkDerivation {
+       pname = "katip";
+       version = "0.4.0.0";
+       sha256 = "1l9zpq7gr5madmqmm4cp3p6lid0krxaf6gki2qcxlkvsm39cr9vz";
+       libraryHaskellDepends = [
+         aeson async auto-update base bytestring containers either
+         exceptions hostname microlens microlens-th monad-control mtl
+         old-locale resourcet semigroups string-conv template-haskell text
+         time transformers transformers-base transformers-compat unagi-chan
+         unix unordered-containers
+       ];
+       testHaskellDepends = [
+         aeson base bytestring directory microlens quickcheck-instances
+         regex-tdfa tasty tasty-golden tasty-hunit tasty-quickcheck
+         template-haskell text time time-locale-compat unordered-containers
+       ];
+       benchmarkHaskellDepends = [
+         aeson async base blaze-builder criterion deepseq text time
+         transformers unix
+       ];
+       homepage = "https://github.com/Soostone/katip";
+       description = "A structured logging framework";
+       license = stdenv.lib.licenses.bsd3;
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "katip-elasticsearch" = callPackage
     ({ mkDerivation, aeson, async, base, bloodhound, containers
      , criterion, deepseq, enclosed-exceptions, exceptions, http-client
@@ -117849,8 +117940,8 @@ self: {
      }:
      mkDerivation {
        pname = "language-sally";
-       version = "0.1.0.1";
-       sha256 = "0zbq1sjf96hpsidnx2cqwh4g4q3s5zqq6iv92y4rwff58j2fdy35";
+       version = "0.1.1.0";
+       sha256 = "10ddikcavh7ppmm5issii7mv9nagrs0841cngz3alfw0sw6bw47v";
        libraryHaskellDepends = [
          ansi-wl-pprint base bytestring containers text
        ];
@@ -120435,6 +120526,29 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "lifted-async_0_9_2" = callPackage
+    ({ mkDerivation, async, base, constraints, criterion, deepseq
+     , HUnit, lifted-base, monad-control, mtl, tasty, tasty-hunit
+     , tasty-th, transformers-base
+     }:
+     mkDerivation {
+       pname = "lifted-async";
+       version = "0.9.2";
+       sha256 = "14p8fbbvcr35kkv8ayxlsqcfn55am9lyzmszciww13y8mx7b214z";
+       libraryHaskellDepends = [
+         async base constraints lifted-base monad-control transformers-base
+       ];
+       testHaskellDepends = [
+         async base HUnit lifted-base monad-control mtl tasty tasty-hunit
+         tasty-th
+       ];
+       benchmarkHaskellDepends = [ async base criterion deepseq ];
+       homepage = "https://github.com/maoe/lifted-async";
+       description = "Run lifted IO operations asynchronously and wait for their results";
+       license = stdenv.lib.licenses.bsd3;
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "lifted-base" = callPackage
     ({ mkDerivation, base, criterion, HUnit, monad-control, monad-peel
      , test-framework, test-framework-hunit, transformers
@@ -123854,8 +123968,8 @@ self: {
      }:
      mkDerivation {
        pname = "loup";
-       version = "0.0.6";
-       sha256 = "0lvz5pkb2b4r18hcm4951bc06yb503wywkx20iihax76vgssxr8b";
+       version = "0.0.8";
+       sha256 = "0chb4pp8czc0i0nn0dx78r7j7gr3d9mi0f51kdrimk301dpcca29";
        isLibrary = true;
        isExecutable = true;
        libraryHaskellDepends = [
@@ -130588,6 +130702,23 @@ self: {
        license = stdenv.lib.licenses.mit;
      }) {};
 
+  "monad-mock" = callPackage
+    ({ mkDerivation, base, constraints, exceptions, hspec
+     , monad-control, mtl, transformers-base
+     }:
+     mkDerivation {
+       pname = "monad-mock";
+       version = "0.1.0.0";
+       sha256 = "0ax46lh6j2xxs6xidj1i6jw2yv2i1p79807fcwfqrkb1rl6xchx4";
+       libraryHaskellDepends = [
+         base constraints exceptions monad-control mtl transformers-base
+       ];
+       testHaskellDepends = [ base hspec ];
+       homepage = "https://github.com/cjdev/monad-mock#readme";
+       description = "A monad transformer for mocking mtl-style typeclasses";
+       license = stdenv.lib.licenses.isc;
+     }) {};
+
   "monad-open" = callPackage
     ({ mkDerivation, base, exceptions, mtl, transformers }:
      mkDerivation {
@@ -139635,8 +139766,8 @@ self: {
      }:
      mkDerivation {
        pname = "opencv";
-       version = "0.0.1.0";
-       sha256 = "1ar5h1z875bqz52j2d1kqmb1v78prwwwn5nmwqz37kg5qk3lhzkf";
+       version = "0.0.1.1";
+       sha256 = "095vljv7y7am7dfn7hp9rncfcbcmmqvgzwgw6iwrp6s3z0qv10jn";
        configureFlags = [
          "--with-gcc=${stdenv.cc}/bin/c++" "--with-ld=${stdenv.cc}/bin/c++"
        ];
@@ -139668,8 +139799,8 @@ self: {
      }:
      mkDerivation {
        pname = "opencv-extra";
-       version = "0.0.0.1";
-       sha256 = "0z0ym7mg6w67vxyj09zybybnhvqvvrdr1n04vzyqj2b5lqbryrw6";
+       version = "0.1.0.0";
+       sha256 = "1ah6jipanqag0vk4fjd35rr5xi479w2iym0ix6wd9g9zswb89k8j";
        setupHaskellDepends = [ base Cabal ];
        libraryHaskellDepends = [
          base bindings-DSL bytestring containers inline-c inline-c-cpp
@@ -147851,6 +147982,22 @@ self: {
        license = stdenv.lib.licenses.mit;
      }) {};
 
+  "ploton" = callPackage
+    ({ mkDerivation, base, hspec, optparse-applicative, process }:
+     mkDerivation {
+       pname = "ploton";
+       version = "0.1.0.0";
+       sha256 = "0iv4ngwf7zj20wglpa2klj5a39nfqmwbh7s1kivrlia1mi0xck3d";
+       isLibrary = true;
+       isExecutable = true;
+       libraryHaskellDepends = [ base optparse-applicative process ];
+       executableHaskellDepends = [ base ];
+       testHaskellDepends = [ base hspec ];
+       homepage = "https://github.com/ishiy1993/ploton#readme";
+       description = "A useful cli tool to draw figures";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
+
   "plots" = callPackage
     ({ mkDerivation, adjunctions, base, base-orphans, colour
      , containers, data-default, diagrams-core, diagrams-lib, directory
@@ -149401,6 +149548,29 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "postgresql-schema_0_1_11" = callPackage
+    ({ mkDerivation, base, basic-prelude, optparse-applicative
+     , postgresql-simple, shelly, text, time, time-locale-compat
+     }:
+     mkDerivation {
+       pname = "postgresql-schema";
+       version = "0.1.11";
+       sha256 = "1xhaqxc389dghf77hlz6zy6pa6phxv8by42lzs91ymjhvwhnb7bl";
+       isLibrary = true;
+       isExecutable = true;
+       libraryHaskellDepends = [
+         base basic-prelude postgresql-simple shelly text
+       ];
+       executableHaskellDepends = [
+         base basic-prelude optparse-applicative shelly text time
+         time-locale-compat
+       ];
+       homepage = "https://github.com/mfine/postgresql-schema";
+       description = "PostgreSQL Schema Management";
+       license = stdenv.lib.licenses.bsd3;
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "postgresql-simple" = callPackage
     ({ mkDerivation, aeson, attoparsec, base, base16-bytestring
      , bytestring, bytestring-builder, case-insensitive, containers
@@ -150795,15 +150965,13 @@ self: {
      }:
      mkDerivation {
        pname = "prettyprinter-compat-ansi-wl-pprint";
-       version = "1";
-       sha256 = "1w84df99n1fwzwyflfjh6bsbrv03yzdsq8b42ziqcb3m1mq5hf1v";
-       revision = "2";
-       editedCabalFile = "1bcj2y4b4pj028lllljpj52m622h6rv0qngfyq2xc8jzn7pls5ca";
+       version = "1.0.1";
+       sha256 = "0gzpjddnxl4z8pvb0lyal13jbr94dk900k8g4qwcq9fs26vnnb81";
        libraryHaskellDepends = [
          base prettyprinter prettyprinter-ansi-terminal text
        ];
        homepage = "http://github.com/quchen/prettyprinter";
-       description = "Prettyprinter compatibility module for previous users of the ansi-wl-pprint package";
+       description = "Drop-in compatibility package to migrate from »ansi-wl-pprint« to »prettyprinter«";
        license = stdenv.lib.licenses.bsd2;
      }) {};
 
@@ -152118,6 +152286,23 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "proto-lens-arbitrary_0_1_0_3" = callPackage
+    ({ mkDerivation, base, bytestring, containers, lens-family
+     , proto-lens, QuickCheck, text
+     }:
+     mkDerivation {
+       pname = "proto-lens-arbitrary";
+       version = "0.1.0.3";
+       sha256 = "029liw55v5k9f5bsfpsadd85sgrriwvrhfk242d2wfp3fypafd39";
+       libraryHaskellDepends = [
+         base bytestring containers lens-family proto-lens QuickCheck text
+       ];
+       homepage = "https://github.com/google/proto-lens";
+       description = "Arbitrary instances for proto-lens";
+       license = stdenv.lib.licenses.bsd3;
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "proto-lens-combinators" = callPackage
     ({ mkDerivation, base, Cabal, data-default-class, HUnit
      , lens-family, lens-family-core, proto-lens, proto-lens-protoc
@@ -159725,6 +159910,8 @@ self: {
        pname = "repa";
        version = "3.4.1.2";
        sha256 = "0myw05dicby7dhkmjvv9wphfnnx2jj3dxaa50357n76zysxhpy2p";
+       revision = "1";
+       editedCabalFile = "0pagab03fw7xp1vvgrc87g6g6zdr60plqhjjxk3fwwm1gs0jj61k";
        libraryHaskellDepends = [
          base bytestring ghc-prim QuickCheck template-haskell vector
        ];
@@ -167129,8 +167316,8 @@ self: {
      }:
      mkDerivation {
        pname = "servant-auth-token";
-       version = "0.4.7.0";
-       sha256 = "0237kjsvgi6wfn8qisbf93w3irp73i00728zd4v1z3s5a435kgff";
+       version = "0.4.7.1";
+       sha256 = "0mswxxq2b6n1f3laz15y87nxnsw5l1bmpl9kfdif4spd286wgaa8";
        libraryHaskellDepends = [
          aeson-injector base bytestring containers mtl pwstore-fast
          servant-auth-token-api servant-server text time transformers uuid
@@ -167150,8 +167337,8 @@ self: {
      }:
      mkDerivation {
        pname = "servant-auth-token-acid";
-       version = "0.4.1.0";
-       sha256 = "0m1kpjyl9s6xxmmg6sxq2ipg2ylw0ccvwbqzjg0lx26h9h44wzai";
+       version = "0.4.1.1";
+       sha256 = "01y3dis2v984a7g4hfl28ygac6jp6dcr5kzp8b45c4lywsi6pd7a";
        libraryHaskellDepends = [
          acid-state aeson-injector base bytestring containers ghc-prim
          monad-control mtl safe safecopy servant-auth-token
@@ -167170,8 +167357,8 @@ self: {
      }:
      mkDerivation {
        pname = "servant-auth-token-api";
-       version = "0.4.2.1";
-       sha256 = "06sn1k17acznmldknlqhfdvlb7cs7wiihsjcfk5xs9wzc6ssrvqf";
+       version = "0.4.2.2";
+       sha256 = "0dnaqhri1hg1c3gmlpnpyk21q4cq9j513fnd3g1m9k7mkc6h6bgv";
        libraryHaskellDepends = [
          aeson aeson-injector base lens raw-strings-qq servant servant-docs
          servant-swagger swagger2 text
@@ -167191,8 +167378,8 @@ self: {
      }:
      mkDerivation {
        pname = "servant-auth-token-leveldb";
-       version = "0.4.2.0";
-       sha256 = "09pnqdm6n3l5nivcrlczjp4sax0l1cg3l42hxwkw0s0prwvq1vi8";
+       version = "0.4.2.1";
+       sha256 = "0i7h05jsc0r644prgifbvj7xrjpr7qsmwhqcc93p33f1wznn9h5n";
        libraryHaskellDepends = [
          aeson-injector base bytestring concurrent-extra containers
          exceptions lens leveldb-haskell monad-control mtl resourcet safe
@@ -167214,8 +167401,8 @@ self: {
      }:
      mkDerivation {
        pname = "servant-auth-token-persistent";
-       version = "0.5.1.0";
-       sha256 = "0kvhk4wd8qdiaqjgs3k8s8jlxhph9jddpgq8caf7yldw6wz2kqi2";
+       version = "0.5.1.1";
+       sha256 = "09np7cilm1ij7ra06zyx7wqcm8ynras0q6fsfkkklpr5w632ifh1";
        libraryHaskellDepends = [
          aeson-injector base bytestring containers monad-control mtl
          persistent persistent-template servant-auth-token
@@ -167237,8 +167424,8 @@ self: {
      }:
      mkDerivation {
        pname = "servant-auth-token-rocksdb";
-       version = "0.4.2.0";
-       sha256 = "0268i74lf0ib7kc6nc8nqyfdn761vkdgjl1xyjcz8c8vlg0624vb";
+       version = "0.4.2.1";
+       sha256 = "0zl5xr12pnz99798pz1rn6q2msir57df97h6xayj3167zmmdv2fy";
        libraryHaskellDepends = [
          aeson-injector base bytestring concurrent-extra containers
          exceptions lens monad-control mtl resourcet rocksdb safe
@@ -168722,16 +168909,18 @@ self: {
      }) {};
 
   "serviette" = callPackage
-    ({ mkDerivation, aeson, base, bytestring, generic-deriving, text }:
+    ({ mkDerivation, aeson, base, bytestring, generic-deriving, text
+     , text-show
+     }:
      mkDerivation {
        pname = "serviette";
-       version = "0.1.0.4";
-       sha256 = "1i5k12y547z3l2hb4h1zafvv9sbfh5x60hajjw78dnk2p4v1gzl4";
+       version = "0.1.0.6";
+       sha256 = "00bh2c73g11bglw5z96g9d1bqkcd783byd3jrf5amgay28xk2l5d";
        libraryHaskellDepends = [
-         aeson base bytestring generic-deriving text
+         aeson base bytestring generic-deriving text text-show
        ];
        homepage = "https://github.com/v0d1ch/serviette#readme";
-       description = "JSON to raw Sql string";
+       description = "JSON to Sql";
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
@@ -170061,8 +170250,8 @@ self: {
      }:
      mkDerivation {
        pname = "shikensu";
-       version = "0.3.6";
-       sha256 = "121ff1a68lrzclx8qq7y5yn8rxqzj6bn92naws5v15ps9mx1b34r";
+       version = "0.3.7";
+       sha256 = "1gi1l8rs093s2jxyqwpg7yjbyjc9km87hdxai2j832viwrd828b5";
        libraryHaskellDepends = [
          aeson base bytestring directory filepath flow Glob text
          unordered-containers
@@ -170083,10 +170272,8 @@ self: {
      }:
      mkDerivation {
        pname = "shine";
-       version = "0.1.0.0";
-       sha256 = "1839whd680f1jm0789i6aqlkfbs8af6szzpfyhxzbxhdqjrz63mj";
-       revision = "2";
-       editedCabalFile = "0rq1p8w4yp6y5yf49fw0bpaxjcrb3dkqw9x9fl9j614d5xg03gxj";
+       version = "0.2.0.1";
+       sha256 = "07d990gkvgd804a6k85n0m8cxss6855gsgg7d52r341l1l706aca";
        libraryHaskellDepends = [
          base ghcjs-dom ghcjs-prim keycode mtl time transformers
        ];
@@ -170103,8 +170290,8 @@ self: {
        pname = "shine-varying";
        version = "0.1.0.0";
        sha256 = "13mnzf8i9y7ifn73mvsrzv0dh01vc20cymqli29j384z1491sc40";
-       revision = "1";
-       editedCabalFile = "133i3r6kv109vq5hn1y6yq06p79hkfk4cd7qgb6caidgn422cm7v";
+       revision = "3";
+       editedCabalFile = "1icg7mcfw6zrdf884kh2g0ss2lki0zf0b3r0yqzmz4h2cwvxl910";
        libraryHaskellDepends = [ base ghcjs-dom keycode shine varying ];
        testHaskellDepends = [ base ghcjs-dom keycode shine varying ];
        homepage = "https://github.com/fgaz/shine-varying";
@@ -170402,15 +170589,13 @@ self: {
      }) {};
 
   "si-clock" = callPackage
-    ({ mkDerivation, base, bytestring, hsI2C, read-env-var, time
-     , transformers
-     }:
+    ({ mkDerivation, base, bytestring, hsI2C, time, transformers }:
      mkDerivation {
        pname = "si-clock";
-       version = "0.1.0";
-       sha256 = "18qgibfy0rj3wxz51rj0ks9bxp574wxpdjxdkjgf8xzsl1hs9h8i";
+       version = "0.1.1";
+       sha256 = "1wcw3ws1125lpazar5934v93y76shdl279ll02z8911d3hcx0vh5";
        libraryHaskellDepends = [
-         base bytestring hsI2C read-env-var time transformers
+         base bytestring hsI2C time transformers
        ];
        description = "An interface to the Silicon Labs Si5351 clock chip";
        license = stdenv.lib.licenses.bsd3;
@@ -181231,6 +181416,70 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "symantic" = callPackage
+    ({ mkDerivation, base, containers, ghc-prim, mono-traversable
+     , symantic-document, symantic-grammar, text, transformers
+     }:
+     mkDerivation {
+       pname = "symantic";
+       version = "6.0.0.20170623";
+       sha256 = "0g4gfy8hjdwg95hr2jka2b3jvhb5dy27m71sb8kidbk954si8fhy";
+       libraryHaskellDepends = [
+         base containers ghc-prim mono-traversable symantic-document
+         symantic-grammar text transformers
+       ];
+       description = "Library for Typed Tagless-Final Higher-Order Composable DSL";
+       license = stdenv.lib.licenses.gpl3;
+     }) {};
+
+  "symantic-document" = callPackage
+    ({ mkDerivation, ansi-terminal, base, text }:
+     mkDerivation {
+       pname = "symantic-document";
+       version = "0.0.0.20170623";
+       sha256 = "0va9q2lp6vp81sm0vfm10s7ybp34i89bk6p2ry2f0fcr0lhb09i0";
+       libraryHaskellDepends = [ ansi-terminal base text ];
+       description = "Document symantics";
+       license = stdenv.lib.licenses.gpl3;
+     }) {};
+
+  "symantic-grammar" = callPackage
+    ({ mkDerivation, base, megaparsec, tasty, tasty-hunit, text
+     , transformers
+     }:
+     mkDerivation {
+       pname = "symantic-grammar";
+       version = "0.0.0.20170623";
+       sha256 = "0ds1r71n96kjsr60l5jlv4kb56v7pplrwp93bzni6hiddfm6g917";
+       libraryHaskellDepends = [ base text ];
+       testHaskellDepends = [
+         base megaparsec tasty tasty-hunit text transformers
+       ];
+       description = "Library for symantic grammars";
+       license = stdenv.lib.licenses.gpl3;
+     }) {};
+
+  "symantic-lib" = callPackage
+    ({ mkDerivation, base, containers, ghc-prim, megaparsec
+     , monad-classes, mono-traversable, symantic, symantic-grammar
+     , tasty, tasty-hunit, text, transformers
+     }:
+     mkDerivation {
+       pname = "symantic-lib";
+       version = "0.0.2.20170623";
+       sha256 = "10wj4p8dj2qb3qk73gkikfazq5szg8yrhjwdhj37xks7hvsfqgsv";
+       libraryHaskellDepends = [
+         base containers ghc-prim monad-classes mono-traversable symantic
+         symantic-grammar text transformers
+       ];
+       testHaskellDepends = [
+         base containers megaparsec monad-classes mono-traversable symantic
+         symantic-grammar tasty tasty-hunit text transformers
+       ];
+       description = "Symantics for common types";
+       license = stdenv.lib.licenses.gpl3;
+     }) {};
+
   "symbol" = callPackage
     ({ mkDerivation, base, containers, deepseq }:
      mkDerivation {
@@ -187460,6 +187709,21 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "thread-local-storage_0_1_2" = callPackage
+    ({ mkDerivation, atomic-primops, base, containers, criterion }:
+     mkDerivation {
+       pname = "thread-local-storage";
+       version = "0.1.2";
+       sha256 = "0nfl0i9g0d2z199a824ja6vb2h9nqswizv0hn266j0mpid1p3hl5";
+       libraryHaskellDepends = [ base containers ];
+       testHaskellDepends = [ atomic-primops base ];
+       benchmarkHaskellDepends = [ atomic-primops base criterion ];
+       homepage = "https://github.com/rrnewton/thread-local-storage";
+       description = "Several options for thread-local-storage (TLS) in Haskell";
+       license = stdenv.lib.licenses.bsd3;
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "threadPool" = callPackage
     ({ mkDerivation, base, process }:
      mkDerivation {
@@ -187781,8 +188045,8 @@ self: {
      }:
      mkDerivation {
        pname = "throwable-exceptions";
-       version = "0.1.0.6";
-       sha256 = "0mfc5jc23l7wxsl8c5r5s3i1kvhi2jqzlhif3wb00bh292g1p9ak";
+       version = "0.1.0.7";
+       sha256 = "1afxzk9xvxlvi13ysda9gcv6zzr7njcvi5p15lbn9bg68nrwqazj";
        isLibrary = true;
        isExecutable = true;
        libraryHaskellDepends = [ base safe-exceptions template-haskell ];
@@ -202430,19 +202694,19 @@ self: {
   "wolf" = callPackage
     ({ mkDerivation, aeson, amazonka, amazonka-swf, base, bytestring
      , conduit, directory, exceptions, filemanip, filepath, http-types
-     , lifted-async, lifted-base, monad-control, optparse-generic
-     , preamble, process, resourcet, shakers, time, uuid, yaml
+     , lifted-async, lifted-base, optparse-generic, preamble, process
+     , shakers, time, uuid, yaml
      }:
      mkDerivation {
        pname = "wolf";
-       version = "0.3.18";
-       sha256 = "08wpjp1m6szx2sp4g7h03ks7r2ryadzz3a3apchd2vymhlb1qaxb";
+       version = "0.3.19";
+       sha256 = "1bgwcklmxygc7f44nrcckdccdwg7f1y4s1qhfzn33ji1dkkhdp8m";
        isLibrary = true;
        isExecutable = true;
        libraryHaskellDepends = [
          aeson amazonka amazonka-swf base bytestring conduit directory
          exceptions filemanip filepath http-types lifted-async lifted-base
-         monad-control preamble process resourcet time uuid yaml
+         preamble process time uuid yaml
        ];
        executableHaskellDepends = [ base optparse-generic shakers ];
        homepage = "https://github.com/swift-nav/wolf";
@@ -203052,6 +203316,8 @@ self: {
        pname = "writer-cps-morph";
        version = "0.1.0.2";
        sha256 = "1n6m7wpxvvnxgkjz8qfiqz9jn2d83qb9wj4gmp476fg8vjvhf7g9";
+       revision = "1";
+       editedCabalFile = "0dqpbpaidwa7ahk0n7pv397mv7ncr26p3vcrjh1xzl6vk26bdah5";
        libraryHaskellDepends = [ base mmorph writer-cps-transformers ];
        homepage = "https://github.com/louispan/writer-cps-morph#readme";
        description = "MFunctor instance for CPS style WriterT and RWST";
@@ -209040,7 +209306,7 @@ self: {
        description = "An embedded language for programming the Yices SMT solver";
        license = stdenv.lib.licenses.bsd3;
        hydraPlatforms = stdenv.lib.platforms.none;
-     }) {inherit (pkgs) gmp; yices = null;};
+     }) {inherit (pkgs) gmp; inherit (pkgs) yices;};
 
   "yjftp" = callPackage
     ({ mkDerivation, base, directory, ftphs, haskeline, hsConfigure
diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix
index c5fa05651bbe6..34058c558af07 100644
--- a/pkgs/development/interpreters/python/cpython/2.7/default.nix
+++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl
+{ stdenv, hostPlatform, fetchurl
 , bzip2
 , gdbm
 , fetchpatch
@@ -69,7 +69,7 @@ let
 
       ./glibc-2.25-enosys.patch
 
-    ] ++ optionals stdenv.isCygwin [
+    ] ++ optionals hostPlatform.isCygwin [
       ./2.5.2-ctypes-util-find_library.patch
       ./2.5.2-tkinter-x11.patch
       ./2.6.2-ssl-threads.patch
@@ -110,7 +110,7 @@ let
     "--enable-shared"
     "--with-threads"
     "--enable-unicode=ucs4"
-  ] ++ optionals stdenv.isCygwin [
+  ] ++ optionals hostPlatform.isCygwin [
     "--with-system-ffi"
     "--with-system-expat"
     "ac_cv_func_bind_textdomain_codeset=yes"
@@ -118,14 +118,14 @@ let
     "--disable-toolbox-glue"
   ];
 
-  postConfigure = if stdenv.isCygwin then ''
+  postConfigure = if hostPlatform.isCygwin then ''
     sed -i Makefile -e 's,PYTHONPATH="$(srcdir),PYTHONPATH="$(abs_srcdir),'
   '' else null;
 
   buildInputs =
     optional (stdenv ? cc && stdenv.cc.libc != null) stdenv.cc.libc ++
     [ bzip2 openssl zlib ]
-    ++ optionals stdenv.isCygwin [ expat libffi ]
+    ++ optionals hostPlatform.isCygwin [ expat libffi ]
     ++ [ db gdbm ncurses sqlite readline ]
     ++ optionals x11Support [ tcl tk xlibsWrapper libX11 ]
     ++ optionals stdenv.isDarwin [ CF configd ];
@@ -190,6 +190,8 @@ in stdenv.mkDerivation {
         find $out -name "*.py" | $out/bin/python -m compileall -q -f -x "lib2to3" -i -
         find $out -name "*.py" | $out/bin/python -O -m compileall -q -f -x "lib2to3" -i -
         find $out -name "*.py" | $out/bin/python -OO -m compileall -q -f -x "lib2to3" -i -
+      '' + optionalString hostPlatform.isCygwin ''
+        cp libpython2.7.dll.a $out/lib
       '';
 
     passthru = let
diff --git a/pkgs/development/libraries/gdbm/default.nix b/pkgs/development/libraries/gdbm/default.nix
index de77b4c99b8b9..86d9bd649881c 100644
--- a/pkgs/development/libraries/gdbm/default.nix
+++ b/pkgs/development/libraries/gdbm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ stdenv, lib, buildPlatform, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "gdbm-1.13";
@@ -10,9 +10,22 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
+  # Linking static stubs on cygwin requires correct ordering.
+  # Consider upstreaming this.
+
+  # Disable dbmfetch03.at test because it depends on unlink()
+  # failing on a link in a chmod -w directory, which cygwin
+  # apparently allows.
+  postPatch = lib.optionalString buildPlatform.isCygwin ''
+      substituteInPlace tests/Makefile.in --replace \
+        '_LDADD = ../src/libgdbm.la ../compat/libgdbm_compat.la' \
+        '_LDADD = ../compat/libgdbm_compat.la ../src/libgdbm.la'
+      substituteInPlace tests/testsuite.at --replace \
+        'm4_include([dbmfetch03.at])' ""
+  '';
   configureFlags = [ "--enable-libgdbm-compat" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GNU dbm key/value database library";
 
     longDescription =
diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix
index 7d555ba4d062b..d705888410454 100644
--- a/pkgs/development/libraries/gettext/default.nix
+++ b/pkgs/development/libraries/gettext/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, libiconv, xz }:
+{ stdenv, lib, hostPlatform, fetchurl, libiconv, xz }:
 
 stdenv.mkDerivation rec {
   name = "gettext-${version}";
@@ -18,15 +18,6 @@ stdenv.mkDerivation rec {
   LDFLAGS = if stdenv.isSunOS then "-lm -lmd -lmp -luutil -lnvpair -lnsl -lidmap -lavl -lsec" else "";
 
   configureFlags = [ "--disable-csharp" "--with-xz" ]
-     ++ lib.optionals stdenv.isCygwin [
-            "--disable-java"
-            "--disable-native-java"
-            # Share the cache among the various `configure' runs.
-            "--config-cache"
-            "--with-included-gettext"
-            "--with-included-glib"
-            "--with-included-libcroco"
-        ]
      # avoid retaining reference to CF during stdenv bootstrap
      ++ lib.optionals stdenv.isDarwin [
             "gt_cv_func_CFPreferencesCopyAppValue=no"
@@ -38,6 +29,9 @@ stdenv.mkDerivation rec {
    substituteInPlace gettext-tools/projects/KDE/trigger --replace "/bin/pwd" pwd
    substituteInPlace gettext-tools/projects/GNOME/trigger --replace "/bin/pwd" pwd
    substituteInPlace gettext-tools/src/project-id --replace "/bin/pwd" pwd
+  '' + lib.optionalString hostPlatform.isCygwin ''
+    sed -i -e "s/\(cldr_plurals_LDADD = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in
+    sed -i -e "s/\(libgettextsrc_la_LDFLAGS = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in
   '';
 
   # On cross building, gettext supposes that the wchar.h from libc
@@ -49,11 +43,9 @@ stdenv.mkDerivation rec {
       echo gl_cv_func_wcwidth_works=yes > cachefile
       configureFlags="$configureFlags --cache-file=`pwd`/cachefile"
     fi
-  '' + lib.optionalString stdenv.isCygwin ''
-    sed -i -e "s/\(am_libgettextlib_la_OBJECTS = \)error.lo/\\1/" gettext-tools/gnulib-lib/Makefile.in
   '';
 
-  nativeBuildInputs = [ xz xz.bin ] ++ stdenv.lib.optional (!stdenv.isLinux) libiconv; # HACK, see #10874 (and 14664)
+  nativeBuildInputs = [ xz xz.bin ] ++ stdenv.lib.optional (!stdenv.isLinux && !hostPlatform.isCygwin) libiconv; # HACK, see #10874 (and 14664)
 
   enableParallelBuilding = true;
 
@@ -89,14 +81,3 @@ stdenv.mkDerivation rec {
 // stdenv.lib.optionalAttrs stdenv.isDarwin {
   makeFlags = "CFLAGS=-D_FORTIFY_SOURCE=0";
 }
-
-// stdenv.lib.optionalAttrs stdenv.isCygwin {
-  patchPhase =
-   # Make sure `error.c' gets compiled and is part of `libgettextlib.la'.
-   # This fixes:
-   # gettext-0.18.1.1/gettext-tools/src/msgcmp.c:371: undefined reference to `_error_message_count'
-  '' 
-   sed -i gettext-tools/gnulib-lib/Makefile.in \
-          -e 's/am_libgettextlib_la_OBJECTS =/am_libgettextlib_la_OBJECTS = error.lo/g'
-   '';
-}
diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix
index 96175d04a4ed8..84c0446827798 100644
--- a/pkgs/development/libraries/glib/default.nix
+++ b/pkgs/development/libraries/glib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, gettext, perl, python
+{ stdenv, hostPlatform, fetchurl, pkgconfig, gettext, perl, python
 , libiconv, libintlOrEmpty, zlib, libffi, pcre, libelf
 # use utillinuxMinimal to avoid circular dependency (utillinux, systemd, glib)
 , utillinuxMinimal ? null
@@ -9,7 +9,7 @@
 
 with stdenv.lib;
 
-assert stdenv.isFreeBSD || stdenv.isDarwin || stdenv.cc.isGNU;
+assert stdenv.isFreeBSD || stdenv.isDarwin || stdenv.cc.isGNU || hostPlatform.isCygwin;
 assert stdenv.isLinux -> utillinuxMinimal != null;
 
 # TODO:
diff --git a/pkgs/development/libraries/glibc/CVE-2017-1000366-rtld-LD_AUDIT.patch b/pkgs/development/libraries/glibc/CVE-2017-1000366-rtld-LD_AUDIT.patch
new file mode 100644
index 0000000000000..68e2798181fbb
--- /dev/null
+++ b/pkgs/development/libraries/glibc/CVE-2017-1000366-rtld-LD_AUDIT.patch
@@ -0,0 +1,209 @@
+From ba67ba3275d47e0080f0e5f09d9f5102c000c97e Mon Sep 17 00:00:00 2001
+Message-Id: <ba67ba3275d47e0080f0e5f09d9f5102c000c97e.1495998948.git.fweimer@redhat.com>
+In-Reply-To: <cover.1495998948.git.fweimer@redhat.com>
+References: <cover.1495998948.git.fweimer@redhat.com>
+From: Florian Weimer <fweimer@redhat.com>
+Date: Sun, 28 May 2017 20:44:52 +0200
+Subject: [PATCH 3/3] rtld: Reject overly long LD_AUDIT path elements
+To: libc-alpha@sourceware.org
+
+Also only process the last LD_AUDIT entry.
+---
+ elf/rtld.c | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++---------
+ 1 file changed, 95 insertions(+), 15 deletions(-)
+
+diff --git a/elf/rtld.c b/elf/rtld.c
+index 30f0cae..89d8573 100644
+--- a/elf/rtld.c
++++ b/elf/rtld.c
+@@ -116,13 +116,95 @@ dso_name_valid_for_suid (const char *p)
+   return *p != '\0';
+ }
+ 
+-/* List of auditing DSOs.  */
++/* LD_AUDIT variable contents.  Must be processed before the
++   audit_list below.  */
++const char *audit_list_string;
++
++/* Cyclic list of auditing DSOs.  audit_list->next is the first
++   element.  */
+ static struct audit_list
+ {
+   const char *name;
+   struct audit_list *next;
+ } *audit_list;
+ 
++/* Iterator for audit_list_string followed by audit_list.  */
++struct audit_list_iter
++{
++  /* Tail of audit_list_string still needing processing, or NULL.  */
++  const char *audit_list_tail;
++
++  /* The list element returned in the previous iteration.  NULL before
++     the first element.  */
++  struct audit_list *previous;
++
++  /* Scratch buffer for returning a name which is part of
++     audit_list_string.  */
++#ifdef PATH_MAX
++  char fname[PATH_MAX];
++#else
++  char fname[4096];
++#endif
++};
++
++/* Initialize an audit list iterator.  */
++static void
++audit_list_iter_init (struct audit_list_iter *iter)
++{
++  iter->audit_list_tail = audit_list_string;
++  iter->previous = NULL;
++}
++
++/* Iterate through both audit_list_string and audit_list.  */
++static const char *
++audit_list_iter_next (struct audit_list_iter *iter)
++{
++  if (iter->audit_list_tail != NULL)
++    {
++      /* First iterate over audit_list_string.  */
++      while (*iter->audit_list_tail != '\0')
++	{
++	  /* Split audit list at colon.  */
++	  size_t len = strcspn (iter->audit_list_tail, ":");
++	  if (len > 0 && len < sizeof(iter->fname))
++	    {
++	      memcpy (iter->fname, iter->audit_list_tail, len);
++	      iter->fname[len] = '\0';
++	    }
++	  else
++	    /* Do not return this name to the caller.  */
++	    iter->fname[0] = '\0';
++
++	  /* Skip over the substring and the following delimiter.  */
++	  iter->audit_list_tail += len;
++	  if (*iter->audit_list_tail == ':')
++	    ++iter->audit_list_tail;
++
++	  /* If the name is valid, return it.  */
++	  if (dso_name_valid_for_suid (iter->fname))
++	    return iter->fname;
++	  /* Otherwise, wrap around and try the next name.  */
++	}
++      /* Fall through to the procesing of audit_list.  */
++    }
++
++  if (iter->previous == NULL)
++    {
++      if (audit_list == NULL)
++	/* No pre-parsed audit list.  */
++	return NULL;
++      /* Start of audit list.  The first list element is at
++	 audit_list->next (cyclic list).  */
++      iter->previous = audit_list->next;
++      return iter->previous->name;
++    }
++  if (iter->previous == audit_list)
++    /* Cyclic list wrap-around.  */
++    return NULL;
++  iter->previous = iter->previous->next;
++  return iter->previous->name;
++}
++
+ #ifndef HAVE_INLINED_SYSCALLS
+ /* Set nonzero during loading and initialization of executable and
+    libraries, cleared before the executable's entry point runs.  This
+@@ -1290,11 +1368,13 @@ of this helper program; chances are you did not intend to run this program.\n\
+     GL(dl_rtld_map).l_tls_modid = _dl_next_tls_modid ();
+ 
+   /* If we have auditing DSOs to load, do it now.  */
+-  if (__glibc_unlikely (audit_list != NULL))
++  bool need_security_init = true;
++  if (__glibc_unlikely (audit_list != NULL)
++      || __glibc_unlikely (audit_list_string != NULL))
+     {
+-      /* Iterate over all entries in the list.  The order is important.  */
+       struct audit_ifaces *last_audit = NULL;
+-      struct audit_list *al = audit_list->next;
++      struct audit_list_iter al_iter;
++      audit_list_iter_init (&al_iter);
+ 
+       /* Since we start using the auditing DSOs right away we need to
+ 	 initialize the data structures now.  */
+@@ -1305,9 +1385,14 @@ of this helper program; chances are you did not intend to run this program.\n\
+ 	 use different values (especially the pointer guard) and will
+ 	 fail later on.  */
+       security_init ();
++      need_security_init = false;
+ 
+-      do
++      while (true)
+ 	{
++	  const char *name = audit_list_iter_next (&al_iter);
++	  if (name == NULL)
++	    break;
++
+ 	  int tls_idx = GL(dl_tls_max_dtv_idx);
+ 
+ 	  /* Now it is time to determine the layout of the static TLS
+@@ -1316,7 +1401,7 @@ of this helper program; chances are you did not intend to run this program.\n\
+ 	     no DF_STATIC_TLS bit is set.  The reason is that we know
+ 	     glibc will use the static model.  */
+ 	  struct dlmopen_args dlmargs;
+-	  dlmargs.fname = al->name;
++	  dlmargs.fname = name;
+ 	  dlmargs.map = NULL;
+ 
+ 	  const char *objname;
+@@ -1329,7 +1414,7 @@ of this helper program; chances are you did not intend to run this program.\n\
+ 	    not_loaded:
+ 	      _dl_error_printf ("\
+ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
+-				al->name, err_str);
++				name, err_str);
+ 	      if (malloced)
+ 		free ((char *) err_str);
+ 	    }
+@@ -1433,10 +1518,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
+ 		  goto not_loaded;
+ 		}
+ 	    }
+-
+-	  al = al->next;
+ 	}
+-      while (al != audit_list->next);
+ 
+       /* If we have any auditing modules, announce that we already
+ 	 have two objects loaded.  */
+@@ -1700,7 +1782,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
+   if (tcbp == NULL)
+     tcbp = init_tls ();
+ 
+-  if (__glibc_likely (audit_list == NULL))
++  if (__glibc_likely (need_security_init))
+     /* Initialize security features.  But only if we have not done it
+        earlier.  */
+     security_init ();
+@@ -2331,9 +2413,7 @@ process_dl_audit (char *str)
+   char *p;
+ 
+   while ((p = (strsep) (&str, ":")) != NULL)
+-    if (p[0] != '\0'
+-	&& (__builtin_expect (! __libc_enable_secure, 1)
+-	    || strchr (p, '/') == NULL))
++    if (dso_name_valid_for_suid (p))
+       {
+ 	/* This is using the local malloc, not the system malloc.  The
+ 	   memory can never be freed.  */
+@@ -2397,7 +2477,7 @@ process_envvars (enum mode *modep)
+ 	      break;
+ 	    }
+ 	  if (memcmp (envline, "AUDIT", 5) == 0)
+-	    process_dl_audit (&envline[6]);
++	    audit_list_string = &envline[6];
+ 	  break;
+ 
+ 	case 7:
+-- 
+2.9.4
+
diff --git a/pkgs/development/libraries/glibc/CVE-2017-1000366-rtld-LD_LIBRARY_PATH.patch b/pkgs/development/libraries/glibc/CVE-2017-1000366-rtld-LD_LIBRARY_PATH.patch
new file mode 100644
index 0000000000000..88b1925fa1261
--- /dev/null
+++ b/pkgs/development/libraries/glibc/CVE-2017-1000366-rtld-LD_LIBRARY_PATH.patch
@@ -0,0 +1,33 @@
+From 4d009d39ac9ede0369e268554a181b428f177a80 Mon Sep 17 00:00:00 2001
+Message-Id: <4d009d39ac9ede0369e268554a181b428f177a80.1495998948.git.fweimer@redhat.com>
+In-Reply-To: <cover.1495998948.git.fweimer@redhat.com>
+References: <cover.1495998948.git.fweimer@redhat.com>
+From: Florian Weimer <fweimer@redhat.com>
+Date: Sun, 28 May 2017 20:37:40 +0200
+Subject: [PATCH 1/3] rtld: Completely ignore LD_LIBRARY_PATH for AT_SECURE=1
+ programs
+To: libc-alpha@sourceware.org
+
+LD_LIBRARY_PATH can only be used to reorder system search paths, which
+is not useful functionality.
+---
+ elf/rtld.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/elf/rtld.c b/elf/rtld.c
+index 319ef06..824b6cf 100644
+--- a/elf/rtld.c
++++ b/elf/rtld.c
+@@ -2419,7 +2419,8 @@ process_envvars (enum mode *modep)
+ 
+ 	case 12:
+ 	  /* The library search path.  */
+-	  if (memcmp (envline, "LIBRARY_PATH", 12) == 0)
++	  if (!__libc_enable_secure
++	      && memcmp (envline, "LIBRARY_PATH", 12) == 0)
+ 	    {
+ 	      library_path = &envline[13];
+ 	      break;
+-- 
+2.9.4
+
diff --git a/pkgs/development/libraries/glibc/CVE-2017-1000366-rtld-LD_PRELOAD.patch b/pkgs/development/libraries/glibc/CVE-2017-1000366-rtld-LD_PRELOAD.patch
new file mode 100644
index 0000000000000..76be2a3308f6c
--- /dev/null
+++ b/pkgs/development/libraries/glibc/CVE-2017-1000366-rtld-LD_PRELOAD.patch
@@ -0,0 +1,115 @@
+From 65ff0b7a085b85271ec8fde99f542281b495e3bc Mon Sep 17 00:00:00 2001
+Message-Id: <65ff0b7a085b85271ec8fde99f542281b495e3bc.1495998948.git.fweimer@redhat.com>
+In-Reply-To: <cover.1495998948.git.fweimer@redhat.com>
+References: <cover.1495998948.git.fweimer@redhat.com>
+From: Florian Weimer <fweimer@redhat.com>
+Date: Sun, 28 May 2017 20:57:40 +0200
+Subject: [PATCH 2/3] rtld: Reject overly long LD_PRELOAD path elements
+To: libc-alpha@sourceware.org
+
+---
+ elf/rtld.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++---------------
+ 1 file changed, 53 insertions(+), 16 deletions(-)
+
+diff --git a/elf/rtld.c b/elf/rtld.c
+index 824b6cf..30f0cae 100644
+--- a/elf/rtld.c
++++ b/elf/rtld.c
+@@ -99,6 +99,22 @@ uintptr_t __pointer_chk_guard_local
+ strong_alias (__pointer_chk_guard_local, __pointer_chk_guard)
+ #endif
+ 
++/* Check that AT_SECURE=0, or that the passed name does not contain
++   directories and is not overly long.  Reject empty names
++   unconditionally.  */
++static bool
++dso_name_valid_for_suid (const char *p)
++{
++  if (__glibc_unlikely (__libc_enable_secure))
++    {
++      /* Ignore pathnames with directories for AT_SECURE=1
++	 programs, and also skip overlong names.  */
++      size_t len = strlen (p);
++      if (len >= NAME_MAX || memchr (p, '/', len) != NULL)
++	return false;
++    }
++  return *p != '\0';
++}
+ 
+ /* List of auditing DSOs.  */
+ static struct audit_list
+@@ -716,6 +732,46 @@ static const char *preloadlist attribute_relro;
+ /* Nonzero if information about versions has to be printed.  */
+ static int version_info attribute_relro;
+ 
++/* The LD_PRELOAD environment variable gives list of libraries
++   separated by white space or colons that are loaded before the
++   executable's dependencies and prepended to the global scope list.
++   (If the binary is running setuid all elements containing a '/' are
++   ignored since it is insecure.)  Return the number of preloads
++   performed.  */
++unsigned int
++handle_ld_preload (const char *preloadlist, struct link_map *main_map)
++{
++  unsigned int npreloads = 0;
++  const char *p = preloadlist;
++#ifdef PATH_MAX
++  char fname[PATH_MAX];
++#else
++  char fname[4096];
++#endif
++
++  while (*p != '\0')
++    {
++      /* Split preload list at space/colon.  */
++      size_t len = strcspn (p, " :");
++      if (len > 0 && len < sizeof(fname))
++	{
++	  memcpy (fname, p, len);
++	  fname[len] = '\0';
++	}
++      else
++	fname[0] = '\0';
++
++      /* Skip over the substring and the following delimiter.  */
++      p += len;
++      if (*p == ' ' || *p == ':')
++	++p;
++
++      if (dso_name_valid_for_suid (fname))
++	npreloads += do_preload (fname, main_map, "LD_PRELOAD");
++    }
++  return npreloads;
++}
++
+ static void
+ dl_main (const ElfW(Phdr) *phdr,
+ 	 ElfW(Word) phnum,
+@@ -1462,23 +1514,8 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
+ 
+   if (__glibc_unlikely (preloadlist != NULL))
+     {
+-      /* The LD_PRELOAD environment variable gives list of libraries
+-	 separated by white space or colons that are loaded before the
+-	 executable's dependencies and prepended to the global scope
+-	 list.  If the binary is running setuid all elements
+-	 containing a '/' are ignored since it is insecure.  */
+-      char *list = strdupa (preloadlist);
+-      char *p;
+-
+       HP_TIMING_NOW (start);
+-
+-      /* Prevent optimizing strsep.  Speed is not important here.  */
+-      while ((p = (strsep) (&list, " :")) != NULL)
+-	if (p[0] != '\0'
+-	    && (__builtin_expect (! __libc_enable_secure, 1)
+-		|| strchr (p, '/') == NULL))
+-	  npreloads += do_preload (p, main_map, "LD_PRELOAD");
+-
++      npreloads += handle_ld_preload (preloadlist, main_map);
+       HP_TIMING_NOW (stop);
+       HP_TIMING_DIFF (diff, start, stop);
+       HP_TIMING_ACCUM_NT (load_time, diff);
+-- 
+2.9.4
+
diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix
index db80a8be299ce..647a34e95dba8 100644
--- a/pkgs/development/libraries/glibc/common.nix
+++ b/pkgs/development/libraries/glibc/common.nix
@@ -59,8 +59,16 @@ stdenv.mkDerivation ({
          "/bin:/usr/bin", which is inappropriate on NixOS machines. This
          patch extends the search path by "/run/current-system/sw/bin". */
       ./fix_path_attribute_in_getconf.patch
+
+      /* Stack Clash */
+      ./CVE-2017-1000366-rtld-LD_LIBRARY_PATH.patch
+      ./CVE-2017-1000366-rtld-LD_PRELOAD.patch
+      ./CVE-2017-1000366-rtld-LD_AUDIT.patch
     ]
-      ++ lib.optional stdenv.isi686 ./fix-i686-memchr.patch;
+    ++ lib.optionals stdenv.isi686 [
+      ./fix-i686-memchr.patch
+      ./i686-fix-vectorized-strcspn.patch
+    ];
 
   postPatch =
     # Needed for glibc to build with the gnumake 3.82
diff --git a/pkgs/development/libraries/glibc/i686-fix-vectorized-strcspn.patch b/pkgs/development/libraries/glibc/i686-fix-vectorized-strcspn.patch
new file mode 100644
index 0000000000000..ba4ec7c60cb66
--- /dev/null
+++ b/pkgs/development/libraries/glibc/i686-fix-vectorized-strcspn.patch
@@ -0,0 +1,42 @@
+From adc7e06fb412a2a1ee52f8cb788caf436335b9f3 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Wed, 14 Jun 2017 08:11:22 +0200
+Subject: [PATCH] i686: Add missing IS_IN (libc) guards to vectorized strcspn
+
+Since commit d957c4d3fa48d685ff2726c605c988127ef99395 (i386: Compile
+rtld-*.os with -mno-sse -mno-mmx -mfpmath=387), vector intrinsics can
+no longer be used in ld.so, even if the compiled code never makes it
+into the final ld.so link.  This commit adds the missing IS_IN (libc)
+guard to the SSE 4.2 strcspn implementation, so that it can be used from
+ld.so in the future.
+
+(cherry picked from commit 69052a3a95da37169a08f9e59b2cc1808312753c)
+---
+ ChangeLog                               | 5 +++++
+ sysdeps/i386/i686/multiarch/strcspn-c.c | 6 ++++--
+ sysdeps/i386/i686/multiarch/varshift.c  | 4 +++-
+ 3 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/i386/i686/multiarch/strcspn-c.c b/sysdeps/i386/i686/multiarch/strcspn-c.c
+index 6d61e19..ec230fb 100644
+--- a/sysdeps/i386/i686/multiarch/strcspn-c.c
++++ b/sysdeps/i386/i686/multiarch/strcspn-c.c
+@@ -1,2 +1,4 @@
+-#define __strcspn_sse2 __strcspn_ia32
+-#include <sysdeps/x86_64/multiarch/strcspn-c.c>
++#if IS_IN (libc)
++# define __strcspn_sse2 __strcspn_ia32
++# include <sysdeps/x86_64/multiarch/strcspn-c.c>
++#endif
+diff --git a/sysdeps/i386/i686/multiarch/varshift.c b/sysdeps/i386/i686/multiarch/varshift.c
+index 7760b96..6742a35 100644
+--- a/sysdeps/i386/i686/multiarch/varshift.c
++++ b/sysdeps/i386/i686/multiarch/varshift.c
+@@ -1 +1,3 @@
+-#include <sysdeps/x86_64/multiarch/varshift.c>
++#if IS_IN (libc)
++# include <sysdeps/x86_64/multiarch/varshift.c>
++#endif
+-- 
+2.9.3
+
diff --git a/pkgs/development/libraries/gsl/default.nix b/pkgs/development/libraries/gsl/default.nix
index d130a328dbaf2..afd6391d719b6 100644
--- a/pkgs/development/libraries/gsl/default.nix
+++ b/pkgs/development/libraries/gsl/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, fetchpatch, stdenv }:
 
 stdenv.mkDerivation rec {
-  name = "gsl-2.3";
+  name = "gsl-2.4";
 
   src = fetchurl {
     url = "mirror://gnu/gsl/${name}.tar.gz";
-    sha256 = "1yxdzqjwmi2aid650fa9zyr8llw069x7lm489wx9nnfdi6vh09an";
+    sha256 = "16yfs5n444s03np1naj6yp1fsysd42kdscxzkg0k2yvfjixx0ijd";
   };
 
   patches = [
diff --git a/pkgs/development/libraries/libatomic_ops/default.nix b/pkgs/development/libraries/libatomic_ops/default.nix
index 33209f2fd4468..eedc0993d7365 100644
--- a/pkgs/development/libraries/libatomic_ops/default.nix
+++ b/pkgs/development/libraries/libatomic_ops/default.nix
@@ -5,7 +5,10 @@ stdenv.mkDerivation rec {
   version = "7.6.0";
 
   src = fetchurl {
-    url = "http://www.ivmaisoft.com/_bin/atomic_ops/libatomic_ops-${version}.tar.gz";
+    urls = [
+      "http://www.ivmaisoft.com/_bin/atomic_ops/libatomic_ops-${version}.tar.gz"
+      "https://github.com/ivmai/libatomic_ops/releases/download/v${version}/libatomic_ops-${version}.tar.gz"
+    ];
     sha256 ="03ylfr29g9zc0r6b6axz3i68alj5qmxgzknxwam3jlx0sz8hcb4f";
   };
 
diff --git a/pkgs/development/libraries/libev/default.nix b/pkgs/development/libraries/libev/default.nix
index 37e0c9b3431ea..d77337c912b28 100644
--- a/pkgs/development/libraries/libev/default.nix
+++ b/pkgs/development/libraries/libev/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "libev-${version}";
-  version="4.22";
+  version="4.24";
 
   src = fetchurl {
     url = "http://dist.schmorp.de/libev/Attic/${name}.tar.gz";
-    sha256 = "1mhvy38g9947bbr0n0hzc34zwfvvfd99qgzpkbap8g2lmkl7jq3k";
+    sha256 = "08gqsza1czx0nf62nkk183jb0946yzjsymaacxbzdgcs8z9r6dcp";
   };
 
   meta = {
diff --git a/pkgs/development/libraries/libiconv/default.nix b/pkgs/development/libraries/libiconv/default.nix
index a056f148683c9..8994651241001 100644
--- a/pkgs/development/libraries/libiconv/default.nix
+++ b/pkgs/development/libraries/libiconv/default.nix
@@ -13,11 +13,6 @@ stdenv.mkDerivation rec {
     sha256 = "0y1ij745r4p48mxq84rax40p10ln7fc7m243p8k8sia519i3dxfc";
   };
 
-  patches = lib.optionals stdenv.isCygwin [
-    ./libiconv-1.14-reloc.patch
-    ./libiconv-1.14-wchar.patch
-  ];
-
   postPatch =
     lib.optionalString ((hostPlatform != buildPlatform && hostPlatform.libc == "msvcrt") || stdenv.cc.nativeLibc)
       ''
@@ -25,12 +20,7 @@ stdenv.mkDerivation rec {
       '';
 
   configureFlags =
-  # On Cygwin, Libtool produces a `.dll.a', which is not a "real" DLL
-  # (Windows' linker would need to be used somehow to produce an actual
-  # DLL.)  Thus, build the static library too, and this is what Gettext
-  # will actually use.
-    lib.optional stdenv.isCygwin "--enable-static"
-    ++ lib.optional stdenv.isFreeBSD "--with-pic";
+    lib.optional stdenv.isFreeBSD "--with-pic";
 
   crossAttrs = {
     # Disable stripping to avoid "libiconv.a: Archive has no index" (MinGW).
diff --git a/pkgs/development/libraries/libiconv/libiconv-1.14-reloc.patch b/pkgs/development/libraries/libiconv/libiconv-1.14-reloc.patch
deleted file mode 100644
index 005e3379d165d..0000000000000
--- a/pkgs/development/libraries/libiconv/libiconv-1.14-reloc.patch
+++ /dev/null
@@ -1,269 +0,0 @@
---- libiconv-1.14/lib/relocatable.c	2011-08-07 13:48:03.000000000 -0400
-+++ libiconv-1.14/lib/relocatable.c	2011-10-15 03:14:13.195133600 -0400
-@@ -2,20 +2,18 @@
-    Copyright (C) 2003-2006, 2008-2011 Free Software Foundation, Inc.
-    Written by Bruno Haible <bruno@clisp.org>, 2003.
- 
--   This program is free software; you can redistribute it and/or modify it
--   under the terms of the GNU Library General Public License as published
--   by the Free Software Foundation; either version 2, or (at your option)
--   any later version.
-+   This program is free software: you can redistribute it and/or modify
-+   it under the terms of the GNU Lesser General Public License as published by
-+   the Free Software Foundation; either version 2.1 of the License, or
-+   (at your option) any later version.
- 
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
--   Library General Public License for more details.
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU Lesser General Public License for more details.
- 
--   You should have received a copy of the GNU Library General Public
--   License along with this program; if not, write to the Free Software
--   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
--   USA.  */
-+   You should have received a copy of the GNU Lesser General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
- 
- 
- /* Tell glibc's <stdio.h> to provide a prototype for getline().
-@@ -87,6 +85,19 @@
- # define FILE_SYSTEM_PREFIX_LEN(P) 0
- #endif
- 
-+/* Whether to enable the more costly support for relocatable libraries.
-+   It allows libraries to be have been installed with a different original
-+   prefix than the program.  But it is quite costly, especially on Cygwin
-+   platforms, see below.  Therefore we enable it by default only on native
-+   Win32 platforms.  */
-+#ifndef ENABLE_COSTLY_RELOCATABLE
-+# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-+#  define ENABLE_COSTLY_RELOCATABLE 1
-+# else
-+#  define ENABLE_COSTLY_RELOCATABLE 0
-+# endif
-+#endif
-+
- /* Original installation prefix.  */
- static char *orig_prefix;
- static size_t orig_prefix_len;
-@@ -156,7 +167,7 @@
- #endif
- }
- 
--#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR)
-+#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE)
- 
- /* Convenience function:
-    Computes the current installation prefix, based on the original
-@@ -286,7 +297,7 @@
- 
- #endif /* !IN_LIBRARY || PIC */
- 
--#if defined PIC && defined INSTALLDIR
-+#if defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE
- 
- /* Full pathname of shared library, or NULL.  */
- static char *shared_library_fullname;
-@@ -332,7 +343,9 @@
- #if (defined __linux__ && (__GLIBC__ >= 2 || defined __UCLIBC__)) || defined __CYGWIN__
-   /* Linux has /proc/self/maps. glibc 2 and uClibc have the getline()
-      function.
--     Cygwin >= 1.5 has /proc/self/maps and the getline() function too.  */
-+     Cygwin >= 1.5 has /proc/self/maps and the getline() function too.
-+     But it is costly: ca. 0.3 ms on Linux, 3 ms on Cygwin 1.5, and 5 ms on
-+     Cygwin 1.7.  */
-   FILE *fp;
- 
-   /* Open the current process' maps file.  It describes one VMA per line.  */
-@@ -405,7 +418,7 @@
- const char *
- relocate (const char *pathname)
- {
--#if defined PIC && defined INSTALLDIR
-+#if defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE
-   static int initialized;
- 
-   /* Initialization code for a shared library.  */
---- libiconv-1.14/libcharset/lib/relocatable.c	2011-08-07 13:48:03.000000000 -0400
-+++ libiconv-1.14/libcharset/lib/relocatable.c	2011-10-15 03:14:27.878133600 -0400
-@@ -2,20 +2,18 @@
-    Copyright (C) 2003-2006, 2008-2011 Free Software Foundation, Inc.
-    Written by Bruno Haible <bruno@clisp.org>, 2003.
- 
--   This program is free software; you can redistribute it and/or modify it
--   under the terms of the GNU Library General Public License as published
--   by the Free Software Foundation; either version 2, or (at your option)
--   any later version.
-+   This program is free software: you can redistribute it and/or modify
-+   it under the terms of the GNU Lesser General Public License as published by
-+   the Free Software Foundation; either version 2.1 of the License, or
-+   (at your option) any later version.
- 
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
--   Library General Public License for more details.
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU Lesser General Public License for more details.
- 
--   You should have received a copy of the GNU Library General Public
--   License along with this program; if not, write to the Free Software
--   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
--   USA.  */
-+   You should have received a copy of the GNU Lesser General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
- 
- 
- /* Tell glibc's <stdio.h> to provide a prototype for getline().
-@@ -87,6 +85,19 @@
- # define FILE_SYSTEM_PREFIX_LEN(P) 0
- #endif
- 
-+/* Whether to enable the more costly support for relocatable libraries.
-+   It allows libraries to be have been installed with a different original
-+   prefix than the program.  But it is quite costly, especially on Cygwin
-+   platforms, see below.  Therefore we enable it by default only on native
-+   Win32 platforms.  */
-+#ifndef ENABLE_COSTLY_RELOCATABLE
-+# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-+#  define ENABLE_COSTLY_RELOCATABLE 1
-+# else
-+#  define ENABLE_COSTLY_RELOCATABLE 0
-+# endif
-+#endif
-+
- /* Original installation prefix.  */
- static char *orig_prefix;
- static size_t orig_prefix_len;
-@@ -156,7 +167,7 @@
- #endif
- }
- 
--#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR)
-+#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE)
- 
- /* Convenience function:
-    Computes the current installation prefix, based on the original
-@@ -286,7 +297,7 @@
- 
- #endif /* !IN_LIBRARY || PIC */
- 
--#if defined PIC && defined INSTALLDIR
-+#if defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE
- 
- /* Full pathname of shared library, or NULL.  */
- static char *shared_library_fullname;
-@@ -332,7 +343,9 @@
- #if (defined __linux__ && (__GLIBC__ >= 2 || defined __UCLIBC__)) || defined __CYGWIN__
-   /* Linux has /proc/self/maps. glibc 2 and uClibc have the getline()
-      function.
--     Cygwin >= 1.5 has /proc/self/maps and the getline() function too.  */
-+     Cygwin >= 1.5 has /proc/self/maps and the getline() function too.
-+     But it is costly: ca. 0.3 ms on Linux, 3 ms on Cygwin 1.5, and 5 ms on
-+     Cygwin 1.7.  */
-   FILE *fp;
- 
-   /* Open the current process' maps file.  It describes one VMA per line.  */
-@@ -405,7 +418,7 @@
- const char *
- relocate (const char *pathname)
- {
--#if defined PIC && defined INSTALLDIR
-+#if defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE
-   static int initialized;
- 
-   /* Initialization code for a shared library.  */
---- libiconv-1.14/srclib/relocatable.c	2011-08-07 09:42:06.000000000 -0400
-+++ libiconv-1.14/srclib/relocatable.c	2011-10-15 03:14:37.739133600 -0400
-@@ -3,16 +3,16 @@
-    Written by Bruno Haible <bruno@clisp.org>, 2003.
- 
-    This program is free software: you can redistribute it and/or modify
--   it under the terms of the GNU General Public License as published by
--   the Free Software Foundation; either version 3 of the License, or
-+   it under the terms of the GNU Lesser General Public License as published by
-+   the Free Software Foundation; either version 2.1 of the License, or
-    (at your option) any later version.
- 
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--   GNU General Public License for more details.
-+   GNU Lesser General Public License for more details.
- 
--   You should have received a copy of the GNU General Public License
-+   You should have received a copy of the GNU Lesser General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
- 
- 
-@@ -85,6 +85,19 @@
- # define FILE_SYSTEM_PREFIX_LEN(P) 0
- #endif
- 
-+/* Whether to enable the more costly support for relocatable libraries.
-+   It allows libraries to be have been installed with a different original
-+   prefix than the program.  But it is quite costly, especially on Cygwin
-+   platforms, see below.  Therefore we enable it by default only on native
-+   Win32 platforms.  */
-+#ifndef ENABLE_COSTLY_RELOCATABLE
-+# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-+#  define ENABLE_COSTLY_RELOCATABLE 1
-+# else
-+#  define ENABLE_COSTLY_RELOCATABLE 0
-+# endif
-+#endif
-+
- /* Original installation prefix.  */
- static char *orig_prefix;
- static size_t orig_prefix_len;
-@@ -154,7 +167,7 @@
- #endif
- }
- 
--#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR)
-+#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE)
- 
- /* Convenience function:
-    Computes the current installation prefix, based on the original
-@@ -284,7 +297,7 @@
- 
- #endif /* !IN_LIBRARY || PIC */
- 
--#if defined PIC && defined INSTALLDIR
-+#if defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE
- 
- /* Full pathname of shared library, or NULL.  */
- static char *shared_library_fullname;
-@@ -330,7 +343,9 @@
- #if (defined __linux__ && (__GLIBC__ >= 2 || defined __UCLIBC__)) || defined __CYGWIN__
-   /* Linux has /proc/self/maps. glibc 2 and uClibc have the getline()
-      function.
--     Cygwin >= 1.5 has /proc/self/maps and the getline() function too.  */
-+     Cygwin >= 1.5 has /proc/self/maps and the getline() function too.
-+     But it is costly: ca. 0.3 ms on Linux, 3 ms on Cygwin 1.5, and 5 ms on
-+     Cygwin 1.7.  */
-   FILE *fp;
- 
-   /* Open the current process' maps file.  It describes one VMA per line.  */
-@@ -403,7 +418,7 @@
- const char *
- relocate (const char *pathname)
- {
--#if defined PIC && defined INSTALLDIR
-+#if defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE
-   static int initialized;
- 
-   /* Initialization code for a shared library.  */
---- libiconv-1.14/srcm4/gnulib-comp.m4	2011-08-07 09:42:12.000000000 -0400
-+++ libiconv-1.14/srcm4/gnulib-comp.m4	2011-08-30 02:40:45.597317000 -0400
-@@ -164,6 +164,7 @@ gl_UNISTD_MODULE_INDICATOR([readlink])
- gl_RELOCATABLE([$gl_source_base])
- if test $RELOCATABLE = yes; then
-   AC_LIBOBJ([progreloc])
-+  AC_LIBOBJ([relocatable])
- fi
- gl_FUNC_READLINK_SEPARATE
- gl_CANONICALIZE_LGPL_SEPARATE
diff --git a/pkgs/development/libraries/libiconv/libiconv-1.14-wchar.patch b/pkgs/development/libraries/libiconv/libiconv-1.14-wchar.patch
deleted file mode 100644
index 0e4ddd931bb05..0000000000000
--- a/pkgs/development/libraries/libiconv/libiconv-1.14-wchar.patch
+++ /dev/null
@@ -1,102 +0,0 @@
---- libiconv-1.14/libcharset/lib/localcharset.c	2011-02-28 17:43:35.000000000 -0500
-+++ libiconv-1.14/libcharset/lib/localcharset.c	2011-08-28 00:16:57.238000000 -0400
-@@ -54,10 +54,6 @@
- #   include <locale.h>
- #  endif
- # endif
--# ifdef __CYGWIN__
--#  define WIN32_LEAN_AND_MEAN
--#  include <windows.h>
--# endif
- #elif defined WIN32_NATIVE
- # define WIN32_LEAN_AND_MEAN
- # include <windows.h>
-@@ -124,7 +120,7 @@
-   cp = charset_aliases;
-   if (cp == NULL)
-     {
--#if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE || defined __CYGWIN__)
-+#if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE)
-       const char *dir;
-       const char *base = "charset.alias";
-       char *file_name;
-@@ -309,7 +305,7 @@
-            "DECKOREAN" "\0" "EUC-KR" "\0";
- # endif
- 
--# if defined WIN32_NATIVE || defined __CYGWIN__
-+# if defined WIN32_NATIVE
-       /* To avoid the troubles of installing a separate file in the same
-          directory as the DLL and of retrieving the DLL's directory at
-          runtime, simply inline the aliases here.  */
-@@ -365,64 +361,12 @@
- 
- # if HAVE_LANGINFO_CODESET
- 
--  /* Most systems support nl_langinfo (CODESET) nowadays.  */
--  codeset = nl_langinfo (CODESET);
--
--#  ifdef __CYGWIN__
--  /* Cygwin < 1.7 does not have locales.  nl_langinfo (CODESET) always
--     returns "US-ASCII".  Return the suffix of the locale name from the
--     environment variables (if present) or the codepage as a number.  */
--  if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0)
--    {
--      const char *locale;
--      static char buf[2 + 10 + 1];
--
--      locale = getenv ("LC_ALL");
--      if (locale == NULL || locale[0] == '\0')
--        {
--          locale = getenv ("LC_CTYPE");
--          if (locale == NULL || locale[0] == '\0')
--            locale = getenv ("LANG");
--        }
--      if (locale != NULL && locale[0] != '\0')
--        {
--          /* If the locale name contains an encoding after the dot, return
--             it.  */
--          const char *dot = strchr (locale, '.');
--
--          if (dot != NULL)
--            {
--              const char *modifier;
--
--              dot++;
--              /* Look for the possible @... trailer and remove it, if any.  */
--              modifier = strchr (dot, '@');
--              if (modifier == NULL)
--                return dot;
--              if (modifier - dot < sizeof (buf))
--                {
--                  memcpy (buf, dot, modifier - dot);
--                  buf [modifier - dot] = '\0';
--                  return buf;
--                }
--            }
--        }
--
--      /* Woe32 has a function returning the locale's codepage as a number:
--         GetACP().  This encoding is used by Cygwin, unless the user has set
--         the environment variable CYGWIN=codepage:oem (which very few people
--         do).
--         Output directed to console windows needs to be converted (to
--         GetOEMCP() if the console is using a raster font, or to
--         GetConsoleOutputCP() if it is using a TrueType font).  Cygwin does
--         this conversion transparently (see winsup/cygwin/fhandler_console.cc),
--         converting to GetConsoleOutputCP().  This leads to correct results,
--         except when SetConsoleOutputCP has been called and a raster font is
--         in use.  */
--      sprintf (buf, "CP%u", GetACP ());
--      codeset = buf;
--    }
--#  endif
-+  /* Most systems support nl_langinfo (CODESET) nowadays.
-+     POSIX allows that the returned pointer may point to a static area that
-+     may be overwritten by subsequent calls to setlocale or nl_langinfo. */
-+  static char codeset_buf[64];
-+  codeset_buf[0] = '\0';
-+  codeset = strncat (codeset_buf, nl_langinfo (CODESET), sizeof (codeset_buf));
- 
- # else
- 
diff --git a/pkgs/development/libraries/libmicrohttpd/default.nix b/pkgs/development/libraries/libmicrohttpd/default.nix
index 0a1fe70bd1dd7..23e6a37f918cc 100644
--- a/pkgs/development/libraries/libmicrohttpd/default.nix
+++ b/pkgs/development/libraries/libmicrohttpd/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, libgcrypt, curl, gnutls, pkgconfig }:
 
 stdenv.mkDerivation rec {
-  name = "libmicrohttpd-0.9.53";
+  name = "libmicrohttpd-0.9.55";
 
   src = fetchurl {
     url = "mirror://gnu/libmicrohttpd/${name}.tar.gz";
-    sha256 = "1i1c7hwjmc4n31cgmfycgi8xsnm3kyc4zzdd4dir6i0z70nyq5cv";
+    sha256 = "1y6h1slav5l6k8zyb01dpw65dscdgxxgfa3a0z9qnn7jr66sn70c";
   };
 
   outputs = [ "out" "dev" "devdoc" "info" ];
diff --git a/pkgs/development/libraries/libxslt/default.nix b/pkgs/development/libraries/libxslt/default.nix
index a9e98d41e75eb..118b8af5a6f92 100644
--- a/pkgs/development/libraries/libxslt/default.nix
+++ b/pkgs/development/libraries/libxslt/default.nix
@@ -19,6 +19,12 @@ stdenv.mkDerivation rec {
 
   patches = stdenv.lib.optional stdenv.isSunOS ./patch-ah.patch;
 
+  # fixes: can't build x86_64-unknown-cygwin shared library unless -no-undefined is specified
+  postPatch = optionalString hostPlatform.isCygwin ''
+    substituteInPlace tests/plugins/Makefile.in \
+      --replace 'la_LDFLAGS =' 'la_LDFLAGS = $(WIN32_EXTRA_LDFLAGS)'
+  '';
+
   outputs = [ "bin" "dev" "out" "doc" ] ++ stdenv.lib.optional pythonSupport "py";
 
   buildInputs = [ libxml2.dev ] ++ stdenv.lib.optionals pythonSupport [ libxml2.py python2 ];
diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix
index 46283e371aa94..827a556a4688f 100644
--- a/pkgs/development/libraries/ncurses/default.nix
+++ b/pkgs/development/libraries/ncurses/default.nix
@@ -61,8 +61,6 @@ stdenv.mkDerivation rec {
            -e '/CPPFLAGS="$CPPFLAGS/s/ -D_XOPEN_SOURCE_EXTENDED//' \
         configure
     CFLAGS=-D_XOPEN_SOURCE_EXTENDED
-  '' + lib.optionalString stdenv.isCygwin ''
-    sed -i -e 's,LIB_SUFFIX="t,LIB_SUFFIX=",' configure
   '';
 
   enableParallelBuilding = true;
@@ -122,7 +120,7 @@ stdenv.mkDerivation rec {
     moveToOutput "bin/tset" "$out"
   '';
 
-  preFixup = ''
+  preFixup = lib.optionalString (!hostPlatform.isCygwin) ''
     rm "$out"/lib/*.a
   '';
 
diff --git a/pkgs/development/libraries/opencv/3.x.nix b/pkgs/development/libraries/opencv/3.x.nix
index dc4a00e6dd99f..85b4d56272014 100644
--- a/pkgs/development/libraries/opencv/3.x.nix
+++ b/pkgs/development/libraries/opencv/3.x.nix
@@ -15,6 +15,7 @@
 , enableFfmpeg    ? false, ffmpeg
 , enableGStreamer ? false, gst_all_1
 , enableEigen     ? false, eigen
+, enableOpenblas  ? false, openblas
 , enableCuda      ? false, cudatoolkit, gcc5
 , AVFoundation, Cocoa, QTKit
 }:
@@ -130,6 +131,7 @@ stdenv.mkDerivation rec {
     ++ lib.optional enableFfmpeg ffmpeg
     ++ lib.optionals enableGStreamer (with gst_all_1; [ gstreamer gst-plugins-base ])
     ++ lib.optional enableEigen eigen
+    ++ lib.optional enableOpenblas openblas
     ++ lib.optionals enableCuda [ cudatoolkit gcc5 ]
     ++ lib.optional enableContrib protobuf3_1
     ++ lib.optionals stdenv.isDarwin [ AVFoundation Cocoa QTKit ];
@@ -141,7 +143,7 @@ stdenv.mkDerivation rec {
   NIX_CFLAGS_COMPILE = lib.optional enableEXR "-I${ilmbase.dev}/include/OpenEXR";
 
   cmakeFlags = [
-    "-DWITH_IPP=${if enableIpp then "ON" else "OFF"}"
+    "-DWITH_IPP=${if enableIpp then "ON" else "OFF"} -DWITH_OPENMP=ON"
     (opencvFlag "TIFF" enableTIFF)
     (opencvFlag "JASPER" enableJPEG2K)
     (opencvFlag "WEBP" enableWebP)
diff --git a/pkgs/development/libraries/openldap/default.nix b/pkgs/development/libraries/openldap/default.nix
index 05c03dcd8424a..7155d0f48a809 100644
--- a/pkgs/development/libraries/openldap/default.nix
+++ b/pkgs/development/libraries/openldap/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, openssl, cyrus_sasl, db, groff, libtool }:
 
 stdenv.mkDerivation rec {
-  name = "openldap-2.4.44";
+  name = "openldap-2.4.45";
 
   src = fetchurl {
     url = "http://www.openldap.org/software/download/OpenLDAP/openldap-release/${name}.tgz";
-    sha256 = "0044p20hx07fwgw2mbwj1fkx04615hhs1qyx4mawj2bhqvrnppnp";
+    sha256 = "091qvwk5dkcpp17ziabcnh3rg3m7qwzw2pihfcd1d5fdxgywzmnd";
   };
 
   # TODO: separate "out" and "bin"
diff --git a/pkgs/development/libraries/openssl/1.0.1-cygwin64.patch b/pkgs/development/libraries/openssl/1.0.1-cygwin64.patch
deleted file mode 100644
index 63112abf3a39d..0000000000000
--- a/pkgs/development/libraries/openssl/1.0.1-cygwin64.patch
+++ /dev/null
@@ -1,136 +0,0 @@
---- openssl-1.0.1e/config      2014-10-23 15:53:23.436600000 +0200
-+++ openssl-1.0.1e/config      2014-10-23 15:55:33.837000000 +0200
-@@ -832,6 +832,7 @@
-   # these are all covered by the catchall below
-   # *-dgux) OUT="dgux" ;;
-   mips-sony-newsos4) OUT="newsos4-gcc" ;;
-+  x86_64-*-cygwin) OUT="Cygwin-x86_64" ;;
-   *-*-cygwin_pre1.3) OUT="Cygwin-pre1.3" ;;
-   *-*-cygwin) OUT="Cygwin" ;;
-   t3e-cray-unicosmk) OUT="cray-t3e" ;;
---- openssl-1.0.1e/Configure	2013-02-17 17:06:18.682058900 -0600
-+++ openssl-1.0.1e/Configure	2013-02-17 16:38:08.000000000 -0600
-@@ -550,6 +550,7 @@ my %table=(
- "Cygwin-pre1.3", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32",
- "Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:coff:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a",
- "debug-Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror:::CYGWIN32:::${no_asm}:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a",
-+"Cygwin-x86_64", "gcc:-DTERMIOS -DL_ENDIAN -O3 -Wall:::CYGWIN32::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:mingw64:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a",
- 
- # NetWare from David Ward (dsward@novell.com)
- # requires either MetroWerks NLM development tools, or gcc / nlmconv
-@@ -1128,7 +1129,7 @@ foreach (sort @experimental)
- 
- my $IsMK1MF=scalar grep /^$target$/,@MK1MF_Builds;
- 
--$exe_ext=".exe" if ($target eq "Cygwin" || $target eq "DJGPP" || $target =~ /^mingw/);
-+$exe_ext=".exe" if ($target =~ /^Cygwin/ || $target eq "DJGPP" || $target =~ /^mingw/);
- $exe_ext=".nlm" if ($target =~ /netware/);
- $exe_ext=".pm"  if ($target =~ /vos/);
- $openssldir="/usr/local/ssl" if ($openssldir eq "" and $prefix eq "");
---- openssl-1.0.1e/Makefile.org	2013-02-11 09:26:04.000000000 -0600
-+++ openssl-1.0.1e/Makefile.org	2013-02-17 16:38:08.000000000 -0600
-@@ -326,9 +326,9 @@ clean-shared:
- 			done; \
- 		fi; \
- 		( set -x; rm -f lib$$i$(SHLIB_EXT) ); \
--		if [ "$(PLATFORM)" = "Cygwin" ]; then \
-+		case "$(PLATFORM)" in Cygwin*)  \
- 			( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
--		fi; \
-+		esac; \
- 	done
- 
- link-shared:
-@@ -571,11 +571,7 @@ install_sw:
- 		do \
- 			if [ -f "$$i" -o -f "$$i.a" ]; then \
- 			(       echo installing $$i; \
--				if [ "$(PLATFORM)" != "Cygwin" ]; then \
--					cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
--					chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
--					mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
--				else \
-+				case "$(PLATFORM)" in Cygwin*) \
- 					c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
- 					cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
- 					chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
-@@ -583,7 +579,12 @@ install_sw:
- 					cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
- 					chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
- 					mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
--				fi ); \
-+					;; \
-+				*) \
-+					cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
-+					chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
-+					mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
-+				esac ); \
- 				if expr $(PLATFORM) : 'mingw' > /dev/null; then \
- 				(	case $$i in \
- 						*crypto*) i=libeay32.dll;; \
-@@ -643,9 +644,9 @@ install_docs:
- 	@pod2man="`cd ./util; ./pod2mantest $(PERL)`"; \
- 	here="`pwd`"; \
- 	filecase=; \
--	if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" -o "$(PLATFORM)" = "mingw" ]; then \
-+	case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*) \
- 		filecase=-i; \
--	fi; \
-+	esac; \
- 	set -e; for i in doc/apps/*.pod; do \
- 		fn=`basename $$i .pod`; \
- 		sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
---- openssl-1.0.1e/engines/ccgost/Makefile	2013-02-11 09:26:04.000000000 -0600
-+++ openssl-1.0.1e/engines/ccgost/Makefile	2013-02-17 17:05:47.759290200 -0600
-@@ -45,7 +45,11 @@ install:
- 		set -e; \
- 		echo installing $(LIBNAME); \
- 		pfx=lib; \
--		if [ "$(PLATFORM)" != "Cygwin" ]; then \
-+		case "$(PLATFORM)" in Cygwin*) \
-+			sfx=".so"; \
-+			cp cyg$(LIBNAME).dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new; \
-+			;; \
-+		*) \
- 			case "$(CFLAGS)" in \
- 			*DSO_BEOS*) sfx=".so";; \
- 			*DSO_DLFCN*) sfx=`expr "$(SHLIB_EXT)" : '.*\(\.[a-z][a-z]*\)' \| ".so"`;; \
-@@ -54,10 +58,7 @@ install:
- 			*) sfx=".bad";; \
- 			esac; \
- 			cp $${pfx}$(LIBNAME)$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new; \
--		else \
--			sfx=".so"; \
--			cp cyg$(LIBNAME).dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new; \
--		fi; \
-+		esac; \
- 		chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new; \
- 		mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx; \
- 	fi
---- openssl-1.0.1i/engines/Makefile	2014-10-23 16:08:19.360200000 +0200
-+++ openssl-1.0.1i/engines/Makefile	2014-10-23 16:10:54.205800000 +0200
-@@ -111,7 +111,11 @@
- 		for l in $(LIBNAMES); do \
- 			( echo installing $$l; \
- 			  pfx=lib; \
--			  if [ "$(PLATFORM)" != "Cygwin" ]; then \
-+			  case "$(PLATFORM)" in Cygwin*) \
-+				sfx=".so"; \
-+				cp cyg$$l.dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
-+				;; \
-+			  *) \
- 				case "$(CFLAGS)" in \
- 				*DSO_BEOS*)	sfx=".so";;	\
- 				*DSO_DLFCN*)	sfx=`expr "$(SHLIB_EXT)" : '.*\(\.[a-z][a-z]*\)' \| ".so"`;;	\
-@@ -120,10 +124,7 @@
- 				*)		sfx=".bad";;	\
- 				esac; \
- 				cp $$pfx$$l$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
--			  else \
--				sfx=".so"; \
--				cp cyg$$l.dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
--			  fi; \
-+			  esac; \
- 			  chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
- 			  mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx ); \
- 		done; \
diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix
index b3ce2fdbbb06f..2120e60ec6aae 100644
--- a/pkgs/development/libraries/openssl/default.nix
+++ b/pkgs/development/libraries/openssl/default.nix
@@ -24,7 +24,6 @@ let
       ++ [ ./nix-ssl-cert-file.patch ]
       ++ optional (versionOlder version "1.1.0")
           (if stdenv.isDarwin then ./use-etc-ssl-certs-darwin.patch else ./use-etc-ssl-certs.patch)
-      ++ optional stdenv.isCygwin ./1.0.1-cygwin64.patch
       ++ optional (versionOlder version "1.0.2" && hostPlatform.isDarwin)
            ./darwin-arch.patch;
 
diff --git a/pkgs/development/libraries/sqlite/default.nix b/pkgs/development/libraries/sqlite/default.nix
index a803171623025..5230df995242b 100644
--- a/pkgs/development/libraries/sqlite/default.nix
+++ b/pkgs/development/libraries/sqlite/default.nix
@@ -3,11 +3,11 @@
 assert interactive -> readline != null && ncurses != null;
 
 stdenv.mkDerivation {
-  name = "sqlite-3.17.0";
+  name = "sqlite-3.19.3";
 
   src = fetchurl {
-    url = "http://sqlite.org/2017/sqlite-autoconf-3170000.tar.gz";
-    sha256 = "0k472gq0p706jq4529p60znvw02hdf172qxgbdv59q0n7anqbr54";
+    url = "http://sqlite.org/2017/sqlite-autoconf-3190300.tar.gz";
+    sha256 = "00b3l2qglpl1inx21fckiwxnfq5xf6441flc79rqg7zdvh1rq4h6";
   };
 
   outputs = [ "bin" "dev" "out" ];
diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix
index 40334f0b46240..eab36c21dc2b1 100644
--- a/pkgs/development/libraries/zlib/default.nix
+++ b/pkgs/development/libraries/zlib/default.nix
@@ -17,6 +17,8 @@ stdenv.mkDerivation rec {
     sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1";
   };
 
+  patches = stdenv.lib.optional hostPlatform.isCygwin ./disable-cygwin-widechar.patch;
+
   postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
     substituteInPlace configure \
       --replace '/usr/bin/libtool' 'ar' \
diff --git a/pkgs/development/libraries/zlib/disable-cygwin-widechar.patch b/pkgs/development/libraries/zlib/disable-cygwin-widechar.patch
new file mode 100644
index 0000000000000..3de4978c30661
--- /dev/null
+++ b/pkgs/development/libraries/zlib/disable-cygwin-widechar.patch
@@ -0,0 +1,13 @@
+diff --git a/gzguts.h b/gzguts.h
+index 990a4d2..6378d46 100644
+--- a/gzguts.h
++++ b/gzguts.h
+@@ -39,7 +39,7 @@
+ #  include <io.h>
+ #endif
+ 
+-#if defined(_WIN32) || defined(__CYGWIN__)
++#if defined(_WIN32)
+ #  define WIDECHAR
+ #endif
+ 
diff --git a/pkgs/development/python-modules/pip-tools/default.nix b/pkgs/development/python-modules/pip-tools/default.nix
index df2bcc03de423..5fa03a18aaa2f 100644
--- a/pkgs/development/python-modules/pip-tools/default.nix
+++ b/pkgs/development/python-modules/pip-tools/default.nix
@@ -1,19 +1,17 @@
-{ stdenv, fetchFromGitHub, buildPythonPackage, pip, pytest, click, six, first, glibcLocales }:
+{ stdenv, fetchurl, buildPythonPackage, pip, pytest, click, six, first, setuptools_scm, glibcLocales }:
 buildPythonPackage rec {
   pname = "pip-tools";
   version = "1.9.0";
   name = "pip-tools-${version}";
 
-  src = fetchFromGitHub {
-    owner = "jazzband";
-    repo = "pip-tools";
-    rev = version;
-    sha256 = "0706feb27263a2dade6d39cc508e718282bd08f455d0643f251659f905be4d56";
+  src = fetchurl {
+    url = "mirror://pypi/p/pip-tools/${name}.tar.gz";
+    sha256 = "0mjdpq2zjn8n4lzn9l2myh4bv0l2f6751k1rdpgdm8k3fargw1h7";
   };
 
   LC_ALL = "en_US.UTF-8";
   buildInputs = [ pytest glibcLocales ];
-  propagatedBuildInputs = [ pip click six first ];
+  propagatedBuildInputs = [ pip click six first setuptools_scm ];
 
   checkPhase = ''
     export HOME=$(mktemp -d)
diff --git a/pkgs/development/python-modules/pylast/default.nix b/pkgs/development/python-modules/pylast/default.nix
new file mode 100644
index 0000000000000..aa0d1d5f575d4
--- /dev/null
+++ b/pkgs/development/python-modules/pylast/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, buildPythonPackage, fetchPypi, certifi, six }:
+
+buildPythonPackage rec {
+  pname = "pylast";
+  version = "1.8.0";
+  name = "${pname}-${version}";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "85f8dd96aef0ccba5f80379c3d7bc1fabd72f59aebab040daf40a8b72268f9bd";
+  };
+
+  propagatedBuildInputs = [ certifi six ];
+
+  # tests require last.fm credentials
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    homepage = "https://github.com/pylast/pylast";
+    description = "A python interface to last.fm (and compatibles)";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ rvolosatovs ];
+  };
+}
diff --git a/pkgs/development/python-modules/spotipy/default.nix b/pkgs/development/python-modules/spotipy/default.nix
new file mode 100644
index 0000000000000..326975e715582
--- /dev/null
+++ b/pkgs/development/python-modules/spotipy/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, buildPythonPackage, fetchPypi, requests }:
+
+buildPythonPackage rec {
+  pname = "spotipy";
+  name = "spotipy-${version}";
+  version = "2.4.4";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1l8ya0cln936x0mx2j5ngl1xwpc0r89hs3wcvb8x8paw3d4dl1ab";
+  };
+
+  propagatedBuildInputs = [ requests ];
+
+  meta = with stdenv.lib; {
+    homepage = "http://spotipy.readthedocs.org/";
+    description = "A light weight Python library for the Spotify Web API";
+    license = licenses.mit;
+    maintainers = [ maintainers.rvolosatovs ];
+  };
+}
diff --git a/pkgs/development/python-modules/uritools/default.nix b/pkgs/development/python-modules/uritools/default.nix
new file mode 100644
index 0000000000000..d680c29e224e1
--- /dev/null
+++ b/pkgs/development/python-modules/uritools/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, buildPythonPackage, fetchPypi, ipaddress }:
+
+buildPythonPackage rec {
+  pname = "uritools";
+  name = "uritools-${version}";
+  version = "2.0.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "20d7881a947cd3c3bb452e2b541f44acc52febe9c4e3f6d05c55d559fb208c50";
+  };
+
+  propagatedBuildInputs = [ ipaddress ];
+
+  meta = with stdenv.lib; {
+    description = "RFC 3986 compliant, Unicode-aware, scheme-agnostic replacement for urlparse";
+    license = licenses.mit;
+    maintainers = [ maintainers.rvolosatovs ];
+  };
+}
diff --git a/pkgs/development/tools/continuous-integration/gitlab-runner/default.nix b/pkgs/development/tools/continuous-integration/gitlab-runner/default.nix
index e3f6e3c623caa..7e11cf531994c 100644
--- a/pkgs/development/tools/continuous-integration/gitlab-runner/default.nix
+++ b/pkgs/development/tools/continuous-integration/gitlab-runner/default.nix
@@ -1,16 +1,16 @@
 { lib, buildGoPackage, fetchFromGitLab, fetchurl, go-bindata }:
 
 let
-  version = "9.2.0";
+  version = "9.3.0";
   # Gitlab runner embeds some docker images these are prebuilt for arm and x86_64
   docker_x86_64 = fetchurl {
     url = "https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/v${version}/docker/prebuilt-x86_64.tar.xz";
-    sha256 = "0x6pwh3wjq2czvzb8rl8npa8a58snwf1f9dwr6rbbxijaf886jfc";
+    sha256 = "1svml4k1zkmnw49sg4ipzl4fzvxx9rbj0643lwf6vm55j8xykhrq";
   };
 
   docker_arm = fetchurl {
     url = "https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/v${version}/docker/prebuilt-arm.tar.xz";
-    sha256 = "1y6i5dn1l1qlwyg95qw4sff2y9zypxwmvsw4mb0555vf157h88kg";
+    sha256 = "0xbbbjd7hvhlzi47rzf09fzcpkd7jrf80xk1y736px75yyvq3jr2";
   };
 in
 buildGoPackage rec {
@@ -29,7 +29,7 @@ buildGoPackage rec {
     owner = "gitlab-org";
     repo = "gitlab-ci-multi-runner";
     rev = "v${version}";
-    sha256 = "0gz6byjnnfn9acy40hcbyzdql4199xn0yvjx2cfjjjzd9kryjrxp";
+    sha256 = "0ddsh31sqjp9xs6mv5jbmqvjq2hcy6j21grrn1m73z8blk4ylxsd";
   };
 
   patches = [ ./fix-shell-path.patch ];
diff --git a/pkgs/development/tools/misc/help2man/1.40.4-cygwin-nls.patch b/pkgs/development/tools/misc/help2man/1.40.4-cygwin-nls.patch
index 20b99998154df..82f8cf1cb37bf 100644
--- a/pkgs/development/tools/misc/help2man/1.40.4-cygwin-nls.patch
+++ b/pkgs/development/tools/misc/help2man/1.40.4-cygwin-nls.patch
@@ -16,8 +16,8 @@ that we're trying to help2man).
 
  install_preload: install_dirs preload
 -	$(INSTALL_PROGRAM) $(preload).so $(DESTDIR)$(pkglibdir)
-+	$(INSTALL_PROGRAM) lib/cygintl-8.dll $(DESTDIR)$(pkglibdir)
-+	ln -sf cygintl-8.dll $(DESTDIR)$(pkglibdir)/$(preload).so
++	$(INSTALL_PROGRAM) lib/cygintl-9.dll $(DESTDIR)$(pkglibdir)
++	ln -sf cygintl-9.dll $(DESTDIR)$(pkglibdir)/$(preload).so
 
  install_l10n: install_dirs msg_l10n man_l10n info_l10n
         set -e; \
@@ -27,8 +27,8 @@ that we're trying to help2man).
  $(preload).so: $(srcdir)/$(preload).c
 -	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ -fPIC -shared $? $(LIBS)
 +	mkdir -p lib
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o lib/cygintl-8.dll -shared $? $(LIBS)
-+	ln -sf lib/cygintl-8.dll $@
++	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o lib/cygintl-9.dll -shared $? $(LIBS)
++	ln -sf lib/cygintl-9.dll $@
 
  man: $(target).1
  $(target).1: $(srcdir)/$(target).PL $(srcdir)/$(target).h2m.PL
@@ -62,7 +62,7 @@ that we're trying to help2man).
          return;
  
 +#ifdef __CYGWIN__
-+    if (!(RTLD_NEXT = dlopen("/usr/bin/cygintl-8.dll", RTLD_LAZY)))
++    if (!(RTLD_NEXT = dlopen("/usr/bin/cygintl-9.dll", RTLD_LAZY)))
 +        die("libintl8 not found");
 +#endif
 +
diff --git a/pkgs/development/tools/misc/help2man/default.nix b/pkgs/development/tools/misc/help2man/default.nix
index 8bf3db59147b5..5e2edce56f0df 100644
--- a/pkgs/development/tools/misc/help2man/default.nix
+++ b/pkgs/development/tools/misc/help2man/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, gettext, LocaleGettext, makeWrapper }:
+{ stdenv, hostPlatform, fetchurl, perl, gettext, LocaleGettext, makeWrapper }:
 
 stdenv.mkDerivation rec {
   name = "help2man-1.47.4";
@@ -12,11 +12,12 @@ stdenv.mkDerivation rec {
 
   doCheck = false;                                # target `check' is missing
 
-  patches = if stdenv.isCygwin then [ ./1.40.4-cygwin-nls.patch ] else null;
+  patches = if hostPlatform.isCygwin then [ ./1.40.4-cygwin-nls.patch ] else null;
 
   postInstall =
     '' wrapProgram "$out/bin/help2man" \
-         --prefix PERL5LIB : "$(echo ${LocaleGettext}/lib/perl*/site_perl)"
+         --prefix PERL5LIB : "$(echo ${LocaleGettext}/lib/perl*/site_perl)" \
+         ${stdenv.lib.optionalString hostPlatform.isCygwin "--prefix PATH : ${gettext}/bin"}
     '';
 
 
diff --git a/pkgs/development/tools/misc/pkgconfig/2.36.3-not-win32.patch b/pkgs/development/tools/misc/pkgconfig/2.36.3-not-win32.patch
index 246173d465afb..c1dd808e60080 100644
--- a/pkgs/development/tools/misc/pkgconfig/2.36.3-not-win32.patch
+++ b/pkgs/development/tools/misc/pkgconfig/2.36.3-not-win32.patch
@@ -309,3 +309,16 @@
  # else
  
    /* On old systems which lack it, use setlocale or getenv.  */
+diff --git a/glib/gtypes.h b/glib/gtypes.h
+index c18e0bf..816685a 100644
+--- a/glib/glib/gtypes.h
++++ b/glib/glib/gtypes.h
+@@ -462,7 +462,7 @@ G_END_DECLS
+  * properly get exported in Windows DLLs.
+  */
+ #ifndef GLIB_VAR
+-#  ifdef G_PLATFORM_WIN32
++#  ifdef G_OS_WIN32
+ #    ifdef GLIB_STATIC_COMPILATION
+ #      define GLIB_VAR extern
+ #    else /* !GLIB_STATIC_COMPILATION */
diff --git a/pkgs/development/tools/misc/pkgconfig/default.nix b/pkgs/development/tools/misc/pkgconfig/default.nix
index 10358df69c22b..5be42855a9c7f 100644
--- a/pkgs/development/tools/misc/pkgconfig/default.nix
+++ b/pkgs/development/tools/misc/pkgconfig/default.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
   configureFlags = [ "--with-internal-glib" ]
     ++ optional (stdenv.isSunOS) [ "--with-libiconv=gnu" "--with-system-library-path" "--with-system-include-path" "CFLAGS=-DENABLE_NLS" ];
 
-  postInstall = ''rm "$out"/bin/*-pkg-config''; # clean the duplicate file
+  postInstall = ''rm -f "$out"/bin/*-pkg-config''; # clean the duplicate file
 
   meta = {
     description = "A tool that allows packages to find out information about other packages";
diff --git a/pkgs/development/tools/nailgun/default.nix b/pkgs/development/tools/nailgun/default.nix
new file mode 100644
index 0000000000000..aef851e647653
--- /dev/null
+++ b/pkgs/development/tools/nailgun/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchMavenArtifact, fetchFromGitHub, bash, jre, makeWrapper }:
+
+let
+  version = "0.9.1";
+  nailgun-server = fetchMavenArtifact {
+    groupId = "com.martiansoftware";
+    artifactId = "nailgun-server";
+    inherit version;
+    sha256 = "09ggkkd1s58jmpc74s6m10d3hyf6bmif31advk66zljbpykgl625";
+  };
+in
+stdenv.mkDerivation rec {
+  name = "nailgun-${version}";
+
+  src = fetchFromGitHub {
+    owner = "martylamb";
+    repo = "nailgun";
+    rev = "1ad9ad9d2d17c895144a9ee0e7acb1d3d90fb66f";
+    sha256 = "1f8ac5kg7imhix9kqdzwiav1bxh8vljv2hb1mq8yz4rqsrx2r4w3";
+  };
+
+  makeFlags = "PREFIX=$(out)";
+
+  buildInputs = [ makeWrapper ];
+
+  installPhase = ''
+    install -D ng $out/bin/ng
+
+    makeWrapper ${jre}/bin/java $out/bin/ng-server \
+      --add-flags '-cp ${nailgun-server.jar}:$CLASSPATH com.martiansoftware.nailgun.NGServer'
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Client, protocol, and server for running Java programs from the command line without incurring the JVM startup overhead";
+    homepage = http://martiansoftware.com/nailgun/;
+    license = licenses.apsl20;
+    platforms = platforms.linux;
+    maintainer = with maintainers; [ volth ];
+  };
+}