summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/editors/vscode/default.nix8
-rw-r--r--pkgs/applications/graphics/gimp/plugins/default.nix34
-rw-r--r--pkgs/applications/graphics/imagej/default.nix48
-rw-r--r--pkgs/applications/graphics/mozjpeg/default.nix4
-rw-r--r--pkgs/applications/misc/calibre/default.nix4
-rw-r--r--pkgs/applications/misc/electrum-ltc/default.nix54
-rw-r--r--pkgs/applications/networking/browsers/firefox/common.nix2
-rw-r--r--pkgs/applications/networking/browsers/firefox/wrapper.nix12
-rw-r--r--pkgs/applications/networking/cluster/helm/default.nix6
-rw-r--r--pkgs/applications/networking/cluster/openshift/default.nix2
-rw-r--r--pkgs/applications/networking/corebird/default.nix4
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird/default.nix4
-rw-r--r--pkgs/applications/networking/remote/freerdp/default.nix18
-rw-r--r--pkgs/applications/networking/remote/freerdp/dlopen-absolute-paths.diff25
-rw-r--r--pkgs/applications/office/watson/default.nix27
-rw-r--r--pkgs/applications/science/electronics/kicad/default.nix12
-rw-r--r--pkgs/applications/science/misc/openmvg/default.nix50
-rw-r--r--pkgs/applications/version-management/git-and-tools/gitflow/default.nix7
-rw-r--r--pkgs/applications/version-management/gitkraken/default.nix4
-rw-r--r--pkgs/applications/video/obs-studio/default.nix18
-rw-r--r--pkgs/applications/video/obs-studio/find-xcb.patch31
-rw-r--r--pkgs/applications/video/smplayer/default.nix4
-rw-r--r--pkgs/applications/window-managers/stalonetray/default.nix8
-rw-r--r--pkgs/data/documentation/man-pages/default.nix4
-rw-r--r--pkgs/development/haskell-modules/configuration-common.nix3
-rw-r--r--pkgs/development/haskell-modules/generic-builder.nix17
-rw-r--r--pkgs/development/haskell-modules/with-packages-wrapper.nix23
-rw-r--r--pkgs/development/libraries/c-blosc/default.nix24
-rw-r--r--pkgs/development/libraries/capnproto/clang4.patch22
-rw-r--r--pkgs/development/libraries/capnproto/default.nix9
-rw-r--r--pkgs/development/libraries/gdal/default.nix6
-rw-r--r--pkgs/development/libraries/libressl/2.5.nix4
-rw-r--r--pkgs/development/libraries/libseccomp/default.nix6
-rw-r--r--pkgs/development/libraries/libsmi/default.nix18
-rw-r--r--pkgs/development/libraries/opencv/3.x.nix10
-rw-r--r--pkgs/development/libraries/rdkafka/default.nix11
-rw-r--r--pkgs/development/python-modules/PyLD/default.nix56
-rw-r--r--pkgs/development/python-modules/aenum/default.nix15
-rw-r--r--pkgs/development/python-modules/agate-dbf/default.nix21
-rw-r--r--pkgs/development/python-modules/agate-excel/default.nix22
-rw-r--r--pkgs/development/python-modules/agate-sql/default.nix21
-rw-r--r--pkgs/development/python-modules/agate/default.nix27
-rw-r--r--pkgs/development/python-modules/autobahn/default.nix21
-rw-r--r--pkgs/development/python-modules/bibtexparser/default.nix25
-rw-r--r--pkgs/development/python-modules/branca/default.nix30
-rw-r--r--pkgs/development/python-modules/csvkit/default.nix28
-rw-r--r--pkgs/development/python-modules/dbf/default.nix25
-rw-r--r--pkgs/development/python-modules/dbfread/default.nix19
-rw-r--r--pkgs/development/python-modules/folium/default.nix45
-rw-r--r--pkgs/development/python-modules/httpserver/default.nix27
-rw-r--r--pkgs/development/python-modules/ltc_scrypt/default.nix22
-rw-r--r--pkgs/development/python-modules/mplleaflet/default.nix28
-rw-r--r--pkgs/development/python-modules/os-testr/default.nix32
-rw-r--r--pkgs/development/python-modules/phpserialize/default.nix22
-rw-r--r--pkgs/development/python-modules/plotly/default.nix37
-rw-r--r--pkgs/development/python-modules/pyproj/default.nix28
-rw-r--r--pkgs/development/python-modules/pytest-asyncio/default.nix4
-rw-r--r--pkgs/development/python-modules/pytest-datafiles/default.nix19
-rw-r--r--pkgs/development/python-modules/pytest-flake8/default.nix29
-rw-r--r--pkgs/development/python-modules/python-slugify/default.nix24
-rw-r--r--pkgs/development/python-modules/pytimeparse/default.nix21
-rw-r--r--pkgs/development/python-modules/sqlalchemy-migrate/default.nix34
-rw-r--r--pkgs/development/python-modules/tables/default.nix5
-rw-r--r--pkgs/development/tools/build-managers/buildbot/default.nix14
-rw-r--r--pkgs/development/tools/build-managers/buildbot/skip_test_linux_distro.patch11
-rw-r--r--pkgs/development/tools/haskell/intero-nix-shim/default.nix21
-rw-r--r--pkgs/development/tools/misc/hydra/default.nix2
-rw-r--r--pkgs/development/tools/rust/bindgen/default.nix13
-rw-r--r--pkgs/misc/tw-rs/default.nix24
-rw-r--r--pkgs/os-specific/linux/firmware/broadcom-bt-firmware/default.nix42
-rw-r--r--pkgs/os-specific/linux/firmware/bt-fw-converter/default.nix35
-rw-r--r--pkgs/os-specific/linux/kernel/linux-4.10.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-4.4.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-4.9.nix4
-rw-r--r--pkgs/os-specific/linux/spl/default.nix4
-rw-r--r--pkgs/os-specific/linux/zfs/default.nix6
-rw-r--r--pkgs/servers/emby/default.nix4
-rw-r--r--pkgs/servers/http/nginx/modules.nix12
-rw-r--r--pkgs/stdenv/darwin/make-bootstrap-tools.nix4
-rw-r--r--pkgs/tools/misc/openopc/default.nix2
-rw-r--r--pkgs/tools/networking/connman-gtk/default.nix43
-rw-r--r--pkgs/tools/networking/dd-agent/default.nix3
-rw-r--r--pkgs/tools/package-management/nix/default.nix6
-rw-r--r--pkgs/tools/text/mb2md/default.nix38
-rw-r--r--pkgs/top-level/all-packages.nix31
-rw-r--r--pkgs/top-level/perl-packages.nix13
-rw-r--r--pkgs/top-level/python-packages.nix318
-rw-r--r--pkgs/top-level/release-cross.nix43
88 files changed, 1457 insertions, 474 deletions
diff --git a/pkgs/applications/editors/vscode/default.nix b/pkgs/applications/editors/vscode/default.nix
index 3d710296219..81aca06267b 100644
--- a/pkgs/applications/editors/vscode/default.nix
+++ b/pkgs/applications/editors/vscode/default.nix
@@ -2,7 +2,7 @@
   makeWrapper, libXScrnSaver, libxkbfile }:
 
 let
-  version = "1.11.2";
+  version = "1.12.1";
   channel = "stable";
 
   plat = {
@@ -12,9 +12,9 @@ let
   }.${stdenv.system};
 
   sha256 = {
-    "i686-linux" = "0cd3iwd5aizixfxc6ayrpvx6k1zk8nsfhd8i3rgz4p4zzfnx6ri5";
-    "x86_64-linux" = "1y3qgm7p1vchh02mqgn8d8pxxnifxfs6hbv01q8zjw3gb7m4anw3";
-    "x86_64-darwin" = "1v8x466080rpm0rfiv1mr2adbpia6j5v9pbsspwm0ndc7ly0h71k";
+    "i686-linux" = "0i4zqxbq7bm2afzyny3a53sq1fghlz5an1z8fkqh5i3029s635h9";
+    "x86_64-linux" = "0kwmfiyb70if4svamnivbc9w65c14j3lrn5vysqkc4b8hlk4r75i";
+    "x86_64-darwin" = "1dgs4k4m885qzammhj0x9k6pd8rayxn61iq3fiazp0w8v5bhl4l5";
   }.${stdenv.system};
 
   archive_fmt = if stdenv.system == "x86_64-darwin" then "zip" else "tar.gz";
diff --git a/pkgs/applications/graphics/gimp/plugins/default.nix b/pkgs/applications/graphics/gimp/plugins/default.nix
index cf36ac4a382..6b145ca09ee 100644
--- a/pkgs/applications/graphics/gimp/plugins/default.nix
+++ b/pkgs/applications/graphics/gimp/plugins/default.nix
@@ -5,7 +5,7 @@
 
 { pkgs, gimp }:
 let
-  inherit (pkgs) stdenv fetchurl pkgconfig glib fetchFromGitHub;
+  inherit (pkgs) stdenv fetchurl pkgconfig intltool glib fetchFromGitHub;
   inherit (gimp) targetPluginDir targetScriptDir;
 
   pluginDerivation = a: stdenv.mkDerivation ({
@@ -23,7 +23,11 @@ let
   }
   // a
     # don't call this gimp-* unless you want nix replace gimp by a plugin :-)
-  // { name = "${a.name}-${gimp.name}-plugin"; }
+  // {
+      name = "${a.name}-${gimp.name}-plugin";
+      buildInputs = [ gimp gimp.gtk glib ] ++ (a.buildInputs or []);
+      nativeBuildInputs = [ pkgconfig intltool ] ++ (a.nativeBuildInputs or []);
+    }
   );
 
   scriptDerivation = {name, src} : pluginDerivation {
@@ -34,7 +38,6 @@ let
  libLQR = pluginDerivation {
     name = "liblqr-1-0.4.1";
     # required by lqrPlugin, you don't havet to install this lib explicitely
-    buildInputs = [ gimp ] ++ gimp.nativeBuildInputs;
     src = fetchurl {
       url = http://registry.gimp.org/files/liblqr-1-0.4.1.tar.bz2;
       sha256 = "02g90wag7xi5rjlmwq8h0qs666b1i2sa90s4303hmym40il33nlz";
@@ -48,7 +51,6 @@ rec {
        Video
     */
     name = "gap-2.6.0";
-    buildInputs = [ gimp pkgconfig glib pkgs.intltool gimp.gtk ] ++ gimp.nativeBuildInputs;
     src = fetchurl {
       url = http://ftp.gimp.org/pub/gimp/plug-ins/v2.6/gap/gimp-gap-2.6.0.tar.bz2;
       sha256 = "1jic7ixcmsn4kx2cn32nc5087rk6g8xsrz022xy11yfmgvhzb0ql";
@@ -73,7 +75,7 @@ rec {
        Filters/Generic/FFT Inverse
     */
     name = "fourier-0.4.1";
-    buildInputs = [ gimp pkgs.fftw  pkgconfig glib] ++ gimp.nativeBuildInputs;
+    buildInputs = with pkgs; [ fftw ];
     postInstall = "fail";
     installPhase = "installPlugins fourier";
     src = fetchurl {
@@ -87,7 +89,7 @@ rec {
        Blur/Focus Blur
     */
     name = "focusblur-3.2.6";
-    buildInputs = [ gimp pkgconfig pkgs.fftwSinglePrec ] ++ gimp.nativeBuildInputs;
+    buildInputs = with pkgs; [ fftwSinglePrec ];
     patches = [ ./patches/focusblur-glib.patch ];
     postInstall = "fail";
     installPhase = "installPlugins src/focusblur";
@@ -105,7 +107,7 @@ rec {
       Filters/Enhance/Smart remove selection
     */
     name = "resynthesizer-0.16";
-    buildInputs = [ gimp pkgs.fftw pkgs.pkgconfig pkgs.gtk2 ] ++ gimp.nativeBuildInputs;
+    buildInputs = with pkgs; [ fftw ];
     src = fetchurl {
       url = http://www.logarithmic.net/pfh-files/resynthesizer/resynthesizer-0.16.tar.gz;
       sha256 = "1k90a1jzswxmajn56rdxa4r60v9v34fmqsiwfdxqcvx3yf4yq96x";
@@ -125,10 +127,8 @@ rec {
       Filters/Enhance/Smart remove selection
     */
     name = "resynthesizer-2.0.1";
-    buildInputs = [ gimp pkgs.fftw pkgs.autoreconfHook pkgs.pkgconfig pkgs.gtk2
-      pkgs.intltool
-    ]
-      ++ gimp.nativeBuildInputs;
+    buildInputs = with pkgs; [ fftw ];
+    nativeBuildInputs = with pkgs; [ autoreconfHook ];
     makeFlags = "GIMP_LIBDIR=$out/lib/gimp/2.0/";
     src = fetchFromGitHub {
       owner = "bootchk";
@@ -140,11 +140,11 @@ rec {
 
   texturize = pluginDerivation {
     name = "texturize-2.1";
-    buildInputs = [ gimp ] ++ gimp.nativeBuildInputs;
     src = fetchurl {
       url = mirror://sourceforge/gimp-texturize/texturize-2.1_src.tgz;
       sha256 = "0cdjq25g3yfxx6bzx6nid21kq659s1vl9id4wxyjs2dhcv229cg3";
     };
+    buildInputs = with pkgs; [ perl ];
     patchPhase = ''
       sed -i '/.*gimpimage_pdb.h.*/ d' src/*.c*
     '';
@@ -156,7 +156,6 @@ rec {
       Filters/Enhance/Wavelet sharpen
     */
     name = "wavelet-sharpen-0.1.2";
-    buildInputs = [ gimp ] ++ gimp.nativeBuildInputs;
     src = fetchurl {
       url = http://registry.gimp.org/files/wavelet-sharpen-0.1.2.tar.gz;
       sha256 = "0vql1k67i21g5ivaa1jh56rg427m0icrkpryrhg75nscpirfxxqw";
@@ -169,7 +168,7 @@ rec {
        Layer/Liquid Rescale
     */
     name = "lqr-plugin-0.6.1";
-    buildInputs = [ pkgconfig libLQR gimp ] ++ gimp.nativeBuildInputs;
+    buildInputs = with pkgs; [ libLQR ];
     src = fetchurl {
       url = http://registry.gimp.org/files/gimp-lqr-plugin-0.6.1.tar.bz2;
       sha256 = "00hklkpcimcbpjly4rjhfipaw096cpy768g9wixglwrsyqhil7l9";
@@ -182,8 +181,7 @@ rec {
     pluginDerivation rec {
       inherit (pkgs.gmic) name src meta;
 
-      nativeBuildInputs = [ pkgconfig ];
-      buildInputs = [ pkgs.fftw pkgs.opencv gimp ] ++ gimp.nativeBuildInputs;
+      buildInputs = with pkgs; [ fftw opencv curl ];
 
       sourceRoot = "${name}/src";
 
@@ -197,7 +195,7 @@ rec {
   # or use the binary
   ufraw = pluginDerivation rec {
     name = "ufraw-0.19.2";
-    buildInputs = [pkgs.gtkimageview pkgs.lcms gimp] ++ gimp.nativeBuildInputs;
+    buildInputs = with pkgs; [ gtkimageview lcms ];
       # --enable-mime - install mime files, see README for more information
       # --enable-extras - build extra (dcraw, nikon-curve) executables
       # --enable-dst-correction - enable DST correction for file timestamps.
@@ -230,7 +228,7 @@ rec {
       sha256 = "0zlmp9v732qmzj083mnk5z421s57mnckmpjhiw890wmmwzj2lhxz";
     };
 
-    buildInputs = [ gimp pkgconfig glib gimp.gtk pkgs.lensfun pkgs.exiv2 ];
+    buildInputs = with pkgs; [ lensfun exiv2 ];
 
     installPhase = "
       installPlugins gimp-lensfun
diff --git a/pkgs/applications/graphics/imagej/default.nix b/pkgs/applications/graphics/imagej/default.nix
new file mode 100644
index 00000000000..673361c734e
--- /dev/null
+++ b/pkgs/applications/graphics/imagej/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, fetchurl, jre, unzip, makeWrapper }:
+
+# Note:
+# - User config dir is hard coded by upstream to $HOME/.imagej on linux systems
+#   and to $HOME/Library/Preferences on macOS.
+#  (The current trend appears to be to use $HOME/.config/imagej
+#    on linux systems, but we here do not attempt to fix it.)
+
+let
+  imagej150 = stdenv.mkDerivation rec {
+    name = "imagej-${version}";
+    version = "150";
+
+    src = fetchurl {
+      url = "http://wsr.imagej.net/distros/cross-platform/ij150.zip";
+      sha256 = "97aba6fc5eb908f5160243aebcdc4965726693cb1353d9c0d71b8f5dd832cb7b";
+    };
+    buildInputs = [ unzip makeWrapper ];
+    inherit jre;
+
+    # JAR files that are intended to be used by other packages
+    # should go to $out/share/java.
+    # (Some uses ij.jar as a library not as a standalone program.)
+    installPhase = ''
+      mkdir -p $out/share/java
+      # Read permisssion suffices for the jar and others.
+      # Simple cp shall clear suid bits, if any.
+      cp ij.jar $out/share/java
+      cp -dR luts macros plugins $out/share
+      mkdir $out/bin
+      makeWrapper ${jre}/bin/java $out/bin/imagej \
+        --add-flags "-jar $out/share/java/ij.jar -ijpath $out/share"
+    '';
+    meta = with stdenv.lib; {
+      homepage = https://imagej.nih.gov/ij/;
+      description = "Image processing and analysis in Java";
+      longDescription = ''
+        ImageJ is a public domain Java image processing program
+        inspired by NIH Image for the Macintosh.
+        It runs on any computer with a Java 1.4 or later virtual machine.
+      '';
+      license = licenses.publicDomain;
+      platforms = with platforms; linux ++ darwin;
+      maintainers = with maintainers; [ yuriaisaka ];
+    };
+  };
+in
+  imagej150
diff --git a/pkgs/applications/graphics/mozjpeg/default.nix b/pkgs/applications/graphics/mozjpeg/default.nix
index 1b082de98bc..0ca997adb78 100644
--- a/pkgs/applications/graphics/mozjpeg/default.nix
+++ b/pkgs/applications/graphics/mozjpeg/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, file, pkgconfig, libpng, nasm }:
 
 stdenv.mkDerivation rec {
-  version = "3.1";
+  version = "3.2";
   name = "mozjpeg-${version}";
 
   src = fetchurl {
     url = "https://github.com/mozilla/mozjpeg/releases/download/v${version}/mozjpeg-${version}-release-source.tar.gz";
-    sha256 = "07vs0xq9di7bv3y68daig8dvxvjqrn8a5na702gj3nn58a1xivfy";
+    sha256 = "0wvv5qh1jasz8apq93c3j9d5wd22j7lld9dr06p76yj4mpnc3v4a";
   };
 
   postPatch = ''
diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix
index fd35c5d3681..6dcd96216cb 100644
--- a/pkgs/applications/misc/calibre/default.nix
+++ b/pkgs/applications/misc/calibre/default.nix
@@ -5,12 +5,12 @@
 }:
 
 stdenv.mkDerivation rec {
-  version = "2.83.0";
+  version = "2.84.0";
   name = "calibre-${version}";
 
   src = fetchurl {
     url = "https://download.calibre-ebook.com/${version}/${name}.tar.xz";
-    sha256 = "1ar6hkcl50lhgwccss759201cqgnwasqmhw9japgnz04fj66w5ln";
+    sha256 = "1kvnmb6hsby4bdnx70bcy32f4dz1axzlr310dr6mkvnc8bqw59km";
   };
 
   patches = [
diff --git a/pkgs/applications/misc/electrum-ltc/default.nix b/pkgs/applications/misc/electrum-ltc/default.nix
new file mode 100644
index 00000000000..50cc434f631
--- /dev/null
+++ b/pkgs/applications/misc/electrum-ltc/default.nix
@@ -0,0 +1,54 @@
+{ stdenv
+, fetchurl
+, python2Packages
+}:
+
+python2Packages.buildPythonApplication rec {
+  name = "electrum-ltc-${version}";
+  version = "2.6.4.2";
+
+  src = fetchurl {
+    url = "https://electrum-ltc.org/download/Electrum-LTC-${version}.tar.gz";
+    sha256 = "0sqcyk6n6kgaiinnwh6mzbbn4whk3ga59r5bw5rqmnnfqk1xdnb4";
+  };
+
+  propagatedBuildInputs = with python2Packages; [
+    pyqt4
+    slowaes
+    ecdsa
+    pbkdf2
+    requests
+    qrcode
+    ltc_scrypt
+    protobuf3_0
+    dns
+    jsonrpclib
+  ];
+
+  preBuild = ''
+    sed -i 's,usr_share = .*,usr_share = "'$out'/share",g' setup.py
+    pyrcc4 icons.qrc -o gui/qt/icons_rc.py
+    # Recording the creation timestamps introduces indeterminism to the build
+    sed -i '/Created: .*/d' gui/qt/icons_rc.py
+  '';
+
+  checkPhase = ''
+    $out/bin/electrum-ltc help >/dev/null
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Litecoin thin client";
+    longDescription = ''
+      Electrum-LTC is a simple, but powerful Litecoin wallet. A twelve-word
+      security passphrase (or “seed”) leaves intruders stranded and your peace
+      of mind intact. Keep it on paper, or in your head... and never worry
+      about losing your litecoins to theft or hardware failure. No waiting, no
+      lengthy blockchain downloads and no syncing to the network.
+    '';
+    homepage = https://electrum-ltc.org/;
+    license = licenses.mit;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ asymmetric ];
+  };
+}
+
diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix
index e926822b42a..8d8217e33a2 100644
--- a/pkgs/applications/networking/browsers/firefox/common.nix
+++ b/pkgs/applications/networking/browsers/firefox/common.nix
@@ -200,6 +200,6 @@ stdenv.mkDerivation (rec {
     gtk = gtk2;
     inherit nspr;
     inherit ffmpegSupport;
-  };
+  } // lib.optionalAttrs gtk3Support { inherit gtk3; };
 
 } // overrides)
diff --git a/pkgs/applications/networking/browsers/firefox/wrapper.nix b/pkgs/applications/networking/browsers/firefox/wrapper.nix
index f2ca9eaa622..cffdfa7a97d 100644
--- a/pkgs/applications/networking/browsers/firefox/wrapper.nix
+++ b/pkgs/applications/networking/browsers/firefox/wrapper.nix
@@ -74,7 +74,9 @@ in stdenv.mkDerivation {
     ];
   };
 
-  buildInputs = [makeWrapper] ++ lib.optionals (!ffmpegSupport) gst-plugins;
+  buildInputs = [makeWrapper]
+    ++ lib.optional (!ffmpegSupport) gst-plugins
+    ++ lib.optional (browser ? gtk3) browser.gtk3;
 
   buildCommand = ''
     if [ ! -x "${browser}/bin/${browserName}" ]
@@ -92,7 +94,13 @@ in stdenv.mkDerivation {
         --prefix-contents PATH ':' "$(filterExisting $(addSuffix /extra-bin-path $plugins))" \
         --suffix PATH ':' "$out/bin" \
         --set MOZ_APP_LAUNCHER "${browserName}${nameSuffix}" \
-        ${lib.optionalString (!ffmpegSupport) ''--prefix GST_PLUGIN_SYSTEM_PATH : "$GST_PLUGIN_SYSTEM_PATH"''}
+        ${lib.optionalString (!ffmpegSupport)
+            ''--prefix GST_PLUGIN_SYSTEM_PATH : "$GST_PLUGIN_SYSTEM_PATH"''
+        + lib.optionalString (browser ? gtk3)
+            ''--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \
+              --suffix XDG_DATA_DIRS : '${gnome3.defaultIconTheme}/share'
+            ''
+         }
 
     if [ -e "${browser}/share/icons" ]; then
         mkdir -p "$out/share"
diff --git a/pkgs/applications/networking/cluster/helm/default.nix b/pkgs/applications/networking/cluster/helm/default.nix
index 31ed8946529..2a0616f3094 100644
--- a/pkgs/applications/networking/cluster/helm/default.nix
+++ b/pkgs/applications/networking/cluster/helm/default.nix
@@ -4,12 +4,12 @@ let
          then "linux-amd64"
          else "darwin-amd64";
   checksum = if stdenv.isLinux
-             then "fa434644d1afd92637369a033fd65b717d8dfa910127d335e8a82c8fad74cc35"
-             else "64420d467e03ceb666a4f22b89e08b93c06f76f5917fe539860b04cd5e5e515f";
+             then "17fya0d1v2w44df5n5xb99vr8qjbnbfjvicsi9p7yz4iz2mcymd6"
+             else "0299ffws37d60wim8kvdp4xrvqxa93sggrprgrsiclcp8bab0dcr";
 in
 stdenv.mkDerivation rec {
   pname = "helm";
-  version = "2.2.3";
+  version = "2.3.1";
   name = "${pname}-${version}";
 
   src = fetchurl {
diff --git a/pkgs/applications/networking/cluster/openshift/default.nix b/pkgs/applications/networking/cluster/openshift/default.nix
index 3915ab6cc26..6ade5bab70e 100644
--- a/pkgs/applications/networking/cluster/openshift/default.nix
+++ b/pkgs/applications/networking/cluster/openshift/default.nix
@@ -36,7 +36,7 @@ in buildGoPackage rec {
 
   installPhase = ''
     mkdir -p "$bin/bin"
-    cp "_output/local/bin/$(go env GOOS)/$(go env GOARCH)/"* "$bin/bin/"
+    cp -a "_output/local/bin/$(go env GOOS)/$(go env GOARCH)/"* "$bin/bin/"
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/networking/corebird/default.nix b/pkgs/applications/networking/corebird/default.nix
index b4197a12db3..7b67ad235e3 100644
--- a/pkgs/applications/networking/corebird/default.nix
+++ b/pkgs/applications/networking/corebird/default.nix
@@ -3,14 +3,14 @@
 , glib_networking }:
 
 stdenv.mkDerivation rec {
-  version = "1.4.2";
+  version = "1.5";
   name = "corebird-${version}";
 
   src = fetchFromGitHub {
     owner = "baedert";
     repo = "corebird";
     rev = version;
-    sha256 = "0s28q9c7p4p4jyhb1g6gdwdphlf6yhi6yg4yn8bkd0gmyf9acakb";
+    sha256 = "0nll3ns1riylxg33w6myz5x8h6ai39k5fw2bkf96g5rgmi6zsjma";
   };
 
   preConfigure = ''
diff --git a/pkgs/applications/networking/mailreaders/thunderbird/default.nix b/pkgs/applications/networking/mailreaders/thunderbird/default.nix
index 501e7180783..2a942ce14f3 100644
--- a/pkgs/applications/networking/mailreaders/thunderbird/default.nix
+++ b/pkgs/applications/networking/mailreaders/thunderbird/default.nix
@@ -6,7 +6,7 @@
 , cairo, gstreamer, gst-plugins-base, icu, libpng, jemalloc
 , autoconf213, which, m4
 , writeScript, xidel, common-updater-scripts, coreutils, gnused, gnugrep, curl
-, enableGTK3 ? false, gtk3, wrapGAppsHook, makeWrapper
+, enableGTK3 ? false, gtk3, gnome3, wrapGAppsHook, makeWrapper
 , enableCalendar ? true
 , debugBuild ? false
 , # If you want the resulting program to call itself "Thunderbird" instead
@@ -47,7 +47,7 @@ in stdenv.mkDerivation rec {
       hunspell libevent libstartup_notification /* cairo */
       icu libpng jemalloc
     ]
-    ++ lib.optional enableGTK3 gtk3;
+    ++ lib.optionals enableGTK3 [ gtk3 gnome3.defaultIconTheme ];
 
   # from firefox + m4 + wrapperTool
   nativeBuildInputs = [ m4 autoconf213 which gnused pkgconfig perl python wrapperTool ];
diff --git a/pkgs/applications/networking/remote/freerdp/default.nix b/pkgs/applications/networking/remote/freerdp/default.nix
index d35f22c1839..f4109bbd179 100644
--- a/pkgs/applications/networking/remote/freerdp/default.nix
+++ b/pkgs/applications/networking/remote/freerdp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitHub, substituteAll, cmake, pkgconfig
+{ stdenv, lib, fetchFromGitHub, cmake, pkgconfig
 , alsaLib, ffmpeg_2, glib, openssl, pcre, zlib
 , libX11, libXcursor, libXdamage, libXext, libXi, libXinerama, libXrandr, libXrender, libXv
 , libxkbcommon, libxkbfile
@@ -14,13 +14,13 @@
 
 stdenv.mkDerivation rec {
   name = "freerdp-git-${version}";
-  version = "20170201";
+  version = "20170502";
 
   src = fetchFromGitHub {
     owner  = "FreeRDP";
     repo   = "FreeRDP";
-    rev    = "6001cb710dc67eb8811362b7bf383754257a902b";
-    sha256 = "0l2lwqk2r8rq8a0f91wbb30kqg21fv0k0508djpwj0pa9n73fgmg";
+    rev    = "8569102c3a011602de3a1cdf69f7c69adbb864ee";
+    sha256 = "0m61aiy8l3ybnk2d2kjmpp9ql31zfs63gjixyj9x95jd4m507j67";
   };
 
   # outputs = [ "bin" "out" "dev" ];
@@ -29,15 +29,11 @@ stdenv.mkDerivation rec {
     export HOME=$TMP
     substituteInPlace "libfreerdp/freerdp.pc.in" \
       --replace "Requires:" "Requires: @WINPR_PKG_CONFIG_FILENAME@"
+  '' + lib.optionalString (pcsclite != null) ''
+    substituteInPlace "winpr/libwinpr/smartcard/smartcard_pcsc.c" \
+      --replace "libpcsclite.so" "${pcsclite}/lib/libpcsclite.so"
   '';
 
-  patches = with lib; [
-  ] ++ optional (pcsclite != null)
-      (substituteAll {
-        src = ./dlopen-absolute-paths.diff;
-        inherit pcsclite;
-      });
-
   buildInputs = with lib; [
     alsaLib cups ffmpeg_2 glib openssl pcre pcsclite libpulseaudio zlib
     gstreamer gst-plugins-base gst-plugins-good
diff --git a/pkgs/applications/networking/remote/freerdp/dlopen-absolute-paths.diff b/pkgs/applications/networking/remote/freerdp/dlopen-absolute-paths.diff
deleted file mode 100644
index 2037ad6acb9..00000000000
--- a/pkgs/applications/networking/remote/freerdp/dlopen-absolute-paths.diff
+++ /dev/null
@@ -1,25 +0,0 @@
-*** FreeRDP-1.2.0-beta1+android7-src/winpr/libwinpr/smartcard/smartcard_pcsc.c.orig	2015-01-25 19:10:03.971628580 -0800
---- FreeRDP-1.2.0-beta1+android7-src/winpr/libwinpr/smartcard/smartcard_pcsc.c	2015-01-25 19:55:05.453980544 -0800
-***************
-*** 2807,2816 ****
-  #ifdef __MACOSX__
-  	g_PCSCModule = LoadLibraryA("/System/Library/Frameworks/PCSC.framework/PCSC");
-  #else
-! 	g_PCSCModule = LoadLibraryA("libpcsclite.so.1");
-  
-  	if (!g_PCSCModule)
-! 		g_PCSCModule = LoadLibraryA("libpcsclite.so");
-  #endif
-  
-  	if (!g_PCSCModule)
---- 2807,2816 ----
-  #ifdef __MACOSX__
-  	g_PCSCModule = LoadLibraryA("/System/Library/Frameworks/PCSC.framework/PCSC");
-  #else
-! 	g_PCSCModule = LoadLibraryA("@pcsclite@/lib/libpcsclite.so.1");
-  
-  	if (!g_PCSCModule)
-! 		g_PCSCModule = LoadLibraryA("@pcsclite@/lib/libpcsclite.so");
-  #endif
-  
-  	if (!g_PCSCModule)
diff --git a/pkgs/applications/office/watson/default.nix b/pkgs/applications/office/watson/default.nix
new file mode 100644
index 00000000000..e3d04285d21
--- /dev/null
+++ b/pkgs/applications/office/watson/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, pythonPackages }:
+
+pythonPackages.buildPythonApplication rec {
+  pname = "td-watson";
+  name = "${pname}-${version}";
+  version = "1.4.0";
+
+  src = pythonPackages.fetchPypi {
+    inherit version pname;
+    sha256 = "1py0g4990jmvq0dn7jasda7f10kzr41bix46hnbyc1rshjzc17hq";
+  };
+
+  # uses tox, test invocation fails
+  doCheck = true;
+  checkPhase = ''
+    py.test -vs tests
+ '';
+  checkInputs = with pythonPackages; [ py pytest pytest-datafiles mock pytest-mock pytestrunner ];
+  propagatedBuildInputs = with pythonPackages; [ requests2 click arrow ];
+
+  meta = with stdenv.lib; {
+    homepage = https://tailordev.github.io/Watson/;
+    description = "A wonderful CLI to track your time!";
+    license = licenses.mit;
+    maintainers = with maintainers; [ mguentner ] ;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/applications/science/electronics/kicad/default.nix b/pkgs/applications/science/electronics/kicad/default.nix
index 9cac49d5189..a7dcbb675f5 100644
--- a/pkgs/applications/science/electronics/kicad/default.nix
+++ b/pkgs/applications/science/electronics/kicad/default.nix
@@ -1,24 +1,24 @@
-{ stdenv, fetchurl, fetchbzr, cmake, mesa, wxGTK, zlib, libX11, gettext, glew, cairo, openssl, boost, pkgconfig, doxygen }:
+{ stdenv, fetchurl, fetchbzr, cmake, mesa, wxGTK, zlib, libX11, gettext, glew, cairo, curl, openssl, boost, pkgconfig, doxygen }:
 
 stdenv.mkDerivation rec {
   name = "kicad-${series}";
   series = "4.0";
-  version = "4.0.2";
+  version = "4.0.6";
 
   srcs = [
     (fetchurl {
       url = "https://code.launchpad.net/kicad/${series}/${version}/+download/kicad-${version}.tar.xz";
-      sha256 = "1fcf91fmxj6ha3mm6gzdb0px50j58m80p8wrncm8ca9shj36kbif";
+      sha256 = "1612lkr1p5sii2c4q8zdm6m4kmdylcq8hkd1mzr6b7l3g70sqz79";
     })
 
     (fetchurl {
       url = "http://downloads.kicad-pcb.org/libraries/kicad-library-${version}.tar.gz";
-      sha256 = "1xk9sxxb3d42chdysqmvizrjcbm0467q7nsq5cahq3j1hci49m6l";
+      sha256 = "16f47pd6f0ddsdxdrp327nr9v05gl8c24d0qypq2aqx5hdjmkp7f";
     })
 
     (fetchurl {
       url = "http://downloads.kicad-pcb.org/libraries/kicad-footprints-${version}.tar.gz";
-      sha256 = "0vrzykgxx423iwgz6186bi8724kmbi5wfl92gfwb3r6mqammgwpg";
+      sha256 = "0vmgqhdw05k5fdnqv42grnvlz7v75g9md82jp2d3dvw2zw050lfb";
     })
   ];
 
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true; # often fails on Hydra: fatal error: pcb_plot_params_lexer.h: No such file or directory
 
-  buildInputs = [ cmake mesa wxGTK zlib libX11 gettext glew cairo openssl boost pkgconfig doxygen ];
+  buildInputs = [ cmake mesa wxGTK zlib libX11 gettext glew cairo curl openssl boost pkgconfig doxygen ];
 
   # They say they only support installs to /usr or /usr/local,
   # so we have to handle this.
diff --git a/pkgs/applications/science/misc/openmvg/default.nix b/pkgs/applications/science/misc/openmvg/default.nix
new file mode 100644
index 00000000000..05e0a98d08e
--- /dev/null
+++ b/pkgs/applications/science/misc/openmvg/default.nix
@@ -0,0 +1,50 @@
+{ lib, stdenv, fetchgit, pkgconfig, cmake
+, libjpeg ? null
+, zlib ? null
+, libpng ? null
+, eigen ? null
+, libtiff ? null
+, enableExamples ? false
+, enableDocs ? false }:
+
+stdenv.mkDerivation rec {
+  version = "1.1";
+  name = "openmvg-${version}";
+
+  src = fetchgit {
+    url = "https://www.github.com/openmvg/openmvg.git";
+
+    # Tag v1.1
+    rev = "f5ecb48";
+    sha256 = "1di9i7yxnkdvl8lhflynmqw62gaxwv00r1sd7nzzs9qn63g0af0f";
+    fetchSubmodules = true;
+  };
+
+  buildInputs = [ libjpeg zlib libpng eigen libtiff ];
+
+  nativeBuildInputs = [ cmake pkgconfig ];
+
+  cmakeFlags = [
+    "-DCMAKE_CXX_FLAGS=-std=c++11"
+    "-DOpenMVG_BUILD_EXAMPLES=${if enableExamples then "ON" else "OFF"}"
+    "-DOpenMVG_BUILD_DOC=${if enableDocs then "ON" else "OFF"}"
+  ];
+
+  cmakeDir = "./src";
+
+  dontUseCmakeBuildDir = true;
+
+  # This can be enabled, but it will exhause virtual memory on most machines.
+  enableParallelBuilding = false;
+
+  # Without hardeningDisable, certain flags are passed to the compile that break the build (primarily string format errors)
+  hardeningDisable = [ "all" ];
+
+  meta = {
+    description = "A library for computer-vision scientists and targeted for the Multiple View Geometry community";
+    homepage = http://openmvg.readthedocs.io/en/latest/;
+    license = stdenv.lib.licenses.mpl20;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [ mdaiter ];
+  };
+}
diff --git a/pkgs/applications/version-management/git-and-tools/gitflow/default.nix b/pkgs/applications/version-management/git-and-tools/gitflow/default.nix
index a6ac1958385..05659a68a52 100644
--- a/pkgs/applications/version-management/git-and-tools/gitflow/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/gitflow/default.nix
@@ -14,15 +14,16 @@ stdenv.mkDerivation rec {
     sha256 = "1i8bwi83qcqvi8zrkjn4mp2v8v7y11fd520wpg2jgy5hqyz34chg";
   };
 
-  buildInputs = optionals (stdenv.isDarwin) [ pkgs.makeWrapper ];
+  buildInputs = [ pkgs.makeWrapper ];
 
   preBuild = ''
     makeFlagsArray+=(prefix="$out")
   '';
 
-  postInstall = optional (stdenv.isDarwin) ''
+  postInstall = ''
     wrapProgram $out/bin/git-flow \
-      --set FLAGS_GETOPT_CMD ${pkgs.getopt}/bin/getopt
+      --set FLAGS_GETOPT_CMD ${pkgs.getopt}/bin/getopt \
+      --suffix PATH : ${pkgs.git}/bin
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/version-management/gitkraken/default.nix b/pkgs/applications/version-management/gitkraken/default.nix
index 2090da057b0..1404bd97599 100644
--- a/pkgs/applications/version-management/gitkraken/default.nix
+++ b/pkgs/applications/version-management/gitkraken/default.nix
@@ -9,11 +9,11 @@ with stdenv.lib;
 
 stdenv.mkDerivation rec {
   name = "gitkraken-${version}";
-  version = "2.4.0";
+  version = "2.5.0";
 
   src = fetchurl {
     url = "https://release.gitkraken.com/linux/v${version}.deb";
-    sha256 = "1s95wnlyy41s8gy7vq4k8w03qrhxq56fr7idsrgvcv065cf5hqmd";
+    sha256 = "1in8caxsc8fld1sl6d9nzch86s9x0770qi6amh573zmb80yyd743";
   };
 
   libPath = makeLibraryPath [
diff --git a/pkgs/applications/video/obs-studio/default.nix b/pkgs/applications/video/obs-studio/default.nix
index 539314867ab..9c0d8c6b004 100644
--- a/pkgs/applications/video/obs-studio/default.nix
+++ b/pkgs/applications/video/obs-studio/default.nix
@@ -1,9 +1,12 @@
 { stdenv
 , fetchFromGitHub
 , cmake
+, fdk_aac
 , ffmpeg
 , jansson
 , libxkbcommon
+, libpthreadstubs
+, libXdmcp
 , qtbase
 , qtx11extras
 , libv4l
@@ -11,6 +14,7 @@
 , curl
 , xorg
 , makeWrapper
+, pkgconfig
 
 , alsaSupport ? false
 , alsaLib
@@ -22,23 +26,29 @@ let
   optional = stdenv.lib.optional;
 in stdenv.mkDerivation rec {
   name = "obs-studio-${version}";
-  version = "18.0.1";
+  version = "18.0.2";
 
   src = fetchFromGitHub {
     owner = "jp9000";
     repo = "obs-studio";
-    rev = "624aa2a5";
-    sha256 = "1bs82rqyq7wjjg99mh23ap8z5bmrhjfnza5iyjx808fzqc0bgzaj";
+    rev = "26c28b45";
+    sha256 = "06rr70z2p2l8prxmd075pnlc759ddlqn3jprn8ns148x6s2vqik2";
   };
 
+  patches = [ ./find-xcb.patch ];
+
   nativeBuildInputs = [ cmake
+                        pkgconfig
                       ];
 
   buildInputs = [ curl
+                  fdk_aac
                   ffmpeg
                   jansson
                   libv4l
                   libxkbcommon
+                  libpthreadstubs
+                  libXdmcp
                   qtbase
                   qtx11extras
                   x264
@@ -65,7 +75,7 @@ in stdenv.mkDerivation rec {
       video content, efficiently
     '';
     homepage = "https://obsproject.com";
-    maintainers = with maintainers; [ jb55 ];
+    maintainers = with maintainers; [ jb55 MP2E ];
     license = licenses.gpl2;
     platforms = with platforms; linux;
   };
diff --git a/pkgs/applications/video/obs-studio/find-xcb.patch b/pkgs/applications/video/obs-studio/find-xcb.patch
new file mode 100644
index 00000000000..c45aba4ce2f
--- /dev/null
+++ b/pkgs/applications/video/obs-studio/find-xcb.patch
@@ -0,0 +1,31 @@
+diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt
+index cd2b80e1..7d829cdb 100644
+--- a/libobs/CMakeLists.txt
++++ b/libobs/CMakeLists.txt
+@@ -15,6 +15,7 @@ if(UNIX)
+ 	find_package(DBus QUIET)
+ 	if (NOT APPLE)
+ 		find_package(X11_XCB REQUIRED)
++		find_package(XCB REQUIRED)
+ 	endif()
+ else()
+ 	set(HAVE_DBUS "0")
+@@ -161,12 +162,15 @@ elseif(UNIX)
+ 	endif()
+ 
+ 	include_directories(
+-		${X11_XCB_INCLUDE_DIRS})
++		${X11_XCB_INCLUDE_DIRS}
++		${XCB_INCLUDE_DIRS})
+ 	add_definitions(
+-		${X11_XCB_DEFINITIONS})
++		${X11_XCB_DEFINITIONS}
++		${XCB_DEFINITIONS})
+ 	set(libobs_PLATFORM_DEPS
+ 		${libobs_PLATFORM_DEPS}
+-		${X11_XCB_LIBRARIES})
++		${X11_XCB_LIBRARIES}
++		${XCB_LIBRARIES})
+ 
+ 	if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+ 		# use the sysinfo compatibility library on bsd
diff --git a/pkgs/applications/video/smplayer/default.nix b/pkgs/applications/video/smplayer/default.nix
index d7411c1128e..41967f50bd0 100644
--- a/pkgs/applications/video/smplayer/default.nix
+++ b/pkgs/applications/video/smplayer/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, qmakeHook, qtscript }:
 
 stdenv.mkDerivation rec {
-  name = "smplayer-17.3.0";
+  name = "smplayer-17.4.2";
 
   src = fetchurl {
     url = "mirror://sourceforge/smplayer/${name}.tar.bz2";
-    sha256 = "0yv7725kr3dq02mcanc07sapirx6s73l4b6d13nzvq5rkwr8crmj";
+    sha256 = "1lc5pj0y56yynygb7cnl98lpvsf82rc0aa4si8isn81nvy07hmq5";
   };
 
   buildInputs = [ qtscript ];
diff --git a/pkgs/applications/window-managers/stalonetray/default.nix b/pkgs/applications/window-managers/stalonetray/default.nix
index 3b5af42a8be..1e6c3b861f1 100644
--- a/pkgs/applications/window-managers/stalonetray/default.nix
+++ b/pkgs/applications/window-managers/stalonetray/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "stalonetray-${version}";
-  version = "0.8.1";
+  version = "0.8.3";
 
   src = fetchurl {
     url = "mirror://sourceforge/stalonetray/${name}.tar.bz2";
-    sha256 = "1wp8pnlv34w7xizj1vivnc3fkwqq4qgb9dbrsg15598iw85gi8ll";
+    sha256 = "0k7xnpdb6dvx25d67v0crlr32cdnzykdsi9j889njiididc8lm1n";
   };
 
   buildInputs = [ libX11 xproto ];
@@ -15,8 +15,10 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "Stand alone tray";
-    maintainers = with maintainers; [ raskin ];
+    homepage = http://stalonetray.sourceforge.net;
+    license = licenses.gpl2;
     platforms = platforms.linux;
+    maintainers = with maintainers; [ raskin ];
   };
 
   passthru = {
diff --git a/pkgs/data/documentation/man-pages/default.nix b/pkgs/data/documentation/man-pages/default.nix
index 52227e9b2ba..6ced5785ecf 100644
--- a/pkgs/data/documentation/man-pages/default.nix
+++ b/pkgs/data/documentation/man-pages/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "man-pages-${version}";
-  version = "4.09";
+  version = "4.11";
 
   src = fetchurl {
     url = "mirror://kernel/linux/docs/man-pages/${name}.tar.xz";
-    sha256 = "1740gq9sq28dp5a5sjn1ya7cvrv8mbky6knb7734v8k29a7a0x55";
+    sha256 = "097m0gsbaz0gf9ir4lmph3h5jj6wmydk1rglfz82dysybx4q1pmd";
   };
 
   makeFlags = [ "MANDIR=$(out)/share/man" ];
diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix
index 0d563081ed2..3f4274441ba 100644
--- a/pkgs/development/haskell-modules/configuration-common.nix
+++ b/pkgs/development/haskell-modules/configuration-common.nix
@@ -684,6 +684,9 @@ self: super: {
     store = self.store_0_3_1;
   });
 
+  # It makes no sense to have intero-nix-shim in Hackage, so we publish it here only.
+  intero-nix-shim = self.callPackage ../tools/haskell/intero-nix-shim {};
+
   # The latest Hoogle needs versions not yet in LTS Haskell 7.x.
   hoogle = super.hoogle.override { haskell-src-exts = self.haskell-src-exts_1_19_1; };
 
diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix
index f2b98e541e8..65569dfb9ba 100644
--- a/pkgs/development/haskell-modules/generic-builder.nix
+++ b/pkgs/development/haskell-modules/generic-builder.nix
@@ -228,6 +228,23 @@ stdenv.mkDerivation ({
         configureFlags+=" --extra-lib-dirs=$p/lib"
       fi
     done
+  '' + (optionalString stdenv.isDarwin ''
+    # Work around a limit in the Mac OS X Sierra linker on the number of paths
+    # referenced by any one dynamic library:
+    #
+    # Create a local directory with symlinks of the *.dylib (Mac OS X shared
+    # libraries) from all the dependencies.
+    local dynamicLinksDir="$out/lib/links"
+    mkdir -p $dynamicLinksDir
+    local foundDylib=false
+    for d in $(grep dynamic-library-dirs $packageConfDir/*|awk '{print $2}'); do
+      ln -s $d/*.dylib $dynamicLinksDir
+    done
+    # Edit the local package DB to reference the links directory.
+    for f in $packageConfDir/*.conf; do
+      sed -i "s,dynamic-library-dirs: .*,dynamic-library-dirs: $dynamicLinksDir," $f
+    done
+  '') + ''
     ${ghcCommand}-pkg --${packageDbFlag}="$packageConfDir" recache
 
     runHook postSetupCompilerEnvironment
diff --git a/pkgs/development/haskell-modules/with-packages-wrapper.nix b/pkgs/development/haskell-modules/with-packages-wrapper.nix
index 15d66bbd6dc..147a021ff53 100644
--- a/pkgs/development/haskell-modules/with-packages-wrapper.nix
+++ b/pkgs/development/haskell-modules/with-packages-wrapper.nix
@@ -96,7 +96,28 @@ symlinkJoin {
         makeWrapper ${ghc}/bin/$prg $out/bin/$prg --add-flags "${packageDBFlag}=${packageCfgDir}"
       fi
     done
-
+  '' + (lib.optionalString stdenv.isDarwin ''
+    # Work around a linker limit in Mac OS X Sierra (see generic-builder.nix):
+    local packageConfDir="$out/lib/${ghc.name}/package.conf.d";
+    local dynamicLinksDir="$out/lib/links"
+    mkdir -p $dynamicLinksDir
+    # Clean up the old links that may have been (transitively) included by
+    # symlinkJoin:
+    rm -f $dynamicLinksDir/*
+    for d in $(grep dynamic-library-dirs $packageConfDir/*|awk '{print $2}'); do
+      ln -s $d/*.dylib $dynamicLinksDir
+    done
+    for f in $packageConfDir/*.conf; do
+      # Initially, $f is a symlink to a read-only file in one of the inputs
+      # (as a result of this symlinkJoin derivation).
+      # Replace it with a copy whose dynamic-library-dirs points to
+      # $dynamicLinksDir
+      cp $f $f-tmp
+      rm $f
+      sed "s,dynamic-library-dirs: .*,dynamic-library-dirs: $dynamicLinksDir," $f-tmp > $f
+      rm $f-tmp
+    done
+  '') + ''
     ${lib.optionalString hasLibraries "$out/bin/${ghcCommand}-pkg recache"}
     ${# ghcjs will read the ghc_libdir file when resolving plugins.
       lib.optionalString (isGhcjs && ghcLibdir != null) ''
diff --git a/pkgs/development/libraries/c-blosc/default.nix b/pkgs/development/libraries/c-blosc/default.nix
new file mode 100644
index 00000000000..5066b0a3250
--- /dev/null
+++ b/pkgs/development/libraries/c-blosc/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  name = "c-blosc";
+  version = "1.11.3";
+
+  src = fetchFromGitHub {
+    owner = "Blosc";
+    repo = "c-blosc";
+    rev = "v${version}";
+    sha256 = "18665lwszwbb48pxgisyxxjh92sr764hv6h7jw8zzsmzdkgzrmcw";
+  };
+
+  buildInputs = [ cmake ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "A blocking, shuffling and loss-less compression library";
+    homepage = http://www.blosc.org;
+    license = licenses.bsd3;
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/development/libraries/capnproto/clang4.patch b/pkgs/development/libraries/capnproto/clang4.patch
deleted file mode 100644
index e83abe9f433..00000000000
--- a/pkgs/development/libraries/capnproto/clang4.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From 0f1fd1938b19dccdb5dbfe9cb5177c4342a2a5b5 Mon Sep 17 00:00:00 2001
-From: Eric Fiselier <eric@efcs.ca>
-Date: Thu, 29 Dec 2016 14:23:40 -0700
-Subject: [PATCH] Fix conversion build error when building with Clang 4.0
-
----
- c++/src/capnp/layout.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/c++/src/capnp/layout.h b/c++/src/capnp/layout.h
-index 850925a..b955f08 100644
---- a/src/capnp/layout.h
-+++ b/src/capnp/layout.h
-@@ -126,7 +126,7 @@template <> struct ElementSizeForType<Void> { static constexpr ElementSize value
- template <> struct ElementSizeForType<bool> { static constexpr ElementSize value = ElementSize::BIT; };
- 
- // Lists and blobs are pointers, not structs.
--template <typename T, bool b> struct ElementSizeForType<List<T, b>> {
-+template <typename T, Kind K> struct ElementSizeForType<List<T, K>> {
-   static constexpr ElementSize value = ElementSize::POINTER;
- };
- template <> struct ElementSizeForType<Text> {
diff --git a/pkgs/development/libraries/capnproto/default.nix b/pkgs/development/libraries/capnproto/default.nix
index 0a5df88efdb..fd2271844ac 100644
--- a/pkgs/development/libraries/capnproto/default.nix
+++ b/pkgs/development/libraries/capnproto/default.nix
@@ -2,18 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "capnproto-${version}";
-  version = "0.5.3";
+  version = "0.6.0";
 
   src = fetchurl {
     url = "https://capnproto.org/capnproto-c++-${version}.tar.gz";
-    sha256 = "1yvaadhgakskqq5wpv53hd6fc3pp17mrdldw4i5cvgck4iwprcfd";
+    sha256 = "0gpp1cxsb9nfd7qkjjykzknx03y0z0n4bq5q0fmxci7w38ci22g5";
   };
 
-  patches = [
-    # Remove once they release a version above 0.5.3. See https://github.com/sandstorm-io/capnproto/issues/433
-    ./clang4.patch
-  ];
-
   meta = with stdenv.lib; {
     homepage    = "http://kentonv.github.io/capnproto";
     description = "Cap'n Proto cerealization protocol";
diff --git a/pkgs/development/libraries/gdal/default.nix b/pkgs/development/libraries/gdal/default.nix
index 599a2c70f13..7e296fb9d06 100644
--- a/pkgs/development/libraries/gdal/default.nix
+++ b/pkgs/development/libraries/gdal/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, composableDerivation, unzip, libjpeg, libtiff, zlib
 , postgresql, mysql, libgeotiff, pythonPackages, proj, geos, openssl
-, libpng, sqlite, libspatialite
+, libpng, sqlite, libspatialite, poppler
 , libiconv
 , netcdfSupport ? true, netcdf, hdf5 , curl
 }:
@@ -16,7 +16,8 @@ composableDerivation.composableDerivation {} (fixed: rec {
     sha256 = "0jh7filpf5dk5iz5acj7y3y49ihnzqypxckdlj0sjigbqq6hlsmf";
   };
 
-  buildInputs = [ unzip libjpeg libtiff libpng proj openssl sqlite libspatialite ]
+  buildInputs = [ unzip libjpeg libtiff libpng proj openssl sqlite
+    libspatialite poppler ]
   ++ (with pythonPackages; [ python numpy wrapPython ])
   ++ stdenv.lib.optional stdenv.isDarwin libiconv
   ++ stdenv.lib.optionals netcdfSupport [ netcdf hdf5 curl ];
@@ -30,6 +31,7 @@ composableDerivation.composableDerivation {} (fixed: rec {
     "--with-jpeg=${libjpeg.dev}"
     "--with-libtiff=${libtiff.dev}" # optional (without largetiff support)
     "--with-png=${libpng.dev}"      # optional
+    "--with-poppler=${poppler.dev}" # optional
     "--with-libz=${zlib.dev}"       # optional
     "--with-pg=${postgresql}/bin/pg_config"
     "--with-mysql=${mysql.lib.dev}/bin/mysql_config"
diff --git a/pkgs/development/libraries/libressl/2.5.nix b/pkgs/development/libraries/libressl/2.5.nix
index b2444b18902..2284db5ad7d 100644
--- a/pkgs/development/libraries/libressl/2.5.nix
+++ b/pkgs/development/libraries/libressl/2.5.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "libressl-${version}";
-  version = "2.5.3";
+  version = "2.5.4";
 
   src = fetchurl {
     url    = "mirror://openbsd/LibreSSL/${name}.tar.gz";
-    sha256 = "0c4awq45cl757fv7f7f75i5i0ibc6v7ns13n7xvfak7chv2lrqql";
+    sha256 = "1ykf6dqlbafafhbdfmcj19pjj1z6wmsq0rmyqga1i0xv5x95nyhh";
   };
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/libseccomp/default.nix b/pkgs/development/libraries/libseccomp/default.nix
index 1575a60ec69..3b365c0e971 100644
--- a/pkgs/development/libraries/libseccomp/default.nix
+++ b/pkgs/development/libraries/libseccomp/default.nix
@@ -15,9 +15,8 @@ stdenv.mkDerivation rec {
     patchShebangs .
   '';
 
-  postInstall = ''
-    wrapProgram $out/bin/scmp_sys_resolver --prefix LD_LIBRARY_PATH ":" $out/lib
-  '';
+  # Hack to ensure that patchelf --shrink-rpath get rids of a $TMPDIR reference.
+  preFixup = "rm -rfv src";
 
   meta = with stdenv.lib; {
     description = "High level library for the Linux Kernel seccomp filter";
@@ -27,4 +26,3 @@ stdenv.mkDerivation rec {
     maintainers = with maintainers; [ thoughtpolice wkennington ];
   };
 }
-
diff --git a/pkgs/development/libraries/libsmi/default.nix b/pkgs/development/libraries/libsmi/default.nix
new file mode 100644
index 00000000000..21b788efb89
--- /dev/null
+++ b/pkgs/development/libraries/libsmi/default.nix
@@ -0,0 +1,18 @@
+{ stdenv , fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "libsmi-${version}";
+  version = "0.5.0";
+
+  src = fetchurl {
+    url = "https://www.ibr.cs.tu-bs.de/projects/libsmi/download/${name}.tar.gz";
+    sha256 = "1lslaxr2qcj6hf4naq5n5mparfhmswsgq4wa7zm2icqvvgdcq6pj";
+  };
+
+  meta = with stdenv.lib; {
+    description = "A Library to Access SMI MIB Information";
+    homepage = "https://www.ibr.cs.tu-bs.de/projects/libsmi/index.html";
+    license = licenses.free;
+    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+  };
+}
diff --git a/pkgs/development/libraries/opencv/3.x.nix b/pkgs/development/libraries/opencv/3.x.nix
index af0456c0162..52afa08f031 100644
--- a/pkgs/development/libraries/opencv/3.x.nix
+++ b/pkgs/development/libraries/opencv/3.x.nix
@@ -4,7 +4,7 @@
 , enablePNG       ? true, libpng
 , enableTIFF      ? true, libtiff
 , enableWebP      ? true, libwebp
-, enableEXR       ? true, openexr, ilmbase
+, enableEXR ? (!stdenv.isDarwin), openexr, ilmbase
 , enableJPEG2K    ? true, jasper
 
 , enableIpp       ? false
@@ -16,6 +16,7 @@
 , enableGStreamer ? false, gst_all_1
 , enableEigen     ? false, eigen
 , enableCuda      ? false, cudatoolkit, gcc5
+, AVFoundation, Cocoa, QTKit
 }:
 
 let
@@ -115,7 +116,7 @@ stdenv.mkDerivation rec {
     ++ lib.optional enableEigen eigen
     ++ lib.optionals enableCuda [ cudatoolkit gcc5 ]
     ++ lib.optional enableContrib protobuf3_1
-    ;
+    ++ lib.optionals stdenv.isDarwin [ AVFoundation Cocoa QTKit ];
 
   propagatedBuildInputs = lib.optional enablePython pythonPackages.numpy;
 
@@ -134,7 +135,8 @@ stdenv.mkDerivation rec {
     (opencvFlag "CUDA" enableCuda)
     (opencvFlag "CUBLAS" enableCuda)
   ] ++ lib.optionals enableCuda [ "-DCUDA_FAST_MATH=ON" ]
-    ++ lib.optional enableContrib "-DBUILD_PROTOBUF=off";
+    ++ lib.optional enableContrib "-DBUILD_PROTOBUF=off"
+    ++ lib.optionals stdenv.isDarwin ["-DWITH_OPENCL=OFF" "-DWITH_LAPACK=OFF"];
 
   enableParallelBuilding = true;
 
@@ -147,6 +149,6 @@ stdenv.mkDerivation rec {
     homepage = http://opencv.org/;
     license = stdenv.lib.licenses.bsd3;
     maintainers = with stdenv.lib.maintainers; [viric flosse mdaiter];
-    platforms = with stdenv.lib.platforms; linux;
+    platforms = with stdenv.lib.platforms; linux ++ darwin;
   };
 }
diff --git a/pkgs/development/libraries/rdkafka/default.nix b/pkgs/development/libraries/rdkafka/default.nix
index 32fff70ebfb..c80c25381b3 100644
--- a/pkgs/development/libraries/rdkafka/default.nix
+++ b/pkgs/development/libraries/rdkafka/default.nix
@@ -1,16 +1,17 @@
-{ stdenv, fetchFromGitHub, zlib, perl }:
+{ stdenv, fetchFromGitHub, zlib, perl, pkgconfig, python }:
 
 stdenv.mkDerivation rec {
-  name = "rdkafka-2015-11-03";
+  name = "rdkafka-${version}";
+  version = "0.9.5";
 
   src = fetchFromGitHub {
     owner = "edenhill";
     repo = "librdkafka";
-    rev = "3e1babf4f26a7d12bbd272c1cdf4aa6a44000d4a";
-    sha256 = "1vmbbkgdwxr25wz60hi6rhqb843ipz34r9baygv87fwh3lwwkqwl";
+    rev = "v${version}";
+    sha256 = "0yp8vmj3yc564hcmhx46ssyn8qayywnsrg4wg67qk6jw967qgwsn";
   };
 
-  buildInputs = [ zlib perl ];
+  buildInputs = [ zlib perl pkgconfig python ];
 
   NIX_CFLAGS_COMPILE = "-Wno-error=strict-overflow";
 
diff --git a/pkgs/development/python-modules/PyLD/default.nix b/pkgs/development/python-modules/PyLD/default.nix
new file mode 100644
index 00000000000..e4edaf83a25
--- /dev/null
+++ b/pkgs/development/python-modules/PyLD/default.nix
@@ -0,0 +1,56 @@
+{ stdenv, fetchPypi, buildPythonPackage, fetchFromGitHub, python, gnugrep }:
+
+let
+
+  json-ld = fetchFromGitHub {
+    owner = "json-ld";
+    repo = "json-ld.org";
+    rev = "843a70e4523d7cd2a4d3f5325586e726eb1b123f";
+    sha256 = "05j0nq6vafclyypxjj30iw898ig0m32nvz0rjdlslx6lawkiwb2a";
+  };
+
+  normalization = fetchFromGitHub {
+    owner = "json-ld";
+    repo = "normalization";
+    rev = "aceeaf224b64d6880189d795bd99c3ffadb5d79e";
+    sha256 = "125q5rllfm8vg9mz8hn7bhvhv2vqpd86kx2kxlk84smh33l8kbyl";
+  };
+
+in
+
+buildPythonPackage rec {
+  pname = "PyLD";
+  version = "0.7.2";
+  name = "${pname}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "digitalbazaar";
+    repo = "pyld";
+    rev = "652473f828e9a396d4c1db9addbd294fb7db1797";
+    sha256 = "1bmpz4s6j7by6l45wwxy7dn7hmrhxc26kbx2hbfy41x29vbjg6j9";
+  };
+
+  # Unfortunately PyLD does not pass all testcases in the JSON-LD corpus. We
+  # check for at least a minimum amount of successful tests so we know it's not
+  # getting worse, at least.
+  checkPhase = ''
+    ok_min=401
+
+    if ! ${python.interpreter} tests/runtests.py -d ${json-ld}/test-suite 2>&1 | tee test.out; then
+      ok_count=$(${gnugrep}/bin/grep -F '... ok' test.out | wc -l)
+      if [[ $ok_count -lt $ok_min ]]; then
+        echo "Less than $ok_min tests passed ($ok_count). Failing the build."
+        exit 1
+      fi
+    fi
+
+    ${python.interpreter} tests/runtests.py -d ${normalization}/tests
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Python implementation of the JSON-LD API";
+    homepage = "https://github.com/digitalbazaar/pyld";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ apeschar ];
+  };
+}
diff --git a/pkgs/development/python-modules/aenum/default.nix b/pkgs/development/python-modules/aenum/default.nix
index 1233b94dccd..9d6fe94a262 100644
--- a/pkgs/development/python-modules/aenum/default.nix
+++ b/pkgs/development/python-modules/aenum/default.nix
@@ -1,18 +1,25 @@
-{ stdenv, fetchPypi, buildPythonPackage }:
+{ stdenv, fetchPypi, buildPythonPackage, isPy3k }:
 
 buildPythonPackage rec {
   pname = "aenum";
-  version = "1.4.7";
+  version = "2.0.6";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1bvn2k53nz99fiwql5fkl0fh7xjw8ama9qzdjp36609mpk05ikl8";
+    sha256 = "0rlhb5wzlyyz0l44r2jxn3m0nh51ifih97dk2y7zfs1m299gwcv6";
   };
 
+  doCheck = !isPy3k;
+  # The following tests fail (only in python3
+  # test_convert (aenum.test.TestIntEnumConvert)
+  # test_convert_value_lookup_priority (aenum.test.TestIntEnumConvert)
+  # test_convert (aenum.test.TestIntEnumConvert)
+  # test_convert_value_lookup_priority (aenum.test.TestIntEnumConvert)
+
   meta = {
     description = "Advanced Enumerations (compatible with Python's stdlib Enum), NamedTuples, and NamedConstants";
-    maintainer = with stdenv.lib.maintainers; [ vrthra ];
+    maintainers = with stdenv.lib.maintainers; [ vrthra ];
     license = with stdenv.lib.licenses; [ bsd3 ];
     homepage = https://bitbucket.org/stoneleaf/aenum;
   };
diff --git a/pkgs/development/python-modules/agate-dbf/default.nix b/pkgs/development/python-modules/agate-dbf/default.nix
new file mode 100644
index 00000000000..11409a11778
--- /dev/null
+++ b/pkgs/development/python-modules/agate-dbf/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchPypi, buildPythonPackage, agate, dbf, dbfread }:
+
+buildPythonPackage rec {
+    name = "${pname}-${version}";
+    pname = "agate-dbf";
+    version = "0.2.0";
+
+    propagatedBuildInputs = [ agate dbf dbfread ];
+
+    src = fetchPypi {
+      inherit pname version;
+      sha256 = "0pkk6m873xpqj77ja6ylmg8v41abpn4bvsqw6mh2hjyd0snw2rh6";
+    };
+
+    meta = with stdenv.lib; {
+      description = "Adds read support for dbf files to agate";
+      homepage    = https://github.com/wireservice/agate-dbf;
+      license     = with licenses; [ mit ];
+      maintainers = with maintainers; [ vrthra ];
+    };
+}
diff --git a/pkgs/development/python-modules/agate-excel/default.nix b/pkgs/development/python-modules/agate-excel/default.nix
new file mode 100644
index 00000000000..cb0113c22b3
--- /dev/null
+++ b/pkgs/development/python-modules/agate-excel/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchPypi, buildPythonPackage, agate, openpyxl, xlrd }:
+
+buildPythonPackage rec {
+    name = "${pname}-${version}";
+    pname = "agate-excel";
+    version = "0.2.1";
+
+    src = fetchPypi {
+      inherit pname version;
+      sha256 = "1d28s01a0a8n8rdrd78w88cqgl3lawzy38h9afwm0iks618i0qn7";
+    };
+
+    propagatedBuildInputs = [ agate openpyxl xlrd ];
+
+    meta = with stdenv.lib; {
+      description = "Adds read support for excel files to agate";
+      homepage    = "https://github.com/wireservice/agate-excel";
+      license     = licenses.mit;
+      maintainers = with maintainers; [ vrthra ];
+    };
+
+}
diff --git a/pkgs/development/python-modules/agate-sql/default.nix b/pkgs/development/python-modules/agate-sql/default.nix
new file mode 100644
index 00000000000..0167b40ea43
--- /dev/null
+++ b/pkgs/development/python-modules/agate-sql/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchPypi, buildPythonPackage, agate, sqlalchemy }:
+
+buildPythonPackage rec {
+    name = "${pname}-${version}";
+    pname = "agate-sql";
+    version = "0.5.2";
+
+    src = fetchPypi {
+      inherit pname version;
+      sha256 = "0qlfwql6fnbs0r1rj7nxv4n5scad53b8dlh4qv6gyklvdk3wwn14";
+    };
+
+    propagatedBuildInputs = [ agate sqlalchemy ];
+
+    meta = with stdenv.lib; {
+      description = "Adds SQL read/write support to agate.";
+      homepage    = https://github.com/wireservice/agate-sql;
+      license     = with licenses; [ mit ];
+      maintainers = with maintainers; [ vrthra ];
+    };
+}
diff --git a/pkgs/development/python-modules/agate/default.nix b/pkgs/development/python-modules/agate/default.nix
new file mode 100644
index 00000000000..3ff097a78cf
--- /dev/null
+++ b/pkgs/development/python-modules/agate/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchPypi, buildPythonPackage, isPy3k,
+  discid, six, parsedatetime, isodate, Babel, pytimeparse,
+  leather, python-slugify }:
+
+buildPythonPackage rec {
+    name = "${pname}-${version}";
+    pname = "agate";
+    version = "1.6.0";
+
+    src = fetchPypi {
+      inherit pname version;
+      sha256 = "02pb5jjvzjqfpsa7q12afbk9nqj06xdpw1s7qa6a1bnalikfniqm";
+    };
+
+    propagatedBuildInputs = [ discid six parsedatetime
+         isodate Babel pytimeparse leather python-slugify ];
+
+    doCheck = !isPy3k;
+    # (only) on python3 unittest loader (loadTestsFromModule) fails
+
+    meta = with stdenv.lib; {
+      description = "A Python data analysis library that is optimized for humans instead of machines";
+      homepage    = https://github.com/wireservice/agate;
+      license     = with licenses; [ mit ];
+      maintainers = with maintainers; [ vrthra ];
+    };
+}
diff --git a/pkgs/development/python-modules/autobahn/default.nix b/pkgs/development/python-modules/autobahn/default.nix
index 6230a5d149c..b83d731c720 100644
--- a/pkgs/development/python-modules/autobahn/default.nix
+++ b/pkgs/development/python-modules/autobahn/default.nix
@@ -1,21 +1,26 @@
-{ stdenv, buildPythonPackage, fetchurl, isPy3k,
-  unittest2, mock, pytest, trollius, pytest-asyncio,
-  six, twisted, txaio
+{ stdenv, buildPythonPackage, fetchurl, isPy3k, isPy33,
+  unittest2, mock, pytest, trollius, asyncio,
+  pytest-asyncio, futures,
+  six, twisted, txaio, zope_interface
 }:
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "autobahn";
-  version = "0.18.2";
+  version = "17.5.1";
 
   src = fetchurl {
     url = "mirror://pypi/a/${pname}/${name}.tar.gz";
-    sha256 = "1alp71plqnrak5nm2vn9mmkxayjb081c1kihqwf60wdpvv0w7y14";
+    sha256 = "0p2xx20g0rj6pnp4h3231mn8zk4ag8msv69f93gai2hzl5vglcia";
   };
 
-  buildInputs = [ unittest2 mock pytest trollius pytest-asyncio ];
-  propagatedBuildInputs = [ six twisted txaio ];
+  # Upstream claim python2 support, but tests require pytest-asyncio which
+  # is pythn3 only. Therefore, tests are skipped for python2.
+  doCheck = isPy3k;
+  buildInputs = stdenv.lib.optionals isPy3k [ unittest2 mock pytest pytest-asyncio ];
+  propagatedBuildInputs = [ six twisted zope_interface txaio ] ++
+    (stdenv.lib.optional isPy33 asyncio) ++
+    (stdenv.lib.optionals (!isPy3k) [ trollius futures ]);
 
-  disabled = !isPy3k;
   checkPhase = ''
     py.test $out
   '';
diff --git a/pkgs/development/python-modules/bibtexparser/default.nix b/pkgs/development/python-modules/bibtexparser/default.nix
new file mode 100644
index 00000000000..0f624a145e0
--- /dev/null
+++ b/pkgs/development/python-modules/bibtexparser/default.nix
@@ -0,0 +1,25 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+}:
+
+buildPythonPackage rec {
+  pname = "bibtexparser";
+  version = "0.6.2";
+  name = "${pname}-${version}";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "5888219ac5db1c63ae0ad4db52ec7ad87fe7a32bd60e62ee87bceedb8ebf73b8";
+  };
+
+  # No tests in archive
+  doCheck = false;
+
+  meta = {
+    description = "Bibtex parser for python 2.7 and 3.3 and newer";
+    homepage = https://github.com/sciunto-org/python-bibtexparser;
+    license = with lib.licenses; [ gpl3 bsd3 ];
+    maintainer = with lib.maintainers; [ fridh ];
+  };
+}
diff --git a/pkgs/development/python-modules/branca/default.nix b/pkgs/development/python-modules/branca/default.nix
new file mode 100644
index 00000000000..886433a358a
--- /dev/null
+++ b/pkgs/development/python-modules/branca/default.nix
@@ -0,0 +1,30 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, pytest
+, jinja2
+, selenium
+}:
+
+buildPythonPackage rec {
+  pname = "branca";
+  version = "0.2.0";
+  name = "${pname}-${version}";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "327b0bae73a519f25dc2f320d8d9f1885aad2e8e5105add1496269d5391b8ea4";
+  };
+
+  checkInputs = [ pytest selenium ];
+  propagatedBuildInputs = [ jinja2 ];
+
+  # Seems to require a browser
+  doCheck = false;
+
+  meta = {
+    description = "Generate complex HTML+JS pages with Python";
+    homepage = https://github.com/python-visualization/branca;
+    license = with lib.licenses; [ mit ];
+  };
+}
diff --git a/pkgs/development/python-modules/csvkit/default.nix b/pkgs/development/python-modules/csvkit/default.nix
new file mode 100644
index 00000000000..bfabf4376e7
--- /dev/null
+++ b/pkgs/development/python-modules/csvkit/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchPypi, buildPythonPackage,
+  dateutil, dbf, xlrd, sqlalchemy, openpyxl,
+ agate-excel, agate-dbf, agate-sql, isPy3k }:
+
+buildPythonPackage rec {
+    name = "${pname}-${version}";
+    pname = "csvkit";
+    version = "1.0.2";
+
+    src = fetchPypi {
+      inherit pname version;
+      sha256 = "05vfsba9nwh4islszgs18rq8sjkpzqni0cdwvvkw7pi0r63pz2as";
+    };
+
+    propagatedBuildInputs = [ dateutil dbf xlrd sqlalchemy openpyxl
+      agate-excel agate-dbf agate-sql ];
+
+    doCheck = !isPy3k;
+    # (only) python 3 we had 9 failures and 57 errors out of a much larger
+    # number of tests.
+
+    meta = with stdenv.lib; {
+      description = "A library of utilities for working with CSV, the king of tabular file formats";
+      maintainers = with maintainers; [ vrthra ];
+      license = with licenses; [ mit ];
+      homepage = https://github.com/wireservice/csvkit;
+    };
+}
diff --git a/pkgs/development/python-modules/dbf/default.nix b/pkgs/development/python-modules/dbf/default.nix
new file mode 100644
index 00000000000..2343ea2918b
--- /dev/null
+++ b/pkgs/development/python-modules/dbf/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchPypi, buildPythonPackage, aenum, isPy3k }:
+
+buildPythonPackage rec {
+    pname = "dbf";
+    version = "0.96.8";
+    name = "${pname}-${version}";
+
+    src = fetchPypi {
+      inherit pname version;
+      sha256 = "1z8n7s4cka6x9ybh4qpfhj51v2qrk38h2f06npizzhm0hmn6r3v1";
+    };
+
+    propagatedBuildInputs = [ aenum ];
+
+    doCheck = !isPy3k;
+    # tests are not yet ported.
+    # https://groups.google.com/forum/#!topic/python-dbase/96rx2xmCG4w
+
+    meta = with stdenv.lib; {
+      description = "Pure python package for reading/writing dBase, FoxPro, and Visual FoxPro .dbf files";
+      homepage    = "https://pypi.python.org/pypi/dbf";
+      license     = licenses.bsd2;
+      maintainers = with maintainers; [ vrthra ];
+    };
+}
diff --git a/pkgs/development/python-modules/dbfread/default.nix b/pkgs/development/python-modules/dbfread/default.nix
new file mode 100644
index 00000000000..6bbc4775605
--- /dev/null
+++ b/pkgs/development/python-modules/dbfread/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchPypi, buildPythonPackage }:
+
+buildPythonPackage rec {
+    name = "${pname}-${version}";
+    pname = "dbfread";
+    version = "2.0.5";
+
+    src = fetchPypi {
+      inherit pname version;
+      sha256 = "0r5axq9ax0czyapm7b69krcv22r1nyb4vci7c5x8mx8pq1axim93";
+    };
+
+    meta = with stdenv.lib; {
+      description = "Read DBF Files with Python";
+      homepage    = http://dbfread.readthedocs.org/;
+      license     = with licenses; [ mit ];
+      maintainers = with maintainers; [ vrthra ];
+    };
+}
diff --git a/pkgs/development/python-modules/folium/default.nix b/pkgs/development/python-modules/folium/default.nix
new file mode 100644
index 00000000000..387da64219d
--- /dev/null
+++ b/pkgs/development/python-modules/folium/default.nix
@@ -0,0 +1,45 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, pytest
+, numpy
+, nbconvert
+, pandas
+, mock
+, jinja2
+, branca
+, six
+}:
+
+buildPythonPackage rec {
+  pname = "folium";
+  version = "0.3.0";
+  name = "${pname}-${version}";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "7729ddd6766b9c5dab17b3709e2387935fd5c655872f1cbab7b7036474415217";
+  };
+
+  postPatch = ''
+    # Causes trouble because a certain file cannot be found
+    rm tests/notebooks/test_notebooks.py
+  '';
+
+  checkInputs = [ pytest numpy nbconvert pandas mock ];
+  propagatedBuildInputs = [ jinja2 branca six ];
+
+  #
+#   doCheck = false;
+
+#   checkPhase = ''
+#     py.test -k 'not test_notebooks'
+#   '';
+
+  meta = {
+    description = "Make beautiful maps with Leaflet.js & Python";
+    homepage = https://github.com/python-visualization/folium;
+    license = with lib.licenses; [ mit ];
+    maintainers = with lib.maintainers; [ fridh ];
+  };
+}
diff --git a/pkgs/development/python-modules/httpserver/default.nix b/pkgs/development/python-modules/httpserver/default.nix
new file mode 100644
index 00000000000..0e4ae14acd7
--- /dev/null
+++ b/pkgs/development/python-modules/httpserver/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchPypi, buildPythonPackage, docopt, pythonOlder }:
+
+buildPythonPackage rec {
+  name = "${pname}-${version}";
+  pname = "httpserver";
+  version = "1.1.0";
+
+  buildInputs = [ docopt ];
+
+  # Tests pull in lots of other dependencies to emulate different web
+  # drivers.
+  doCheck = false;
+
+  # Because it uses asyncio
+  disabled = pythonOlder "3.4";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1q62g324dvb0hqdwwrnj41sqr4d3ly78v9nc26rz1whj4pwdmhsv";
+  };
+
+  meta = {
+    description = "Asyncio implementation of an HTTP server";
+    homepage = https://github.com/thomwiggers/httpserver;
+    license = with lib.licenses; [ bsd3 ];
+  };
+}
diff --git a/pkgs/development/python-modules/ltc_scrypt/default.nix b/pkgs/development/python-modules/ltc_scrypt/default.nix
new file mode 100644
index 00000000000..273571c66e1
--- /dev/null
+++ b/pkgs/development/python-modules/ltc_scrypt/default.nix
@@ -0,0 +1,22 @@
+{ stdenv
+, buildPythonPackage
+, fetchPypi
+}:
+
+buildPythonPackage rec {
+  pname = "ltc_scrypt";
+  version = "1.0";
+  name = "${pname}-${version}";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1h90hh3iw4i7zs7jgskdjlk8gi97b3v2zqsxdfwdvhrrnhpvv856";
+  };
+
+  meta = with stdenv.lib; {
+    description = "Bindings for scrypt proof of work used by Litecoin";
+    homepage = https://pypi.python.org/pypi/ltc_scrypt;
+    maintainers = with maintainers; [ asymmetric ];
+    license = licenses.bsd2;
+  };
+}
diff --git a/pkgs/development/python-modules/mplleaflet/default.nix b/pkgs/development/python-modules/mplleaflet/default.nix
new file mode 100644
index 00000000000..29984eed9e9
--- /dev/null
+++ b/pkgs/development/python-modules/mplleaflet/default.nix
@@ -0,0 +1,28 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, jinja2
+, six
+}:
+
+buildPythonPackage rec {
+  pname = "mplleaflet";
+  version = "0.0.5";
+  name = "${pname}-${version}";
+
+  propagatedBuildInputs = [ jinja2 six ];
+
+  # No tests in archive
+  doCheck = false;
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "049e0b91797ce5b462853395138161fed9e8dfc1f4723f482ebb0739a0bbd289";
+  };
+
+  meta = {
+    description = "Convert Matplotlib plots into Leaflet web maps";
+    homepage = http://github.com/jwass/mplleaflet;
+    license = with lib.licenses; [ bsd3 ];
+  };
+}
diff --git a/pkgs/development/python-modules/os-testr/default.nix b/pkgs/development/python-modules/os-testr/default.nix
new file mode 100644
index 00000000000..3dbf54102e9
--- /dev/null
+++ b/pkgs/development/python-modules/os-testr/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, buildPythonPackage, fetchurl, python,
+  pbr, Babel, testrepository, subunit, testtools,
+  coverage, oslosphinx, oslotest, testscenarios, six, ddt 
+}:
+buildPythonPackage rec {
+  name = "os-testr-${version}";
+  version = "0.8.1";
+
+  src = fetchurl {
+    url = "mirror://pypi/o/os-testr/${name}.tar.gz";
+    sha256 = "10ws7l5p25psnp6rwymwdzh4zagmmnbf56xwg06cn2292m95l4i7";
+  };
+
+  patchPhase = ''
+    sed -i 's@python@${python.interpreter}@' .testr.conf
+    sed -i 's@python@${python.interpreter}@' os_testr/tests/files/testr-conf
+  '';
+
+  checkPhase = ''
+    export PATH=$PATH:$out/bin
+    ${python.interpreter} setup.py test
+  '';
+
+  propagatedBuildInputs = [ pbr Babel testrepository subunit testtools ];
+  buildInputs = [ coverage oslosphinx oslotest testscenarios six ddt ];
+
+  meta = with stdenv.lib; {
+    description = "A testr wrapper to provide functionality for OpenStack projects";
+    homepage  = http://docs.openstack.org/developer/os-testr/;
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/python-modules/phpserialize/default.nix b/pkgs/development/python-modules/phpserialize/default.nix
new file mode 100644
index 00000000000..57dd687604d
--- /dev/null
+++ b/pkgs/development/python-modules/phpserialize/default.nix
@@ -0,0 +1,22 @@
+{lib, buildPythonPackage, fetchPypi}:
+
+buildPythonPackage rec {
+  name = "${pname}-${version}";
+  pname = "phpserialize";
+  version = "1.3";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "19qgkb9z4zjbjxlpwh2w6pxkz2j3iymnydi69jl0jg905lqjsrxz";
+  };
+
+  # project does not have tests at the moment
+  doCheck = false;
+
+  meta = {
+    description = "A port of the serialize and unserialize functions of PHP to Python";
+    homepage = http://github.com/mitsuhiko/phpserialize;
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ jluttine ];
+  };
+}
diff --git a/pkgs/development/python-modules/plotly/default.nix b/pkgs/development/python-modules/plotly/default.nix
new file mode 100644
index 00000000000..3c2e78ac1f1
--- /dev/null
+++ b/pkgs/development/python-modules/plotly/default.nix
@@ -0,0 +1,37 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, decorator
+, nbformat
+, pytz
+, requests2
+, six
+}:
+
+buildPythonPackage rec {
+  pname = "plotly";
+  version = "2.0.8";
+  name = "${pname}-${version}";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1zbwx771w6425w4g6l9fhq4x1854fdnni6xq9xhvs8xqgxkrljm5";
+  };
+
+  propagatedBuildInputs = [
+    decorator
+    nbformat
+    pytz
+    requests2
+    six
+  ];
+
+  # No tests in archive
+  doCheck = false;
+
+  meta = {
+    description = "Python plotting library for collaborative, interactive, publication-quality graphs";
+    homepage = https://plot.ly/python/;
+    license = with lib.licenses; [ mit ];
+  };
+}
diff --git a/pkgs/development/python-modules/pyproj/default.nix b/pkgs/development/python-modules/pyproj/default.nix
new file mode 100644
index 00000000000..eff6f436858
--- /dev/null
+++ b/pkgs/development/python-modules/pyproj/default.nix
@@ -0,0 +1,28 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, proj
+, python
+}:
+
+buildPythonPackage rec {
+  pname = "pyproj";
+  version = "1.9.5.1";
+  name = "${pname}-${version}";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "53fa54c8fa8a1dfcd6af4bf09ce1aae5d4d949da63b90570ac5ec849efaf3ea8";
+  };
+
+  buildInputs = [ proj ];
+
+  # Could not get tests working
+  doCheck = false;
+
+  meta = {
+    description = "Python interface to PROJ.4 library";
+    homepage = http://github.com/jswhit/pyproj;
+    license = with lib.licenses; [ isc ];
+  };
+}
diff --git a/pkgs/development/python-modules/pytest-asyncio/default.nix b/pkgs/development/python-modules/pytest-asyncio/default.nix
index a8e3f7e0268..966a207e50c 100644
--- a/pkgs/development/python-modules/pytest-asyncio/default.nix
+++ b/pkgs/development/python-modules/pytest-asyncio/default.nix
@@ -1,9 +1,11 @@
-{ stdenv, buildPythonPackage, fetchurl, pytest }:
+{ stdenv, buildPythonPackage, fetchurl, pytest, isPy3k }:
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "pytest-asyncio";
   version = "0.5.0";
 
+  disabled = !isPy3k;
+
   src = fetchurl {
     url = "mirror://pypi/p/${pname}/${name}.tar.gz";
     sha256 = "03sxq8fglr4lw4y6wqlbli9ypr65fxzx6hlpn5wpccx8v5472iff";
diff --git a/pkgs/development/python-modules/pytest-datafiles/default.nix b/pkgs/development/python-modules/pytest-datafiles/default.nix
new file mode 100644
index 00000000000..6df1792f884
--- /dev/null
+++ b/pkgs/development/python-modules/pytest-datafiles/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, buildPythonPackage, fetchPypi, py, pytest }:
+
+buildPythonPackage rec {
+  name = "${pname}-${version}";
+  pname = "pytest-datafiles";
+  version = "1.0";
+  src = fetchPypi {
+    inherit version pname;
+    sha256 = "1w5435b5pimk6479ml53lmld3qbag7awcg4gl3ljdywc1v096r5v";
+  };
+
+  buildInputs = [ py pytest ];
+
+  meta = with stdenv.lib; {
+    license = licenses.mit;
+    website = https://pypi.python.org/pypi/pytest-catchlog/;
+    description = "py.test plugin to create a 'tmpdir' containing predefined files/directories.";
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/pytest-flake8/default.nix b/pkgs/development/python-modules/pytest-flake8/default.nix
new file mode 100644
index 00000000000..93883283627
--- /dev/null
+++ b/pkgs/development/python-modules/pytest-flake8/default.nix
@@ -0,0 +1,29 @@
+{lib, buildPythonPackage, fetchPypi, pytest, flake8}:
+
+buildPythonPackage rec {
+  name = "${pname}-${version}";
+  pname = "pytest-flake8";
+  version = "0.8.1";
+
+  # although pytest is a runtime dependency, do not add it as
+  # propagatedBuildInputs in order to allow packages depend on another version
+  # of pytest more easily
+  buildInputs = [ pytest ];
+  propagatedBuildInputs = [ flake8 ];
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1za5i09gz127yraigmcl443w6149714l279rmlfxg1bl2kdsc45a";
+  };
+
+  checkPhase = ''
+    pytest --ignore=nix_run_setup.py .
+  '';
+
+  meta = {
+    description = "py.test plugin for efficiently checking PEP8 compliance";
+    homepage = https://github.com/tholo/pytest-flake8;
+    maintainers = with lib.maintainers; [ jluttine ];
+    license = lib.licenses.bsd2;
+  };
+}
diff --git a/pkgs/development/python-modules/python-slugify/default.nix b/pkgs/development/python-modules/python-slugify/default.nix
new file mode 100644
index 00000000000..03c37f7a6c4
--- /dev/null
+++ b/pkgs/development/python-modules/python-slugify/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchPypi, buildPythonPackage, unidecode, regex, isPy3k }:
+
+buildPythonPackage rec {
+    name = "${pname}-${version}";
+    pname = "python-slugify";
+    version = "1.2.4";
+
+    src = fetchPypi {
+      inherit pname version;
+      sha256 = "097qllxys22kghcv2a5jcc1zdlr9zzqayvk6ywavsv8wgbgqb8sp";
+    };
+    doCheck = !isPy3k;
+    # (only) on python3 unittest loader (loadTestsFromModule) fails
+
+    propagatedBuildInputs = [ unidecode regex ];
+
+    meta = with stdenv.lib; {
+      homepage = https://github.com/un33k/python-slugify;
+      description = "A Python Slugify application that handles Unicode";
+      license = licenses.mit;
+      platforms = platforms.all;
+      maintainers = with maintainers; [ vrthra ];
+    };
+}
diff --git a/pkgs/development/python-modules/pytimeparse/default.nix b/pkgs/development/python-modules/pytimeparse/default.nix
new file mode 100644
index 00000000000..ce5ff058664
--- /dev/null
+++ b/pkgs/development/python-modules/pytimeparse/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchPypi, buildPythonPackage, nose }:
+
+buildPythonPackage rec {
+    pname = "pytimeparse";
+    version = "1.1.6";
+    name = "${pname}-${version}";
+
+    src = fetchPypi {
+      inherit pname version;
+      sha256 = "0imbb68i5n5fm704gv47if1blpxd4f8g16qmp5ar07cavgh2mibl";
+    };
+
+    propagatedBuildInputs = [ nose ];
+
+    meta = with stdenv.lib; {
+      description = "A small Python library to parse various kinds of time expressions";
+      homepage    = "https://github.com/wroberts/pytimeparse";
+      license     = licenses.mit;
+      maintainers = with maintainers; [ vrthra ];
+    };
+}
diff --git a/pkgs/development/python-modules/sqlalchemy-migrate/default.nix b/pkgs/development/python-modules/sqlalchemy-migrate/default.nix
new file mode 100644
index 00000000000..11ed3a8d673
--- /dev/null
+++ b/pkgs/development/python-modules/sqlalchemy-migrate/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, buildPythonPackage, fetchurl, python,
+  unittest2, scripttest, pytz, pylint, tempest-lib, mock, testtools,
+  pbr, tempita, decorator, sqlalchemy, six, sqlparse 
+}:
+buildPythonPackage rec {
+  name = "sqlalchemy-migrate-${version}";
+  version = "0.11.0";
+
+  src = fetchurl {
+    url = "mirror://pypi/s/sqlalchemy-migrate/${name}.tar.gz";
+    sha256 = "0ld2bihp9kmf57ykgzrfgxs4j9kxlw79sgdj9sfn47snw3izb2p6";
+  };
+
+  buildInputs = [ unittest2 scripttest pytz pylint tempest-lib mock testtools ];
+  propagatedBuildInputs = [ pbr tempita decorator sqlalchemy six sqlparse ];
+
+  checkPhase = ''
+    export PATH=$PATH:$out/bin
+    echo sqlite:///__tmp__ > test_db.cfg
+    # depends on ibm_db_sa
+    rm migrate/tests/changeset/databases/test_ibmdb2.py
+    # wants very old testtools
+    rm migrate/tests/versioning/test_schema.py
+    # transient failures on py27
+    substituteInPlace migrate/tests/versioning/test_util.py --replace "test_load_model" "noop"
+    ${python.interpreter} setup.py test
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://code.google.com/p/sqlalchemy-migrate/;
+    description = "Schema migration tools for SQLAlchemy";
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/python-modules/tables/default.nix b/pkgs/development/python-modules/tables/default.nix
index e5de7c4e2a4..7faad8ec4f4 100644
--- a/pkgs/development/python-modules/tables/default.nix
+++ b/pkgs/development/python-modules/tables/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, python, buildPythonPackage
-, cython, bzip2, lzo, numpy, numexpr, hdf5, six }:
+, cython, bzip2, lzo, numpy, numexpr, hdf5, six, c-blosc }:
 
 buildPythonPackage rec {
   version = "3.3.0";
@@ -10,7 +10,7 @@ buildPythonPackage rec {
     sha256 = "0b4211s0zzdmh74k49ss0m9lc2ql2iazq2aa95ams6h45vqcr0w3";
   };
 
-  buildInputs = [ hdf5 cython bzip2 lzo ];
+  buildInputs = [ hdf5 cython bzip2 lzo c-blosc ];
   propagatedBuildInputs = [ numpy numexpr six ];
 
   # The setup script complains about missing run-paths, but they are
@@ -19,6 +19,7 @@ buildPythonPackage rec {
     [ "--hdf5=${hdf5}"
       "--lzo=${lzo}"
       "--bzip2=${bzip2.dev}"
+      "--blosc=${c-blosc}"
     ];
 
   # Run the test suite.
diff --git a/pkgs/development/tools/build-managers/buildbot/default.nix b/pkgs/development/tools/build-managers/buildbot/default.nix
index 8c8caf06303..a4fb9a8b8bf 100644
--- a/pkgs/development/tools/build-managers/buildbot/default.nix
+++ b/pkgs/development/tools/build-managers/buildbot/default.nix
@@ -13,11 +13,11 @@ let
   package = pythonPackages.buildPythonApplication (rec {
     name = "${pname}-${version}";
     pname = "buildbot";
-    version = "0.9.5";
+    version = "0.9.6";
 
     src = pythonPackages.fetchPypi {
       inherit pname version;
-      sha256 = "11r553nmh87a9pm58wycimapk2pw9hnlc7hffn97xwbqprd8qh66";
+      sha256 = "0d6ys1wjwsv4jg4bja1cqhy279hhrl1c9kwyx126srf45slcvg1w";
     };
 
     buildInputs = with pythonPackages; [
@@ -69,6 +69,12 @@ let
 
     ];
 
+    patches = [
+      # This patch disables the test that tries to reat /etc/os-release which
+      # is not accessible in sandboxed builds.
+      ./skip_test_linux_distro.patch
+    ];
+
     postPatch = ''
       substituteInPlace buildbot/scripts/logwatcher.py --replace '/usr/bin/tail' "$(type -P tail)"
 
@@ -79,6 +85,10 @@ let
       rm -fv buildbot/test/unit/test_interpolate_secrets.py
       rm -fv buildbot/test/unit/test_secret_in_file.py
       rm -fv buildbot/test/unit/test_secret_in_vault.py
+
+      # Remove this line after next update. See
+      # https://github.com/buildbot/buildbot/commit/e7fc8c8eba903c2aa6d7e6393499e5b9bffc2334
+      rm -fv buildbot/test/unit/test_mq_wamp.py
     '';
 
     passthru = { inherit withPlugins; };
diff --git a/pkgs/development/tools/build-managers/buildbot/skip_test_linux_distro.patch b/pkgs/development/tools/build-managers/buildbot/skip_test_linux_distro.patch
new file mode 100644
index 00000000000..8fe5c7b56b4
--- /dev/null
+++ b/pkgs/development/tools/build-managers/buildbot/skip_test_linux_distro.patch
@@ -0,0 +1,11 @@
+diff -Nur buildbot-0.9.6/buildbot/test/unit/test_buildbot_net_usage_data.py buildbot-0.9.6.patched/buildbot/test/unit/test_buildbot_net_usage_data.py
+--- buildbot-0.9.6/buildbot/test/unit/test_buildbot_net_usage_data.py	2017-04-19 16:57:02.000000000 +0200
++++ buildbot-0.9.6.patched/buildbot/test/unit/test_buildbot_net_usage_data.py	2017-05-04 12:22:54.575762551 +0200
+@@ -147,6 +147,7 @@
+         _sendBuildbotNetUsageData({'foo': 'bar'})
+ 
+     def test_linux_distro(self):
++        raise SkipTest("NixOS sandboxed builds hides /etc/os-release")
+         system = platform.system()
+         if system != "Linux":
+             raise SkipTest("test is only for linux")
diff --git a/pkgs/development/tools/haskell/intero-nix-shim/default.nix b/pkgs/development/tools/haskell/intero-nix-shim/default.nix
new file mode 100644
index 00000000000..4e9e3381ab0
--- /dev/null
+++ b/pkgs/development/tools/haskell/intero-nix-shim/default.nix
@@ -0,0 +1,21 @@
+{ mkDerivation, base, directory, filepath, optparse-applicative
+, posix-escape, split, stdenv, unix, fetchFromGitHub
+}:
+mkDerivation {
+  pname = "intero-nix-shim";
+  version = "0.1.2";
+  src = fetchFromGitHub {
+    owner = "michalrus";
+    repo = "intero-nix-shim";
+    rev = "0.1.2";
+    sha256 = "0p1h3w15bgvsbzi7f1n2dxxxz9yq7vmbxmww5igc5d3dm76skgzg";
+  };
+  isLibrary = false;
+  isExecutable = true;
+  executableHaskellDepends = [
+    base directory filepath optparse-applicative posix-escape split
+    unix
+  ];
+  homepage = "https://github.com/michalrus/intero-nix-shim";
+  license = stdenv.lib.licenses.asl20;
+}
diff --git a/pkgs/development/tools/misc/hydra/default.nix b/pkgs/development/tools/misc/hydra/default.nix
index f7c410ecfb2..ba2c62ce8ea 100644
--- a/pkgs/development/tools/misc/hydra/default.nix
+++ b/pkgs/development/tools/misc/hydra/default.nix
@@ -104,7 +104,7 @@ in releaseTools.nixBuild rec {
 
   configureFlags = [ "--with-docbook-xsl=${docbook_xsl}/xml/xsl/docbook" ];
 
-  preHook = ''
+  shellHook = ''
     PATH=$(pwd)/src/script:$(pwd)/src/hydra-eval-jobs:$(pwd)/src/hydra-queue-runner:$(pwd)/src/hydra-evaluator:$PATH
     PERL5LIB=$(pwd)/src/lib:$PERL5LIB;
   '';
diff --git a/pkgs/development/tools/rust/bindgen/default.nix b/pkgs/development/tools/rust/bindgen/default.nix
index 4a4738e069c..79c400fd334 100644
--- a/pkgs/development/tools/rust/bindgen/default.nix
+++ b/pkgs/development/tools/rust/bindgen/default.nix
@@ -1,25 +1,30 @@
-{ stdenv, fetchFromGitHub, rustPlatform, llvmPackages }:
+{ stdenv, fetchFromGitHub, rustPlatform, makeWrapper, llvmPackages }:
 
 # Future work: Automatically communicate NIX_CFLAGS_COMPILE to bindgen's tests and the bindgen executable itself.
 
 rustPlatform.buildRustPackage rec {
   name = "rust-bindgen-${version}";
-  version = "0.23.0";
+  version = "0.24.0";
 
   src = fetchFromGitHub {
     owner = "servo";
     repo = "rust-bindgen";
     rev = "v${version}";
-    sha256 = "1cr7wgb13pavjpv2glq02wf5sqigcl1k0qgf3cqi9c5mjca2cg5y";
+    sha256 = "1nzva8g5nj7m2w8vax86p4rd02ci8793nhnm7sf76ajr4hfnx323";
   };
 
+  nativeBuildInputs = [ makeWrapper ];
   buildInputs = [ llvmPackages.clang-unwrapped ];
 
   configurePhase = ''
     export LIBCLANG_PATH="${llvmPackages.clang-unwrapped}/lib"
   '';
 
-  depsSha256 = "1qrnd9a73vxr7572byjjlhwbax3z4slc7qmwjx3aiwjix3r250dh";
+  postInstall = ''
+    wrapProgram $out/bin/bindgen --set LIBCLANG_PATH "${llvmPackages.clang-unwrapped}/lib"
+  '';
+
+  depsSha256 = "1l8c48y67azzwmv4hzghia1c53b5dw6qiv22cgv8zbyrg20aj8as";
 
   doCheck = false; # A test fails because it can't find standard headers in NixOS
 
diff --git a/pkgs/misc/tw-rs/default.nix b/pkgs/misc/tw-rs/default.nix
new file mode 100644
index 00000000000..6c6963303e9
--- /dev/null
+++ b/pkgs/misc/tw-rs/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchFromGitHub, rustPlatform, perl, zlib, openssl }:
+
+rustPlatform.buildRustPackage rec {
+  name = "tw-rs-${version}";
+  version = "0.1.26";
+
+  src = fetchFromGitHub {
+    owner = "vmchale";
+    repo = "tw-rs";
+    rev = "${version}";
+    sha256 = "1s1gk2wcs3792gdzrngksczz3gma5kv02ni2jqrhib8l6z8mg9ia";
+    };
+  buildInputs = [ perl zlib openssl ];
+
+  depsSha256 = "1lg1jh6f9w28i94vaj62r859g6raalxmxabvw7av6sqr0hr56p05";
+
+  meta = with stdenv.lib; {
+    description = "Twitter command-line interface written in rust";
+    homepage = https://github.com/vmchale/tw-rs;
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ vmchale ];
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/os-specific/linux/firmware/broadcom-bt-firmware/default.nix b/pkgs/os-specific/linux/firmware/broadcom-bt-firmware/default.nix
new file mode 100644
index 00000000000..101468c7e08
--- /dev/null
+++ b/pkgs/os-specific/linux/firmware/broadcom-bt-firmware/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchurl, cabextract, bt-fw-converter }:
+
+# Kernels between 4.2 and 4.7 will not work with
+# this packages as they expect the firmware to be named "BCM.hcd"
+# see: https://github.com/NixOS/nixpkgs/pull/25478#issuecomment-299034865
+stdenv.mkDerivation rec {
+  name = "broadcom-bt-firmware-${version}";
+  version = "12.0.1.1011";
+
+  src = fetchurl {
+    url = "http://download.windowsupdate.com/d/msdownload/update/driver/drvs/2016/11/200033618_94cfea9130b30c04bc602cd3dcc1f9a793fc75bb.cab";
+    sha256 = "6091e49c9d9c71cbe3aed2db3c0d60994ff562804c3b40e1e8bcbb818180987b";
+  };
+
+  nativeBuildInputs = [ cabextract bt-fw-converter ];
+
+  unpackCmd = ''
+    mkdir -p ${name}
+    cabextract $src --directory ${name}
+  '';
+  
+  installPhase = ''
+    mkdir -p $out/lib/firmware/brcm
+    bt-fw-converter -f bcbtums.inf -o $out/lib/firmware/brcm
+    for filename in $out/lib/firmware/brcm/*.hcd
+    do
+      linkname=$(basename $filename | awk 'match($0,/^(BCM)[0-9A-Z]+(-[0-9a-z]{4}-[0-9a-z]{4}\.hcd)$/,c) { print c[1]c[2] }')
+      if ! [ -z $linkname ]
+      then
+        ln -s -T $filename $out/lib/firmware/brcm/$linkname
+      fi
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Firmware for Broadcom WIDCOMM® Bluetooth devices";
+    homepage = http://www.catalog.update.microsoft.com/Search.aspx?q=Broadcom+bluetooth;
+    license = licenses.unfree;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ zraexy ];
+  };
+} 
diff --git a/pkgs/os-specific/linux/firmware/bt-fw-converter/default.nix b/pkgs/os-specific/linux/firmware/bt-fw-converter/default.nix
new file mode 100644
index 00000000000..8927e1a28e7
--- /dev/null
+++ b/pkgs/os-specific/linux/firmware/bt-fw-converter/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, makeWrapper, perl, perlPackages, bluez }:
+
+stdenv.mkDerivation  rec {
+  name = "bt-fw-converter-${version}";
+  version = "2017-02-19";
+  rev = "2d8b34402df01c6f7f4b8622de9e8b82fadf4153";
+
+  src = fetchurl {
+    url = "https://raw.githubusercontent.com/winterheart/broadcom-bt-firmware/${rev}/tools/bt-fw-converter.pl";
+    sha256 = "c259b414a4a273c89a0fa7159b3ef73d1ea62b6de91c3a7c2fcc832868e39f4b";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  buildInputs = [ perl perlPackages.RegexpGrammars bluez ];
+
+  unpackCmd = ''
+    mkdir -p ${name}
+    cp $src ${name}/bt-fw-converter.pl
+  '';
+
+  installPhase = ''
+    install -D -m755 bt-fw-converter.pl $out/bin/bt-fw-converter
+    substituteInPlace $out/bin/bt-fw-converter --replace /usr/bin/hex2hcd ${bluez}/bin/hex2hcd
+    wrapProgram $out/bin/bt-fw-converter --set PERL5LIB $PERL5LIB
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/winterheart/broadcom-bt-firmware/;
+    description = "A tool that converts hex to hcd based on inf file";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ zraexy ];
+  };
+} 
diff --git a/pkgs/os-specific/linux/kernel/linux-4.10.nix b/pkgs/os-specific/linux/kernel/linux-4.10.nix
index e258b3bf978..eca2b2bce92 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.10.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.10.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, perl, buildLinux, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "4.10.13";
+  version = "4.10.14";
   extraMeta.branch = "4.10";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "1vylg3zv0n0hx9y5ngshz65hkpfm2686mvdcarhdg2mnxqd2kc6s";
+    sha256 = "1p9k7z91qxp0qqzd0qjfbasxirmhny5s3sasnlizcwsvyb4vicyk";
   };
 
   kernelPatches = args.kernelPatches;
diff --git a/pkgs/os-specific/linux/kernel/linux-4.4.nix b/pkgs/os-specific/linux/kernel/linux-4.4.nix
index bffdf9ac752..397bca69e7d 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.4.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.4.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, perl, buildLinux, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "4.4.65";
+  version = "4.4.66";
   extraMeta.branch = "4.4";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "1vdb1804m3x991p3z0apxzsrp3ppdgngbfwj4j2ac062xgsp5x31";
+    sha256 = "10yl43sdzdy3c4vyqdzrw5vb59bbfb7z6k171a2sid9qr63hfi4s";
   };
 
   kernelPatches = args.kernelPatches;
diff --git a/pkgs/os-specific/linux/kernel/linux-4.9.nix b/pkgs/os-specific/linux/kernel/linux-4.9.nix
index 34884e41f28..a6fbd0d0658 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.9.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.9.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, perl, buildLinux, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "4.9.25";
+  version = "4.9.26";
   extraMeta.branch = "4.9";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "0drfz75k0zj2prawqmxaqgk27zk2vdj2pwip2n7hb9r1b9ly9bc2";
+    sha256 = "1lz9pj53k57y4kmns22xfx823q5gzw8w5d1sn7rdknsjjzhibinz";
   };
 
   kernelPatches = args.kernelPatches;
diff --git a/pkgs/os-specific/linux/spl/default.nix b/pkgs/os-specific/linux/spl/default.nix
index 8e0bb935730..a67c9426844 100644
--- a/pkgs/os-specific/linux/spl/default.nix
+++ b/pkgs/os-specific/linux/spl/default.nix
@@ -66,7 +66,7 @@ in
       sha256 = "15qpx2nhprmk14jgb7yqp9dvfb6i3hhhspi77kvian171b0a6112";
     };
     splUnstable = common {
-      version = "0.7.0-rc3";
-      sha256 = "09v5gh7mqdl3bfq5an9iiw9fw3l1skprclxdz7r19bw3ids3lfja";
+      version = "0.7.0-rc4";
+      sha256 = "13r5qwrdnaabqfy9fvizvdj4n4cvfv6zy4jh0vijzjvbjd4an9g1";
     };
   }
diff --git a/pkgs/os-specific/linux/zfs/default.nix b/pkgs/os-specific/linux/zfs/default.nix
index c70e96aa9fd..b03da8869f7 100644
--- a/pkgs/os-specific/linux/zfs/default.nix
+++ b/pkgs/os-specific/linux/zfs/default.nix
@@ -139,12 +139,12 @@ in
     };
     zfsUnstable = common {
       # comment/uncomment if breaking kernel versions are known
-      incompatibleKernelVersion = "4.11";
+      incompatibleKernelVersion = null;
 
-      version = "0.7.0-rc3";
+      version = "0.7.0-rc4";
 
       # this package should point to a version / git revision compatible with the latest kernel release
-      sha256 = "0js3lazqq8wb4nklqxd6sgbvwqgwnjgz3xi3mm33xf4284gia6pc";
+      sha256 = "16jiq2h7m2ljg5xv7m5lqmsszzclkhvj1iq1wa9w740la4vl22kf";
       extraPatches = [
         (fetchpatch {
           url = "https://github.com/Mic92/zfs/compare/zfs-0.7.0-rc3...nixos-zfs-0.7.0-rc3.patch";
diff --git a/pkgs/servers/emby/default.nix b/pkgs/servers/emby/default.nix
index f88b82675da..406731424cd 100644
--- a/pkgs/servers/emby/default.nix
+++ b/pkgs/servers/emby/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "emby-${version}";
-  version = "3.2.12";
+  version = "3.2.13.0";
 
   src = fetchurl {
     url = "https://github.com/MediaBrowser/Emby/releases/download/${version}/Emby.Mono.zip";
-    sha256 = "0vbb7ax3100djz6zl8vji04a1x3r9vrrgkar605sc2w9n1j1msp2";
+    sha256 = "180prfbc1lv35cqwamzzgl30c0j89nh18jr1nwjancq0s0wkiksp";
   };
 
   buildInputs = with pkgs; [
diff --git a/pkgs/servers/http/nginx/modules.nix b/pkgs/servers/http/nginx/modules.nix
index 9626045500b..02786cd19d1 100644
--- a/pkgs/servers/http/nginx/modules.nix
+++ b/pkgs/servers/http/nginx/modules.nix
@@ -30,18 +30,6 @@
     inputs = [ pkgs.expat ];
   };
 
-  syslog = rec {
-    src = fetchFromGitHub {
-      owner = "yaoweibin";
-      repo = "nginx_syslog_patch";
-      rev = "3ca5ba65541637f74467038aa032e2586321d0cb";
-      sha256 = "0y8dxkx8m1jw4v5zsvw1gfah9vh3ryq0hfmrcbjzcmwp5b5lb1i8";
-    };
-    preConfigure = ''
-      patch -p1 < "${src}/syslog-1.7.0.patch"
-    '';
-  };
-
   moreheaders = {
     src = fetchFromGitHub {
       owner = "openresty";
diff --git a/pkgs/stdenv/darwin/make-bootstrap-tools.nix b/pkgs/stdenv/darwin/make-bootstrap-tools.nix
index 4f651575d6a..65f0cba51f7 100644
--- a/pkgs/stdenv/darwin/make-bootstrap-tools.nix
+++ b/pkgs/stdenv/darwin/make-bootstrap-tools.nix
@@ -301,8 +301,8 @@ in rec {
       export flags="-idirafter ${unpack}/include-Libsystem --sysroot=${unpack} -L${unpack}/lib"
 
       export CPP="clang -E $flags"
-      export CC="clang $flags -Wl,-rpath,${unpack}/lib -Wl,-v"
-      export CXX="clang++ $flags --stdlib=libc++ -lc++abi -isystem${unpack}/include/c++/v1 -Wl,-rpath,${unpack}/lib -Wl,-v"
+      export CC="clang $flags -Wl,-rpath,${unpack}/lib -Wl,-v -Wl,-sdk_version,10.10"
+      export CXX="clang++ $flags --stdlib=libc++ -lc++abi -isystem${unpack}/include/c++/v1 -Wl,-rpath,${unpack}/lib -Wl,-v -Wl,-sdk_version,10.10"
 
       echo '#include <stdio.h>' >> foo.c
       echo '#include <float.h>' >> foo.c
diff --git a/pkgs/tools/misc/openopc/default.nix b/pkgs/tools/misc/openopc/default.nix
index 9da59824e29..8d3850745f1 100644
--- a/pkgs/tools/misc/openopc/default.nix
+++ b/pkgs/tools/misc/openopc/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, python }:
 
 let
-  pythonEnv = python.withPackages(ps: [ps.pyro3]);
+  pythonEnv = python.withPackages(ps: [ps.Pyro]);
 in stdenv.mkDerivation rec {
   name = "openopc-${version}";
   version = "1.2.0";
diff --git a/pkgs/tools/networking/connman-gtk/default.nix b/pkgs/tools/networking/connman-gtk/default.nix
new file mode 100644
index 00000000000..d5688354a76
--- /dev/null
+++ b/pkgs/tools/networking/connman-gtk/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchFromGitHub, autoconf, automake, intltool, pkgconfig,
+gtk3, connman, openconnect, wrapGAppsHook }:
+
+stdenv.mkDerivation rec {
+  name = "connman-gtk-${version}";
+  version = "1.1.1";
+
+  src = fetchFromGitHub {
+    owner = "jgke";
+    repo = "connman-gtk";
+    rev = "v${version}";
+    sha256 = "09k0hx5hxpbykvslv12l2fq9pxdwpd311mxj038hbqzjghcyidyr";
+  };
+
+  nativeBuildInputs = [
+    autoconf
+    automake
+    intltool
+    pkgconfig
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    gtk3
+    openconnect
+    connman
+  ];
+
+  preConfigure = ''
+    # m4/intltool.m4 is an invalid symbolic link
+    rm m4/intltool.m4
+    ln -s ${intltool}/share/aclocal/intltool.m4 m4/
+    ./autogen.sh
+  '';
+
+  meta = with stdenv.lib; {
+    description = "GTK GUI for Connman";
+    homepage = https://github.com/jgke/connman-gtk;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.romildo ];
+  };
+}
diff --git a/pkgs/tools/networking/dd-agent/default.nix b/pkgs/tools/networking/dd-agent/default.nix
index 10b7b47b3f4..e9a70b17130 100644
--- a/pkgs/tools/networking/dd-agent/default.nix
+++ b/pkgs/tools/networking/dd-agent/default.nix
@@ -64,6 +64,9 @@ in stdenv.mkDerivation rec {
     ln -s $out/agent/dogstatsd.py $out/bin/dogstatsd
     ln -s $out/agent/ddagent.py $out/bin/dd-forwarder
 
+    # Move out default conf.d so that /etc/dd-agent/conf.d is used
+    mv $out/agent/conf.d $out/agent/conf.d-system
+
     cat > $out/bin/dd-jmxfetch <<EOF
     #!/usr/bin/env bash
     exec ${python}/bin/python $out/agent/jmxfetch.py $@
diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix
index 31186fb07e3..5295591af29 100644
--- a/pkgs/tools/package-management/nix/default.nix
+++ b/pkgs/tools/package-management/nix/default.nix
@@ -147,12 +147,12 @@ in rec {
 
   nixUnstable = (lib.lowPrio (common rec {
     name = "nix-1.12${suffix}";
-    suffix = "pre5308_2f21d522";
+    suffix = "pre5344_eba840c8";
     src = fetchFromGitHub {
       owner = "NixOS";
       repo = "nix";
-      rev = "2f21d522c28b1e902bd7f0b5b9e7523975102d81";
-      sha256 = "1r3jxz0ydnlxp4b3ggxjgx1q9dv7jyfjm8w1srqjanzn944wnmi9";
+      rev = "eba840c8a13b465ace90172ff76a0db2899ab11b";
+      sha256 = "08yrzlmshg854w5pwq8af634wic91h7k55fs51i55dyxpw4wpxk7";
     };
     fromGit = true;
   })) // { perl-bindings = perl-bindings { nix = nixUnstable; }; };
diff --git a/pkgs/tools/text/mb2md/default.nix b/pkgs/tools/text/mb2md/default.nix
new file mode 100644
index 00000000000..a920cbf3948
--- /dev/null
+++ b/pkgs/tools/text/mb2md/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, lib, fetchurl, perl, makeWrapper, perlPackages }:
+
+let
+  perlDeps = with perlPackages; [ TimeDate ];
+in
+stdenv.mkDerivation rec {
+  version = "3.20";
+  name = "mb2md-${version}";
+
+  src = fetchurl {
+    url = "http://batleth.sapienti-sat.org/projects/mb2md/mb2md-${version}.pl.gz";
+    sha256 = "0bvkky3c90738h3skd2f1b2yy5xzhl25cbh9w2dy97rs86ssjidg";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ perl ];
+
+  unpackPhase = ''
+    sourceRoot=.
+    gzip -d < $src > mb2md.pl
+  '';
+
+  installPhase = ''
+    install -D $sourceRoot/mb2md.pl $out/bin/mb2md
+  '';
+
+  postFixup = ''
+    wrapProgram $out/bin/mb2md \
+      --set PERL5LIB "${lib.makePerlPath perlDeps}"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "mbox to maildir tool";
+    license = licenses.publicDomain;
+    platforms = platforms.all;
+    maintainers = [ maintainers.jb55 ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index dce94584e03..b6fcaba70d3 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1261,6 +1261,8 @@ with pkgs;
 
   connman = callPackage ../tools/networking/connman { };
 
+  connman-gtk = callPackage ../tools/networking/connman-gtk { };
+
   connman-notify = callPackage ../tools/networking/connman-notify { };
 
   connmanui = callPackage ../tools/networking/connmanui { };
@@ -2580,6 +2582,8 @@ with pkgs;
 
   libcpuid = callPackage ../tools/misc/libcpuid { };
 
+  libsmi = callPackage ../development/libraries/libsmi { };
+
   lesspipe = callPackage ../tools/misc/lesspipe { };
 
   liquidsoap = callPackage ../tools/audio/liquidsoap/full.nix {
@@ -2915,6 +2919,8 @@ with pkgs;
 
   mawk = callPackage ../tools/text/mawk { };
 
+  mb2md = callPackage ../tools/text/mb2md { };
+
   mbox = callPackage ../tools/security/mbox { };
 
   mbuffer = callPackage ../tools/misc/mbuffer { };
@@ -3301,6 +3307,8 @@ with pkgs;
 
   openjade = callPackage ../tools/text/sgml/openjade { };
 
+  openmvg = callPackage ../applications/science/misc/openmvg { };
+
   openntpd = callPackage ../tools/networking/openntpd { };
 
   openntpd_nixos = openntpd.override {
@@ -5040,6 +5048,9 @@ with pkgs;
       cross = targetPlatform;
       crossStageStatic = false;
 
+      # XXX: We have troubles cross-compiling libstdc++ on MinGW (see
+      # <http://hydra.nixos.org/build/4268232>), so don't even try.
+      langCC = targetPlatform.config != "i686-pc-mingw32";
       # Why is this needed?
       inherit (forcedNativePackages) binutils;
     };
@@ -7231,6 +7242,8 @@ with pkgs;
     fetchurl = fetchurlBoot;
   };
 
+  c-blosc = callPackage ../development/libraries/c-blosc { };
+
   capnproto = callPackage ../development/libraries/capnproto { };
 
   ccnx = callPackage ../development/libraries/ccnx { };
@@ -9326,7 +9339,9 @@ with pkgs;
     ffmpeg = ffmpeg_2;
   };
 
-  opencv3 = callPackage ../development/libraries/opencv/3.x.nix { };
+  opencv3 = callPackage ../development/libraries/opencv/3.x.nix {
+    inherit (darwin.apple_sdk.frameworks) AVFoundation Cocoa QTKit;
+  };
 
   # this ctl version is needed by openexr_viewers
   openexr_ctl = ctl;
@@ -11355,6 +11370,10 @@ with pkgs;
   b43Firmware_6_30_163_46 = callPackage ../os-specific/linux/firmware/b43-firmware/6.30.163.46.nix { };
 
   b43FirmwareCutter = callPackage ../os-specific/linux/firmware/b43-firmware-cutter { };
+  
+  bt-fw-converter = callPackage ../os-specific/linux/firmware/bt-fw-converter { };
+
+  broadcom-bt-firmware = callPackage ../os-specific/linux/firmware/broadcom-bt-firmware { };
 
   batctl = callPackage ../os-specific/linux/batman-adv/batctl.nix { };
 
@@ -13439,6 +13458,8 @@ with pkgs;
 
   electrum-dash = callPackage ../applications/misc/electrum-dash { };
 
+  electrum-ltc = callPackage ../applications/misc/electrum-ltc { };
+
   elinks = callPackage ../applications/networking/browsers/elinks { };
 
   elvis = callPackage ../applications/editors/elvis { };
@@ -14274,6 +14295,8 @@ with pkgs;
     inherit (perlPackages.override { pkgs = pkgs // { imagemagick = imagemagickBig;}; }) PerlMagick;
   };
 
+  imagej = callPackage ../applications/graphics/imagej { };
+
   imagemagick_light = imagemagick.override {
     bzip2 = null;
     zlib = null;
@@ -16181,6 +16204,10 @@ with pkgs;
     imlib2 = imlib2-nox;
   };
 
+  watson = callPackage ../applications/office/watson {
+    pythonPackages = python3Packages;
+  };
+
   way-cooler = callPackage ../applications/window-managers/way-cooler {};
 
   wayv = callPackage ../tools/X11/wayv {};
@@ -18669,6 +18696,8 @@ with pkgs;
 
   fpm2 = callPackage ../tools/security/fpm2 { };
 
+  tw-rs = callPackage ../misc/tw-rs { };
+
   simplenote = callPackage ../applications/misc/simplenote { };
 
   hy = callPackage ../development/interpreters/hy {};
diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix
index e48e1269166..19a3503c72f 100644
--- a/pkgs/top-level/perl-packages.nix
+++ b/pkgs/top-level/perl-packages.nix
@@ -11317,6 +11317,19 @@ let self = _self // overrides; _self = with self; {
       sha256 = "09c8xb43p1s6ala6g4274az51mf33phyjkp66dpvgkgbi1xfnawp";
     };
   };
+  
+  RegexpGrammars = buildPerlPackage rec {
+    name = "Regexp-Grammars-1.045";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/D/DC/DCONWAY/${name}.tar.gz";
+      sha256 = "8ab001f5641d03f7acce09ca5826b219b02ce40f8e56c2066737228a9232b594";
+    };
+    meta = {
+      homepage = http://search.cpan.org/~dconway/Regexp-Grammars-1.045/lib/Regexp/Grammars.pm;
+      description = "Add grammatical parsing features to Perl 5.10 regexes";
+      license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
+    };
+  };
 
   RegexpIPv6 = buildPerlPackage {
     name = "Regexp-IPv6-0.03";
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 774ef2fb0fc..4ebc4f77f1e 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -114,64 +114,15 @@ in {
 
   aenum = callPackage ../development/python-modules/aenum { };
 
-  agate = buildPythonPackage rec {
-    name = "agate-1.2.2";
-    disabled = isPy3k;
-
-    meta = {
-      description = "A Python data analysis library that is optimized for humans instead of machines";
-      homepage    = "https://github.com/wireservice/agate";
-      license     = licenses.mit;
-      maintainers = with maintainers; [ vrthra ];
-    };
-
-    propagatedBuildInputs = with self; [ discid six parsedatetime isodate Babel pytimeparse ];
+  agate = callPackage ../development/python-modules/agate { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/a/agate/${name}.tar.gz";
-      sha256 = "0h2w30a0zhylivz86d823a05hvg8w8p61lmm855z1wwkgml9l9d4";
-    };
-  };
+  agate-dbf = callPackage ../development/python-modules/agate-dbf { };
 
   phonenumbers = callPackage ../development/python-modules/phonenumbers { };
 
-  agate-dbf = buildPythonPackage rec {
-    name = "agate-dbf-0.1.0";
-    disabled = isPy3k;
-
-    meta = {
-      description = "Adds read support for dbf files to agate";
-      homepage    = "https://github.com/wireservice/agate-dbf";
-      license     = licenses.mit;
-      maintainers = with maintainers; [ vrthra ];
-    };
-
-    propagatedBuildInputs = with self; [ agate dbf dbfread ];
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/a/agate-dbf/${name}.tar.gz";
-      sha256 = "0xzz834lh4xbl342c6wmxqy7ynmsrjp42bsjahfcxhsgq33vzngz";
-    };
-  };
-
-  agate-excel = buildPythonPackage rec {
-    name = "agate-excel-0.1.0";
-    disabled = isPy3k;
+  agate-excel = callPackage ../development/python-modules/agate-excel { };
 
-    meta = {
-      description = "Adds read support for excel files to agate";
-      homepage    = "https://github.com/wireservice/agate-excel";
-      license     = licenses.mit;
-      maintainers = with maintainers; [ vrthra ];
-    };
-
-    propagatedBuildInputs = with self; [ agate openpyxl xlrd ];
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/a/agate-excel/${name}.tar.gz";
-      sha256 = "08zvj3pwqw8zhd58iyymiwblrk92y4gl6yyrb2svb0k8za7v0hak";
-    };
-  };
+  agate-sql = callPackage ../development/python-modules/agate-sql { };
 
   ansicolor = buildPythonPackage rec {
     name = "ansicolor-${version}";
@@ -206,40 +157,9 @@ in {
 
   bugseverywhere = callPackage ../applications/version-management/bugseverywhere {};
 
-  dbf = buildPythonPackage rec {
-    name = "dbf-0.94.003";
-    disabled = isPy3k;
+  dbf = callPackage ../development/python-modules/dbf { };
 
-    meta = {
-      description = "Pure python package for reading/writing dBase, FoxPro, and Visual FoxPro .dbf files";
-      homepage    = "https://pypi.python.org/pypi/dbf";
-      license     = licenses.bsd2;
-      maintainers = with maintainers; [ vrthra ];
-    };
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/d/dbf/${name}.tar.gz";
-      sha256 = "0i2454hwg67079jb56x663wqmmwr55pcr6c76q2415185y6nhny9";
-    };
-  };
-
-
-  dbfread = buildPythonPackage rec {
-    name = "dbfread-2.0.5";
-    disabled = isPy3k;
-
-    meta = {
-      description = "Read DBF Files with Python";
-      homepage    = "http://dbfread.readthedocs.org/";
-      license     = licenses.mit;
-      maintainers = with maintainers; [ vrthra ];
-    };
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/d/dbfread/${name}.tar.gz";
-      sha256 = "0r5axq9ax0czyapm7b69krcv22r1nyb4vci7c5x8mx8pq1axim93";
-    };
-  };
+  dbfread = callPackage ../development/python-modules/dbfread { };
 
   dkimpy = callPackage ../development/python-modules/dkimpy { };
 
@@ -398,25 +318,7 @@ in {
 
   python-stdnum = callPackage ../development/python-modules/python-stdnum { };
 
-  pytimeparse = buildPythonPackage rec {
-    pname = "pytimeparse";
-    version = "1.1.6";
-    name = "${pname}-${version}";
-
-    meta = {
-      description = "A small Python library to parse various kinds of time expressions";
-      homepage    = "https://github.com/wroberts/pytimeparse";
-      license     = licenses.mit;
-      maintainers = with maintainers; [ vrthra ];
-    };
-
-    propagatedBuildInputs = with self; [ nose ];
-
-    src = fetchPypi {
-      inherit pname version;
-      sha256 = "0imbb68i5n5fm704gv47if1blpxd4f8g16qmp5ar07cavgh2mibl";
-    };
-  };
+  pytimeparse =  callPackage ../development/python-modules/pytimeparse { };
 
   PyWebDAV = callPackage ../development/python-modules/pywebdav { };
 
@@ -1586,6 +1488,8 @@ in {
     };
   }));
 
+  python-slugify = callPackage ../development/python-modules/python-slugify { };
+
   awesome-slugify = buildPythonPackage rec {
     name = "awesome-slugify-${version}";
     version = "1.6.5";
@@ -2217,6 +2121,8 @@ in {
     };
   };
 
+  bibtexparser = callPackage ../development/python-modules/bibtexparser { };
+
   binwalk_fun = { visualizationSupport ? false, pyqtgraph ? null }:
     assert visualizationSupport -> pyqtgraph != null;
 
@@ -2529,25 +2435,7 @@ in {
 
   csscompressor = callPackage ../development/python-modules/csscompressor.nix {};
 
-  csvkit = buildPythonPackage rec {
-    name = "csvkit-${version}";
-    version = "0.9.1";
-    disabled = isPy3k;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/c/csvkit/${name}.tar.gz";
-      sha256 = "0fprr4wgp0bq8kl5qims88np11af7ahr5bxkrhfwpdgcgdjbiy4j";
-    };
-
-    propagatedBuildInputs = with self; [ dateutil_2_2 dbf xlrd sqlalchemy openpyxl_2_2_0_b1 ];
-
-    meta = {
-      description = "A library of utilities for working with CSV, the king of tabular file formats";
-      maintainers = with maintainers; [ vrthra ];
-      license = licenses.mit;
-      homepage = "https://github.com/wireservice/csvkit";
-    };
-  };
+  csvkit =  callPackage ../development/python-modules/csvkit { };
 
   cx_Freeze = buildPythonPackage rec {
     name = "cx_freeze-${version}";
@@ -2945,6 +2833,8 @@ in {
     };
   };
 
+  httpserver = callPackage ../development/python-modules/httpserver {};
+
   bleach = buildPythonPackage rec {
     pname = "bleach";
     version = "2.0.0";
@@ -3264,6 +3154,8 @@ in {
     };
   };
 
+  branca = callPackage ../development/python-modules/branca { };
+
   bugwarrior = buildPythonPackage rec {
     name = "bugwarrior-${version}";
     version = "1.4.0";
@@ -5083,6 +4975,8 @@ in {
     };
   };
 
+  PyLD = callPackage ../development/python-modules/PyLD { };
+
   python-jose = callPackage ../development/python-modules/python-jose {};
 
   pyhepmc = buildPythonPackage rec {
@@ -5182,6 +5076,8 @@ in {
     };
   };
 
+  pytest-datafiles = callPackage ../development/python-modules/pytest-datafiles { };
+
   pytest-django = callPackage ../development/python-modules/pytest-django { };
 
   pytest-fixture-config = buildPythonPackage rec {
@@ -5235,6 +5131,8 @@ in {
     };
   };
 
+  pytest-flake8 = callPackage ../development/python-modules/pytest-flake8 { };
+
   pytestflakes = buildPythonPackage rec {
     name = "pytest-flakes-${version}";
     version = "1.0.1";
@@ -5261,9 +5159,9 @@ in {
   pytest-mock = buildPythonPackage rec {
     name = "${pname}-${version}";
     pname = "pytest-mock";
-    version = "1.2";
+    version = "1.6.0";
 
-    buildInputs = with self; [ pytest ];
+    buildInputs = with self; [ pytest setuptools_scm ];
     propagatedBuildInputs = with self; [ mock ];
 
     meta = {
@@ -5274,9 +5172,9 @@ in {
       platforms   = platforms.all;
     };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/${pname}/${name}.zip";
-      sha256 = "03zxar5drzm7ksqyrwypjaza3cri6wqvpr6iam92djvg6znp32gp";
+    src = fetchPypi {
+      inherit pname version;
+      sha256 = "07qccww4bq9jxlc0fbhlspr13kcsixchsnl8vk4wdiyvsjy7r8c3";
     };
   };
 
@@ -6010,27 +5908,6 @@ in {
 
   dateutil = callPackage ../development/python-modules/dateutil { };
 
-  # csvkit 0.9.1 needs dateutil==2.2
-  dateutil_2_2 = buildPythonPackage (rec {
-    name = "dateutil-2.2";
-    disabled = isPy3k;
-
-    propagatedBuildInputs = with self; [ self.six ];
-
-    buildInputs = [ pkgs.glibcLocales ];
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/python-dateutil/python-${name}.tar.gz";
-      sha256 = "0s74ad6r789810s10dxgvaf48ni6adac2icrdad34zxygqq6bj7f";
-    };
-
-    meta = {
-      description = "Powerful extensions to the standard datetime module";
-      homepage = http://pypi.python.org/pypi/python-dateutil;
-      license = "BSD-style";
-    };
-  });
-
   # Buildbot 0.8.7p1 needs dateutil==1.5
   dateutil_1_5 = buildPythonPackage (rec {
     name = "dateutil-1.5";
@@ -8827,6 +8704,8 @@ in {
     };
   };
 
+  phpserialize = callPackage ../development/python-modules/phpserialize { };
+
   pies = buildPythonPackage rec {
     name = "pies-2.6.5";
 
@@ -8889,23 +8768,7 @@ in {
     };
   };
 
-  plotly = self.buildPythonPackage rec {
-    name = "plotly-1.9.5";
-    disabled = isPy3k;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/plotly/${name}.tar.gz";
-      sha256 = "628679e880caab22e2a46273e85e1d1ce1382b631e1c7bbfe539f804c5269b21";
-    };
-
-    propagatedBuildInputs = with self; [ self.pytz self.six self.requests ];
-
-    meta = {
-      description = "Python plotting library for collaborative, interactive, publication-quality graphs";
-      homepage = https://plot.ly/python/;
-      license = licenses.mit;
-    };
-  };
+  plotly = callPackage ../development/python-modules/plotly { };
 
   podcastparser = callPackage ../development/python-modules/podcastparser { };
 
@@ -11786,6 +11649,8 @@ in {
     };
   });
 
+  folium = callPackage ../development/python-modules/folium { };
+
   fontforge = pkgs.fontforge.override {
     withPython = true;
     inherit python;
@@ -13944,6 +13809,8 @@ in {
     };
   });
 
+  ltc_scrypt = callPackage ../development/python-modules/ltc_scrypt/default.nix { };
+
   python_magic = buildPythonPackage rec {
     name = "python-magic-0.4.10";
 
@@ -14382,6 +14249,8 @@ in {
     };
   };
 
+  mplleaflet = callPackage ../development/python-modules/mplleaflet { };
+
   multidict = callPackage ../development/python-modules/multidict { };
 
   munch = buildPythonPackage rec {
@@ -16407,31 +16276,6 @@ in {
     doCheck = false;
   };
 
-  openpyxl_2_2_0_b1 = buildPythonPackage rec {
-    version = "2.2.0-b1";
-    name = "openpyxl-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/o/openpyxl/${name}.tar.gz";
-      sha256 = "0n10pawp2558jrrmppyhkrv7889k3g4mifqj3fp68qbr20ldk51k";
-    };
-
-    buildInputs = with self; [ pytest ];
-    propagatedBuildInputs = with self; [ jdcal et_xmlfile lxml ];
-
-    # Tests are not included in archive.
-    # https://bitbucket.org/openpyxl/openpyxl/issues/610
-    doCheck = false;
-
-    meta = {
-      description = "A Python library to read/write Excel 2007 xlsx/xlsm files";
-      homepage = https://openpyxl.readthedocs.org;
-      license = licenses.mit;
-      maintainers = with maintainers; [ lihop sjourdois ];
-      platforms = platforms.all;
-    };
-  };
-
   openpyxl = buildPythonPackage rec {
     version = "2.3.5";
     name = "openpyxl-${version}";
@@ -16647,33 +16491,7 @@ in {
 
   };
 
-  os-testr = buildPythonPackage rec {
-    name = "os-testr-${version}";
-    version = "0.4.2";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/o/os-testr/${name}.tar.gz";
-      sha256 = "0474z0mxb7y3vfk4s097wf1mzji5d135vh27cvlh9q17rq3x9r3w";
-    };
-
-    patchPhase = ''
-      sed -i 's@python@${python.interpreter}@' .testr.conf
-      sed -i 's@python@${python.interpreter}@' os_testr/tests/files/testr-conf
-    '';
-
-    checkPhase = ''
-      export PATH=$PATH:$out/bin
-      ${python.interpreter} setup.py test
-    '';
-
-    propagatedBuildInputs = with self; [ pbr Babel testrepository subunit testtools ];
-    buildInputs = with self; [ coverage oslosphinx oslotest testscenarios six ddt ];
-
-    # Requires pbr < 2
-    # Or update to latest version but that requires updating the whole of openstack / oslo
-    meta.broken = true;
-
-  };
+  os-testr = callPackage ../development/python-modules/os-testr { };
 
   bandit = buildPythonPackage rec {
     name = "bandit-${version}";
@@ -17007,6 +16825,8 @@ in {
 
     meta = with stdenv.lib; {
       homepage = "https://launchpad.net/python-cliff";
+      # requires an update, incompatible with current dependencies (pbr)
+      broken = true;
     };
   };
 
@@ -17100,6 +16920,9 @@ in {
    meta = with stdenv.lib; {
      description = "Python bindings to the OpenStack Images API";
      homepage = "http://www.openstack.org/";
+
+     # requires an update, incompatible with current dependencies (pbr)
+     broken = true;
    };
  };
 
@@ -20231,6 +20054,8 @@ in {
 
   pyopencl = callPackage ../development/python-modules/pyopencl { };
 
+  pyproj = callPackage ../development/python-modules/pyproj { };
+
   pyrr = buildPythonPackage rec {
     name = "pyrr-${version}";
     version = "0.7.2";
@@ -20780,7 +20605,7 @@ in {
     };
   });
 
-  pyro3 = buildPythonPackage (rec {
+  Pyro = buildPythonPackage (rec {
     name = "Pyro-3.16";
     disabled = isPy3k;
 
@@ -21918,8 +21743,10 @@ in {
     };
   };
 
+  requests = self.requests2;
 
-  requests = buildPythonPackage rec {
+  # Remove before release of 17.09
+  requests_1 = buildPythonPackage rec {
     name = "requests-1.2.3";
     disabled = !pythonOlder "3.4";
 
@@ -21934,7 +21761,6 @@ in {
     };
   };
 
-
   requests2 = buildPythonPackage rec {
     name = "requests-${version}";
     version = "2.13.0";
@@ -24756,37 +24582,7 @@ in {
     };
   };
 
-
-  sqlalchemy_migrate_func = sqlalchemy: buildPythonPackage rec {
-    name = "sqlalchemy-migrate-0.10.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/s/sqlalchemy-migrate/${name}.tar.gz";
-      sha256 = "00z0lzjs4ksr9yr31zs26csyacjvavhpz6r74xaw1r89kk75qg7q";
-    };
-
-    buildInputs = with self; [ unittest2 scripttest pytz pylint tempest-lib mock testtools ];
-    propagatedBuildInputs = with self; [ pbr tempita decorator sqlalchemy six sqlparse ];
-
-    checkPhase = ''
-      export PATH=$PATH:$out/bin
-      echo sqlite:///__tmp__ > test_db.cfg
-      # depends on ibm_db_sa
-      rm migrate/tests/changeset/databases/test_ibmdb2.py
-      # wants very old testtools
-      rm migrate/tests/versioning/test_schema.py
-      # transient failures on py27
-      substituteInPlace migrate/tests/versioning/test_util.py --replace "test_load_model" "noop"
-      ${python.interpreter} setup.py test
-    '';
-
-    meta = {
-      homepage = http://code.google.com/p/sqlalchemy-migrate/;
-      description = "Schema migration tools for SQLAlchemy";
-    };
-  };
-
-  sqlalchemy_migrate = self.sqlalchemy_migrate_func self.sqlalchemy;
+  sqlalchemy_migrate = callPackage ../development/python-modules/sqlalchemy-migrate { };
 
   sqlparse = buildPythonPackage rec {
     name = "sqlparse-${version}";
@@ -26046,6 +25842,7 @@ in {
       description = "Ultra fast memcache client written in highly optimized C++ with Python bindings";
       homepage = https://github.com/esnme/ultramemcache;
       license = licenses.bsdOriginal;
+      broken = true;
     };
   };
 
@@ -28721,19 +28518,24 @@ EOF
 
 
   grequests = buildPythonPackage rec {
-    name = "grequests-0.2.0";
+    pname = "grequests";
+    version = "0.3.0";
+    name = "${pname}-${version}";
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/g/grequests/${name}.tar.gz";
+    src = fetchPypi {
+      inherit pname version;
       sha256 = "0lafzax5igbh8y4x0krizr573wjsxz7bhvwygiah6qwrzv83kv5c";
     };
 
-    buildInputs = with self; [ requests gevent ];
+    # No tests in archive
+    doCheck = false;
+
+    propagatedBuildInputs = with self; [ requests2 gevent ];
 
     meta = {
       description = "Asynchronous HTTP requests";
       homepage = https://github.com/kennethreitz/grequests;
-      license = "bsd";
+      license = with licenses; [ bsd2 ];
       maintainers = with maintainers; [ matejc ];
     };
   };
diff --git a/pkgs/top-level/release-cross.nix b/pkgs/top-level/release-cross.nix
index b22eff33dc0..82428972699 100644
--- a/pkgs/top-level/release-cross.nix
+++ b/pkgs/top-level/release-cross.nix
@@ -20,27 +20,12 @@ let
   /* Basic list of packages to be natively built,
      but need a crossSystem defined to get meaning */
   basicNativeDrv = {
-    buildPackages.binutils = nativePlatforms;
     buildPackages.gccCrossStageFinal = nativePlatforms;
     buildPackages.gdbCross = nativePlatforms;
   };
 
   basic = basicCrossDrv // basicNativeDrv;
 
-  windows = {
-    buildPackages.binutils = nativePlatforms;
-    buildPackages.gccCrossStageFinal = nativePlatforms;
-
-    coreutils = nativePlatforms;
-    boehmgc = nativePlatforms;
-    gmp = nativePlatforms;
-    guile_1_8 = nativePlatforms;
-    libffi = nativePlatforms;
-    libtool = nativePlatforms;
-    libunistring = nativePlatforms;
-    windows.wxMSW = nativePlatforms;
-  };
-
 in
 
 {
@@ -104,30 +89,48 @@ in
   /* Test some cross builds on 32 bit mingw-w64 */
   crossMingw32 = let
     crossSystem = {
-      config = "i686-pc-mingw32";
+      config = "i686-w64-mingw32";
       arch = "x86"; # Irrelevant
       libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
       platform = {};
     };
-  in mapTestOnCross crossSystem windows;
+  in mapTestOnCross crossSystem {
+    coreutils = nativePlatforms;
+    boehmgc = nativePlatforms;
+    gmp = nativePlatforms;
+    guile_1_8 = nativePlatforms;
+    libffi = nativePlatforms;
+    libtool = nativePlatforms;
+    libunistring = nativePlatforms;
+    windows.wxMSW = nativePlatforms;
+  };
 
 
   /* Test some cross builds on 64 bit mingw-w64 */
   crossMingwW64 = let
     crossSystem = {
       # That's the triplet they use in the mingw-w64 docs.
-      config = "x86_64-pc-mingw32";
+      config = "x86_64-w64-mingw32";
       arch = "x86_64"; # Irrelevant
       libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
       platform = {};
     };
-  in mapTestOnCross crossSystem windows;
+  in mapTestOnCross crossSystem {
+    coreutils = nativePlatforms;
+    boehmgc = nativePlatforms;
+    gmp = nativePlatforms;
+    guile_1_8 = nativePlatforms;
+    libffi = nativePlatforms;
+    libtool = nativePlatforms;
+    libunistring = nativePlatforms;
+    windows.wxMSW = nativePlatforms;
+  };
 
 
   /* Linux on the fuloong */
   fuloongminipc = let
     crossSystem = {
-      config = "mips64el-unknown-linux-gnu";
+      config = "mips64el-unknown-linux";
       bigEndian = false;
       arch = "mips";
       float = "hard";