summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--COPYING4
-rw-r--r--doc/cross-compilation.xml2
-rw-r--r--lib/maintainers.nix2
-rw-r--r--nixos/modules/services/web-apps/mattermost.nix2
-rw-r--r--nixos/modules/services/x11/compton.nix2
-rw-r--r--nixos/modules/tasks/network-interfaces.nix8
-rw-r--r--pkgs/applications/audio/lmms/default.nix36
-rw-r--r--pkgs/applications/editors/eclipse/plugins.nix14
-rw-r--r--pkgs/applications/editors/emacs-modes/font-lock-plus/default.nix23
-rw-r--r--pkgs/applications/editors/jucipp/default.nix4
-rw-r--r--pkgs/applications/editors/rednotebook/default.nix37
-rw-r--r--pkgs/applications/editors/zed/default.nix24
-rw-r--r--pkgs/applications/editors/zed/deps.json6
-rwxr-xr-xpkgs/applications/editors/zed/deps.sh7
-rw-r--r--pkgs/applications/editors/zed/node-packages.nix877
-rw-r--r--pkgs/applications/editors/zed/node.nix1839
-rw-r--r--pkgs/applications/misc/keepassx/community.nix2
-rw-r--r--pkgs/applications/misc/mediainfo-gui/default.nix6
-rw-r--r--pkgs/applications/misc/mediainfo/default.nix6
-rw-r--r--pkgs/applications/networking/browsers/opera/default.nix20
-rw-r--r--pkgs/applications/networking/browsers/surf/default.nix4
-rw-r--r--pkgs/applications/networking/cluster/mesos/default.nix2
-rw-r--r--pkgs/applications/networking/gns3/default.nix6
-rw-r--r--pkgs/applications/networking/gns3/server.nix36
-rw-r--r--pkgs/applications/networking/mailreaders/mailnag/default.nix15
-rw-r--r--pkgs/applications/networking/syncthing/default.nix4
-rw-r--r--pkgs/applications/science/logic/glucose/default.nix10
-rw-r--r--pkgs/applications/science/logic/glucose/syrup.nix13
-rw-r--r--pkgs/applications/version-management/cvs/CVE-2017-12836.patch29
-rw-r--r--pkgs/applications/version-management/cvs/default.nix1
-rw-r--r--pkgs/applications/version-management/gitaly/Gemfile4
-rw-r--r--pkgs/applications/version-management/gitaly/Gemfile.lock26
-rw-r--r--pkgs/applications/version-management/gitaly/default.nix4
-rw-r--r--pkgs/applications/version-management/gitaly/gemset.nix102
-rw-r--r--pkgs/applications/version-management/gitlab-shell/default.nix4
-rw-r--r--pkgs/applications/version-management/gitlab-shell/remove-hardcoded-locations.patch4
-rw-r--r--pkgs/applications/version-management/gitlab-workhorse/default.nix4
-rw-r--r--pkgs/applications/version-management/gitlab-workhorse/remove-hardcoded-paths.patch4
-rw-r--r--pkgs/applications/version-management/gitlab/Gemfile17
-rw-r--r--pkgs/applications/version-management/gitlab/Gemfile.lock102
-rw-r--r--pkgs/applications/version-management/gitlab/default.nix6
-rw-r--r--pkgs/applications/version-management/gitlab/gemset.nix166
-rw-r--r--pkgs/applications/version-management/gitlab/nulladapter.patch6
-rw-r--r--pkgs/applications/version-management/gitlab/remove-hardcoded-locations.patch20
-rw-r--r--pkgs/applications/virtualization/virtualbox/default.nix8
-rw-r--r--pkgs/applications/window-managers/sway/default.nix8
-rw-r--r--pkgs/build-support/cc-wrapper/cc-wrapper.sh2
-rw-r--r--pkgs/build-support/cc-wrapper/default.nix7
-rw-r--r--pkgs/build-support/cc-wrapper/gnat-wrapper.sh2
-rw-r--r--pkgs/build-support/cc-wrapper/gnatlink-wrapper.sh2
-rw-r--r--pkgs/build-support/cc-wrapper/ld-wrapper.sh2
-rw-r--r--pkgs/data/misc/dns-root-data/default.nix4
-rw-r--r--pkgs/data/misc/hackage/default.nix38
-rw-r--r--pkgs/data/misc/hackage/partition-all-cabal-hashes.c190
-rw-r--r--pkgs/desktops/gnome-3/misc/gitg/src.nix6
-rw-r--r--pkgs/desktops/gnome-3/misc/libgit2-glib/default.nix10
-rw-r--r--pkgs/desktops/gnome-3/misc/libgit2-glib/src.nix10
-rw-r--r--pkgs/development/beam-modules/hex-packages.nix1331
-rw-r--r--pkgs/development/compilers/gcc/4.5/default.nix9
-rw-r--r--pkgs/development/compilers/gcc/4.8/default.nix14
-rw-r--r--pkgs/development/compilers/gcc/4.9/default.nix9
-rw-r--r--pkgs/development/compilers/gcc/5/default.nix13
-rw-r--r--pkgs/development/compilers/gcc/6/default.nix17
-rw-r--r--pkgs/development/compilers/gcc/7/default.nix13
-rw-r--r--pkgs/development/compilers/gcc/res_state-not-declared.patch13
-rw-r--r--pkgs/development/compilers/gcc/sigsegv-not-declared.patch13
-rw-r--r--pkgs/development/compilers/gcc/snapshot/default.nix13
-rw-r--r--pkgs/development/compilers/gcc/struct-sigaltstack-4.9.patch78
-rw-r--r--pkgs/development/compilers/gcc/struct-sigaltstack.patch87
-rw-r--r--pkgs/development/compilers/gcc/struct-ucontext-4.5.patch107
-rw-r--r--pkgs/development/compilers/gcc/struct-ucontext-4.8.patch177
-rw-r--r--pkgs/development/compilers/gcc/struct-ucontext.patch190
-rw-r--r--pkgs/development/compilers/ghc/7.10.2.nix4
-rw-r--r--pkgs/development/compilers/ghc/7.10.3.nix4
-rw-r--r--pkgs/development/compilers/ghc/7.6.3.nix2
-rw-r--r--pkgs/development/compilers/ghc/8.0.2.nix4
-rw-r--r--pkgs/development/compilers/ghc/8.2.1.nix16
-rw-r--r--pkgs/development/compilers/ghc/head.nix4
-rw-r--r--pkgs/development/compilers/halvm/2.4.0.nix8
-rw-r--r--pkgs/development/compilers/julia/0.6.nix3
-rw-r--r--pkgs/development/compilers/llvm/3.5/libc++/default.nix6
-rw-r--r--pkgs/development/compilers/llvm/3.5/libc++/xlocale-glibc-2.26.patch17
-rw-r--r--pkgs/development/compilers/llvm/3.7/libc++/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/3.7/libc++/xlocale-glibc-2.26.patch17
-rw-r--r--pkgs/development/compilers/llvm/3.7/llvm.nix13
-rw-r--r--pkgs/development/compilers/llvm/3.8/libc++/default.nix5
-rw-r--r--pkgs/development/compilers/llvm/3.8/llvm.nix13
-rw-r--r--pkgs/development/compilers/llvm/3.9/libc++/default.nix5
-rw-r--r--pkgs/development/compilers/llvm/3.9/libc++/xlocale-glibc-2.26.patch19
-rw-r--r--pkgs/development/compilers/llvm/3.9/llvm.nix14
-rw-r--r--pkgs/development/compilers/llvm/4/libc++/default.nix8
-rw-r--r--pkgs/development/compilers/llvm/4/libc++/xlocale-glibc-2.26.patch19
-rw-r--r--pkgs/development/compilers/llvm/4/llvm.nix14
-rw-r--r--pkgs/development/compilers/neko/default.nix3
-rw-r--r--pkgs/development/compilers/neko/xlocale-fix.patch59
-rw-r--r--pkgs/development/compilers/ponyc/pony-stable.nix4
-rw-r--r--pkgs/development/compilers/purescript/psc-package/default.nix4
-rw-r--r--pkgs/development/compilers/rust/rustc.nix7
-rw-r--r--pkgs/development/compilers/swift/default.nix4
-rw-r--r--pkgs/development/coq-modules/mathcomp/default.nix6
-rw-r--r--pkgs/development/coq-modules/ssreflect/default.nix6
-rw-r--r--pkgs/development/haskell-modules/make-package-set.nix25
-rw-r--r--pkgs/development/interpreters/clisp/default.nix6
-rw-r--r--pkgs/development/interpreters/clisp/remove-cfree-binding.patch12
-rw-r--r--pkgs/development/interpreters/erlang/R20.nix4
-rw-r--r--pkgs/development/interpreters/php/default.nix4
-rw-r--r--pkgs/development/libraries/SDL2/default.nix4
-rw-r--r--pkgs/development/libraries/expat/default.nix4
-rw-r--r--pkgs/development/libraries/git2/0.25.nix33
-rw-r--r--pkgs/development/libraries/git2/default.nix33
-rw-r--r--pkgs/development/libraries/git2/disable-security.framework.patch58
-rw-r--r--pkgs/development/libraries/glibc/2.25-49.patch.gzbin89721 -> 0 bytes
-rw-r--r--pkgs/development/libraries/glibc/2.26-75.patch.gzbin0 -> 289084 bytes
-rw-r--r--pkgs/development/libraries/glibc/common.nix17
-rw-r--r--pkgs/development/libraries/icu/base.nix5
-rw-r--r--pkgs/development/libraries/libmediainfo/default.nix6
-rw-r--r--pkgs/development/libraries/libnsl/default.nix24
-rw-r--r--pkgs/development/libraries/libstdc++5/default.nix2
-rw-r--r--pkgs/development/libraries/libstdc++5/struct-ucontext.patch61
-rw-r--r--pkgs/development/libraries/libzen/default.nix6
-rw-r--r--pkgs/development/libraries/live555/default.nix7
-rw-r--r--pkgs/development/libraries/mlt/default.nix15
-rw-r--r--pkgs/development/libraries/mlt/qt-5.nix12
-rw-r--r--pkgs/development/libraries/ti-rpc/default.nix4
-rw-r--r--pkgs/development/libraries/vigra/default.nix2
-rw-r--r--pkgs/development/libraries/wlc/default.nix16
-rw-r--r--pkgs/development/python-modules/h2/default.nix21
-rw-r--r--pkgs/development/python-modules/hyperframe/default.nix17
-rw-r--r--pkgs/development/python-modules/kaitaistruct/default.nix18
-rw-r--r--pkgs/development/python-modules/keepkey/default.nix18
-rw-r--r--pkgs/development/python-modules/ldap3/default.nix24
-rw-r--r--pkgs/development/python-modules/libagent/default.nix10
-rw-r--r--pkgs/development/python-modules/meliae/default.nix2
-rw-r--r--pkgs/development/python-modules/pyasn1-modules/default.nix22
-rw-r--r--pkgs/development/python-modules/pyasn1/default.nix19
-rw-r--r--pkgs/development/python-modules/pygit2/default.nix31
-rw-r--r--pkgs/development/python-modules/selenium/default.nix50
-rw-r--r--pkgs/development/python-modules/trezor/default.nix4
-rw-r--r--pkgs/development/python-modules/urwid/default.nix16
-rw-r--r--pkgs/development/tools/continuous-integration/jenkins/default.nix6
-rw-r--r--pkgs/development/tools/geckodriver/default.nix25
-rw-r--r--pkgs/development/tools/git-series/default.nix2
-rw-r--r--pkgs/development/tools/misc/dbench/default.nix5
-rw-r--r--pkgs/development/tools/misc/dbench/fix-missing-stdint.patch10
-rw-r--r--pkgs/development/tools/parsing/flex/default.nix14
-rw-r--r--pkgs/development/tools/profiling/systemtap/default.nix6
-rw-r--r--pkgs/games/anki/default.nix2
-rw-r--r--pkgs/games/brogue/default.nix2
-rw-r--r--pkgs/games/steam/runtime.nix4
-rw-r--r--pkgs/games/uqm/3dovideo.nix7
-rw-r--r--pkgs/games/uqm/default.nix43
-rw-r--r--pkgs/misc/drivers/hplip/default.nix8
-rw-r--r--pkgs/misc/vscode-extensions/cpptools/default.nix128
-rw-r--r--pkgs/misc/vscode-extensions/cpptools/vscode-cpptools-0-12-3-package-json.patch82
-rw-r--r--pkgs/misc/vscode-extensions/default.nix4
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/libsecurity_filedb/default.nix2
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/libsecurity_generic/default.nix2
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/libsecurity_keychain/default.nix4
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/libsecurity_utilities/default.nix5
-rw-r--r--pkgs/os-specific/darwin/cf-private/default.nix23
-rw-r--r--pkgs/os-specific/darwin/osx-private-sdk/default.nix29
-rw-r--r--pkgs/os-specific/darwin/security-tool/default.nix2
-rw-r--r--pkgs/os-specific/linux/android-udev-rules/default.nix4
-rw-r--r--pkgs/os-specific/linux/checkpolicy/default.nix11
-rw-r--r--pkgs/os-specific/linux/ffado/default.nix5
-rw-r--r--pkgs/os-specific/linux/ffado/glibc226.patch10
-rw-r--r--pkgs/os-specific/linux/kernel/common-config.nix5
-rw-r--r--pkgs/os-specific/linux/kernel/linux-4.13.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/kernel/linux-hardened-copperhead.nix4
-rw-r--r--pkgs/os-specific/linux/libselinux/default.nix3
-rw-r--r--pkgs/os-specific/linux/nfs-utils/default.nix2
-rw-r--r--pkgs/os-specific/linux/tcp-wrappers/default.nix4
-rw-r--r--pkgs/servers/asterisk/default.nix4
-rw-r--r--pkgs/servers/gpm/default.nix5
-rw-r--r--pkgs/servers/mattermost/default.nix39
-rw-r--r--pkgs/servers/openafs-client/default.nix10
-rw-r--r--pkgs/servers/rpcbind/default.nix4
-rw-r--r--pkgs/stdenv/booter.nix25
-rw-r--r--pkgs/tools/audio/mpdas/default.nix27
-rw-r--r--pkgs/tools/graphics/gnuplot/default.nix4
-rw-r--r--pkgs/tools/networking/htpdate/default.nix2
-rw-r--r--pkgs/tools/networking/mitmproxy/default.nix74
-rw-r--r--pkgs/tools/networking/p2p/gtk-gnutella/default.nix4
-rw-r--r--pkgs/tools/networking/reaver-wps-t6x/default.nix21
-rw-r--r--pkgs/tools/networking/strongswan/default.nix2
-rw-r--r--pkgs/tools/package-management/nix/default.nix2
-rwxr-xr-xpkgs/tools/package-management/nixui/generate.sh2
-rw-r--r--pkgs/tools/security/mpw/default.nix45
-rw-r--r--pkgs/tools/system/procodile/Gemfile2
-rw-r--r--pkgs/tools/system/procodile/Gemfile.lock15
-rw-r--r--pkgs/tools/system/procodile/default.nix22
-rw-r--r--pkgs/tools/system/procodile/gemset.nix19
-rw-r--r--pkgs/tools/text/gawk/default.nix4
-rw-r--r--pkgs/tools/typesetting/pygmentex/default.nix12
-rw-r--r--pkgs/top-level/aliases.nix1
-rw-r--r--pkgs/top-level/all-packages.nix36
-rw-r--r--pkgs/top-level/emacs-packages.nix2
-rw-r--r--pkgs/top-level/perl-packages.nix3
-rw-r--r--pkgs/top-level/python-packages.nix179
-rw-r--r--pkgs/top-level/splice.nix2
-rw-r--r--pkgs/top-level/stage.nix6
203 files changed, 3600 insertions, 4233 deletions
diff --git a/COPYING b/COPYING
index a632d6f58b1..afc460fff5c 100644
--- a/COPYING
+++ b/COPYING
@@ -23,9 +23,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 Note: the license above does not apply to the packages built by the
 Nix Packages collection, merely to the package descriptions (i.e., Nix
-expressions, build scripts, etc.).  Also, the license does not apply
-to some of the binaries used for bootstrapping Nixpkgs (e.g.,
-pkgs/stdenv/linux/tools/bash).  It also might not apply to patches
+expressions, build scripts, etc.).  It also might not apply to patches
 included in Nixpkgs, which may be derivative works of the packages to
 which they apply.  The aforementioned artifacts are all covered by the
 licenses of the respective packages.
diff --git a/doc/cross-compilation.xml b/doc/cross-compilation.xml
index 77d020afa2d..9e9dd41c288 100644
--- a/doc/cross-compilation.xml
+++ b/doc/cross-compilation.xml
@@ -184,7 +184,7 @@
       For now, feel free to use either method.
     </para>
     <note><para>
-      There is also a "backlink" <varname>__targetPackages</varname>, yielding a package set whose <varname>buildPackages</varname> is the current package set.
+      There is also a "backlink" <varname>targetPackages</varname>, yielding a package set whose <varname>buildPackages</varname> is the current package set.
       This is a hack, though, to accommodate compilers with lousy build systems.
       Please do not use this unless you are absolutely sure you are packaging such a compiler and there is no other way.
     </para></note>
diff --git a/lib/maintainers.nix b/lib/maintainers.nix
index 514709082fc..93edea1e40e 100644
--- a/lib/maintainers.nix
+++ b/lib/maintainers.nix
@@ -518,6 +518,7 @@
   rardiol = "Ricardo Ardissone <ricardo.ardissone@gmail.com>";
   rasendubi = "Alexey Shmalko <rasen.dubi@gmail.com>";
   raskin = "Michael Raskin <7c6f434c@mail.ru>";
+  ravloony = "Tom Macdonald <ravloony@gmail.com>";
   rbasso = "Rafael Basso <rbasso@sharpgeeks.net>";
   redbaron = "Maxim Ivanov <ivanov.maxim@gmail.com>";
   redvers = "Redvers Davies <red@infect.me>";
@@ -613,6 +614,7 @@
   sztupi = "Attila Sztupak <attila.sztupak@gmail.com>";
   taeer = "Taeer Bar-Yam <taeer@necsi.edu>";
   tailhook = "Paul Colomiets <paul@colomiets.name>";
+  taketwo = "Sergey Alexandrov <alexandrov88@gmail.com>";
   takikawa = "Asumu Takikawa <asumu@igalia.com>";
   taktoa = "Remy Goldschmidt <taktoa@gmail.com>";
   taku0 = "Takuo Yonezawa <mxxouy6x3m_github@tatapa.org>";
diff --git a/nixos/modules/services/web-apps/mattermost.nix b/nixos/modules/services/web-apps/mattermost.nix
index 0b637e3991b..be74a2b1955 100644
--- a/nixos/modules/services/web-apps/mattermost.nix
+++ b/nixos/modules/services/web-apps/mattermost.nix
@@ -173,7 +173,7 @@ in
 
         preStart = ''
           mkdir -p ${cfg.statePath}/{data,config,logs}
-          ln -sf ${pkgs.mattermost}/{bin,fonts,i18n,templates,webapp} ${cfg.statePath}
+          ln -sf ${pkgs.mattermost}/{bin,fonts,i18n,templates,client} ${cfg.statePath}
         '' + lib.optionalString (!cfg.mutableConfig) ''
           ln -sf ${mattermostConfJSON} ${cfg.statePath}/config/config.json
         '' + lib.optionalString cfg.mutableConfig ''
diff --git a/nixos/modules/services/x11/compton.nix b/nixos/modules/services/x11/compton.nix
index 8701354b528..11cbcac6fa8 100644
--- a/nixos/modules/services/x11/compton.nix
+++ b/nixos/modules/services/x11/compton.nix
@@ -221,7 +221,7 @@ in {
     };
 
     extraOptions = mkOption {
-      type = types.str;
+      type = types.lines;
       default = "";
       example = ''
         unredir-if-possible = true;
diff --git a/nixos/modules/tasks/network-interfaces.nix b/nixos/modules/tasks/network-interfaces.nix
index 8ce7b2d2cf3..1741d2c7e1f 100644
--- a/nixos/modules/tasks/network-interfaces.nix
+++ b/nixos/modules/tasks/network-interfaces.nix
@@ -924,6 +924,14 @@ in
       (flip map interfaces (i: {
         assertion = i.subnetMask == null;
         message = "The networking.interfaces.${i.name}.subnetMask option is defunct. Use prefixLength instead.";
+      })) ++ (flip map interfaces (i: {
+        # With the linux kernel, interface name length is limited by IFNAMSIZ
+        # to 16 bytes, including the trailing null byte.
+        # See include/linux/if.h in the kernel sources
+        assertion = stringLength i.name < 16;
+        message = ''
+          The name of networking.interfaces."${i.name}" is too long, it needs to be less than 16 characters.
+        '';
       })) ++ (flip map slaveIfs (i: {
         assertion = i.ip4 == [ ] && i.ipAddress == null && i.ip6 == [ ] && i.ipv6Address == null;
         message = "The networking.interfaces.${i.name} must not have any defined ips when it is a slave.";
diff --git a/pkgs/applications/audio/lmms/default.nix b/pkgs/applications/audio/lmms/default.nix
index dcefbb06436..25d7f2ed015 100644
--- a/pkgs/applications/audio/lmms/default.nix
+++ b/pkgs/applications/audio/lmms/default.nix
@@ -1,31 +1,47 @@
-{ stdenv, fetchFromGitHub, SDL, alsaLib, cmake, fftwSinglePrec, fluidsynth
-, fltk13, libjack2, libvorbis , libsamplerate, libsndfile, pkgconfig
-, libpulseaudio, qt4, freetype, libgig
-}:
+{ stdenv, fetchFromGitHub, cmake, pkgconfig, alsaLib ? null, fftwFloat, fltk13
+, fluidsynth ? null, lame ? null, libgig ? null, libjack2 ? null, libpulseaudio ? null
+, libsamplerate, libsoundio ? null, libsndfile, libvorbis ? null, portaudio ? null
+, qtbase, qttools, SDL ? null }:
 
 stdenv.mkDerivation rec {
   name = "lmms-${version}";
-  version = "1.1.90";
+  version = "1.2.0-rc4";
 
   src = fetchFromGitHub {
     owner = "LMMS";
     repo = "lmms";
     rev = "v${version}";
-    sha256 = "0njiarndwqamqiinr1wbwkzjn87yzr1z5k9cfwk0jdkbalgakkq3";
+    sha256 = "1n3py18zqbvfnkdiz4wc6z60xaajpkd3kn1wxmby5dmc4vccvjj5";
   };
 
+  nativeBuildInputs = [ cmake qttools pkgconfig ];
+
   buildInputs = [
-    SDL alsaLib cmake fftwSinglePrec fltk13 fluidsynth libjack2 libgig
-    libsamplerate libsndfile libvorbis pkgconfig libpulseaudio qt4
+    alsaLib
+    fftwFloat
+    fltk13
+    fluidsynth
+    lame
+    libgig
+    libjack2
+    libpulseaudio
+    libsamplerate
+    libsndfile
+    libsoundio
+    libvorbis
+    portaudio
+    qtbase
+    SDL # TODO: switch to SDL2 in the next version
   ];
 
+  cmakeFlags = [ "-DWANT_QT5=ON" ];
   enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
-    description = "Linux MultiMedia Studio";
+    description = "DAW similar to FL Studio (music production software)";
     homepage = https://lmms.io;
     license = licenses.gpl2Plus;
     platforms = platforms.linux;
-    maintainers = [ maintainers.goibhniu ];
+    maintainers = with maintainers; [ goibhniu yegortimoshenko ];
   };
 }
diff --git a/pkgs/applications/editors/eclipse/plugins.nix b/pkgs/applications/editors/eclipse/plugins.nix
index 0aeaee2155a..8d96a79b3c3 100644
--- a/pkgs/applications/editors/eclipse/plugins.nix
+++ b/pkgs/applications/editors/eclipse/plugins.nix
@@ -24,9 +24,7 @@ rec {
     buildEclipsePluginBase (attrs // {
       srcs = [ srcFeature srcPlugin ];
 
-      phases = [ "installPhase" ];
-
-      installPhase = ''
+      buildCommand = ''
         dropinDir="$out/eclipse/dropins/${name}"
 
         mkdir -p $dropinDir/features
@@ -35,7 +33,6 @@ rec {
         mkdir -p $dropinDir/plugins
         cp -v ${srcPlugin} $dropinDir/plugins/${name}.jar
       '';
-
     });
 
   # Helper for the case where the build directory has the layout of an
@@ -44,7 +41,8 @@ rec {
   # directories will be installed.
   buildEclipseUpdateSite = { name, ... } @ attrs:
     buildEclipsePluginBase (attrs // {
-      phases = [ "unpackPhase" "installPhase" ];
+      dontBuild = true;
+      doCheck = false;
 
       installPhase = ''
         dropinDir="$out/eclipse/dropins/${name}"
@@ -152,16 +150,16 @@ rec {
 
   bytecode-outline = buildEclipsePlugin rec {
     name = "bytecode-outline-${version}";
-    version = "2.4.3";
+    version = "2.5.0.201711011753-5a57fdf";
 
     srcFeature = fetchurl {
       url = "http://andrei.gmxhome.de/eclipse/features/de.loskutov.BytecodeOutline.feature_${version}.jar";
-      sha256 = "0imhwp73gxy1y5d5gpjgd05ywn0xg3vqc5980wcx3fd51g4ifc67";
+      sha256 = "0yciqhcq0n5i326mwy57r4ywmkz2c2jky7r4pcmznmhvks3z65ps";
     };
 
     srcPlugin = fetchurl {
       url = "http://dl.bintray.com/iloveeclipse/plugins/de.loskutov.BytecodeOutline_${version}.jar";
-      sha256 = "0230i88mvvxhn11m9c5mv3494zhh1xkxyfyva9qahck0wbqwpzkw";
+      sha256 = "1vmsqv32jfl7anvdkw0vir342miv5sr9df7vd1w44lf1yf97vxlw";
     };
 
     meta = with stdenv.lib; {
diff --git a/pkgs/applications/editors/emacs-modes/font-lock-plus/default.nix b/pkgs/applications/editors/emacs-modes/font-lock-plus/default.nix
new file mode 100644
index 00000000000..ce4010c9881
--- /dev/null
+++ b/pkgs/applications/editors/emacs-modes/font-lock-plus/default.nix
@@ -0,0 +1,23 @@
+{ fetchurl, stdenv, melpaBuild }:
+
+melpaBuild {
+  pname = "font-lock-plus";
+  version = "20170222.1755";
+
+  src = fetchurl {
+    url = "https://www.emacswiki.org/emacs/download/font-lock+.el";
+    sha256 = "0iajkgh0n3pbrwwxx9rmrrwz8dw2m7jsp4mggnhq7zsb20ighs30";
+    name = "font-lock+.el";
+  };
+
+  recipeFile = fetchurl {
+    url = "https://raw.githubusercontent.com/milkypostman/melpa/a5d15f875b0080b12ce45cf696c581f6bbf061ba/recipes/font-lock+";
+    sha256 = "1wn99cb53ykds87lg9mrlfpalrmjj177nwskrnp9wglyqs65lk4g";
+    name = "font-lock-plus";
+  };
+
+  meta = with stdenv.lib; {
+    homepage = "https://melpa.org/#/font-lock+";
+    license = lib.licenses.gpl2Plus;
+  };
+}
diff --git a/pkgs/applications/editors/jucipp/default.nix b/pkgs/applications/editors/jucipp/default.nix
index ae4f1e6ad52..3d623d3f3bd 100644
--- a/pkgs/applications/editors/jucipp/default.nix
+++ b/pkgs/applications/editors/jucipp/default.nix
@@ -1,7 +1,7 @@
 { config, stdenv, fetchgit, makeWrapper, gnome3, at_spi2_core, libcxx,
   boost, epoxy, cmake, aspell, llvmPackages, libgit2, pkgconfig, pcre,
   libXdmcp, libxkbcommon, libpthreadstubs, wrapGAppsHook, aspellDicts,
-  coreutils, glibc, dbus_libs, openssl, libxml2, gnumake, binutils, ctags }:
+  coreutils, glibc, dbus_libs, openssl, libxml2, gnumake, ctags }:
 
 with stdenv.lib;
 
@@ -65,7 +65,7 @@ stdenv.mkDerivation rec {
   postInstall = ''
     mv $out/bin/juci $out/bin/.juci
     makeWrapper "$out/bin/.juci" "$out/bin/juci" \
-      --set PATH "${stdenv.lib.makeBinPath [ ctags coreutils llvmPackages.clang.cc cmake gnumake binutils llvmPackages.clang ]}" \
+      --set PATH "${stdenv.lib.makeBinPath [ ctags coreutils llvmPackages.clang.cc cmake gnumake llvmPackages.clang.bintools llvmPackages.clang ]}" \
       --set NO_AT_BRIDGE 1 \
       --set ASPELL_CONF "dict-dir ${aspellDicts.en}/lib/aspell"
   '';
diff --git a/pkgs/applications/editors/rednotebook/default.nix b/pkgs/applications/editors/rednotebook/default.nix
new file mode 100644
index 00000000000..1a0e6e54fb3
--- /dev/null
+++ b/pkgs/applications/editors/rednotebook/default.nix
@@ -0,0 +1,37 @@
+{ lib, buildPythonApplication, fetchFromGitHub
+, gdk_pixbuf, glib, gtk3, pango, webkitgtk
+, pygobject3, pyyaml
+}:
+
+buildPythonApplication rec {
+  name = "rednotebook-${version}";
+  version = "2.3";
+
+  src = fetchFromGitHub {
+    owner = "jendrikseipp";
+    repo = "rednotebook";
+    rev = "v${version}";
+    sha256 = "0zkfid104hcsf20r6829v11wxdghqkd3j1zbgyvd1s7q4nxjn5lj";
+  };
+
+  # We have not packaged tests.
+  doCheck = false;
+
+  propagatedBuildInputs = [
+    gdk_pixbuf glib gtk3 pango webkitgtk
+    pygobject3 pyyaml
+  ];
+
+  makeWrapperArgs = [
+    "--set GI_TYPELIB_PATH $GI_TYPELIB_PATH"
+    "--prefix XDG_DATA_DIRS : $out/share"
+    "--suffix XDG_DATA_DIRS : $XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH"
+  ];
+
+  meta = with lib; {
+    homepage = http://rednotebook.sourceforge.net/;
+    description = "A modern journal that includes a calendar navigation, customizable templates, export functionality and word clouds";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ orivej tstrobel ];
+  };
+}
diff --git a/pkgs/applications/editors/zed/default.nix b/pkgs/applications/editors/zed/default.nix
index 0170319871f..bcf262957bc 100644
--- a/pkgs/applications/editors/zed/default.nix
+++ b/pkgs/applications/editors/zed/default.nix
@@ -5,22 +5,16 @@ let
   name = "zed-${version}";
   version = "1.1.0";
 
-  # When upgrading node.nix / node packages:
-  #   fetch package.json from Zed's repository
-  #   run `npm2nix package.json node.nix`
-  #   and replace node.nix with new one
-  nodePackages = import ../../../../pkgs/top-level/node-packages.nix {
+  nodePackages = import ./node.nix {
     inherit pkgs;
-    inherit (pkgs) stdenv nodejs fetchurl fetchgit;
-    neededNatives = [ pkgs.python ] ++ pkgs.lib.optional pkgs.stdenv.isLinux pkgs.utillinux;
-    self = nodePackages;
-    generated = ./node.nix;
+    system = stdenv.system;
   };
 
   node_env = buildEnv {
     name = "node_env";
-    paths = [ nodePackages."body-parser" nodePackages.express
-      nodePackages.request nodePackages.tar nodePackages.ws ];
+    paths = [ nodePackages."body-parser-~1.6.3" nodePackages."express-~4.8.3"
+      nodePackages."request-~2.34.0" nodePackages."tar-~0.1.19"
+      nodePackages."ws-~0.4.32" ];
     pathsToLink = [ "/lib" ];
     ignoreCollisions = true;
   };
@@ -78,11 +72,11 @@ in stdenv.mkDerivation rec {
     ln -s ${zed_script} $out/bin/zed
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "A fully offline-capable, open source, keyboard-focused, text and code editor for power users";
-    license = stdenv.lib.licenses.mit;
+    license = licenses.mit;
     homepage = http://zedapp.org/;
-    maintainers = [ stdenv.lib.maintainers.matejc ];
-    platforms = stdenv.lib.platforms.linux;
+    maintainers = with maintainers; [ matejc ma27 ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/editors/zed/deps.json b/pkgs/applications/editors/zed/deps.json
new file mode 100644
index 00000000000..d3a7708d156
--- /dev/null
+++ b/pkgs/applications/editors/zed/deps.json
@@ -0,0 +1,6 @@
+[ { "body-parser": "~1.6.3" }
+, { "express": "~4.8.3" }
+, { "request": "~2.34.0" }
+, { "tar": "~0.1.19" }
+, { "ws": "~0.4.32" }
+]
diff --git a/pkgs/applications/editors/zed/deps.sh b/pkgs/applications/editors/zed/deps.sh
new file mode 100755
index 00000000000..6d2bf29532e
--- /dev/null
+++ b/pkgs/applications/editors/zed/deps.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env nix-shell
+#! nix-shell -i bash -p nodePackages.node2nix
+
+node2nix -6 -i deps.json \
+  -e ../../../development/node-packages/node-env.nix \
+  --no-copy-node-env \
+  -c node.nix
diff --git a/pkgs/applications/editors/zed/node-packages.nix b/pkgs/applications/editors/zed/node-packages.nix
new file mode 100644
index 00000000000..5aaa75b6c91
--- /dev/null
+++ b/pkgs/applications/editors/zed/node-packages.nix
@@ -0,0 +1,877 @@
+# This file has been generated by node2nix 1.3.0. Do not edit!
+
+{nodeEnv, fetchurl, fetchgit, globalBuildInputs ? []}:
+
+let
+  sources = {
+    "bytes-1.0.0" = {
+      name = "bytes";
+      packageName = "bytes";
+      version = "1.0.0";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/bytes/-/bytes-1.0.0.tgz";
+        sha1 = "3569ede8ba34315fab99c3e92cb04c7220de1fa8";
+      };
+    };
+    "depd-0.4.4" = {
+      name = "depd";
+      packageName = "depd";
+      version = "0.4.4";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/depd/-/depd-0.4.4.tgz";
+        sha1 = "07091fae75f97828d89b4a02a2d4778f0e7c0662";
+      };
+    };
+    "iconv-lite-0.4.4" = {
+      name = "iconv-lite";
+      packageName = "iconv-lite";
+      version = "0.4.4";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.4.tgz";
+        sha1 = "e95f2e41db0735fc21652f7827a5ee32e63c83a8";
+      };
+    };
+    "media-typer-0.2.0" = {
+      name = "media-typer";
+      packageName = "media-typer";
+      version = "0.2.0";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/media-typer/-/media-typer-0.2.0.tgz";
+        sha1 = "d8a065213adfeaa2e76321a2b6dda36ff6335984";
+      };
+    };
+    "on-finished-2.1.0" = {
+      name = "on-finished";
+      packageName = "on-finished";
+      version = "2.1.0";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/on-finished/-/on-finished-2.1.0.tgz";
+        sha1 = "0c539f09291e8ffadde0c8a25850fb2cedc7022d";
+      };
+    };
+    "qs-2.2.2" = {
+      name = "qs";
+      packageName = "qs";
+      version = "2.2.2";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/qs/-/qs-2.2.2.tgz";
+        sha1 = "dfe783f1854b1ac2b3ade92775ad03e27e03218c";
+      };
+    };
+    "raw-body-1.3.0" = {
+      name = "raw-body";
+      packageName = "raw-body";
+      version = "1.3.0";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/raw-body/-/raw-body-1.3.0.tgz";
+        sha1 = "978230a156a5548f42eef14de22d0f4f610083d1";
+      };
+    };
+    "type-is-1.3.2" = {
+      name = "type-is";
+      packageName = "type-is";
+      version = "1.3.2";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/type-is/-/type-is-1.3.2.tgz";
+        sha1 = "4f2a5dc58775ca1630250afc7186f8b36309d1bb";
+      };
+    };
+    "ee-first-1.0.5" = {
+      name = "ee-first";
+      packageName = "ee-first";
+      version = "1.0.5";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/ee-first/-/ee-first-1.0.5.tgz";
+        sha1 = "8c9b212898d8cd9f1a9436650ce7be202c9e9ff0";
+      };
+    };
+    "mime-types-1.0.2" = {
+      name = "mime-types";
+      packageName = "mime-types";
+      version = "1.0.2";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/mime-types/-/mime-types-1.0.2.tgz";
+        sha1 = "995ae1392ab8affcbfcb2641dd054e943c0d5dce";
+      };
+    };
+    "accepts-1.0.7" = {
+      name = "accepts";
+      packageName = "accepts";
+      version = "1.0.7";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/accepts/-/accepts-1.0.7.tgz";
+        sha1 = "5b501fb4f0704309964ccdb048172541208dab1a";
+      };
+    };
+    "buffer-crc32-0.2.3" = {
+      name = "buffer-crc32";
+      packageName = "buffer-crc32";
+      version = "0.2.3";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.3.tgz";
+        sha1 = "bb54519e95d107cbd2400e76d0cab1467336d921";
+      };
+    };
+    "debug-1.0.4" = {
+      name = "debug";
+      packageName = "debug";
+      version = "1.0.4";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/debug/-/debug-1.0.4.tgz";
+        sha1 = "5b9c256bd54b6ec02283176fa8a0ede6d154cbf8";
+      };
+    };
+    "escape-html-1.0.1" = {
+      name = "escape-html";
+      packageName = "escape-html";
+      version = "1.0.1";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/escape-html/-/escape-html-1.0.1.tgz";
+        sha1 = "181a286ead397a39a92857cfb1d43052e356bff0";
+      };
+    };
+    "finalhandler-0.1.0" = {
+      name = "finalhandler";
+      packageName = "finalhandler";
+      version = "0.1.0";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/finalhandler/-/finalhandler-0.1.0.tgz";
+        sha1 = "da05bbc4f5f4a30c84ce1d91f3c154007c4e9daa";
+      };
+    };
+    "methods-1.1.0" = {
+      name = "methods";
+      packageName = "methods";
+      version = "1.1.0";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/methods/-/methods-1.1.0.tgz";
+        sha1 = "5dca4ee12df52ff3b056145986a8f01cbc86436f";
+      };
+    };
+    "parseurl-1.3.2" = {
+      name = "parseurl";
+      packageName = "parseurl";
+      version = "1.3.2";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz";
+        sha1 = "fc289d4ed8993119460c156253262cdc8de65bf3";
+      };
+    };
+    "path-to-regexp-0.1.3" = {
+      name = "path-to-regexp";
+      packageName = "path-to-regexp";
+      version = "0.1.3";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.3.tgz";
+        sha1 = "21b9ab82274279de25b156ea08fd12ca51b8aecb";
+      };
+    };
+    "proxy-addr-1.0.1" = {
+      name = "proxy-addr";
+      packageName = "proxy-addr";
+      version = "1.0.1";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.0.1.tgz";
+        sha1 = "c7c566d5eb4e3fad67eeb9c77c5558ccc39b88a8";
+      };
+    };
+    "range-parser-1.0.0" = {
+      name = "range-parser";
+      packageName = "range-parser";
+      version = "1.0.0";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/range-parser/-/range-parser-1.0.0.tgz";
+        sha1 = "a4b264cfe0be5ce36abe3765ac9c2a248746dbc0";
+      };
+    };
+    "send-0.8.5" = {
+      name = "send";
+      packageName = "send";
+      version = "0.8.5";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/send/-/send-0.8.5.tgz";
+        sha1 = "37f708216e6f50c175e74c69fec53484e2fd82c7";
+      };
+    };
+    "serve-static-1.5.4" = {
+      name = "serve-static";
+      packageName = "serve-static";
+      version = "1.5.4";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/serve-static/-/serve-static-1.5.4.tgz";
+        sha1 = "819fb37ae46bd02dd520b77fcf7fd8f5112f9782";
+      };
+    };
+    "vary-0.1.0" = {
+      name = "vary";
+      packageName = "vary";
+      version = "0.1.0";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/vary/-/vary-0.1.0.tgz";
+        sha1 = "df0945899e93c0cc5bd18cc8321d9d21e74f6176";
+      };
+    };
+    "cookie-0.1.2" = {
+      name = "cookie";
+      packageName = "cookie";
+      version = "0.1.2";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/cookie/-/cookie-0.1.2.tgz";
+        sha1 = "72fec3d24e48a3432073d90c12642005061004b1";
+      };
+    };
+    "fresh-0.2.2" = {
+      name = "fresh";
+      packageName = "fresh";
+      version = "0.2.2";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/fresh/-/fresh-0.2.2.tgz";
+        sha1 = "9731dcf5678c7faeb44fb903c4f72df55187fa77";
+      };
+    };
+    "cookie-signature-1.0.4" = {
+      name = "cookie-signature";
+      packageName = "cookie-signature";
+      version = "1.0.4";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.4.tgz";
+        sha1 = "0edd22286e3a111b9a2a70db363e925e867f6aca";
+      };
+    };
+    "merge-descriptors-0.0.2" = {
+      name = "merge-descriptors";
+      packageName = "merge-descriptors";
+      version = "0.0.2";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-0.0.2.tgz";
+        sha1 = "c36a52a781437513c57275f39dd9d317514ac8c7";
+      };
+    };
+    "utils-merge-1.0.0" = {
+      name = "utils-merge";
+      packageName = "utils-merge";
+      version = "1.0.0";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz";
+        sha1 = "0294fb922bb9375153541c4f7096231f287c8af8";
+      };
+    };
+    "negotiator-0.4.7" = {
+      name = "negotiator";
+      packageName = "negotiator";
+      version = "0.4.7";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/negotiator/-/negotiator-0.4.7.tgz";
+        sha1 = "a4160f7177ec806738631d0d3052325da42abdc8";
+      };
+    };
+    "ms-0.6.2" = {
+      name = "ms";
+      packageName = "ms";
+      version = "0.6.2";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz";
+        sha1 = "d89c2124c6fdc1353d65a8b77bf1aac4b193708c";
+      };
+    };
+    "ipaddr.js-0.1.2" = {
+      name = "ipaddr.js";
+      packageName = "ipaddr.js";
+      version = "0.1.2";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-0.1.2.tgz";
+        sha1 = "6a1fd3d854f5002965c34d7bbcd9b4a8d4b0467e";
+      };
+    };
+    "destroy-1.0.3" = {
+      name = "destroy";
+      packageName = "destroy";
+      version = "1.0.3";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/destroy/-/destroy-1.0.3.tgz";
+        sha1 = "b433b4724e71fd8551d9885174851c5fc377e2c9";
+      };
+    };
+    "mime-1.2.11" = {
+      name = "mime";
+      packageName = "mime";
+      version = "1.2.11";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz";
+        sha1 = "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10";
+      };
+    };
+    "qs-0.6.6" = {
+      name = "qs";
+      packageName = "qs";
+      version = "0.6.6";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/qs/-/qs-0.6.6.tgz";
+        sha1 = "6e015098ff51968b8a3c819001d5f2c89bc4b107";
+      };
+    };
+    "json-stringify-safe-5.0.1" = {
+      name = "json-stringify-safe";
+      packageName = "json-stringify-safe";
+      version = "5.0.1";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz";
+        sha1 = "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb";
+      };
+    };
+    "forever-agent-0.5.2" = {
+      name = "forever-agent";
+      packageName = "forever-agent";
+      version = "0.5.2";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz";
+        sha1 = "6d0e09c4921f94a27f63d3b49c5feff1ea4c5130";
+      };
+    };
+    "node-uuid-1.4.8" = {
+      name = "node-uuid";
+      packageName = "node-uuid";
+      version = "1.4.8";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz";
+        sha1 = "b040eb0923968afabf8d32fb1f17f1167fdab907";
+      };
+    };
+    "tough-cookie-2.3.3" = {
+      name = "tough-cookie";
+      packageName = "tough-cookie";
+      version = "2.3.3";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz";
+        sha1 = "0b618a5565b6dea90bf3425d04d55edc475a7561";
+      };
+    };
+    "form-data-0.1.4" = {
+      name = "form-data";
+      packageName = "form-data";
+      version = "0.1.4";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz";
+        sha1 = "91abd788aba9702b1aabfa8bc01031a2ac9e3b12";
+      };
+    };
+    "tunnel-agent-0.3.0" = {
+      name = "tunnel-agent";
+      packageName = "tunnel-agent";
+      version = "0.3.0";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.3.0.tgz";
+        sha1 = "ad681b68f5321ad2827c4cfb1b7d5df2cfe942ee";
+      };
+    };
+    "http-signature-0.10.1" = {
+      name = "http-signature";
+      packageName = "http-signature";
+      version = "0.10.1";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/http-signature/-/http-signature-0.10.1.tgz";
+        sha1 = "4fbdac132559aa8323121e540779c0a012b27e66";
+      };
+    };
+    "oauth-sign-0.3.0" = {
+      name = "oauth-sign";
+      packageName = "oauth-sign";
+      version = "0.3.0";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.3.0.tgz";
+        sha1 = "cb540f93bb2b22a7d5941691a288d60e8ea9386e";
+      };
+    };
+    "hawk-1.0.0" = {
+      name = "hawk";
+      packageName = "hawk";
+      version = "1.0.0";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/hawk/-/hawk-1.0.0.tgz";
+        sha1 = "b90bb169807285411da7ffcb8dd2598502d3b52d";
+      };
+    };
+    "aws-sign2-0.5.0" = {
+      name = "aws-sign2";
+      packageName = "aws-sign2";
+      version = "0.5.0";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz";
+        sha1 = "c57103f7a17fc037f02d7c2e64b602ea223f7d63";
+      };
+    };
+    "punycode-1.4.1" = {
+      name = "punycode";
+      packageName = "punycode";
+      version = "1.4.1";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz";
+        sha1 = "c0d5a63b2718800ad8e1eb0fa5269c84dd41845e";
+      };
+    };
+    "combined-stream-0.0.7" = {
+      name = "combined-stream";
+      packageName = "combined-stream";
+      version = "0.0.7";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz";
+        sha1 = "0137e657baa5a7541c57ac37ac5fc07d73b4dc1f";
+      };
+    };
+    "async-0.9.2" = {
+      name = "async";
+      packageName = "async";
+      version = "0.9.2";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/async/-/async-0.9.2.tgz";
+        sha1 = "aea74d5e61c1f899613bf64bda66d4c78f2fd17d";
+      };
+    };
+    "delayed-stream-0.0.5" = {
+      name = "delayed-stream";
+      packageName = "delayed-stream";
+      version = "0.0.5";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz";
+        sha1 = "d4b1f43a93e8296dfe02694f4680bc37a313c73f";
+      };
+    };
+    "assert-plus-0.1.5" = {
+      name = "assert-plus";
+      packageName = "assert-plus";
+      version = "0.1.5";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz";
+        sha1 = "ee74009413002d84cec7219c6ac811812e723160";
+      };
+    };
+    "asn1-0.1.11" = {
+      name = "asn1";
+      packageName = "asn1";
+      version = "0.1.11";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz";
+        sha1 = "559be18376d08a4ec4dbe80877d27818639b2df7";
+      };
+    };
+    "ctype-0.5.3" = {
+      name = "ctype";
+      packageName = "ctype";
+      version = "0.5.3";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz";
+        sha1 = "82c18c2461f74114ef16c135224ad0b9144ca12f";
+      };
+    };
+    "hoek-0.9.1" = {
+      name = "hoek";
+      packageName = "hoek";
+      version = "0.9.1";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz";
+        sha1 = "3d322462badf07716ea7eb85baf88079cddce505";
+      };
+    };
+    "boom-0.4.2" = {
+      name = "boom";
+      packageName = "boom";
+      version = "0.4.2";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz";
+        sha1 = "7a636e9ded4efcefb19cef4947a3c67dfaee911b";
+      };
+    };
+    "cryptiles-0.2.2" = {
+      name = "cryptiles";
+      packageName = "cryptiles";
+      version = "0.2.2";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz";
+        sha1 = "ed91ff1f17ad13d3748288594f8a48a0d26f325c";
+      };
+    };
+    "sntp-0.2.4" = {
+      name = "sntp";
+      packageName = "sntp";
+      version = "0.2.4";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz";
+        sha1 = "fb885f18b0f3aad189f824862536bceeec750900";
+      };
+    };
+    "block-stream-0.0.9" = {
+      name = "block-stream";
+      packageName = "block-stream";
+      version = "0.0.9";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz";
+        sha1 = "13ebfe778a03205cfe03751481ebb4b3300c126a";
+      };
+    };
+    "fstream-0.1.31" = {
+      name = "fstream";
+      packageName = "fstream";
+      version = "0.1.31";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/fstream/-/fstream-0.1.31.tgz";
+        sha1 = "7337f058fbbbbefa8c9f561a28cab0849202c988";
+      };
+    };
+    "inherits-2.0.3" = {
+      name = "inherits";
+      packageName = "inherits";
+      version = "2.0.3";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz";
+        sha1 = "633c2c83e3da42a502f52466022480f4208261de";
+      };
+    };
+    "graceful-fs-3.0.11" = {
+      name = "graceful-fs";
+      packageName = "graceful-fs";
+      version = "3.0.11";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.11.tgz";
+        sha1 = "7613c778a1afea62f25c630a086d7f3acbbdd818";
+      };
+    };
+    "mkdirp-0.5.1" = {
+      name = "mkdirp";
+      packageName = "mkdirp";
+      version = "0.5.1";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz";
+        sha1 = "30057438eac6cf7f8c4767f38648d6697d75c903";
+      };
+    };
+    "rimraf-2.6.2" = {
+      name = "rimraf";
+      packageName = "rimraf";
+      version = "2.6.2";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz";
+        sha512 = "3kmrqh8xli7rzfm8wc6j9lp0c6vml172iv3z088an9xlwl1xvkvh3fn92za66ms4c9yww80qa5kan31k1z1ypqvkchmh1mznb09xdwn";
+      };
+    };
+    "natives-1.1.0" = {
+      name = "natives";
+      packageName = "natives";
+      version = "1.1.0";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/natives/-/natives-1.1.0.tgz";
+        sha1 = "e9ff841418a6b2ec7a495e939984f78f163e6e31";
+      };
+    };
+    "minimist-0.0.8" = {
+      name = "minimist";
+      packageName = "minimist";
+      version = "0.0.8";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz";
+        sha1 = "857fcabfc3397d2625b8228262e86aa7a011b05d";
+      };
+    };
+    "glob-7.1.2" = {
+      name = "glob";
+      packageName = "glob";
+      version = "7.1.2";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz";
+        sha512 = "08vjxzixc9dwc1hn5pd60yyij98krk2pr758aiga97r02ncvaqx1hidi95wk470k1v84gg4alls9bm52m77174z128bgf13b61x951h";
+      };
+    };
+    "fs.realpath-1.0.0" = {
+      name = "fs.realpath";
+      packageName = "fs.realpath";
+      version = "1.0.0";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz";
+        sha1 = "1504ad2523158caa40db4a2787cb01411994ea4f";
+      };
+    };
+    "inflight-1.0.6" = {
+      name = "inflight";
+      packageName = "inflight";
+      version = "1.0.6";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz";
+        sha1 = "49bd6331d7d02d0c09bc910a1075ba8165b56df9";
+      };
+    };
+    "minimatch-3.0.4" = {
+      name = "minimatch";
+      packageName = "minimatch";
+      version = "3.0.4";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz";
+        sha512 = "1879a3j85h92ypvb7lpv1dqpcxl49rqnbgs5la18zmj1yqhwl60c2m74254wbr5pp3znckqpkg9dvjyrz6hfz8b9vag5a3j910db4f8";
+      };
+    };
+    "once-1.4.0" = {
+      name = "once";
+      packageName = "once";
+      version = "1.4.0";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/once/-/once-1.4.0.tgz";
+        sha1 = "583b1aa775961d4b113ac17d9c50baef9dd76bd1";
+      };
+    };
+    "path-is-absolute-1.0.1" = {
+      name = "path-is-absolute";
+      packageName = "path-is-absolute";
+      version = "1.0.1";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz";
+        sha1 = "174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f";
+      };
+    };
+    "wrappy-1.0.2" = {
+      name = "wrappy";
+      packageName = "wrappy";
+      version = "1.0.2";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz";
+        sha1 = "b5243d8f3ec1aa35f1364605bc0d1036e30ab69f";
+      };
+    };
+    "brace-expansion-1.1.8" = {
+      name = "brace-expansion";
+      packageName = "brace-expansion";
+      version = "1.1.8";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz";
+        sha1 = "c07b211c7c952ec1f8efd51a77ef0d1d3990a292";
+      };
+    };
+    "balanced-match-1.0.0" = {
+      name = "balanced-match";
+      packageName = "balanced-match";
+      version = "1.0.0";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz";
+        sha1 = "89b4d199ab2bee49de164ea02b89ce462d71b767";
+      };
+    };
+    "concat-map-0.0.1" = {
+      name = "concat-map";
+      packageName = "concat-map";
+      version = "0.0.1";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz";
+        sha1 = "d8a96bd77fd68df7793a73036a3ba0d5405d477b";
+      };
+    };
+    "commander-2.1.0" = {
+      name = "commander";
+      packageName = "commander";
+      version = "2.1.0";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/commander/-/commander-2.1.0.tgz";
+        sha1 = "d121bbae860d9992a3d517ba96f56588e47c6781";
+      };
+    };
+    "nan-1.0.0" = {
+      name = "nan";
+      packageName = "nan";
+      version = "1.0.0";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/nan/-/nan-1.0.0.tgz";
+        sha1 = "ae24f8850818d662fcab5acf7f3b95bfaa2ccf38";
+      };
+    };
+    "tinycolor-0.0.1" = {
+      name = "tinycolor";
+      packageName = "tinycolor";
+      version = "0.0.1";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/tinycolor/-/tinycolor-0.0.1.tgz";
+        sha1 = "320b5a52d83abb5978d81a3e887d4aefb15a6164";
+      };
+    };
+    "options-0.0.6" = {
+      name = "options";
+      packageName = "options";
+      version = "0.0.6";
+      src = fetchurl {
+        url = "https://registry.npmjs.org/options/-/options-0.0.6.tgz";
+        sha1 = "ec22d312806bb53e731773e7cdaefcf1c643128f";
+      };
+    };
+  };
+in
+{
+  "body-parser-~1.6.3" = nodeEnv.buildNodePackage {
+    name = "body-parser";
+    packageName = "body-parser";
+    version = "1.6.7";
+    src = fetchurl {
+      url = "https://registry.npmjs.org/body-parser/-/body-parser-1.6.7.tgz";
+      sha1 = "82306becadf44543e826b3907eae93f0237c4e5c";
+    };
+    dependencies = [
+      sources."bytes-1.0.0"
+      sources."depd-0.4.4"
+      sources."iconv-lite-0.4.4"
+      sources."media-typer-0.2.0"
+      sources."on-finished-2.1.0"
+      sources."qs-2.2.2"
+      sources."raw-body-1.3.0"
+      sources."type-is-1.3.2"
+      sources."ee-first-1.0.5"
+      sources."mime-types-1.0.2"
+    ];
+    buildInputs = globalBuildInputs;
+    meta = {
+      description = "Node.js body parsing middleware";
+      homepage = https://github.com/expressjs/body-parser;
+      license = "MIT";
+    };
+    production = true;
+  };
+  "express-~4.8.3" = nodeEnv.buildNodePackage {
+    name = "express";
+    packageName = "express";
+    version = "4.8.8";
+    src = fetchurl {
+      url = "https://registry.npmjs.org/express/-/express-4.8.8.tgz";
+      sha1 = "6aba348ccdfa87608040b12ca0010107a0aac28e";
+    };
+    dependencies = [
+      sources."accepts-1.0.7"
+      sources."buffer-crc32-0.2.3"
+      sources."debug-1.0.4"
+      sources."depd-0.4.4"
+      sources."escape-html-1.0.1"
+      sources."finalhandler-0.1.0"
+      sources."media-typer-0.2.0"
+      sources."methods-1.1.0"
+      sources."parseurl-1.3.2"
+      sources."path-to-regexp-0.1.3"
+      sources."proxy-addr-1.0.1"
+      sources."qs-2.2.2"
+      sources."range-parser-1.0.0"
+      sources."send-0.8.5"
+      sources."serve-static-1.5.4"
+      sources."type-is-1.3.2"
+      sources."vary-0.1.0"
+      sources."cookie-0.1.2"
+      sources."fresh-0.2.2"
+      sources."cookie-signature-1.0.4"
+      sources."merge-descriptors-0.0.2"
+      sources."utils-merge-1.0.0"
+      sources."mime-types-1.0.2"
+      sources."negotiator-0.4.7"
+      sources."ms-0.6.2"
+      sources."ipaddr.js-0.1.2"
+      sources."destroy-1.0.3"
+      sources."mime-1.2.11"
+      sources."on-finished-2.1.0"
+      sources."ee-first-1.0.5"
+    ];
+    buildInputs = globalBuildInputs;
+    meta = {
+      description = "Fast, unopinionated, minimalist web framework";
+      homepage = http://expressjs.com/;
+      license = "MIT";
+    };
+    production = true;
+  };
+  "request-~2.34.0" = nodeEnv.buildNodePackage {
+    name = "request";
+    packageName = "request";
+    version = "2.34.0";
+    src = fetchurl {
+      url = "https://registry.npmjs.org/request/-/request-2.34.0.tgz";
+      sha1 = "b5d8b9526add4a2d4629f4d417124573996445ae";
+    };
+    dependencies = [
+      sources."qs-0.6.6"
+      sources."json-stringify-safe-5.0.1"
+      sources."forever-agent-0.5.2"
+      sources."node-uuid-1.4.8"
+      sources."mime-1.2.11"
+      sources."tough-cookie-2.3.3"
+      sources."form-data-0.1.4"
+      sources."tunnel-agent-0.3.0"
+      sources."http-signature-0.10.1"
+      sources."oauth-sign-0.3.0"
+      sources."hawk-1.0.0"
+      sources."aws-sign2-0.5.0"
+      sources."punycode-1.4.1"
+      sources."combined-stream-0.0.7"
+      sources."async-0.9.2"
+      sources."delayed-stream-0.0.5"
+      sources."assert-plus-0.1.5"
+      sources."asn1-0.1.11"
+      sources."ctype-0.5.3"
+      sources."hoek-0.9.1"
+      sources."boom-0.4.2"
+      sources."cryptiles-0.2.2"
+      sources."sntp-0.2.4"
+    ];
+    buildInputs = globalBuildInputs;
+    meta = {
+      description = "Simplified HTTP request client.";
+      homepage = https://github.com/mikeal/request;
+      license = "Apache, Version 2.0";
+    };
+    production = true;
+  };
+  "tar-~0.1.19" = nodeEnv.buildNodePackage {
+    name = "tar";
+    packageName = "tar";
+    version = "0.1.20";
+    src = fetchurl {
+      url = "https://registry.npmjs.org/tar/-/tar-0.1.20.tgz";
+      sha1 = "42940bae5b5f22c74483699126f9f3f27449cb13";
+    };
+    dependencies = [
+      sources."block-stream-0.0.9"
+      sources."fstream-0.1.31"
+      sources."inherits-2.0.3"
+      sources."graceful-fs-3.0.11"
+      sources."mkdirp-0.5.1"
+      sources."rimraf-2.6.2"
+      sources."natives-1.1.0"
+      sources."minimist-0.0.8"
+      sources."glob-7.1.2"
+      sources."fs.realpath-1.0.0"
+      sources."inflight-1.0.6"
+      sources."minimatch-3.0.4"
+      sources."once-1.4.0"
+      sources."path-is-absolute-1.0.1"
+      sources."wrappy-1.0.2"
+      sources."brace-expansion-1.1.8"
+      sources."balanced-match-1.0.0"
+      sources."concat-map-0.0.1"
+    ];
+    buildInputs = globalBuildInputs;
+    meta = {
+      description = "tar for node";
+      homepage = https://github.com/isaacs/node-tar;
+      license = "BSD";
+    };
+    production = true;
+  };
+  "ws-~0.4.32" = nodeEnv.buildNodePackage {
+    name = "ws";
+    packageName = "ws";
+    version = "0.4.32";
+    src = fetchurl {
+      url = "https://registry.npmjs.org/ws/-/ws-0.4.32.tgz";
+      sha1 = "787a6154414f3c99ed83c5772153b20feb0cec32";
+    };
+    dependencies = [
+      sources."commander-2.1.0"
+      sources."nan-1.0.0"
+      sources."tinycolor-0.0.1"
+      sources."options-0.0.6"
+    ];
+    buildInputs = globalBuildInputs;
+    meta = {
+      description = "simple to use, blazing fast and thoroughly tested websocket client, server and console for node.js, up-to-date against RFC-6455";
+      homepage = https://github.com/einaros/ws;
+    };
+    production = true;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/applications/editors/zed/node.nix b/pkgs/applications/editors/zed/node.nix
index e74ff1ec45f..ff0bf1eb805 100644
--- a/pkgs/applications/editors/zed/node.nix
+++ b/pkgs/applications/editors/zed/node.nix
@@ -1,1825 +1,16 @@
-{ self, fetchurl, fetchgit ? null, lib }:
+# This file has been generated by node2nix 1.3.0. Do not edit!
 
-{
-  by-spec."accepts"."~1.2.7" =
-    self.by-version."accepts"."1.2.7";
-  by-version."accepts"."1.2.7" = lib.makeOverridable self.buildNodePackage {
-    name = "accepts-1.2.7";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/accepts/-/accepts-1.2.7.tgz";
-        name = "accepts-1.2.7.tgz";
-        sha1 = "efea24e36e0b5b93d001a7598ac441c32ef56003";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."accepts" or []);
-    deps = {
-      "mime-types-2.0.12" = self.by-version."mime-types"."2.0.12";
-      "negotiator-0.5.3" = self.by-version."negotiator"."0.5.3";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "accepts" ];
-  };
-  by-spec."asn1"."0.1.11" =
-    self.by-version."asn1"."0.1.11";
-  by-version."asn1"."0.1.11" = lib.makeOverridable self.buildNodePackage {
-    name = "asn1-0.1.11";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz";
-        name = "asn1-0.1.11.tgz";
-        sha1 = "559be18376d08a4ec4dbe80877d27818639b2df7";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."asn1" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "asn1" ];
-  };
-  by-spec."assert-plus"."^0.1.5" =
-    self.by-version."assert-plus"."0.1.5";
-  by-version."assert-plus"."0.1.5" = lib.makeOverridable self.buildNodePackage {
-    name = "assert-plus-0.1.5";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz";
-        name = "assert-plus-0.1.5.tgz";
-        sha1 = "ee74009413002d84cec7219c6ac811812e723160";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."assert-plus" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "assert-plus" ];
-  };
-  by-spec."async"."~0.9.0" =
-    self.by-version."async"."0.9.2";
-  by-version."async"."0.9.2" = lib.makeOverridable self.buildNodePackage {
-    name = "async-0.9.2";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/async/-/async-0.9.2.tgz";
-        name = "async-0.9.2.tgz";
-        sha1 = "aea74d5e61c1f899613bf64bda66d4c78f2fd17d";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."async" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "async" ];
-  };
-  by-spec."aws-sign2"."~0.5.0" =
-    self.by-version."aws-sign2"."0.5.0";
-  by-version."aws-sign2"."0.5.0" = lib.makeOverridable self.buildNodePackage {
-    name = "aws-sign2-0.5.0";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz";
-        name = "aws-sign2-0.5.0.tgz";
-        sha1 = "c57103f7a17fc037f02d7c2e64b602ea223f7d63";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."aws-sign2" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "aws-sign2" ];
-  };
-  by-spec."balanced-match"."^0.2.0" =
-    self.by-version."balanced-match"."0.2.0";
-  by-version."balanced-match"."0.2.0" = lib.makeOverridable self.buildNodePackage {
-    name = "balanced-match-0.2.0";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz";
-        name = "balanced-match-0.2.0.tgz";
-        sha1 = "38f6730c03aab6d5edbb52bd934885e756d71674";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."balanced-match" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "balanced-match" ];
-  };
-  by-spec."block-stream"."*" =
-    self.by-version."block-stream"."0.0.8";
-  by-version."block-stream"."0.0.8" = lib.makeOverridable self.buildNodePackage {
-    name = "block-stream-0.0.8";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/block-stream/-/block-stream-0.0.8.tgz";
-        name = "block-stream-0.0.8.tgz";
-        sha1 = "0688f46da2bbf9cff0c4f68225a0cb95cbe8a46b";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."block-stream" or []);
-    deps = {
-      "inherits-2.0.1" = self.by-version."inherits"."2.0.1";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "block-stream" ];
-  };
-  by-spec."body-parser"."^1.6.3" =
-    self.by-version."body-parser"."1.12.4";
-  by-version."body-parser"."1.12.4" = lib.makeOverridable self.buildNodePackage {
-    name = "body-parser-1.12.4";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/body-parser/-/body-parser-1.12.4.tgz";
-        name = "body-parser-1.12.4.tgz";
-        sha1 = "090700c4ba28862a8520ef378395fdee5f61c229";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."body-parser" or []);
-    deps = {
-      "bytes-1.0.0" = self.by-version."bytes"."1.0.0";
-      "content-type-1.0.1" = self.by-version."content-type"."1.0.1";
-      "debug-2.2.0" = self.by-version."debug"."2.2.0";
-      "depd-1.0.1" = self.by-version."depd"."1.0.1";
-      "iconv-lite-0.4.8" = self.by-version."iconv-lite"."0.4.8";
-      "on-finished-2.2.1" = self.by-version."on-finished"."2.2.1";
-      "qs-2.4.2" = self.by-version."qs"."2.4.2";
-      "raw-body-2.0.1" = self.by-version."raw-body"."2.0.1";
-      "type-is-1.6.2" = self.by-version."type-is"."1.6.2";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "body-parser" ];
-  };
-  "body-parser" = self.by-version."body-parser"."1.12.4";
-  by-spec."boom"."0.4.x" =
-    self.by-version."boom"."0.4.2";
-  by-version."boom"."0.4.2" = lib.makeOverridable self.buildNodePackage {
-    name = "boom-0.4.2";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/boom/-/boom-0.4.2.tgz";
-        name = "boom-0.4.2.tgz";
-        sha1 = "7a636e9ded4efcefb19cef4947a3c67dfaee911b";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."boom" or []);
-    deps = {
-      "hoek-0.9.1" = self.by-version."hoek"."0.9.1";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "boom" ];
-  };
-  by-spec."brace-expansion"."^1.0.0" =
-    self.by-version."brace-expansion"."1.1.0";
-  by-version."brace-expansion"."1.1.0" = lib.makeOverridable self.buildNodePackage {
-    name = "brace-expansion-1.1.0";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz";
-        name = "brace-expansion-1.1.0.tgz";
-        sha1 = "c9b7d03c03f37bc704be100e522b40db8f6cfcd9";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."brace-expansion" or []);
-    deps = {
-      "balanced-match-0.2.0" = self.by-version."balanced-match"."0.2.0";
-      "concat-map-0.0.1" = self.by-version."concat-map"."0.0.1";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "brace-expansion" ];
-  };
-  by-spec."bytes"."1.0.0" =
-    self.by-version."bytes"."1.0.0";
-  by-version."bytes"."1.0.0" = lib.makeOverridable self.buildNodePackage {
-    name = "bytes-1.0.0";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/bytes/-/bytes-1.0.0.tgz";
-        name = "bytes-1.0.0.tgz";
-        sha1 = "3569ede8ba34315fab99c3e92cb04c7220de1fa8";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."bytes" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "bytes" ];
-  };
-  by-spec."bytes"."2.0.1" =
-    self.by-version."bytes"."2.0.1";
-  by-version."bytes"."2.0.1" = lib.makeOverridable self.buildNodePackage {
-    name = "bytes-2.0.1";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/bytes/-/bytes-2.0.1.tgz";
-        name = "bytes-2.0.1.tgz";
-        sha1 = "673743059be43d929f9c225dd7363ee0f8b15d97";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."bytes" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "bytes" ];
-  };
-  by-spec."combined-stream"."~0.0.4" =
-    self.by-version."combined-stream"."0.0.7";
-  by-version."combined-stream"."0.0.7" = lib.makeOverridable self.buildNodePackage {
-    name = "combined-stream-0.0.7";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz";
-        name = "combined-stream-0.0.7.tgz";
-        sha1 = "0137e657baa5a7541c57ac37ac5fc07d73b4dc1f";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."combined-stream" or []);
-    deps = {
-      "delayed-stream-0.0.5" = self.by-version."delayed-stream"."0.0.5";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "combined-stream" ];
-  };
-  by-spec."commander"."~2.1.0" =
-    self.by-version."commander"."2.1.0";
-  by-version."commander"."2.1.0" = lib.makeOverridable self.buildNodePackage {
-    name = "commander-2.1.0";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/commander/-/commander-2.1.0.tgz";
-        name = "commander-2.1.0.tgz";
-        sha1 = "d121bbae860d9992a3d517ba96f56588e47c6781";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."commander" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "commander" ];
-  };
-  by-spec."concat-map"."0.0.1" =
-    self.by-version."concat-map"."0.0.1";
-  by-version."concat-map"."0.0.1" = lib.makeOverridable self.buildNodePackage {
-    name = "concat-map-0.0.1";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz";
-        name = "concat-map-0.0.1.tgz";
-        sha1 = "d8a96bd77fd68df7793a73036a3ba0d5405d477b";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."concat-map" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "concat-map" ];
-  };
-  by-spec."content-disposition"."0.5.0" =
-    self.by-version."content-disposition"."0.5.0";
-  by-version."content-disposition"."0.5.0" = lib.makeOverridable self.buildNodePackage {
-    name = "content-disposition-0.5.0";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/content-disposition/-/content-disposition-0.5.0.tgz";
-        name = "content-disposition-0.5.0.tgz";
-        sha1 = "4284fe6ae0630874639e44e80a418c2934135e9e";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."content-disposition" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "content-disposition" ];
-  };
-  by-spec."content-type"."~1.0.1" =
-    self.by-version."content-type"."1.0.1";
-  by-version."content-type"."1.0.1" = lib.makeOverridable self.buildNodePackage {
-    name = "content-type-1.0.1";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/content-type/-/content-type-1.0.1.tgz";
-        name = "content-type-1.0.1.tgz";
-        sha1 = "a19d2247327dc038050ce622b7a154ec59c5e600";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."content-type" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "content-type" ];
-  };
-  by-spec."cookie"."0.1.2" =
-    self.by-version."cookie"."0.1.2";
-  by-version."cookie"."0.1.2" = lib.makeOverridable self.buildNodePackage {
-    name = "cookie-0.1.2";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/cookie/-/cookie-0.1.2.tgz";
-        name = "cookie-0.1.2.tgz";
-        sha1 = "72fec3d24e48a3432073d90c12642005061004b1";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."cookie" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "cookie" ];
-  };
-  by-spec."cookie-signature"."1.0.6" =
-    self.by-version."cookie-signature"."1.0.6";
-  by-version."cookie-signature"."1.0.6" = lib.makeOverridable self.buildNodePackage {
-    name = "cookie-signature-1.0.6";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz";
-        name = "cookie-signature-1.0.6.tgz";
-        sha1 = "e303a882b342cc3ee8ca513a79999734dab3ae2c";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."cookie-signature" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "cookie-signature" ];
-  };
-  by-spec."crc"."3.2.1" =
-    self.by-version."crc"."3.2.1";
-  by-version."crc"."3.2.1" = lib.makeOverridable self.buildNodePackage {
-    name = "crc-3.2.1";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/crc/-/crc-3.2.1.tgz";
-        name = "crc-3.2.1.tgz";
-        sha1 = "5d9c8fb77a245cd5eca291e5d2d005334bab0082";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."crc" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "crc" ];
-  };
-  by-spec."cryptiles"."0.2.x" =
-    self.by-version."cryptiles"."0.2.2";
-  by-version."cryptiles"."0.2.2" = lib.makeOverridable self.buildNodePackage {
-    name = "cryptiles-0.2.2";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz";
-        name = "cryptiles-0.2.2.tgz";
-        sha1 = "ed91ff1f17ad13d3748288594f8a48a0d26f325c";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."cryptiles" or []);
-    deps = {
-      "boom-0.4.2" = self.by-version."boom"."0.4.2";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "cryptiles" ];
-  };
-  by-spec."ctype"."0.5.3" =
-    self.by-version."ctype"."0.5.3";
-  by-version."ctype"."0.5.3" = lib.makeOverridable self.buildNodePackage {
-    name = "ctype-0.5.3";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz";
-        name = "ctype-0.5.3.tgz";
-        sha1 = "82c18c2461f74114ef16c135224ad0b9144ca12f";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."ctype" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "ctype" ];
-  };
-  by-spec."debug"."~2.2.0" =
-    self.by-version."debug"."2.2.0";
-  by-version."debug"."2.2.0" = lib.makeOverridable self.buildNodePackage {
-    name = "debug-2.2.0";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/debug/-/debug-2.2.0.tgz";
-        name = "debug-2.2.0.tgz";
-        sha1 = "f87057e995b1a1f6ae6a4960664137bc56f039da";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."debug" or []);
-    deps = {
-      "ms-0.7.1" = self.by-version."ms"."0.7.1";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "debug" ];
-  };
-  by-spec."delayed-stream"."0.0.5" =
-    self.by-version."delayed-stream"."0.0.5";
-  by-version."delayed-stream"."0.0.5" = lib.makeOverridable self.buildNodePackage {
-    name = "delayed-stream-0.0.5";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz";
-        name = "delayed-stream-0.0.5.tgz";
-        sha1 = "d4b1f43a93e8296dfe02694f4680bc37a313c73f";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."delayed-stream" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "delayed-stream" ];
-  };
-  by-spec."depd"."~1.0.1" =
-    self.by-version."depd"."1.0.1";
-  by-version."depd"."1.0.1" = lib.makeOverridable self.buildNodePackage {
-    name = "depd-1.0.1";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/depd/-/depd-1.0.1.tgz";
-        name = "depd-1.0.1.tgz";
-        sha1 = "80aec64c9d6d97e65cc2a9caa93c0aa6abf73aaa";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."depd" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "depd" ];
-  };
-  by-spec."destroy"."1.0.3" =
-    self.by-version."destroy"."1.0.3";
-  by-version."destroy"."1.0.3" = lib.makeOverridable self.buildNodePackage {
-    name = "destroy-1.0.3";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/destroy/-/destroy-1.0.3.tgz";
-        name = "destroy-1.0.3.tgz";
-        sha1 = "b433b4724e71fd8551d9885174851c5fc377e2c9";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."destroy" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "destroy" ];
-  };
-  by-spec."ee-first"."1.1.0" =
-    self.by-version."ee-first"."1.1.0";
-  by-version."ee-first"."1.1.0" = lib.makeOverridable self.buildNodePackage {
-    name = "ee-first-1.1.0";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/ee-first/-/ee-first-1.1.0.tgz";
-        name = "ee-first-1.1.0.tgz";
-        sha1 = "6a0d7c6221e490feefd92ec3f441c9ce8cd097f4";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."ee-first" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "ee-first" ];
-  };
-  by-spec."escape-html"."1.0.1" =
-    self.by-version."escape-html"."1.0.1";
-  by-version."escape-html"."1.0.1" = lib.makeOverridable self.buildNodePackage {
-    name = "escape-html-1.0.1";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/escape-html/-/escape-html-1.0.1.tgz";
-        name = "escape-html-1.0.1.tgz";
-        sha1 = "181a286ead397a39a92857cfb1d43052e356bff0";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."escape-html" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "escape-html" ];
-  };
-  by-spec."etag"."~1.6.0" =
-    self.by-version."etag"."1.6.0";
-  by-version."etag"."1.6.0" = lib.makeOverridable self.buildNodePackage {
-    name = "etag-1.6.0";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/etag/-/etag-1.6.0.tgz";
-        name = "etag-1.6.0.tgz";
-        sha1 = "8bcb2c6af1254c481dfc8b997c906ef4e442c207";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."etag" or []);
-    deps = {
-      "crc-3.2.1" = self.by-version."crc"."3.2.1";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "etag" ];
-  };
-  by-spec."express"."^4.8.3" =
-    self.by-version."express"."4.12.4";
-  by-version."express"."4.12.4" = lib.makeOverridable self.buildNodePackage {
-    name = "express-4.12.4";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/express/-/express-4.12.4.tgz";
-        name = "express-4.12.4.tgz";
-        sha1 = "8fec2510255bc6b2e58107c48239c0fa307c1aa2";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."express" or []);
-    deps = {
-      "accepts-1.2.7" = self.by-version."accepts"."1.2.7";
-      "content-disposition-0.5.0" = self.by-version."content-disposition"."0.5.0";
-      "content-type-1.0.1" = self.by-version."content-type"."1.0.1";
-      "cookie-0.1.2" = self.by-version."cookie"."0.1.2";
-      "cookie-signature-1.0.6" = self.by-version."cookie-signature"."1.0.6";
-      "debug-2.2.0" = self.by-version."debug"."2.2.0";
-      "depd-1.0.1" = self.by-version."depd"."1.0.1";
-      "escape-html-1.0.1" = self.by-version."escape-html"."1.0.1";
-      "etag-1.6.0" = self.by-version."etag"."1.6.0";
-      "finalhandler-0.3.6" = self.by-version."finalhandler"."0.3.6";
-      "fresh-0.2.4" = self.by-version."fresh"."0.2.4";
-      "merge-descriptors-1.0.0" = self.by-version."merge-descriptors"."1.0.0";
-      "methods-1.1.1" = self.by-version."methods"."1.1.1";
-      "on-finished-2.2.1" = self.by-version."on-finished"."2.2.1";
-      "parseurl-1.3.0" = self.by-version."parseurl"."1.3.0";
-      "path-to-regexp-0.1.3" = self.by-version."path-to-regexp"."0.1.3";
-      "proxy-addr-1.0.8" = self.by-version."proxy-addr"."1.0.8";
-      "qs-2.4.2" = self.by-version."qs"."2.4.2";
-      "range-parser-1.0.2" = self.by-version."range-parser"."1.0.2";
-      "send-0.12.3" = self.by-version."send"."0.12.3";
-      "serve-static-1.9.3" = self.by-version."serve-static"."1.9.3";
-      "type-is-1.6.2" = self.by-version."type-is"."1.6.2";
-      "vary-1.0.0" = self.by-version."vary"."1.0.0";
-      "utils-merge-1.0.0" = self.by-version."utils-merge"."1.0.0";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "express" ];
-  };
-  "express" = self.by-version."express"."4.12.4";
-  by-spec."finalhandler"."0.3.6" =
-    self.by-version."finalhandler"."0.3.6";
-  by-version."finalhandler"."0.3.6" = lib.makeOverridable self.buildNodePackage {
-    name = "finalhandler-0.3.6";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/finalhandler/-/finalhandler-0.3.6.tgz";
-        name = "finalhandler-0.3.6.tgz";
-        sha1 = "daf9c4161b1b06e001466b1411dfdb6973be138b";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."finalhandler" or []);
-    deps = {
-      "debug-2.2.0" = self.by-version."debug"."2.2.0";
-      "escape-html-1.0.1" = self.by-version."escape-html"."1.0.1";
-      "on-finished-2.2.1" = self.by-version."on-finished"."2.2.1";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "finalhandler" ];
-  };
-  by-spec."forever-agent"."~0.5.0" =
-    self.by-version."forever-agent"."0.5.2";
-  by-version."forever-agent"."0.5.2" = lib.makeOverridable self.buildNodePackage {
-    name = "forever-agent-0.5.2";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz";
-        name = "forever-agent-0.5.2.tgz";
-        sha1 = "6d0e09c4921f94a27f63d3b49c5feff1ea4c5130";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."forever-agent" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "forever-agent" ];
-  };
-  by-spec."form-data"."~0.1.0" =
-    self.by-version."form-data"."0.1.4";
-  by-version."form-data"."0.1.4" = lib.makeOverridable self.buildNodePackage {
-    name = "form-data-0.1.4";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz";
-        name = "form-data-0.1.4.tgz";
-        sha1 = "91abd788aba9702b1aabfa8bc01031a2ac9e3b12";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."form-data" or []);
-    deps = {
-      "combined-stream-0.0.7" = self.by-version."combined-stream"."0.0.7";
-      "mime-1.2.11" = self.by-version."mime"."1.2.11";
-      "async-0.9.2" = self.by-version."async"."0.9.2";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "form-data" ];
-  };
-  by-spec."forwarded"."~0.1.0" =
-    self.by-version."forwarded"."0.1.0";
-  by-version."forwarded"."0.1.0" = lib.makeOverridable self.buildNodePackage {
-    name = "forwarded-0.1.0";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/forwarded/-/forwarded-0.1.0.tgz";
-        name = "forwarded-0.1.0.tgz";
-        sha1 = "19ef9874c4ae1c297bcf078fde63a09b66a84363";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."forwarded" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "forwarded" ];
-  };
-  by-spec."fresh"."0.2.4" =
-    self.by-version."fresh"."0.2.4";
-  by-version."fresh"."0.2.4" = lib.makeOverridable self.buildNodePackage {
-    name = "fresh-0.2.4";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/fresh/-/fresh-0.2.4.tgz";
-        name = "fresh-0.2.4.tgz";
-        sha1 = "3582499206c9723714190edd74b4604feb4a614c";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."fresh" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "fresh" ];
-  };
-  by-spec."fstream"."~0.1.28" =
-    self.by-version."fstream"."0.1.31";
-  by-version."fstream"."0.1.31" = lib.makeOverridable self.buildNodePackage {
-    name = "fstream-0.1.31";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/fstream/-/fstream-0.1.31.tgz";
-        name = "fstream-0.1.31.tgz";
-        sha1 = "7337f058fbbbbefa8c9f561a28cab0849202c988";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."fstream" or []);
-    deps = {
-      "graceful-fs-3.0.7" = self.by-version."graceful-fs"."3.0.7";
-      "inherits-2.0.1" = self.by-version."inherits"."2.0.1";
-      "mkdirp-0.5.1" = self.by-version."mkdirp"."0.5.1";
-      "rimraf-2.3.4" = self.by-version."rimraf"."2.3.4";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "fstream" ];
-  };
-  by-spec."glob"."^4.4.2" =
-    self.by-version."glob"."4.5.3";
-  by-version."glob"."4.5.3" = lib.makeOverridable self.buildNodePackage {
-    name = "glob-4.5.3";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/glob/-/glob-4.5.3.tgz";
-        name = "glob-4.5.3.tgz";
-        sha1 = "c6cb73d3226c1efef04de3c56d012f03377ee15f";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."glob" or []);
-    deps = {
-      "inflight-1.0.4" = self.by-version."inflight"."1.0.4";
-      "inherits-2.0.1" = self.by-version."inherits"."2.0.1";
-      "minimatch-2.0.8" = self.by-version."minimatch"."2.0.8";
-      "once-1.3.2" = self.by-version."once"."1.3.2";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "glob" ];
-  };
-  by-spec."graceful-fs"."~3.0.2" =
-    self.by-version."graceful-fs"."3.0.7";
-  by-version."graceful-fs"."3.0.7" = lib.makeOverridable self.buildNodePackage {
-    name = "graceful-fs-3.0.7";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.7.tgz";
-        name = "graceful-fs-3.0.7.tgz";
-        sha1 = "e935be4b3e57892d289dc3bef7be8c02779d2b54";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."graceful-fs" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "graceful-fs" ];
-  };
-  by-spec."hawk"."~1.0.0" =
-    self.by-version."hawk"."1.0.0";
-  by-version."hawk"."1.0.0" = lib.makeOverridable self.buildNodePackage {
-    name = "hawk-1.0.0";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/hawk/-/hawk-1.0.0.tgz";
-        name = "hawk-1.0.0.tgz";
-        sha1 = "b90bb169807285411da7ffcb8dd2598502d3b52d";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."hawk" or []);
-    deps = {
-      "hoek-0.9.1" = self.by-version."hoek"."0.9.1";
-      "boom-0.4.2" = self.by-version."boom"."0.4.2";
-      "cryptiles-0.2.2" = self.by-version."cryptiles"."0.2.2";
-      "sntp-0.2.4" = self.by-version."sntp"."0.2.4";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "hawk" ];
-  };
-  by-spec."hoek"."0.9.x" =
-    self.by-version."hoek"."0.9.1";
-  by-version."hoek"."0.9.1" = lib.makeOverridable self.buildNodePackage {
-    name = "hoek-0.9.1";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz";
-        name = "hoek-0.9.1.tgz";
-        sha1 = "3d322462badf07716ea7eb85baf88079cddce505";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."hoek" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "hoek" ];
-  };
-  by-spec."http-signature"."~0.10.0" =
-    self.by-version."http-signature"."0.10.1";
-  by-version."http-signature"."0.10.1" = lib.makeOverridable self.buildNodePackage {
-    name = "http-signature-0.10.1";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/http-signature/-/http-signature-0.10.1.tgz";
-        name = "http-signature-0.10.1.tgz";
-        sha1 = "4fbdac132559aa8323121e540779c0a012b27e66";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."http-signature" or []);
-    deps = {
-      "assert-plus-0.1.5" = self.by-version."assert-plus"."0.1.5";
-      "asn1-0.1.11" = self.by-version."asn1"."0.1.11";
-      "ctype-0.5.3" = self.by-version."ctype"."0.5.3";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "http-signature" ];
-  };
-  by-spec."iconv-lite"."0.4.8" =
-    self.by-version."iconv-lite"."0.4.8";
-  by-version."iconv-lite"."0.4.8" = lib.makeOverridable self.buildNodePackage {
-    name = "iconv-lite-0.4.8";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.8.tgz";
-        name = "iconv-lite-0.4.8.tgz";
-        sha1 = "c6019a7595f2cefca702eab694a010bcd9298d20";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."iconv-lite" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "iconv-lite" ];
-  };
-  by-spec."inflight"."^1.0.4" =
-    self.by-version."inflight"."1.0.4";
-  by-version."inflight"."1.0.4" = lib.makeOverridable self.buildNodePackage {
-    name = "inflight-1.0.4";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz";
-        name = "inflight-1.0.4.tgz";
-        sha1 = "6cbb4521ebd51ce0ec0a936bfd7657ef7e9b172a";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."inflight" or []);
-    deps = {
-      "once-1.3.2" = self.by-version."once"."1.3.2";
-      "wrappy-1.0.1" = self.by-version."wrappy"."1.0.1";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "inflight" ];
-  };
-  by-spec."inherits"."2" =
-    self.by-version."inherits"."2.0.1";
-  by-version."inherits"."2.0.1" = lib.makeOverridable self.buildNodePackage {
-    name = "inherits-2.0.1";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz";
-        name = "inherits-2.0.1.tgz";
-        sha1 = "b17d08d326b4423e568eff719f91b0b1cbdf69f1";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."inherits" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "inherits" ];
-  };
-  by-spec."inherits"."~2.0.0" =
-    self.by-version."inherits"."2.0.1";
-  by-spec."ipaddr.js"."1.0.1" =
-    self.by-version."ipaddr.js"."1.0.1";
-  by-version."ipaddr.js"."1.0.1" = lib.makeOverridable self.buildNodePackage {
-    name = "ipaddr.js-1.0.1";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.0.1.tgz";
-        name = "ipaddr.js-1.0.1.tgz";
-        sha1 = "5f38801dc73e0400fc7076386f6ed5215fbd8f95";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."ipaddr.js" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "ipaddr.js" ];
-  };
-  by-spec."json-stringify-safe"."~5.0.0" =
-    self.by-version."json-stringify-safe"."5.0.1";
-  by-version."json-stringify-safe"."5.0.1" = lib.makeOverridable self.buildNodePackage {
-    name = "json-stringify-safe-5.0.1";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz";
-        name = "json-stringify-safe-5.0.1.tgz";
-        sha1 = "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."json-stringify-safe" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "json-stringify-safe" ];
-  };
-  by-spec."media-typer"."0.3.0" =
-    self.by-version."media-typer"."0.3.0";
-  by-version."media-typer"."0.3.0" = lib.makeOverridable self.buildNodePackage {
-    name = "media-typer-0.3.0";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz";
-        name = "media-typer-0.3.0.tgz";
-        sha1 = "8710d7af0aa626f8fffa1ce00168545263255748";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."media-typer" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "media-typer" ];
-  };
-  by-spec."merge-descriptors"."1.0.0" =
-    self.by-version."merge-descriptors"."1.0.0";
-  by-version."merge-descriptors"."1.0.0" = lib.makeOverridable self.buildNodePackage {
-    name = "merge-descriptors-1.0.0";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.0.tgz";
-        name = "merge-descriptors-1.0.0.tgz";
-        sha1 = "2169cf7538e1b0cc87fb88e1502d8474bbf79864";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."merge-descriptors" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "merge-descriptors" ];
-  };
-  by-spec."methods"."~1.1.1" =
-    self.by-version."methods"."1.1.1";
-  by-version."methods"."1.1.1" = lib.makeOverridable self.buildNodePackage {
-    name = "methods-1.1.1";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/methods/-/methods-1.1.1.tgz";
-        name = "methods-1.1.1.tgz";
-        sha1 = "17ea6366066d00c58e375b8ec7dfd0453c89822a";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."methods" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "methods" ];
-  };
-  by-spec."mime"."1.3.4" =
-    self.by-version."mime"."1.3.4";
-  by-version."mime"."1.3.4" = lib.makeOverridable self.buildNodePackage {
-    name = "mime-1.3.4";
-    bin = true;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/mime/-/mime-1.3.4.tgz";
-        name = "mime-1.3.4.tgz";
-        sha1 = "115f9e3b6b3daf2959983cb38f149a2d40eb5d53";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."mime" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "mime" ];
-  };
-  by-spec."mime"."~1.2.11" =
-    self.by-version."mime"."1.2.11";
-  by-version."mime"."1.2.11" = lib.makeOverridable self.buildNodePackage {
-    name = "mime-1.2.11";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/mime/-/mime-1.2.11.tgz";
-        name = "mime-1.2.11.tgz";
-        sha1 = "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."mime" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "mime" ];
-  };
-  by-spec."mime"."~1.2.9" =
-    self.by-version."mime"."1.2.11";
-  by-spec."mime-db"."~1.10.0" =
-    self.by-version."mime-db"."1.10.0";
-  by-version."mime-db"."1.10.0" = lib.makeOverridable self.buildNodePackage {
-    name = "mime-db-1.10.0";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/mime-db/-/mime-db-1.10.0.tgz";
-        name = "mime-db-1.10.0.tgz";
-        sha1 = "e6308063c758ebd12837874c3d1ea9170766b03b";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."mime-db" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "mime-db" ];
-  };
-  by-spec."mime-types"."~2.0.11" =
-    self.by-version."mime-types"."2.0.12";
-  by-version."mime-types"."2.0.12" = lib.makeOverridable self.buildNodePackage {
-    name = "mime-types-2.0.12";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/mime-types/-/mime-types-2.0.12.tgz";
-        name = "mime-types-2.0.12.tgz";
-        sha1 = "87ae9f124e94f8e440c93d1a72d0dccecdb71135";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."mime-types" or []);
-    deps = {
-      "mime-db-1.10.0" = self.by-version."mime-db"."1.10.0";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "mime-types" ];
-  };
-  by-spec."minimatch"."^2.0.1" =
-    self.by-version."minimatch"."2.0.8";
-  by-version."minimatch"."2.0.8" = lib.makeOverridable self.buildNodePackage {
-    name = "minimatch-2.0.8";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/minimatch/-/minimatch-2.0.8.tgz";
-        name = "minimatch-2.0.8.tgz";
-        sha1 = "0bc20f6bf3570a698ef0ddff902063c6cabda6bf";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."minimatch" or []);
-    deps = {
-      "brace-expansion-1.1.0" = self.by-version."brace-expansion"."1.1.0";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "minimatch" ];
-  };
-  by-spec."minimist"."0.0.8" =
-    self.by-version."minimist"."0.0.8";
-  by-version."minimist"."0.0.8" = lib.makeOverridable self.buildNodePackage {
-    name = "minimist-0.0.8";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz";
-        name = "minimist-0.0.8.tgz";
-        sha1 = "857fcabfc3397d2625b8228262e86aa7a011b05d";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."minimist" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "minimist" ];
-  };
-  by-spec."mkdirp"."0.5" =
-    self.by-version."mkdirp"."0.5.1";
-  by-version."mkdirp"."0.5.1" = lib.makeOverridable self.buildNodePackage {
-    name = "mkdirp-0.5.1";
-    bin = true;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz";
-        name = "mkdirp-0.5.1.tgz";
-        sha1 = "30057438eac6cf7f8c4767f38648d6697d75c903";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."mkdirp" or []);
-    deps = {
-      "minimist-0.0.8" = self.by-version."minimist"."0.0.8";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "mkdirp" ];
-  };
-  by-spec."ms"."0.7.1" =
-    self.by-version."ms"."0.7.1";
-  by-version."ms"."0.7.1" = lib.makeOverridable self.buildNodePackage {
-    name = "ms-0.7.1";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/ms/-/ms-0.7.1.tgz";
-        name = "ms-0.7.1.tgz";
-        sha1 = "9cd13c03adbff25b65effde7ce864ee952017098";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."ms" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "ms" ];
-  };
-  by-spec."nan"."~1.0.0" =
-    self.by-version."nan"."1.0.0";
-  by-version."nan"."1.0.0" = lib.makeOverridable self.buildNodePackage {
-    name = "nan-1.0.0";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/nan/-/nan-1.0.0.tgz";
-        name = "nan-1.0.0.tgz";
-        sha1 = "ae24f8850818d662fcab5acf7f3b95bfaa2ccf38";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."nan" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "nan" ];
-  };
-  by-spec."negotiator"."0.5.3" =
-    self.by-version."negotiator"."0.5.3";
-  by-version."negotiator"."0.5.3" = lib.makeOverridable self.buildNodePackage {
-    name = "negotiator-0.5.3";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/negotiator/-/negotiator-0.5.3.tgz";
-        name = "negotiator-0.5.3.tgz";
-        sha1 = "269d5c476810ec92edbe7b6c2f28316384f9a7e8";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."negotiator" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "negotiator" ];
-  };
-  by-spec."node-uuid"."~1.4.0" =
-    self.by-version."node-uuid"."1.4.3";
-  by-version."node-uuid"."1.4.3" = lib.makeOverridable self.buildNodePackage {
-    name = "node-uuid-1.4.3";
-    bin = true;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.3.tgz";
-        name = "node-uuid-1.4.3.tgz";
-        sha1 = "319bb7a56e7cb63f00b5c0cd7851cd4b4ddf1df9";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."node-uuid" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "node-uuid" ];
-  };
-  by-spec."oauth-sign"."~0.3.0" =
-    self.by-version."oauth-sign"."0.3.0";
-  by-version."oauth-sign"."0.3.0" = lib.makeOverridable self.buildNodePackage {
-    name = "oauth-sign-0.3.0";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.3.0.tgz";
-        name = "oauth-sign-0.3.0.tgz";
-        sha1 = "cb540f93bb2b22a7d5941691a288d60e8ea9386e";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."oauth-sign" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "oauth-sign" ];
-  };
-  by-spec."on-finished"."~2.2.1" =
-    self.by-version."on-finished"."2.2.1";
-  by-version."on-finished"."2.2.1" = lib.makeOverridable self.buildNodePackage {
-    name = "on-finished-2.2.1";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/on-finished/-/on-finished-2.2.1.tgz";
-        name = "on-finished-2.2.1.tgz";
-        sha1 = "5c85c1cc36299f78029653f667f27b6b99ebc029";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."on-finished" or []);
-    deps = {
-      "ee-first-1.1.0" = self.by-version."ee-first"."1.1.0";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "on-finished" ];
-  };
-  by-spec."once"."^1.3.0" =
-    self.by-version."once"."1.3.2";
-  by-version."once"."1.3.2" = lib.makeOverridable self.buildNodePackage {
-    name = "once-1.3.2";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/once/-/once-1.3.2.tgz";
-        name = "once-1.3.2.tgz";
-        sha1 = "d8feeca93b039ec1dcdee7741c92bdac5e28081b";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."once" or []);
-    deps = {
-      "wrappy-1.0.1" = self.by-version."wrappy"."1.0.1";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "once" ];
-  };
-  by-spec."options".">=0.0.5" =
-    self.by-version."options"."0.0.6";
-  by-version."options"."0.0.6" = lib.makeOverridable self.buildNodePackage {
-    name = "options-0.0.6";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/options/-/options-0.0.6.tgz";
-        name = "options-0.0.6.tgz";
-        sha1 = "ec22d312806bb53e731773e7cdaefcf1c643128f";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."options" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "options" ];
-  };
-  by-spec."parseurl"."~1.3.0" =
-    self.by-version."parseurl"."1.3.0";
-  by-version."parseurl"."1.3.0" = lib.makeOverridable self.buildNodePackage {
-    name = "parseurl-1.3.0";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/parseurl/-/parseurl-1.3.0.tgz";
-        name = "parseurl-1.3.0.tgz";
-        sha1 = "b58046db4223e145afa76009e61bac87cc2281b3";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."parseurl" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "parseurl" ];
-  };
-  by-spec."path-to-regexp"."0.1.3" =
-    self.by-version."path-to-regexp"."0.1.3";
-  by-version."path-to-regexp"."0.1.3" = lib.makeOverridable self.buildNodePackage {
-    name = "path-to-regexp-0.1.3";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.3.tgz";
-        name = "path-to-regexp-0.1.3.tgz";
-        sha1 = "21b9ab82274279de25b156ea08fd12ca51b8aecb";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."path-to-regexp" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "path-to-regexp" ];
-  };
-  by-spec."proxy-addr"."~1.0.8" =
-    self.by-version."proxy-addr"."1.0.8";
-  by-version."proxy-addr"."1.0.8" = lib.makeOverridable self.buildNodePackage {
-    name = "proxy-addr-1.0.8";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/proxy-addr/-/proxy-addr-1.0.8.tgz";
-        name = "proxy-addr-1.0.8.tgz";
-        sha1 = "db54ec878bcc1053d57646609219b3715678bafe";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."proxy-addr" or []);
-    deps = {
-      "forwarded-0.1.0" = self.by-version."forwarded"."0.1.0";
-      "ipaddr.js-1.0.1" = self.by-version."ipaddr.js"."1.0.1";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "proxy-addr" ];
-  };
-  by-spec."qs"."2.4.2" =
-    self.by-version."qs"."2.4.2";
-  by-version."qs"."2.4.2" = lib.makeOverridable self.buildNodePackage {
-    name = "qs-2.4.2";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/qs/-/qs-2.4.2.tgz";
-        name = "qs-2.4.2.tgz";
-        sha1 = "f7ce788e5777df0b5010da7f7c4e73ba32470f5a";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."qs" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "qs" ];
-  };
-  by-spec."qs"."~0.6.0" =
-    self.by-version."qs"."0.6.6";
-  by-version."qs"."0.6.6" = lib.makeOverridable self.buildNodePackage {
-    name = "qs-0.6.6";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/qs/-/qs-0.6.6.tgz";
-        name = "qs-0.6.6.tgz";
-        sha1 = "6e015098ff51968b8a3c819001d5f2c89bc4b107";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."qs" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "qs" ];
-  };
-  by-spec."range-parser"."~1.0.2" =
-    self.by-version."range-parser"."1.0.2";
-  by-version."range-parser"."1.0.2" = lib.makeOverridable self.buildNodePackage {
-    name = "range-parser-1.0.2";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/range-parser/-/range-parser-1.0.2.tgz";
-        name = "range-parser-1.0.2.tgz";
-        sha1 = "06a12a42e5131ba8e457cd892044867f2344e549";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."range-parser" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "range-parser" ];
-  };
-  by-spec."raw-body"."~2.0.1" =
-    self.by-version."raw-body"."2.0.1";
-  by-version."raw-body"."2.0.1" = lib.makeOverridable self.buildNodePackage {
-    name = "raw-body-2.0.1";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/raw-body/-/raw-body-2.0.1.tgz";
-        name = "raw-body-2.0.1.tgz";
-        sha1 = "2b70a3ffd1681c0521bae73454e0ccbc785d378e";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."raw-body" or []);
-    deps = {
-      "bytes-2.0.1" = self.by-version."bytes"."2.0.1";
-      "iconv-lite-0.4.8" = self.by-version."iconv-lite"."0.4.8";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "raw-body" ];
-  };
-  by-spec."request"."~2.34.0" =
-    self.by-version."request"."2.34.0";
-  by-version."request"."2.34.0" = lib.makeOverridable self.buildNodePackage {
-    name = "request-2.34.0";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/request/-/request-2.34.0.tgz";
-        name = "request-2.34.0.tgz";
-        sha1 = "b5d8b9526add4a2d4629f4d417124573996445ae";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."request" or []);
-    deps = {
-      "qs-0.6.6" = self.by-version."qs"."0.6.6";
-      "json-stringify-safe-5.0.1" = self.by-version."json-stringify-safe"."5.0.1";
-      "forever-agent-0.5.2" = self.by-version."forever-agent"."0.5.2";
-      "node-uuid-1.4.3" = self.by-version."node-uuid"."1.4.3";
-      "mime-1.2.11" = self.by-version."mime"."1.2.11";
-      "tough-cookie-1.1.0" = self.by-version."tough-cookie"."1.1.0";
-      "form-data-0.1.4" = self.by-version."form-data"."0.1.4";
-      "tunnel-agent-0.3.0" = self.by-version."tunnel-agent"."0.3.0";
-      "http-signature-0.10.1" = self.by-version."http-signature"."0.10.1";
-      "oauth-sign-0.3.0" = self.by-version."oauth-sign"."0.3.0";
-      "hawk-1.0.0" = self.by-version."hawk"."1.0.0";
-      "aws-sign2-0.5.0" = self.by-version."aws-sign2"."0.5.0";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "request" ];
-  };
-  "request" = self.by-version."request"."2.34.0";
-  by-spec."rimraf"."2" =
-    self.by-version."rimraf"."2.3.4";
-  by-version."rimraf"."2.3.4" = lib.makeOverridable self.buildNodePackage {
-    name = "rimraf-2.3.4";
-    bin = true;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/rimraf/-/rimraf-2.3.4.tgz";
-        name = "rimraf-2.3.4.tgz";
-        sha1 = "82d9bc1b2fcf31e205ac7b28138a025d08e9159a";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."rimraf" or []);
-    deps = {
-      "glob-4.5.3" = self.by-version."glob"."4.5.3";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "rimraf" ];
-  };
-  by-spec."send"."0.12.3" =
-    self.by-version."send"."0.12.3";
-  by-version."send"."0.12.3" = lib.makeOverridable self.buildNodePackage {
-    name = "send-0.12.3";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/send/-/send-0.12.3.tgz";
-        name = "send-0.12.3.tgz";
-        sha1 = "cd12dc58fde21e4f91902b39b2fda05a7a6d9bdc";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."send" or []);
-    deps = {
-      "debug-2.2.0" = self.by-version."debug"."2.2.0";
-      "depd-1.0.1" = self.by-version."depd"."1.0.1";
-      "destroy-1.0.3" = self.by-version."destroy"."1.0.3";
-      "escape-html-1.0.1" = self.by-version."escape-html"."1.0.1";
-      "etag-1.6.0" = self.by-version."etag"."1.6.0";
-      "fresh-0.2.4" = self.by-version."fresh"."0.2.4";
-      "mime-1.3.4" = self.by-version."mime"."1.3.4";
-      "ms-0.7.1" = self.by-version."ms"."0.7.1";
-      "on-finished-2.2.1" = self.by-version."on-finished"."2.2.1";
-      "range-parser-1.0.2" = self.by-version."range-parser"."1.0.2";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "send" ];
-  };
-  by-spec."serve-static"."~1.9.3" =
-    self.by-version."serve-static"."1.9.3";
-  by-version."serve-static"."1.9.3" = lib.makeOverridable self.buildNodePackage {
-    name = "serve-static-1.9.3";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/serve-static/-/serve-static-1.9.3.tgz";
-        name = "serve-static-1.9.3.tgz";
-        sha1 = "5f8da07323ad385ff3dc541f1a7917b2e436eb57";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."serve-static" or []);
-    deps = {
-      "escape-html-1.0.1" = self.by-version."escape-html"."1.0.1";
-      "parseurl-1.3.0" = self.by-version."parseurl"."1.3.0";
-      "send-0.12.3" = self.by-version."send"."0.12.3";
-      "utils-merge-1.0.0" = self.by-version."utils-merge"."1.0.0";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "serve-static" ];
-  };
-  by-spec."sntp"."0.2.x" =
-    self.by-version."sntp"."0.2.4";
-  by-version."sntp"."0.2.4" = lib.makeOverridable self.buildNodePackage {
-    name = "sntp-0.2.4";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz";
-        name = "sntp-0.2.4.tgz";
-        sha1 = "fb885f18b0f3aad189f824862536bceeec750900";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."sntp" or []);
-    deps = {
-      "hoek-0.9.1" = self.by-version."hoek"."0.9.1";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "sntp" ];
-  };
-  by-spec."tar"."~0.1.19" =
-    self.by-version."tar"."0.1.20";
-  by-version."tar"."0.1.20" = lib.makeOverridable self.buildNodePackage {
-    name = "tar-0.1.20";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/tar/-/tar-0.1.20.tgz";
-        name = "tar-0.1.20.tgz";
-        sha1 = "42940bae5b5f22c74483699126f9f3f27449cb13";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."tar" or []);
-    deps = {
-      "block-stream-0.0.8" = self.by-version."block-stream"."0.0.8";
-      "fstream-0.1.31" = self.by-version."fstream"."0.1.31";
-      "inherits-2.0.1" = self.by-version."inherits"."2.0.1";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "tar" ];
-  };
-  "tar" = self.by-version."tar"."0.1.20";
-  by-spec."tinycolor"."0.x" =
-    self.by-version."tinycolor"."0.0.1";
-  by-version."tinycolor"."0.0.1" = lib.makeOverridable self.buildNodePackage {
-    name = "tinycolor-0.0.1";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/tinycolor/-/tinycolor-0.0.1.tgz";
-        name = "tinycolor-0.0.1.tgz";
-        sha1 = "320b5a52d83abb5978d81a3e887d4aefb15a6164";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."tinycolor" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "tinycolor" ];
-  };
-  by-spec."tough-cookie".">=0.12.0" =
-    self.by-version."tough-cookie"."1.1.0";
-  by-version."tough-cookie"."1.1.0" = lib.makeOverridable self.buildNodePackage {
-    name = "tough-cookie-1.1.0";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/tough-cookie/-/tough-cookie-1.1.0.tgz";
-        name = "tough-cookie-1.1.0.tgz";
-        sha1 = "126d2490e66ae5286b6863debd4a341076915954";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."tough-cookie" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "tough-cookie" ];
-  };
-  by-spec."tunnel-agent"."~0.3.0" =
-    self.by-version."tunnel-agent"."0.3.0";
-  by-version."tunnel-agent"."0.3.0" = lib.makeOverridable self.buildNodePackage {
-    name = "tunnel-agent-0.3.0";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.3.0.tgz";
-        name = "tunnel-agent-0.3.0.tgz";
-        sha1 = "ad681b68f5321ad2827c4cfb1b7d5df2cfe942ee";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."tunnel-agent" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "tunnel-agent" ];
-  };
-  by-spec."type-is"."~1.6.2" =
-    self.by-version."type-is"."1.6.2";
-  by-version."type-is"."1.6.2" = lib.makeOverridable self.buildNodePackage {
-    name = "type-is-1.6.2";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/type-is/-/type-is-1.6.2.tgz";
-        name = "type-is-1.6.2.tgz";
-        sha1 = "694e83e5d110417e681cea278227f264ae406e33";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."type-is" or []);
-    deps = {
-      "media-typer-0.3.0" = self.by-version."media-typer"."0.3.0";
-      "mime-types-2.0.12" = self.by-version."mime-types"."2.0.12";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "type-is" ];
-  };
-  by-spec."utils-merge"."1.0.0" =
-    self.by-version."utils-merge"."1.0.0";
-  by-version."utils-merge"."1.0.0" = lib.makeOverridable self.buildNodePackage {
-    name = "utils-merge-1.0.0";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz";
-        name = "utils-merge-1.0.0.tgz";
-        sha1 = "0294fb922bb9375153541c4f7096231f287c8af8";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."utils-merge" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "utils-merge" ];
-  };
-  by-spec."vary"."~1.0.0" =
-    self.by-version."vary"."1.0.0";
-  by-version."vary"."1.0.0" = lib.makeOverridable self.buildNodePackage {
-    name = "vary-1.0.0";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/vary/-/vary-1.0.0.tgz";
-        name = "vary-1.0.0.tgz";
-        sha1 = "c5e76cec20d3820d8f2a96e7bee38731c34da1e7";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."vary" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "vary" ];
-  };
-  by-spec."wrappy"."1" =
-    self.by-version."wrappy"."1.0.1";
-  by-version."wrappy"."1.0.1" = lib.makeOverridable self.buildNodePackage {
-    name = "wrappy-1.0.1";
-    bin = false;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz";
-        name = "wrappy-1.0.1.tgz";
-        sha1 = "1e65969965ccbc2db4548c6b84a6f2c5aedd4739";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."wrappy" or []);
-    deps = {
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "wrappy" ];
-  };
-  by-spec."ws"."~0.4.32" =
-    self.by-version."ws"."0.4.32";
-  by-version."ws"."0.4.32" = lib.makeOverridable self.buildNodePackage {
-    name = "ws-0.4.32";
-    bin = true;
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/ws/-/ws-0.4.32.tgz";
-        name = "ws-0.4.32.tgz";
-        sha1 = "787a6154414f3c99ed83c5772153b20feb0cec32";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."ws" or []);
-    deps = {
-      "commander-2.1.0" = self.by-version."commander"."2.1.0";
-      "nan-1.0.0" = self.by-version."nan"."1.0.0";
-      "tinycolor-0.0.1" = self.by-version."tinycolor"."0.0.1";
-      "options-0.0.6" = self.by-version."options"."0.0.6";
-    };
-    peerDependencies = [
-    ];
-    passthru.names = [ "ws" ];
-  };
-  "ws" = self.by-version."ws"."0.4.32";
-}
+{pkgs ? import <nixpkgs> {
+    inherit system;
+  }, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-6_x"}:
+
+let
+  nodeEnv = import ../../../development/node-packages/node-env.nix {
+    inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile;
+    inherit nodejs;
+  };
+in
+import ./node-packages.nix {
+  inherit (pkgs) fetchurl fetchgit;
+  inherit nodeEnv;
+}
\ No newline at end of file
diff --git a/pkgs/applications/misc/keepassx/community.nix b/pkgs/applications/misc/keepassx/community.nix
index 0444b1d96d2..72d9c7d2fb5 100644
--- a/pkgs/applications/misc/keepassx/community.nix
+++ b/pkgs/applications/misc/keepassx/community.nix
@@ -6,7 +6,7 @@
 with stdenv.lib;
 
 stdenv.mkDerivation rec {
-  name = "keepassx-community-${version}";
+  name = "keepassxc-${version}";
   version = "2.2.2";
 
   src = fetchFromGitHub {
diff --git a/pkgs/applications/misc/mediainfo-gui/default.nix b/pkgs/applications/misc/mediainfo-gui/default.nix
index fc702f249de..0167132db78 100644
--- a/pkgs/applications/misc/mediainfo-gui/default.nix
+++ b/pkgs/applications/misc/mediainfo-gui/default.nix
@@ -2,11 +2,11 @@
 , desktop_file_utils, libSM, imagemagick }:
 
 stdenv.mkDerivation rec {
-  version = "0.7.99";
+  version = "17.10";
   name = "mediainfo-gui-${version}";
   src = fetchurl {
     url = "https://mediaarea.net/download/source/mediainfo/${version}/mediainfo_${version}.tar.xz";
-    sha256 = "127d6wsrq3wg3ibbb28m26wrm54qbkv8h8xycanvml6ys4zqsc6a";
+    sha256 = "1yvh4r19kk3bzzgnr4ikrjxqldr6860s35sh4bqr51c7l77k048c";
   };
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
@@ -15,6 +15,8 @@ stdenv.mkDerivation rec {
 
   sourceRoot = "./MediaInfo/Project/GNU/GUI/";
 
+  enableParallelBuilding = true;
+
   meta = with stdenv.lib; {
     description = "Supplies technical and tag information about a video or audio file (GUI version)";
     longDescription = ''
diff --git a/pkgs/applications/misc/mediainfo/default.nix b/pkgs/applications/misc/mediainfo/default.nix
index 84fef1b3983..e6175356348 100644
--- a/pkgs/applications/misc/mediainfo/default.nix
+++ b/pkgs/applications/misc/mediainfo/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, autoreconfHook, pkgconfig, libzen, libmediainfo, zlib }:
 
 stdenv.mkDerivation rec {
-  version = "0.7.99";
+  version = "17.10";
   name = "mediainfo-${version}";
   src = fetchurl {
     url = "https://mediaarea.net/download/source/mediainfo/${version}/mediainfo_${version}.tar.xz";
-    sha256 = "127d6wsrq3wg3ibbb28m26wrm54qbkv8h8xycanvml6ys4zqsc6a";
+    sha256 = "1yvh4r19kk3bzzgnr4ikrjxqldr6860s35sh4bqr51c7l77k048c";
   };
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
@@ -15,6 +15,8 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--with-libmediainfo=${libmediainfo}" ];
 
+  enableParallelBuilding = true;
+
   meta = with stdenv.lib; {
     description = "Supplies technical and tag information about a video or audio file";
     longDescription = ''
diff --git a/pkgs/applications/networking/browsers/opera/default.nix b/pkgs/applications/networking/browsers/opera/default.nix
index 52a2ce9164c..0852b5c9d43 100644
--- a/pkgs/applications/networking/browsers/opera/default.nix
+++ b/pkgs/applications/networking/browsers/opera/default.nix
@@ -37,7 +37,7 @@
 let
 
   mirror = https://get.geo.opera.com/pub/opera/desktop;
-  version = "46.0.2597.39";
+  version = "48.0.2685.52";
 
   rpath = stdenv.lib.makeLibraryPath [
 
@@ -87,19 +87,10 @@ in stdenv.mkDerivation {
 
   name = "opera-${version}";
 
-  src =
-    #if stdenv.system == "i686-linux" then
-    #  fetchurl {
-    #    url = "${mirror}/${version}/linux/opera-stable_${version}_i386.deb";
-    #    sha256 = "...";
-    #  }
-    #else 
-    if stdenv.system == "x86_64-linux" then
-      fetchurl {
-        url = "${mirror}/${version}/linux/opera-stable_${version}_amd64.deb";
-        sha256 = "1ladvqilm5rr222wjybvribnyii2l0p8jbsd10xr06wps63g1kia";
-      }
-    else throw "Opera is not supported on ${stdenv.system} (only x86_64 linux is supported)";
+  src = fetchurl {
+    url = "${mirror}/${version}/linux/opera-stable_${version}_amd64.deb";
+    sha256 = "027njqh2as4d0xsnvzamqiplghb8cxqnc19y0vqkvjnsw57v828p";
+  };
 
   unpackCmd = "${dpkg}/bin/dpkg-deb -x $curSrc .";
 
@@ -123,6 +114,7 @@ in stdenv.mkDerivation {
   meta = {
     homepage = http://www.opera.com;
     description = "Web browser";
+    platforms = [ "x86_64-linux" ];
     license = stdenv.lib.licenses.unfree;
   };
 }
diff --git a/pkgs/applications/networking/browsers/surf/default.nix b/pkgs/applications/networking/browsers/surf/default.nix
index 04d475f36f0..1aa9bf044b0 100644
--- a/pkgs/applications/networking/browsers/surf/default.nix
+++ b/pkgs/applications/networking/browsers/surf/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   version = "2.0";
 
   src = fetchurl {
-    url = "http://dl.suckless.org/surf/surf-${version}.tar.gz";
+    url = "https://dl.suckless.org/surf/surf-${version}.tar.gz";
     sha256 = "07cmajyafljigy10d21kkyvv5jf3hxkx06pz3rwwk3y3c9x4rvps";
   };
 
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
       possible to embed it in another application. Furthermore, one can point
       surf to another URI by setting its XProperties.
     '';
-    homepage = http://surf.suckless.org;
+    homepage = https://surf.suckless.org;
     license = licenses.mit;
     platforms = webkitgtk.meta.platforms;
     maintainers = with maintainers; [ joachifm ];
diff --git a/pkgs/applications/networking/cluster/mesos/default.nix b/pkgs/applications/networking/cluster/mesos/default.nix
index 116e7432690..90924227393 100644
--- a/pkgs/applications/networking/cluster/mesos/default.nix
+++ b/pkgs/applications/networking/cluster/mesos/default.nix
@@ -60,6 +60,8 @@ in stdenv.mkDerivation rec {
       "CXXFLAGS=-O2 -Wno-error=strict-aliasing"
     )
 
+    substituteInPlace 3rdparty/stout/include/stout/jsonify.hpp \
+      --replace '<xlocale.h>' '<locale.h>'
     # Fix cases where makedev(),major(),minor() are referenced through
     # <sys/types.h> instead of <sys/sysmacros.h>
     sed 1i'#include <sys/sysmacros.h>' -i src/linux/fs.cpp
diff --git a/pkgs/applications/networking/gns3/default.nix b/pkgs/applications/networking/gns3/default.nix
index bee3062a5a2..6e86cfb3d02 100644
--- a/pkgs/applications/networking/gns3/default.nix
+++ b/pkgs/applications/networking/gns3/default.nix
@@ -2,7 +2,7 @@
 
 let
   stableVersion = "2.0.3";
-  previewVersion = "2.1.0rc3";
+  previewVersion = "2.1.0rc4";
   addVersion = args:
     let version = if args.stable then stableVersion else previewVersion;
         branch = if args.stable then "stable" else "preview";
@@ -16,7 +16,7 @@ in {
   };
   guiPreview = mkGui {
     stable = false;
-    sha256Hash = "0yc5lr01xb7lk4dsrwx79mimbr91vldpvqbrx37j3kym6p5m84cn";
+    sha256Hash = "10p8i45n6qsf431d0xpy5dk3g5qh6zdlnfj82jn9xdyccgxs4x3s";
   };
 
   serverStable = mkServer {
@@ -25,6 +25,6 @@ in {
   };
   serverPreview = mkServer {
     stable = false;
-    sha256Hash = "1lac88d9cmlhrwmlvxv1sk86600rwznw3lpsm440bax6qbdfcis3";
+    sha256Hash = "1z8a3s90k86vmi4rwsd3v74gwvml68ci6f3zgxaji3z1sm22zcyd";
   };
 }
diff --git a/pkgs/applications/networking/gns3/server.nix b/pkgs/applications/networking/gns3/server.nix
index 9d7bf6f5a3a..6e3280b9901 100644
--- a/pkgs/applications/networking/gns3/server.nix
+++ b/pkgs/applications/networking/gns3/server.nix
@@ -4,7 +4,23 @@
 
 let
   pythonPackages = python3Packages;
-  yarl = if (!stable) then pythonPackages.yarl
+  # TODO: Not sure if all these overwrites are really required...
+  # Upstream seems to have some reasons (bugs, incompatibilities) though.
+  multidict_3_1_3 =
+    (stdenv.lib.overrideDerivation pythonPackages.multidict (oldAttrs:
+      rec {
+        pname = "multidict";
+        version = "3.1.3";
+        name = "${pname}-${version}";
+        src = pythonPackages.fetchPypi {
+          inherit pname version;
+          sha256 = "04kdxh19m41c6vbshwk8jfbidsfsqn7mn0abvx09nyg78sh80pw7";
+        };
+        doInstallCheck = false;
+      }));
+  yarl = if (!stable)
+    then (stdenv.lib.overrideDerivation pythonPackages.yarl (oldAttrs:
+      { propagatedBuildInputs = [ multidict_3_1_3 ]; }))
     else (stdenv.lib.overrideDerivation pythonPackages.yarl (oldAttrs:
       rec {
         pname = "yarl";
@@ -15,7 +31,19 @@ let
           sha256 = "1v2dsmr7bqp0yx51pwhbxyvzza8m2f88prsnbd926mi6ah38p0d7";
         };
       }));
-  aiohttp = if (!stable) then pythonPackages.aiohttp
+  aiohttp = if (!stable)
+    then (stdenv.lib.overrideDerivation pythonPackages.aiohttp (oldAttrs:
+      rec {
+        pname = "aiohttp";
+        version = "2.2.5";
+        name = "${pname}-${version}";
+        src = pythonPackages.fetchPypi {
+          inherit pname version;
+          sha256 = "1g6kzkf5in0briyscwxsihgps833dq2ggcq6lfh1hq95ck8zsnxg";
+        };
+        propagatedBuildInputs = [ yarl multidict_3_1_3 ]
+          ++ (with pythonPackages; [ async-timeout chardet ]);
+      }))
     else (stdenv.lib.overrideDerivation pythonPackages.aiohttp (oldAttrs:
       rec {
         pname = "aiohttp";
@@ -28,7 +56,9 @@ let
         propagatedBuildInputs = [ yarl ]
           ++ (with pythonPackages; [ async-timeout chardet multidict ]);
       }));
-  aiohttp-cors = if (!stable) then pythonPackages.aiohttp-cors
+  aiohttp-cors = if (!stable)
+    then (stdenv.lib.overrideDerivation pythonPackages.aiohttp-cors (oldAttrs:
+      { propagatedBuildInputs = [ aiohttp ]; }))
     else (stdenv.lib.overrideDerivation pythonPackages.aiohttp-cors (oldAttrs:
       rec {
         pname = "aiohttp-cors";
diff --git a/pkgs/applications/networking/mailreaders/mailnag/default.nix b/pkgs/applications/networking/mailreaders/mailnag/default.nix
index 281bc690bad..b1ca80fc7e4 100644
--- a/pkgs/applications/networking/mailreaders/mailnag/default.nix
+++ b/pkgs/applications/networking/mailreaders/mailnag/default.nix
@@ -2,11 +2,13 @@
 , gdk_pixbuf, libnotify, gst_all_1
 , libgnome_keyring3, networkmanager
 , wrapGAppsHook, gnome3
-, withGnomeKeyring ? false
-, withNetworkManager ? true
+# otherwise passwords are stored unencrypted
+, withGnomeKeyring ? true
 }:
 
-pythonPackages.buildPythonApplication rec {
+let
+  inherit (pythonPackages) python;
+in pythonPackages.buildPythonApplication rec {
   name = "mailnag-${version}";
   version = "1.2.1";
 
@@ -20,8 +22,7 @@ pythonPackages.buildPythonApplication rec {
     gst_all_1.gst-plugins-base gst_all_1.gst-plugins-good
     gst_all_1.gst-plugins-bad
     gnome3.defaultIconTheme
-  ] ++ stdenv.lib.optional withGnomeKeyring libgnome_keyring3
-    ++ stdenv.lib.optional withNetworkManager networkmanager;
+  ] ++ stdenv.lib.optional withGnomeKeyring libgnome_keyring3;
 
   nativeBuildInputs = [
     wrapGAppsHook
@@ -31,6 +32,10 @@ pythonPackages.buildPythonApplication rec {
     pygobject3 dbus-python pyxdg
   ];
 
+  buildPhase = "";
+
+  installPhase = "${python}/bin/python setup.py install --prefix=$out";
+
   doCheck = false;
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/networking/syncthing/default.nix b/pkgs/applications/networking/syncthing/default.nix
index f2ffcac452e..ecdecd07eeb 100644
--- a/pkgs/applications/networking/syncthing/default.nix
+++ b/pkgs/applications/networking/syncthing/default.nix
@@ -1,14 +1,14 @@
 { stdenv, lib, fetchFromGitHub, go, procps, removeReferencesTo }:
 
 stdenv.mkDerivation rec {
-  version = "0.14.39";
+  version = "0.14.40";
   name = "syncthing-${version}";
 
   src = fetchFromGitHub {
     owner  = "syncthing";
     repo   = "syncthing";
     rev    = "v${version}";
-    sha256 = "0bq2vdfnl77qldg1zvfhdbmhsj80qz8pds4slqlwjmmjmk19sqnh";
+    sha256 = "0fd4k09sb91d1bjqj2v1fh7raq98fdw45aaa58kramwhidsf9sy5";
   };
 
   buildInputs = [ go removeReferencesTo ];
diff --git a/pkgs/applications/science/logic/glucose/default.nix b/pkgs/applications/science/logic/glucose/default.nix
index 5b318be1664..a0035f96539 100644
--- a/pkgs/applications/science/logic/glucose/default.nix
+++ b/pkgs/applications/science/logic/glucose/default.nix
@@ -1,19 +1,21 @@
 { stdenv, fetchurl, zlib }:
 stdenv.mkDerivation rec {
   name = "glucose-${version}";
-  version = "4.0";
+  version = "4.1";
 
   src = fetchurl {
-    url = "http://www.labri.fr/perso/lsimon/downloads/softwares/glucose-syrup.tgz";
-    sha256 = "0bq5l2jabhdfhng002qfk0mcj4pfi1v5853x3c7igwfrgx0jmfld";
+    url = "http://www.labri.fr/perso/lsimon/downloads/softwares/glucose-syrup-${version}.tgz";
+    sha256 = "0aahrkaq7n0z986fpqz66yz946nxardfi6dh8calzcfjpvqiraji";
   };
 
   buildInputs = [ zlib ];
 
-  sourceRoot = "glucose-syrup/simp";
+  sourceRoot = "glucose-syrup-${version}/simp";
   makeFlags = [ "r" ];
   installPhase = ''
     install -Dm0755 glucose_release $out/bin/glucose
+    mkdir -p "$out/share/doc/${name}/"
+    install -Dm0755 ../{LICEN?E,README*,Changelog*} "$out/share/doc/${name}/"
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/science/logic/glucose/syrup.nix b/pkgs/applications/science/logic/glucose/syrup.nix
index 7604ebc1a3d..fd59a53fd2a 100644
--- a/pkgs/applications/science/logic/glucose/syrup.nix
+++ b/pkgs/applications/science/logic/glucose/syrup.nix
@@ -1,19 +1,18 @@
-{ stdenv, fetchurl, zlib }:
+{ stdenv, fetchurl, zlib, glucose }:
 stdenv.mkDerivation rec {
   name = "glucose-syrup-${version}";
-  version = "4.0";
+  version = glucose.version;
 
-  src = fetchurl {
-    url = "http://www.labri.fr/perso/lsimon/downloads/softwares/glucose-syrup.tgz";
-    sha256 = "0bq5l2jabhdfhng002qfk0mcj4pfi1v5853x3c7igwfrgx0jmfld";
-  };
+  src = glucose.src;
 
   buildInputs = [ zlib ];
 
-  sourceRoot = "glucose-syrup/parallel";
+  sourceRoot = "glucose-syrup-${version}/parallel";
   makeFlags = [ "r" ];
   installPhase = ''
     install -Dm0755 glucose-syrup_release $out/bin/glucose-syrup
+    mkdir -p "$out/share/doc/${name}/"
+    install -Dm0755 ../{LICEN?E,README*,Changelog*} "$out/share/doc/${name}/"
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/version-management/cvs/CVE-2017-12836.patch b/pkgs/applications/version-management/cvs/CVE-2017-12836.patch
new file mode 100644
index 00000000000..95007942368
--- /dev/null
+++ b/pkgs/applications/version-management/cvs/CVE-2017-12836.patch
@@ -0,0 +1,29 @@
+--- a/src/rsh-client.c.orig	2005-10-02 17:17:21.000000000 +0200
++++ b/src/rsh-client.c	2017-11-07 16:56:06.957370469 +0100
+@@ -53,7 +53,7 @@
+     char *cvs_server = (root->cvs_server != NULL
+ 			? root->cvs_server : getenv ("CVS_SERVER"));
+     int i = 0;
+-    /* This needs to fit "rsh", "-b", "-l", "USER", "host",
++    /* This needs to fit "rsh", "-b", "-l", "USER", "--", "host",
+        "cmd (w/ args)", and NULL.  We leave some room to grow. */
+     char *rsh_argv[10];
+ 
+@@ -97,6 +97,9 @@
+ 	rsh_argv[i++] = root->username;
+     }
+ 
++    /* Only non-option arguments from here. (CVE-2017-12836) */
++    rsh_argv[i++] = "--";
++
+     rsh_argv[i++] = root->hostname;
+     rsh_argv[i++] = cvs_server;
+     rsh_argv[i++] = "server";
+@@ -171,6 +174,7 @@
+ 	    *p++ = root->username;
+ 	}
+ 
++	*p++ = "--";
+ 	*p++ = root->hostname;
+ 	*p++ = command;
+ 	*p++ = NULL;
diff --git a/pkgs/applications/version-management/cvs/default.nix b/pkgs/applications/version-management/cvs/default.nix
index 8c69517a750..a330db6a8d6 100644
--- a/pkgs/applications/version-management/cvs/default.nix
+++ b/pkgs/applications/version-management/cvs/default.nix
@@ -11,6 +11,7 @@ stdenv.mkDerivation {
   patches = [
     ./getcwd-chroot.patch
     ./CVE-2012-0804.patch
+    ./CVE-2017-12836.patch
   ];
 
   hardeningDisable = [ "fortify" "format" ];
diff --git a/pkgs/applications/version-management/gitaly/Gemfile b/pkgs/applications/version-management/gitaly/Gemfile
index 88b7120d6f9..7e8f9f2b255 100644
--- a/pkgs/applications/version-management/gitaly/Gemfile
+++ b/pkgs/applications/version-management/gitaly/Gemfile
@@ -3,3 +3,7 @@ source 'https://rubygems.org'
 gem 'github-linguist', '~> 4.7.0', require: 'linguist'
 gem 'gitaly-proto', '~> 0.37.0', require: 'gitaly'
 gem 'activesupport'
+
+group :development, :test do
+  gem 'gitlab-styles', '~> 2.0.0', require: false
+end
diff --git a/pkgs/applications/version-management/gitaly/Gemfile.lock b/pkgs/applications/version-management/gitaly/Gemfile.lock
index 68433fc6878..5ea14855b97 100644
--- a/pkgs/applications/version-management/gitaly/Gemfile.lock
+++ b/pkgs/applications/version-management/gitaly/Gemfile.lock
@@ -8,6 +8,7 @@ GEM
       tzinfo (~> 1.1)
     addressable (2.5.1)
       public_suffix (~> 2.0, >= 2.0.2)
+    ast (2.3.0)
     charlock_holmes (0.7.5)
     concurrent-ruby (1.0.5)
     escape_utils (1.1.1)
@@ -21,6 +22,10 @@ GEM
       escape_utils (~> 1.1.0)
       mime-types (>= 1.19)
       rugged (>= 0.23.0b)
+    gitlab-styles (2.0.0)
+      rubocop (~> 0.49)
+      rubocop-gitlab-security (~> 0.1.0)
+      rubocop-rspec (~> 1.15)
     google-protobuf (3.4.0.2)
     googleauth (0.5.3)
       faraday (~> 0.12)
@@ -47,7 +52,26 @@ GEM
     multi_json (1.12.1)
     multipart-post (2.0.0)
     os (0.9.6)
+    parallel (1.12.0)
+    parser (2.4.0.0)
+      ast (~> 2.2)
+    powerpack (0.1.1)
     public_suffix (2.0.5)
+    rainbow (2.2.2)
+      rake
+    rake (12.1.0)
+    rubocop (0.50.0)
+      parallel (~> 1.10)
+      parser (>= 2.3.3.1, < 3.0)
+      powerpack (~> 0.1)
+      rainbow (>= 2.2.2, < 3.0)
+      ruby-progressbar (~> 1.7)
+      unicode-display_width (~> 1.0, >= 1.0.1)
+    rubocop-gitlab-security (0.1.0)
+      rubocop (>= 0.47.1)
+    rubocop-rspec (1.17.0)
+      rubocop (>= 0.50.0)
+    ruby-progressbar (1.8.3)
     rugged (0.26.0)
     signet (0.7.3)
       addressable (~> 2.3)
@@ -57,6 +81,7 @@ GEM
     thread_safe (0.3.6)
     tzinfo (1.2.2)
       thread_safe (~> 0.1)
+    unicode-display_width (1.3.0)
 
 PLATFORMS
   ruby
@@ -65,6 +90,7 @@ DEPENDENCIES
   activesupport
   gitaly-proto (~> 0.37.0)
   github-linguist (~> 4.7.0)
+  gitlab-styles (~> 2.0.0)
 
 BUNDLED WITH
    1.15.4
diff --git a/pkgs/applications/version-management/gitaly/default.nix b/pkgs/applications/version-management/gitaly/default.nix
index ba8831d370c..63e5758107f 100644
--- a/pkgs/applications/version-management/gitaly/default.nix
+++ b/pkgs/applications/version-management/gitaly/default.nix
@@ -7,14 +7,14 @@ let
     gemdir = ./.;
   };
 in buildGoPackage rec {
-  version = "0.38.0";
+  version = "0.43.1";
   name = "gitaly-${version}";
 
   src = fetchFromGitLab {
     owner = "gitlab-org";
     repo = "gitaly";
     rev = "v${version}";
-    sha256 = "02s5gjxbjvm990n4h5zkyqj71a9mp4yj83hfl8mma0g7gx00icsf";
+    sha256 = "19ggfc5nwv8q1wq739ab8qdfdngpi33431dgfa9593p6ad7v6hyq";
   };
 
   goPackagePath = "gitlab.com/gitlab-org/gitaly";
diff --git a/pkgs/applications/version-management/gitaly/gemset.nix b/pkgs/applications/version-management/gitaly/gemset.nix
index 6dc3eb59666..57480f3f337 100644
--- a/pkgs/applications/version-management/gitaly/gemset.nix
+++ b/pkgs/applications/version-management/gitaly/gemset.nix
@@ -17,6 +17,14 @@
     };
     version = "2.5.1";
   };
+  ast = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0pp82blr5fakdk27d1d21xq9zchzb6vmyb1zcsl520s3ygvprn8m";
+      type = "gem";
+    };
+    version = "2.3.0";
+  };
   charlock_holmes = {
     source = {
       remotes = ["https://rubygems.org"];
@@ -68,6 +76,15 @@
     };
     version = "4.7.6";
   };
+  gitlab-styles = {
+    dependencies = ["rubocop" "rubocop-gitlab-security" "rubocop-rspec"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1k8xrkjx8rcny8p0gsp18wskvn1qbw4rfgdp1f6x0p4xp6dlhjf4";
+      type = "gem";
+    };
+    version = "2.0.0";
+  };
   google-protobuf = {
     source = {
       remotes = ["https://rubygems.org"];
@@ -184,6 +201,31 @@
     };
     version = "0.9.6";
   };
+  parallel = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0qv2yj4sxr36ga6xdxvbq9h05hn10bwcbkqv6j6q1fiixhsdnnzd";
+      type = "gem";
+    };
+    version = "1.12.0";
+  };
+  parser = {
+    dependencies = ["ast"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "130rfk8a2ws2fyq52hmi1n0xakylw39wv4x1qhai4z17x2b0k9cq";
+      type = "gem";
+    };
+    version = "2.4.0.0";
+  };
+  powerpack = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1fnn3fli5wkzyjl4ryh0k90316shqjfnhydmc7f8lqpi0q21va43";
+      type = "gem";
+    };
+    version = "0.1.1";
+  };
   public_suffix = {
     source = {
       remotes = ["https://rubygems.org"];
@@ -192,6 +234,58 @@
     };
     version = "2.0.5";
   };
+  rainbow = {
+    dependencies = ["rake"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "08w2ghc5nv0kcq5b257h7dwjzjz1pqcavajfdx2xjyxqsvh2y34w";
+      type = "gem";
+    };
+    version = "2.2.2";
+  };
+  rake = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0mfqgpp3m69s5v1rd51lfh5qpjwyia5p4rg337pw8c8wzm6pgfsw";
+      type = "gem";
+    };
+    version = "12.1.0";
+  };
+  rubocop = {
+    dependencies = ["parallel" "parser" "powerpack" "rainbow" "ruby-progressbar" "unicode-display_width"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1hpd7zcv4y9y750wj630abvmcjwv39dsrj1fjff60ik7gfri0xlz";
+      type = "gem";
+    };
+    version = "0.50.0";
+  };
+  rubocop-gitlab-security = {
+    dependencies = ["rubocop"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0aw9qmyc6xj6fi0jxp8m4apk358rd91z492ragn6jp4rghkqj5cy";
+      type = "gem";
+    };
+    version = "0.1.0";
+  };
+  rubocop-rspec = {
+    dependencies = ["rubocop"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1hf48ng67yswvshmv4cyysj1rs1z3fnvlycr50jdcgwlynpyxkhs";
+      type = "gem";
+    };
+    version = "1.17.0";
+  };
+  ruby-progressbar = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "029kv0q3kfq53rjyak4ypn7196l8z4hflfmv4p5787n78z7baiqf";
+      type = "gem";
+    };
+    version = "1.8.3";
+  };
   rugged = {
     source = {
       remotes = ["https://rubygems.org"];
@@ -226,4 +320,12 @@
     };
     version = "1.2.2";
   };
+  unicode-display_width = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "12pi0gwqdnbx1lv5136v3vyr0img9wr0kxcn4wn54ipq4y41zxq8";
+      type = "gem";
+    };
+    version = "1.3.0";
+  };
 }
\ No newline at end of file
diff --git a/pkgs/applications/version-management/gitlab-shell/default.nix b/pkgs/applications/version-management/gitlab-shell/default.nix
index 1fdb529d9ac..ac05ca4c484 100644
--- a/pkgs/applications/version-management/gitlab-shell/default.nix
+++ b/pkgs/applications/version-management/gitlab-shell/default.nix
@@ -1,14 +1,14 @@
 { stdenv, ruby, bundler, fetchFromGitLab, go }:
 
 stdenv.mkDerivation rec {
-  version = "5.9.0";
+  version = "5.9.3";
   name = "gitlab-shell-${version}";
 
   srcs = fetchFromGitLab {
     owner = "gitlab-org";
     repo = "gitlab-shell";
     rev = "v${version}";
-    sha256 = "1zjlwivksaqlfxxhxjgpqa3293nhijw76fj7nv0l11820wplc7yf";
+    sha256 = "12iil8ap9lbd7skj7xr2v6lsyjdd97svbmyj0n2j8m819fv0x27p";
   };
 
   buildInputs = [
diff --git a/pkgs/applications/version-management/gitlab-shell/remove-hardcoded-locations.patch b/pkgs/applications/version-management/gitlab-shell/remove-hardcoded-locations.patch
index e88dbad071f..dd1ecafb8bf 100644
--- a/pkgs/applications/version-management/gitlab-shell/remove-hardcoded-locations.patch
+++ b/pkgs/applications/version-management/gitlab-shell/remove-hardcoded-locations.patch
@@ -3,7 +3,7 @@ index 0b11ce3..ffc3faf 100644
 --- a/lib/gitlab_projects.rb
 +++ b/lib/gitlab_projects.rb
 @@ -8,7 +8,7 @@ require_relative 'gitlab_metrics'
- require_relative 'gitlab_reference_counter'
+ require_relative 'gitlab_metrics'
  
  class GitlabProjects
 -  GLOBAL_HOOKS_DIRECTORY = File.join(ROOT_PATH, 'hooks')
@@ -15,7 +15,7 @@ diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb
 index e7d0254..181ec8a 100644
 --- a/lib/gitlab_shell.rb
 +++ b/lib/gitlab_shell.rb
-@@ -163,7 +163,8 @@ class GitlabShell
+@@ -188,7 +188,8 @@ class GitlabShell
      end
  
      # We use 'chdir: ROOT_PATH' to let the next executable know where config.yml is.
diff --git a/pkgs/applications/version-management/gitlab-workhorse/default.nix b/pkgs/applications/version-management/gitlab-workhorse/default.nix
index a91a15e66b8..1f3407eddcf 100644
--- a/pkgs/applications/version-management/gitlab-workhorse/default.nix
+++ b/pkgs/applications/version-management/gitlab-workhorse/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchFromGitLab, git, go }:
 
 stdenv.mkDerivation rec {
-  version = "3.0.0";
+  version = "3.2.0";
   name = "gitlab-workhorse-${version}";
 
   srcs = fetchFromGitLab {
     owner = "gitlab-org";
     repo = "gitlab-workhorse";
     rev = "v${version}";
-    sha256 = "0lz3bgwww640c7gh97vf40a8h6cz4znscl0r00z6iiwkc0xxzp7j";
+    sha256 = "1ivqlhvmxhdb8359yh469zl45j00n94b53naqi8jx06kijfsdz4r";
   };
 
   buildInputs = [ git go ];
diff --git a/pkgs/applications/version-management/gitlab-workhorse/remove-hardcoded-paths.patch b/pkgs/applications/version-management/gitlab-workhorse/remove-hardcoded-paths.patch
index 37f3d2deef5..d8313ecb433 100644
--- a/pkgs/applications/version-management/gitlab-workhorse/remove-hardcoded-paths.patch
+++ b/pkgs/applications/version-management/gitlab-workhorse/remove-hardcoded-paths.patch
@@ -2,11 +2,11 @@ diff --git a/internal/git/command.go b/internal/git/command.go
 index 0e5496c..5778294 100644
 --- a/internal/git/command.go
 +++ b/internal/git/command.go
-@@ -16,6 +16,7 @@ func gitCommand(gl_id string, name string, args ...string) *exec.Cmd {
+@@ -19,6 +19,7 @@ func gitCommand(gl_id string, name string, args ...string) *exec.Cmd {
  	cmd.Env = []string{
  		fmt.Sprintf("HOME=%s", os.Getenv("HOME")),
  		fmt.Sprintf("PATH=%s", os.Getenv("PATH")),
 +		fmt.Sprintf("GITLAB_SHELL_CONFIG_PATH=%s", os.Getenv("GITLAB_SHELL_CONFIG_PATH")),
  		fmt.Sprintf("LD_LIBRARY_PATH=%s", os.Getenv("LD_LIBRARY_PATH")),
- 		fmt.Sprintf("GL_ID=%s", gl_id),
+ 		fmt.Sprintf("GL_PROTOCOL=http"),
  	}
diff --git a/pkgs/applications/version-management/gitlab/Gemfile b/pkgs/applications/version-management/gitlab/Gemfile
index 97af3413b15..b4a457bff6e 100644
--- a/pkgs/applications/version-management/gitlab/Gemfile
+++ b/pkgs/applications/version-management/gitlab/Gemfile
@@ -23,10 +23,10 @@ gem 'faraday', '~> 0.12'
 # Authentication libraries
 gem 'devise', '~> 4.2'
 gem 'doorkeeper', '~> 4.2.0'
-gem 'doorkeeper-openid_connect', '~> 1.1.0'
+gem 'doorkeeper-openid_connect', '~> 1.2.0'
 gem 'omniauth', '~> 1.4.2'
 gem 'omniauth-auth0', '~> 1.4.1'
-gem 'omniauth-azure-oauth2', '~> 0.0.6'
+gem 'omniauth-azure-oauth2', '~> 0.0.9'
 gem 'omniauth-cas3', '~> 1.1.4'
 gem 'omniauth-facebook', '~> 4.0.0'
 gem 'omniauth-github', '~> 1.1.1'
@@ -105,7 +105,7 @@ gem 'fog-rackspace', '~> 0.1.1'
 gem 'fog-aliyun', '~> 0.1.0'
 
 # for Google storage
-gem 'google-api-client', '~> 0.8.6'
+gem 'google-api-client', '~> 0.13.6'
 
 # for aws storage
 gem 'unf', '~> 0.1.4'
@@ -116,7 +116,7 @@ gem 'seed-fu', '~> 2.3.5'
 # Markdown and HTML processing
 gem 'html-pipeline', '~> 1.11.0'
 gem 'deckar01-task_list', '2.0.0'
-gem 'gitlab-markup', '~> 1.5.1'
+gem 'gitlab-markup', '~> 1.6.2'
 gem 'redcarpet', '~> 3.4'
 gem 'RedCloth', '~> 4.3.2'
 gem 'rdoc', '~> 4.2'
@@ -239,7 +239,7 @@ gem 'rack-proxy', '~> 0.6.0'
 gem 'sass-rails', '~> 5.0.6'
 gem 'uglifier', '~> 2.7.2'
 
-gem 'addressable', '~> 2.3.8'
+gem 'addressable', '~> 2.5.2'
 gem 'bootstrap-sass', '~> 3.3.0'
 gem 'font-awesome-rails', '~> 4.7'
 gem 'gemojione', '~> 3.3'
@@ -281,7 +281,7 @@ group :metrics do
   gem 'influxdb', '~> 0.2', require: false
 
   # Prometheus
-  gem 'prometheus-client-mmap', '~>0.7.0.beta14'
+  gem 'prometheus-client-mmap', '~>0.7.0.beta18'
   gem 'raindrops', '~> 0.18'
 end
 
@@ -356,12 +356,13 @@ end
 group :test do
   gem 'shoulda-matchers', '~> 3.1.2', require: false
   gem 'email_spec', '~> 1.6.0'
-  gem 'json-schema', '~> 2.6.2'
+  gem 'json-schema', '~> 2.8.0'
   gem 'webmock', '~> 2.3.2'
   gem 'test_after_commit', '~> 1.1'
   gem 'sham_rack', '~> 1.3.6'
   gem 'timecop', '~> 0.8.0'
   gem 'concurrent-ruby', '~> 1.0.5'
+  gem 'test-prof', '~> 0.2.5'
 end
 
 gem 'octokit', '~> 4.6.2'
@@ -397,7 +398,7 @@ group :ed25519 do
 end
 
 # Gitaly GRPC client
-gem 'gitaly-proto', '~> 0.33.0', require: 'gitaly'
+gem 'gitaly-proto', '~> 0.39.0', require: 'gitaly'
 
 gem 'toml-rb', '~> 0.3.15', require: false
 
diff --git a/pkgs/applications/version-management/gitlab/Gemfile.lock b/pkgs/applications/version-management/gitlab/Gemfile.lock
index 61c5335962b..fd3aab2d54a 100644
--- a/pkgs/applications/version-management/gitlab/Gemfile.lock
+++ b/pkgs/applications/version-management/gitlab/Gemfile.lock
@@ -47,7 +47,8 @@ GEM
     adamantium (0.2.0)
       ice_nine (~> 0.11.0)
       memoizable (~> 0.4.0)
-    addressable (2.3.8)
+    addressable (2.5.2)
+      public_suffix (>= 2.0.2, < 4.0)
     akismet (2.0.0)
     allocations (1.0.5)
     arel (6.0.4)
@@ -64,10 +65,6 @@ GEM
     attr_encrypted (3.0.3)
       encryptor (~> 3.0.0)
     attr_required (1.0.0)
-    autoparse (0.3.3)
-      addressable (>= 2.3.1)
-      extlib (>= 0.9.15)
-      multi_json (>= 1.0.0)
     autoprefixer-rails (6.2.3)
       execjs
       json
@@ -85,7 +82,7 @@ GEM
       coderay (>= 1.0.0)
       erubis (>= 2.6.6)
       rack (>= 0.9.0)
-    bindata (2.3.5)
+    bindata (2.4.1)
     binding_of_caller (0.7.2)
       debug_inspector (>= 0.0.1)
     bootstrap-sass (3.3.6)
@@ -148,6 +145,8 @@ GEM
     debugger-ruby_core_source (1.3.8)
     deckar01-task_list (2.0.0)
       html-pipeline
+    declarative (0.0.10)
+    declarative-option (0.1.0)
     default_value_for (3.0.2)
       activerecord (>= 3.2.0, < 5.1)
     descendants_tracker (0.0.4)
@@ -169,9 +168,9 @@ GEM
     docile (1.1.5)
     domain_name (0.5.20161021)
       unf (>= 0.0.5, < 1.0.0)
-    doorkeeper (4.2.0)
+    doorkeeper (4.2.6)
       railties (>= 4.2)
-    doorkeeper-openid_connect (1.1.2)
+    doorkeeper-openid_connect (1.2.0)
       doorkeeper (~> 4.0)
       json-jwt (~> 1.6)
     dropzonejs-rails (0.7.2)
@@ -190,13 +189,12 @@ GEM
     excon (0.57.1)
     execjs (2.6.0)
     expression_parser (0.9.0)
-    extlib (0.9.16)
     factory_girl (4.7.0)
       activesupport (>= 3.0.0)
     factory_girl_rails (4.7.0)
       factory_girl (~> 4.7.0)
       railties (>= 3.0.0)
-    faraday (0.12.1)
+    faraday (0.12.2)
       multipart-post (>= 1.2, < 3)
     faraday_middleware (0.11.0.1)
       faraday (>= 0.7.4, < 1.0)
@@ -277,7 +275,7 @@ GEM
       po_to_json (>= 1.0.0)
       rails (>= 3.2.0)
     gherkin-ruby (0.3.2)
-    gitaly-proto (0.33.0)
+    gitaly-proto (0.39.0)
       google-protobuf (~> 3.1)
       grpc (~> 1.0)
     github-linguist (4.7.6)
@@ -290,12 +288,12 @@ GEM
       flowdock (~> 0.7)
       gitlab-grit (>= 2.4.1)
       multi_json
-    gitlab-grit (2.8.1)
+    gitlab-grit (2.8.2)
       charlock_holmes (~> 0.6)
       diff-lcs (~> 1.1)
-      mime-types (>= 1.16, < 3)
+      mime-types (>= 1.16)
       posix-spawn (~> 0.3)
-    gitlab-markup (1.5.1)
+    gitlab-markup (1.6.2)
     gitlab_omniauth-ldap (2.0.4)
       net-ldap (~> 0.16)
       omniauth (~> 1.3)
@@ -321,20 +319,16 @@ GEM
       json
       multi_json
       request_store (>= 1.0)
-    google-api-client (0.8.7)
-      activesupport (>= 3.2, < 5.0)
-      addressable (~> 2.3)
-      autoparse (~> 0.3)
-      extlib (~> 0.9)
-      faraday (~> 0.9)
-      googleauth (~> 0.3)
-      launchy (~> 2.4)
-      multi_json (~> 1.10)
-      retriable (~> 1.4)
-      signet (~> 0.6)
+    google-api-client (0.13.6)
+      addressable (~> 2.5, >= 2.5.1)
+      googleauth (~> 0.5)
+      httpclient (>= 2.8.1, < 3.0)
+      mime-types (~> 3.0)
+      representable (~> 3.0)
+      retriable (>= 2.0, < 4.0)
     google-protobuf (3.4.0.2)
-    googleauth (0.5.1)
-      faraday (~> 0.9)
+    googleauth (0.5.3)
+      faraday (~> 0.12)
       jwt (~> 1.4)
       logging (~> 2.0)
       memoist (~> 0.12)
@@ -359,7 +353,7 @@ GEM
       rake
     grape_logging (1.7.0)
       grape
-    grpc (1.4.5)
+    grpc (1.6.0)
       google-protobuf (~> 3.1)
       googleauth (~> 0.5.1)
     haml (4.0.7)
@@ -418,14 +412,14 @@ GEM
       railties (>= 4.2.0)
       thor (>= 0.14, < 2.0)
     json (1.8.6)
-    json-jwt (1.7.1)
+    json-jwt (1.7.2)
       activesupport
       bindata
       multi_json (>= 1.3)
       securecompare
       url_safe_base64
-    json-schema (2.6.2)
-      addressable (~> 2.3.8)
+    json-schema (2.8.0)
+      addressable (>= 2.4)
     jwt (1.5.6)
     kaminari (1.0.1)
       activesupport (>= 4.1.0)
@@ -477,18 +471,20 @@ GEM
     mail (2.6.6)
       mime-types (>= 1.16, < 4)
     mail_room (0.9.1)
-    memoist (0.15.0)
+    memoist (0.16.0)
     memoizable (0.4.2)
       thread_safe (~> 0.3, >= 0.3.1)
     method_source (0.8.2)
-    mime-types (2.99.3)
+    mime-types (3.1)
+      mime-types-data (~> 3.2015)
+    mime-types-data (3.2016.0521)
     mimemagic (0.3.0)
     mini_mime (0.1.4)
     mini_portile2 (2.3.0)
     minitest (5.7.0)
     mmap2 (2.2.7)
     mousetrap-rails (1.4.6)
-    multi_json (1.12.1)
+    multi_json (1.12.2)
     multi_xml (0.6.0)
     multipart-post (2.0.0)
     mustermann (1.0.0)
@@ -518,10 +514,10 @@ GEM
       omniauth-oauth2 (~> 1.1)
     omniauth-authentiq (0.3.1)
       omniauth-oauth2 (~> 1.3, >= 1.3.1)
-    omniauth-azure-oauth2 (0.0.6)
+    omniauth-azure-oauth2 (0.0.9)
       jwt (~> 1.0)
       omniauth (~> 1.0)
-      omniauth-oauth2 (~> 1.1)
+      omniauth-oauth2 (~> 1.4)
     omniauth-cas3 (1.1.4)
       addressable (~> 2.3)
       nokogiri (~> 1.7, >= 1.7.1)
@@ -547,7 +543,7 @@ GEM
     omniauth-oauth (1.1.0)
       oauth
       omniauth (~> 1.0)
-    omniauth-oauth2 (1.3.1)
+    omniauth-oauth2 (1.4.0)
       oauth2 (~> 1.0)
       omniauth (~> 1.2)
     omniauth-oauth2-generic (0.2.2)
@@ -626,7 +622,7 @@ GEM
       parser
       unparser
     procto (0.0.3)
-    prometheus-client-mmap (0.7.0.beta14)
+    prometheus-client-mmap (0.7.0.beta18)
       mmap2 (~> 2.2, >= 2.2.7)
     pry (0.10.4)
       coderay (~> 1.1.0)
@@ -637,6 +633,7 @@ GEM
       pry (~> 0.10)
     pry-rails (0.3.5)
       pry (>= 0.9.10)
+    public_suffix (3.0.0)
     pyu-ruby-sasl (0.0.3.3)
     rack (1.6.8)
     rack-accept (0.4.5)
@@ -686,7 +683,7 @@ GEM
     rainbow (2.2.2)
       rake
     raindrops (0.18.0)
-    rake (12.0.0)
+    rake (12.1.0)
     rblineprof (0.3.6)
       debugger-ruby_core_source (~> 1.3)
     rbnacl (4.0.2)
@@ -719,6 +716,10 @@ GEM
       redis-store (~> 1.2.0)
     redis-store (1.2.0)
       redis (>= 2.2)
+    representable (3.0.4)
+      declarative (< 0.1.0)
+      declarative-option (< 0.2.0)
+      uber (< 0.2.0)
     request_store (1.3.1)
     responders (2.3.0)
       railties (>= 4.2.0, < 5.1)
@@ -726,7 +727,7 @@ GEM
       http-cookie (>= 1.0.2, < 2.0)
       mime-types (>= 1.16, < 4.0)
       netrc (~> 0.8)
-    retriable (1.4.1)
+    retriable (3.1.1)
     rinku (2.0.0)
     rotp (2.1.2)
     rouge (2.2.1)
@@ -884,6 +885,7 @@ GEM
       ffi
     sysexits (1.2.0)
     temple (0.7.7)
+    test-prof (0.2.5)
     test_after_commit (1.1.0)
       activerecord (>= 3.2)
     text (1.3.1)
@@ -904,12 +906,13 @@ GEM
     tzinfo (1.2.3)
       thread_safe (~> 0.1)
     u2f (0.2.1)
+    uber (0.1.0)
     uglifier (2.7.2)
       execjs (>= 0.3.0)
       json (>= 1.8.0)
     unf (0.1.4)
       unf_ext
-    unf_ext (0.0.7.2)
+    unf_ext (0.0.7.4)
     unicode-display_width (1.3.0)
     unicorn (5.1.0)
       kgio (~> 2.6)
@@ -965,7 +968,7 @@ DEPENDENCIES
   activerecord-nulldb-adapter
   activerecord_sane_schema_dumper (= 0.2)
   acts-as-taggable-on (~> 4.0)
-  addressable (~> 2.3.8)
+  addressable (~> 2.5.2)
   akismet (~> 2.0)
   allocations (~> 1.0)
   asana (~> 0.6.0)
@@ -1002,7 +1005,7 @@ DEPENDENCIES
   devise-two-factor (~> 3.0.0)
   diffy (~> 3.1.0)
   doorkeeper (~> 4.2.0)
-  doorkeeper-openid_connect (~> 1.1.0)
+  doorkeeper-openid_connect (~> 1.2.0)
   dropzonejs-rails (~> 0.7.1)
   email_reply_trimmer (~> 0.1)
   email_spec (~> 1.6.0)
@@ -1027,15 +1030,15 @@ DEPENDENCIES
   gettext (~> 3.2.2)
   gettext_i18n_rails (~> 1.8.0)
   gettext_i18n_rails_js (~> 1.2.0)
-  gitaly-proto (~> 0.33.0)
+  gitaly-proto (~> 0.39.0)
   github-linguist (~> 4.7.0)
   gitlab-flowdock-git-hook (~> 1.0.1)
-  gitlab-markup (~> 1.5.1)
+  gitlab-markup (~> 1.6.2)
   gitlab_omniauth-ldap (~> 2.0.4)
   gollum-lib (~> 4.2)
   gollum-rugged_adapter (~> 0.4.4)
   gon (~> 6.1.0)
-  google-api-client (~> 0.8.6)
+  google-api-client (~> 0.13.6)
   gpgme
   grape (~> 1.0)
   grape-entity (~> 0.6.0)
@@ -1053,7 +1056,7 @@ DEPENDENCIES
   jira-ruby (~> 1.4)
   jquery-atwho-rails (~> 1.3.2)
   jquery-rails (~> 4.1.0)
-  json-schema (~> 2.6.2)
+  json-schema (~> 2.8.0)
   jwt (~> 1.5.6)
   kaminari (~> 1.0)
   knapsack (~> 1.11.0)
@@ -1077,7 +1080,7 @@ DEPENDENCIES
   omniauth (~> 1.4.2)
   omniauth-auth0 (~> 1.4.1)
   omniauth-authentiq (~> 0.3.1)
-  omniauth-azure-oauth2 (~> 0.0.6)
+  omniauth-azure-oauth2 (~> 0.0.9)
   omniauth-cas3 (~> 1.1.4)
   omniauth-facebook (~> 4.0.0)
   omniauth-github (~> 1.1.1)
@@ -1103,7 +1106,7 @@ DEPENDENCIES
   pg (~> 0.18.2)
   poltergeist (~> 1.9.0)
   premailer-rails (~> 1.9.7)
-  prometheus-client-mmap (~> 0.7.0.beta14)
+  prometheus-client-mmap (~> 0.7.0.beta18)
   pry-byebug (~> 3.4.1)
   pry-rails (~> 0.3.4)
   rack-attack (~> 4.4.1)
@@ -1166,6 +1169,7 @@ DEPENDENCIES
   stackprof (~> 0.2.10)
   state_machines-activerecord (~> 0.4.0)
   sys-filesystem (~> 1.1.6)
+  test-prof (~> 0.2.5)
   test_after_commit (~> 1.1)
   thin (~> 1.7.0)
   timecop (~> 0.8.0)
diff --git a/pkgs/applications/version-management/gitlab/default.nix b/pkgs/applications/version-management/gitlab/default.nix
index 657221d4b42..bc3ca9192bc 100644
--- a/pkgs/applications/version-management/gitlab/default.nix
+++ b/pkgs/applications/version-management/gitlab/default.nix
@@ -18,11 +18,11 @@ let
     };
   };
 
-  version = "10.0.2";
+  version = "10.1.1";
 
   gitlabDeb = fetchurl {
     url = "https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/jessie/gitlab-ce_${version}-ce.0_amd64.deb/download";
-    sha256 = "0jsqjarvjzbxv1yiddzp5xwsqqrq5cvam0xn749p1vzqhcp8pahc";
+    sha256 = "0xvzxcygy6ffqm24rk6v9gs6g9r744vpwwvk9d00wjla7hwmq3w2";
   };
 
 in
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
     owner = "gitlabhq";
     repo = "gitlabhq";
     rev = "v${version}";
-    sha256 = "1602d6nkb41gg80n6p0wqxrjsn79s0z3817461d8dw2ha2dmbl34";
+    sha256 = "0p118msad6l12pd4q3vkvjggiiasbkh6pnl94riqyb5zkb7yrb1a";
   };
 
   patches = [
diff --git a/pkgs/applications/version-management/gitlab/gemset.nix b/pkgs/applications/version-management/gitlab/gemset.nix
index 34567ddb3ea..4fb4c48b0de 100644
--- a/pkgs/applications/version-management/gitlab/gemset.nix
+++ b/pkgs/applications/version-management/gitlab/gemset.nix
@@ -115,12 +115,13 @@
     version = "0.2.0";
   };
   addressable = {
+    dependencies = ["public_suffix"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1533axm85gpz267km9gnfarf9c78g2scrysd6b8yw33vmhkz2km6";
+      sha256 = "0viqszpkggqi8hq87pqp0xykhvz60g99nwmkwsb0v45kc2liwxvk";
       type = "gem";
     };
-    version = "2.3.8";
+    version = "2.5.2";
   };
   akismet = {
     source = {
@@ -205,15 +206,6 @@
     };
     version = "1.0.0";
   };
-  autoparse = {
-    dependencies = ["addressable" "extlib" "multi_json"];
-    source = {
-      remotes = ["https://rubygems.org"];
-      sha256 = "1q5wkd8gc2ckmgry9fba4b8vxb5kr8k8gqq2wycbirgq06mbllb6";
-      type = "gem";
-    };
-    version = "0.3.3";
-  };
   autoprefixer-rails = {
     dependencies = ["execjs" "json"];
     source = {
@@ -292,10 +284,10 @@
   bindata = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "07i51jzq9iamw40xmmcgkrdq4m8f0vb5gp53p6q1vggj7z53q3v7";
+      sha256 = "0anbg203zjr4crql20ss5b9xg2c6a7j8nm6hs8w3ll1h1akkpp2z";
       type = "gem";
     };
-    version = "2.3.5";
+    version = "2.4.1";
   };
   binding_of_caller = {
     dependencies = ["debug_inspector"];
@@ -592,6 +584,22 @@
     };
     version = "2.0.0";
   };
+  declarative = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0642xvwzzbgi3kp1bg467wma4g3xqrrn0sk369hjam7w579gnv5j";
+      type = "gem";
+    };
+    version = "0.0.10";
+  };
+  declarative-option = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1g4ibxq566f1frnhdymzi9hxxcm4g2gw4n21mpjk2mhwym4q6l0p";
+      type = "gem";
+    };
+    version = "0.1.0";
+  };
   default_value_for = {
     dependencies = ["activerecord"];
     source = {
@@ -665,19 +673,19 @@
     dependencies = ["railties"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0hs8r280k7a1kibzxrhifjps880n43jfrybf4mqpffw669jrwk3v";
+      sha256 = "0r5rfvjjnlf9cn97cdrfw260zkg785k4197xqidgb35445k62mah";
       type = "gem";
     };
-    version = "4.2.0";
+    version = "4.2.6";
   };
   doorkeeper-openid_connect = {
     dependencies = ["doorkeeper" "json-jwt"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1pla85j5wxra0k9rhj04g2ai5d5jg97fiavi0s9v2hjba2l54cni";
+      sha256 = "13k0xlr1grjj8ri26qy2zwbgi3fqxinvnygh53bnyi9qcynx5827";
       type = "gem";
     };
-    version = "1.1.2";
+    version = "1.2.0";
   };
   dropzonejs-rails = {
     dependencies = ["rails"];
@@ -778,14 +786,6 @@
     };
     version = "0.9.0";
   };
-  extlib = {
-    source = {
-      remotes = ["https://rubygems.org"];
-      sha256 = "1cbw3vgb189z3vfc1arijmsd604m3w5y5xvdfkrblc9qh7sbk2rh";
-      type = "gem";
-    };
-    version = "0.9.16";
-  };
   factory_girl = {
     dependencies = ["activesupport"];
     source = {
@@ -808,10 +808,10 @@
     dependencies = ["multipart-post"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1wkx9844vacsk2229xbc27djf6zw15kqd60ifr78whf9mp9v6l03";
+      sha256 = "157c4cmb5g1b3ny6k9qf9z57rfijl54fcq3hnqqf6g31g1m096b2";
       type = "gem";
     };
-    version = "0.12.1";
+    version = "0.12.2";
   };
   faraday_middleware = {
     dependencies = ["faraday"];
@@ -1071,10 +1071,10 @@
     dependencies = ["google-protobuf" "grpc"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0f15idw1850kwi0na6x3xlk13ljwx3mpfnxfv58631cmb3ac7wf8";
+      sha256 = "0irc3yfyr5li2ki6w03znsklnk0qx3srk4wrb7jav042c4kw325k";
       type = "gem";
     };
-    version = "0.33.0";
+    version = "0.39.0";
   };
   github-linguist = {
     dependencies = ["charlock_holmes" "escape_utils" "mime-types" "rugged"];
@@ -1106,18 +1106,18 @@
     dependencies = ["charlock_holmes" "diff-lcs" "mime-types" "posix-spawn"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0lf1cr6pzqrbnxiiwym6q74b1a2ihdi91dynajk8hi1p093hl66n";
+      sha256 = "0xgs3l81ghlc5nm75n0pz7b2cj3hpscfq5iy27c483nnjn2v5mc4";
       type = "gem";
     };
-    version = "2.8.1";
+    version = "2.8.2";
   };
   gitlab-markup = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1aam7zvvbai5nv7vf0c0640pvik6s71f276lip4yb4slbg0pfpn2";
+      sha256 = "114jfbyyfwad609k1l1fcmbzszb3frdchh83gdwndkglllvprhjz";
       type = "gem";
     };
-    version = "1.5.1";
+    version = "1.6.2";
   };
   gitlab_omniauth-ldap = {
     dependencies = ["net-ldap" "omniauth" "pyu-ruby-sasl" "rubyntlm"];
@@ -1174,13 +1174,13 @@
     version = "6.1.0";
   };
   google-api-client = {
-    dependencies = ["activesupport" "addressable" "autoparse" "extlib" "faraday" "googleauth" "launchy" "multi_json" "retriable" "signet"];
+    dependencies = ["addressable" "googleauth" "httpclient" "mime-types" "representable" "retriable"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "11wr57j9fp6x6fym4k1a7jqp72qgc8l24mfwb4y55bbvdmkv1b2d";
+      sha256 = "0ac9qa0kwnirkvwz2w9zf07lqcgbmnvgd1wg8xxyjbadwsbpyf1y";
       type = "gem";
     };
-    version = "0.8.7";
+    version = "0.13.6";
   };
   google-protobuf = {
     source = {
@@ -1194,10 +1194,10 @@
     dependencies = ["faraday" "jwt" "logging" "memoist" "multi_json" "os" "signet"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1nzkg63s161c6jsia92c1jfwpayzbpwn588smd286idn07y0az2m";
+      sha256 = "1xpmvrzhczak25nm0k3r9aa083lmfnzi94mir3g1xyrgzz66vxli";
       type = "gem";
     };
-    version = "0.5.1";
+    version = "0.5.3";
   };
   gpgme = {
     dependencies = ["mini_portile2"];
@@ -1248,10 +1248,10 @@
     dependencies = ["google-protobuf" "googleauth"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1zhci260088zlghpaz6ania1blz1dd7lgklsjnqk1vcymhpr6b38";
+      sha256 = "056ipqai887x5jpbgcc215kdi0lfqjzcjbx3hx11cjrfww01zc52";
       type = "gem";
     };
-    version = "1.4.5";
+    version = "1.6.0";
   };
   haml = {
     dependencies = ["tilt"];
@@ -1471,19 +1471,19 @@
     dependencies = ["activesupport" "bindata" "multi_json" "securecompare" "url_safe_base64"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1ylvlnb6assan9qkhz1vq1gbfwxg35q9a8f8qhlyx0fak5fyks23";
+      sha256 = "15a3v498lvsshzgjnk2dmyvjv87y3lffq71axj5xq3iz4mp1r4b2";
       type = "gem";
     };
-    version = "1.7.1";
+    version = "1.7.2";
   };
   json-schema = {
     dependencies = ["addressable"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "15bva4w940ckan3q89in5f98s8zz77nxglylgm98697wa4fbfqp9";
+      sha256 = "11di8qyam6bmqn0fvvvf3crgaqy4sil0d406ymx0jacn3ff98ymz";
       type = "gem";
     };
-    version = "2.6.2";
+    version = "2.8.0";
   };
   jwt = {
     source = {
@@ -1662,10 +1662,10 @@
   memoist = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0yd3rd7bnbhn9n47qlhcii5z89liabdjhy3is3h6gq77gyfk4f5q";
+      sha256 = "0pq8fhqh8w25qcw9v3vzfb0i6jp0k3949ahxc3wrwz2791dpbgbh";
       type = "gem";
     };
-    version = "0.15.0";
+    version = "0.16.0";
   };
   memoizable = {
     dependencies = ["thread_safe"];
@@ -1685,12 +1685,21 @@
     version = "0.8.2";
   };
   mime-types = {
+    dependencies = ["mime-types-data"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "03j98xr0qw2p2jkclpmk7pm29yvmmh0073d8d43ajmr0h3w7i5l9";
+      sha256 = "0087z9kbnlqhci7fxh9f6il63hj1k02icq2rs0c6cppmqchr753m";
       type = "gem";
     };
-    version = "2.99.3";
+    version = "3.1";
+  };
+  mime-types-data = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "04my3746hwa4yvbx1ranhfaqkgf6vavi1kyijjnw8w3dy37vqhkm";
+      type = "gem";
+    };
+    version = "3.2016.0521";
   };
   mimemagic = {
     source = {
@@ -1743,10 +1752,10 @@
   multi_json = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1wpc23ls6v2xbk3l1qncsbz16npvmw8p0b38l8czdzri18mp51xk";
+      sha256 = "1raim9ddjh672m32psaa9niw67ywzjbxbdb8iijx3wv9k5b0pk2x";
       type = "gem";
     };
-    version = "1.12.1";
+    version = "1.12.2";
   };
   multi_xml = {
     source = {
@@ -1895,10 +1904,10 @@
     dependencies = ["jwt" "omniauth" "omniauth-oauth2"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0qay454zvyas8xfnfkycqpjkafaq5pw4gaji176cdfw0blhviz0s";
+      sha256 = "0ck5616fjik0dw89xvak1mi8ijcv10lsh6n9h4107l5dys2g3jfx";
       type = "gem";
     };
-    version = "0.0.6";
+    version = "0.0.9";
   };
   omniauth-cas3 = {
     dependencies = ["addressable" "nokogiri" "omniauth"];
@@ -1976,10 +1985,10 @@
     dependencies = ["oauth2" "omniauth"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0mskwlw5ibx9mz7ywqji6mm56ikf7mglbnfc02qhg6ry527jsxdm";
+      sha256 = "0aykbg5qfm37ywrq34dydrhxa5jwpski71dpspgp2fi6dinx09f5";
       type = "gem";
     };
-    version = "1.3.1";
+    version = "1.4.0";
   };
   omniauth-oauth2-generic = {
     dependencies = ["omniauth-oauth2"];
@@ -2247,10 +2256,10 @@
     dependencies = ["mmap2"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1r9s30hypcpw4abxlzcjlkcwkckqvr5sbph3blbl0rq2r8c8h25p";
+      sha256 = "1fgkilpiha338mvfkj5rwhny3vld0nb3v1vgbrlxbhnvch26wakh";
       type = "gem";
     };
-    version = "0.7.0.beta14";
+    version = "0.7.0.beta18";
   };
   pry = {
     dependencies = ["coderay" "method_source" "slop"];
@@ -2279,6 +2288,14 @@
     };
     version = "0.3.5";
   };
+  public_suffix = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0snaj1gxfib4ja1mvy3dzmi7am73i0mkqr0zkz045qv6509dhj5f";
+      type = "gem";
+    };
+    version = "3.0.0";
+  };
   pyu-ruby-sasl = {
     source = {
       remotes = ["https://rubygems.org"];
@@ -2431,10 +2448,10 @@
   rake = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "01j8fc9bqjnrsxbppncai05h43315vmz9fwg28qdsgcjw9ck1d7n";
+      sha256 = "0mfqgpp3m69s5v1rd51lfh5qpjwyia5p4rg337pw8c8wzm6pgfsw";
       type = "gem";
     };
-    version = "12.0.0";
+    version = "12.1.0";
   };
   rblineprof = {
     dependencies = ["debugger-ruby_core_source"];
@@ -2575,6 +2592,15 @@
     };
     version = "1.2.0";
   };
+  representable = {
+    dependencies = ["declarative" "declarative-option" "uber"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0qm9rgi1j5a6nv726ka4mmixivlxfsg91h8rpp72wwd4vqbkkm07";
+      type = "gem";
+    };
+    version = "3.0.4";
+  };
   request_store = {
     source = {
       remotes = ["https://rubygems.org"];
@@ -2604,10 +2630,10 @@
   retriable = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1cmhwgv5r4vn7iqy4bfbnbb73pzl8ik69zrwq9vdim45v8b13gsj";
+      sha256 = "0pnriyn9zh120hxm92vb12hfsf7c98nawyims1shxj3ldpl0l3ar";
       type = "gem";
     };
-    version = "1.4.1";
+    version = "3.1.1";
   };
   rinku = {
     source = {
@@ -3195,6 +3221,14 @@
     };
     version = "0.7.7";
   };
+  test-prof = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "08nvn3c1mzgcjgk9lr3py0zjd8fjjrm3ncn9rpqkfbx429mgw2l3";
+      type = "gem";
+    };
+    version = "0.2.5";
+  };
   test_after_commit = {
     dependencies = ["activerecord"];
     source = {
@@ -3296,6 +3330,14 @@
     };
     version = "0.2.1";
   };
+  uber = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1p1mm7mngg40x05z52md3mbamkng0zpajbzqjjwmsyw0zw3v9vjv";
+      type = "gem";
+    };
+    version = "0.1.0";
+  };
   uglifier = {
     dependencies = ["execjs" "json"];
     source = {
@@ -3317,10 +3359,10 @@
   unf_ext = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "04d13bp6lyg695x94whjwsmzc2ms72d94vx861nx1y40k3817yp8";
+      sha256 = "14hr2dzqh33kqc0xchs8l05pf3kjcayvad4z1ip5rdjxrkfk8glb";
       type = "gem";
     };
-    version = "0.0.7.2";
+    version = "0.0.7.4";
   };
   unicode-display_width = {
     source = {
diff --git a/pkgs/applications/version-management/gitlab/nulladapter.patch b/pkgs/applications/version-management/gitlab/nulladapter.patch
index 70195fe821a..3b30ff03346 100644
--- a/pkgs/applications/version-management/gitlab/nulladapter.patch
+++ b/pkgs/applications/version-management/gitlab/nulladapter.patch
@@ -14,7 +14,7 @@ diff --git a/Gemfile.lock b/Gemfile.lock
 index 38944248f9..08ce4486ba 100644
 --- a/Gemfile.lock
 +++ b/Gemfile.lock
-@@ -32,6 +32,8 @@ GEM
+@@ -33,6 +33,8 @@ GEM
        activemodel (= 4.2.8)
        activesupport (= 4.2.8)
        arel (~> 6.0)
@@ -23,11 +23,11 @@ index 38944248f9..08ce4486ba 100644
      activerecord_sane_schema_dumper (0.2)
        rails (>= 4, < 5)
      activesupport (4.2.8)
-@@ -926,6 +928,7 @@ PLATFORMS
+@@ -963,6 +965,7 @@ PLATFORMS
  DEPENDENCIES
    RedCloth (~> 4.3.2)
    ace-rails-ap (~> 4.1.0)
 +  activerecord-nulldb-adapter
    activerecord_sane_schema_dumper (= 0.2)
    acts-as-taggable-on (~> 4.0)
-   addressable (~> 2.3.8)
+   addressable (~> 2.5.2)
diff --git a/pkgs/applications/version-management/gitlab/remove-hardcoded-locations.patch b/pkgs/applications/version-management/gitlab/remove-hardcoded-locations.patch
index c88f525715e..39c7c28847c 100644
--- a/pkgs/applications/version-management/gitlab/remove-hardcoded-locations.patch
+++ b/pkgs/applications/version-management/gitlab/remove-hardcoded-locations.patch
@@ -27,20 +27,20 @@ diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
 index 0b33783869..cd4e41d9bd 100644
 --- a/config/gitlab.yml.example
 +++ b/config/gitlab.yml.example
-@@ -521,7 +521,7 @@ production: &base
+@@ -574,7 +574,7 @@ production: &base
    # CAUTION!
    # Use the default values unless you really know what you are doing
    git:
 -    bin_path: /usr/bin/git
 +    bin_path: git
-     # The next value is the maximum memory size grit can use
-     # Given in number of bytes per git object (e.g. a commit)
-     # This value can be increased if you have very large commits
+ 
+   ## Webpack settings
+   # If enabled, this will tell rails to serve frontend assets from the webpack-dev-server running
 diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
 index 8ddf8e4d2e..559cf9adf7 100644
 --- a/config/initializers/1_settings.rb
 +++ b/config/initializers/1_settings.rb
-@@ -219,7 +219,7 @@ Settings.gitlab['user']       ||= 'git'
+@@ -252,7 +252,7 @@ Settings.gitlab['user']       ||= 'git'
  Settings.gitlab['user_home']  ||= begin
    Etc.getpwnam(Settings.gitlab['user']).dir
  rescue ArgumentError # no user configured
@@ -49,15 +49,15 @@ index 8ddf8e4d2e..559cf9adf7 100644
  end
  Settings.gitlab['time_zone'] ||= nil
  Settings.gitlab['signup_enabled'] ||= true if Settings.gitlab['signup_enabled'].nil?
-@@ -454,7 +454,7 @@ Settings.backup['upload']['storage_class'] ||= nil
+@@ -491,7 +491,7 @@ Settings.backup['upload']['storage_class'] ||= nil
+ # Git
  #
  Settings['git'] ||= Settingslogic.new({})
- Settings.git['max_size']  ||= 20971520 # 20.megabytes
--Settings.git['bin_path']  ||= '/usr/bin/git'
-+Settings.git['bin_path']  ||= 'git'
- Settings.git['timeout']   ||= 10
+-Settings.git['bin_path'] ||= '/usr/bin/git'
++Settings.git['bin_path'] ||= 'git'
  
  # Important: keep the satellites.path setting until GitLab 9.0 at
+ # least. This setting is fed to 'rm -rf' in
 diff --git a/lib/gitlab/logger.rb b/lib/gitlab/logger.rb
 index 59b21149a9..4f4a39a06c 100644
 --- a/lib/gitlab/logger.rb
diff --git a/pkgs/applications/virtualization/virtualbox/default.nix b/pkgs/applications/virtualization/virtualbox/default.nix
index 4f6da3c7cd9..6649b027c31 100644
--- a/pkgs/applications/virtualization/virtualbox/default.nix
+++ b/pkgs/applications/virtualization/virtualbox/default.nix
@@ -94,6 +94,14 @@ in stdenv.mkDerivation {
   postPatch = ''
     sed -i -e 's|/sbin/ifconfig|${nettools}/bin/ifconfig|' \
       src/VBox/HostDrivers/adpctl/VBoxNetAdpCtl.cpp
+    patch -p0 < ${
+      fetchurl { # for glibc-2.26
+        name = "conflicting-types-for-greg_t.patch";
+        url = "http://www.linuxquestions.org/questions/"
+            + "attachment.php?attachmentid=25801&d=1504099531";
+        sha256 = "1bcyf9qrqxizyjp1s662k6n1cfyfjbl7256r4n20kbr65yxcydps";
+      }
+    }
   '';
 
   # first line: ugly hack, and it isn't yet clear why it's a problem
diff --git a/pkgs/applications/window-managers/sway/default.nix b/pkgs/applications/window-managers/sway/default.nix
index 6227ccd2c9f..1e1072e4960 100644
--- a/pkgs/applications/window-managers/sway/default.nix
+++ b/pkgs/applications/window-managers/sway/default.nix
@@ -8,13 +8,13 @@
 
 stdenv.mkDerivation rec {
   name = "sway-${version}";
-  version = "0.14.0";
+  version = "0.15.0";
 
   src = fetchFromGitHub {
-    owner = "Sircmpwn";
+    owner = "swaywm";
     repo = "sway";
-    rev = "${version}";
-    sha256 = "1l8v9cdzd44bm4q71d47vqg6933b8j42q1a61r362vz2la1rcpq2";
+    rev = version;
+    sha256 = "0rz5rgap2ah7hkk4glvlmjq0c8i2f47qzkwjx7gm4wmb8gymikmh";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/build-support/cc-wrapper/cc-wrapper.sh b/pkgs/build-support/cc-wrapper/cc-wrapper.sh
index f1f56cf5cec..d2cdbf6ce0c 100644
--- a/pkgs/build-support/cc-wrapper/cc-wrapper.sh
+++ b/pkgs/build-support/cc-wrapper/cc-wrapper.sh
@@ -1,5 +1,5 @@
 #! @shell@
-set -eu -o pipefail
+set -eu -o pipefail +o posix
 shopt -s nullglob
 
 if (( "${NIX_DEBUG:-0}" >= 7 )); then
diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix
index 489fb02dcb5..8d8b8a42fe9 100644
--- a/pkgs/build-support/cc-wrapper/default.nix
+++ b/pkgs/build-support/cc-wrapper/default.nix
@@ -97,6 +97,11 @@ stdenv.mkDerivation {
   outputs = [ "out" "man" ];
 
   passthru = {
+    # "cc" is the generic name for a C compiler, but there is no one for package
+    # providing the linker and related tools. The two we use now are GNU
+    # Binutils, and Apple's "cctools"; "binutils" as an attempt to find an
+    # unused middle-ground name that evokes both.
+    bintools = binutils_bin;
     inherit libc nativeTools nativeLibc nativePrefix isGNU isClang default_cxx_stdlib_compile
             prefix;
 
@@ -286,7 +291,7 @@ stdenv.mkDerivation {
         *) echo "Multiple dynamic linkers found for platform '${targetPlatform.config}'." >&2;;
       esac
 
-      if [ -n "$dynamicLinker" ]; then
+      if [ -n "''${dynamicLinker:-}" ]; then
         echo $dynamicLinker > $out/nix-support/dynamic-linker
 
     '' + (if targetPlatform.isDarwin then ''
diff --git a/pkgs/build-support/cc-wrapper/gnat-wrapper.sh b/pkgs/build-support/cc-wrapper/gnat-wrapper.sh
index b15f1e461e5..7a0eb28be63 100644
--- a/pkgs/build-support/cc-wrapper/gnat-wrapper.sh
+++ b/pkgs/build-support/cc-wrapper/gnat-wrapper.sh
@@ -1,5 +1,5 @@
 #! @shell@
-set -eu -o pipefail
+set -eu -o pipefail +o posix
 shopt -s nullglob
 
 if (( "${NIX_DEBUG:-0}" >= 7 )); then
diff --git a/pkgs/build-support/cc-wrapper/gnatlink-wrapper.sh b/pkgs/build-support/cc-wrapper/gnatlink-wrapper.sh
index 88e644dc54d..0944d74e431 100644
--- a/pkgs/build-support/cc-wrapper/gnatlink-wrapper.sh
+++ b/pkgs/build-support/cc-wrapper/gnatlink-wrapper.sh
@@ -1,5 +1,5 @@
 #! @shell@
-set -eu -o pipefail
+set -eu -o pipefail +o posix
 shopt -s nullglob
 
 if (( "${NIX_DEBUG:-0}" >= 7 )); then
diff --git a/pkgs/build-support/cc-wrapper/ld-wrapper.sh b/pkgs/build-support/cc-wrapper/ld-wrapper.sh
index 232e1245af0..ef618f9a86d 100644
--- a/pkgs/build-support/cc-wrapper/ld-wrapper.sh
+++ b/pkgs/build-support/cc-wrapper/ld-wrapper.sh
@@ -1,5 +1,5 @@
 #! @shell@
-set -eu -o pipefail
+set -eu -o pipefail +o posix
 shopt -s nullglob
 
 if (( "${NIX_DEBUG:-0}" >= 7 )); then
diff --git a/pkgs/data/misc/dns-root-data/default.nix b/pkgs/data/misc/dns-root-data/default.nix
index dade4be1aaf..88b608c7815 100644
--- a/pkgs/data/misc/dns-root-data/default.nix
+++ b/pkgs/data/misc/dns-root-data/default.nix
@@ -4,7 +4,7 @@ let
 
   rootHints = fetchurl {
     url = "https://www.internic.net/domain/named.root";
-    sha256 = "01n4bqf95kbvig1hahqzmmdkpn4v7mzfc1p944gq922i5j3fjr92";
+    sha256 = "0vdrff4l8s8grif52dnh091s8qydhh88k25zqd9rj66sf1qwcwxl";
   };
 
   rootKey = ./root.key;
@@ -13,7 +13,7 @@ let
 in
 
 stdenv.mkDerivation {
-  name = "dns-root-data-2017-08-29";
+  name = "dns-root-data-2017-10-24";
 
   buildCommand = ''
     mkdir $out
diff --git a/pkgs/data/misc/hackage/default.nix b/pkgs/data/misc/hackage/default.nix
index c3cd9bdb4b3..91d38f3537e 100644
--- a/pkgs/data/misc/hackage/default.nix
+++ b/pkgs/data/misc/hackage/default.nix
@@ -1,34 +1,6 @@
-{ fetchFromGitHub
-, stdenv
-, pkgconfig
-, libarchive
-, glib
-, # Override this to use a different revision
-  src-spec ?
-    { owner = "commercialhaskell";
-      repo = "all-cabal-hashes";
-      rev = "5e87c40f2cd96bd5dd953758e82f302107c7895e";
-      sha256 = "12rw5fld64s0a2zjsdijfs0dv6vc6z7gcf24h4m2dmymzms4namg";
-    }
-, lib
-}:
+{ fetchurl }:
 
-# Use builtins.fetchTarball "https://github.com/commercialhaskell/all-cabal-hashes/archive/hackage.tar.gz"
-# instead if you want the latest Hackage automatically at the price of frequent re-downloads.
-let partition-all-cabal-hashes = stdenv.mkDerivation
-      { name = "partition-all-cabal-hashes";
-        src = ./partition-all-cabal-hashes.c;
-        unpackPhase = "true";
-        buildInputs = [ libarchive glib ];
-        nativeBuildInputs = [ pkgconfig ];
-        buildPhase =
-          "cc -O3 $(pkg-config --cflags --libs libarchive glib-2.0) $src -o partition-all-cabal-hashes";
-        installPhase =
-          ''
-            mkdir -p $out/bin
-            install -m755 partition-all-cabal-hashes $out/bin
-          '';
-      };
-in fetchFromGitHub (src-spec //
-  { postFetch = "${partition-all-cabal-hashes}/bin/partition-all-cabal-hashes $downloadedFile $out";
-  })
+fetchurl {
+  url = "https://github.com/commercialhaskell/all-cabal-hashes/archive/5e87c40f2cd96bd5dd953758e82f302107c7895e.tar.gz";
+  sha256 = "0hjkddda9mdm21nb9bkhr9n5r9jllisif1qmzha91a9cps5w1mx5";
+}
diff --git a/pkgs/data/misc/hackage/partition-all-cabal-hashes.c b/pkgs/data/misc/hackage/partition-all-cabal-hashes.c
deleted file mode 100644
index d8c3eca3701..00000000000
--- a/pkgs/data/misc/hackage/partition-all-cabal-hashes.c
+++ /dev/null
@@ -1,190 +0,0 @@
-#include <stdio.h>
-#include <ctype.h>
-#include <glib.h>
-#include <string.h>
-#include <locale.h>
-#include <archive.h>
-#include <archive_entry.h>
-
-static char * case_normalize(char * str) {
-  for (char * iter = str; *iter; ++iter) {
-    *iter = tolower(*iter);
-  }
-  return str;
-}
-
-static gint compare_str(const void * a, const void * b, void * _) {
-  return strcmp(a, b);
-}
-
-int main(int argc, char ** argv) {
-  if (argc != 3) {
-    fprintf(stderr, "Usage: %s TARBALL OUTPUT\n", argv[0]);
-    return 1;
-  }
-
-  size_t output_len = strlen(argv[2]);
-
-  /* Switch to standard locale to ensure consistency in case-folding.
-   */
-  setlocale(LC_CTYPE, "C");
-
-  /* Map from case-normalized package name to a sorted sequence of
-   * package names in the equivalence class defined by
-   * case-normalization.
-   */
-  GHashTable * equivalence_classes =
-    g_hash_table_new(g_str_hash, g_str_equal);
-
-  /* Open up the tarball.
-   */
-  struct archive * ar = archive_read_new();
-  if (!ar) {
-    perror("Allocating archive structure");
-    return 1;
-  }
-  archive_read_support_filter_gzip(ar);
-  archive_read_support_format_tar(ar);
-  if (archive_read_open_filename( ar
-                                , argv[1]
-                                , 10240
-                                ) == ARCHIVE_FATAL) {
-    fprintf( stderr
-           , "Error opening %s: %s\n"
-           , argv[0]
-           , archive_error_string(ar)
-           );
-    return 1;
-  }
-
-  /* Extract the length of the output directory that prefixes all
-   * tarball entries from the first entry in the tarball.
-   */
-  struct archive_entry * ent;
-  int err = archive_read_next_header(ar, &ent);
-  if (err != ARCHIVE_OK) {
-    if (err == ARCHIVE_EOF) {
-      fprintf( stderr
-             , "No entries in %s, surely this is an error!\n"
-             , argv[1]
-             );
-    } else {
-      fprintf( stderr
-             , "Error reading entry from %s: %s\n"
-             , argv[1]
-             , archive_error_string(ar)
-             );
-    }
-    return 1;
-  }
-  const char * path = archive_entry_pathname(ent);
-  /* Number of characters from the start of the path name until after
-   * the slash after the leading directory.
-   */
-  size_t prefix_len = strchr(path, '/') - path + 1;
-
-  /* Extract each entry to the right partition.
-   */
-  do {
-    path = archive_entry_pathname(ent) + prefix_len;
-    const char * pkg_end = strchr(path, '/');
-    if (!pkg_end)
-      /* If there is no second slash, then this is either just the entry
-       * corresponding to the root or some non-package file (e.g.
-       * travis.yml). In either case, we don't care.
-       */
-      continue;
-
-    /* Find our package in the equivalence class map.
-     */
-    char * pkg_name = g_strndup(path, pkg_end - path);
-    char * pkg_normalized =
-      case_normalize(g_strndup(path, pkg_end - path));
-    GSequence * pkg_class =
-      g_hash_table_lookup(equivalence_classes, pkg_normalized);
-    gint partition_num;
-    if (!pkg_class) {
-      /* We haven't seen any packages with this normalized name yet,
-       * so we need to initialize the sequence and add it to the map.
-       */
-      pkg_class = g_sequence_new(NULL);
-      g_sequence_append(pkg_class, pkg_name);
-      g_hash_table_insert( equivalence_classes
-                         , pkg_normalized
-                         , pkg_class
-                         );
-      partition_num = 1;
-    } else {
-      g_free(pkg_normalized);
-      /* Find the package name in the equivalence class */
-      GSequenceIter * pkg_iter =
-        g_sequence_search( pkg_class
-                         , pkg_name
-                         , compare_str
-                         , NULL
-                         );
-      if (!g_sequence_iter_is_end(pkg_iter)) {
-        /* If there are any packages after this one in the list, bail
-         * out. In principle we could solve this by moving them up to
-         * the next partition, but so far I've never seen any github
-         * tarballs out of order so let's save ourselves the work
-         * until we know we need it.
-         */
-        fprintf( stderr
-               , "Out of order github tarball: %s is after %s\n"
-               , pkg_name
-               , (char *) g_sequence_get(pkg_iter)
-               );
-        return 1;
-      }
-      pkg_iter = g_sequence_iter_prev(pkg_iter);
-      if (strcmp( g_sequence_get(pkg_iter)
-                , pkg_name
-                ) != 0) {
-        /* This package doesn't have the same name as the one right
-         * before where it should be in the sequence, which means it's
-         * new and needs to be added to the sequence.
-         *
-         * !!! We need to change this to use g_sequence_insert_before
-         * if we ever get an out-of-order github tarball, see comment
-         * after the check for !g_sequence_iter_is_end(pkg_iter).
-         */
-        pkg_iter = g_sequence_append(pkg_class, pkg_name);
-      } else {
-        g_free(pkg_name);
-      }
-      /* Get the partition number, starting with 1.
-       */
-      partition_num = g_sequence_iter_get_position(pkg_iter) + 1;
-    }
-
-    /* Set the destination path.
-     * The 3 below is for the length of /#/, the partition number part
-     * of the path. If we have more than 9 partitions, we deserve to
-     * segfault. The 1 at the end is for the trailing null.
-     */
-    char * dest_path = g_malloc(output_len + 3 + strlen(path) + 1);
-    sprintf(dest_path, "%s/%d/%s", argv[2], partition_num, path);
-    archive_entry_set_pathname(ent, dest_path);
-
-    if (archive_read_extract(ar, ent, 0) != ARCHIVE_OK) {
-      fprintf( stderr
-             , "Error extracting entry %s from %s: %s\n"
-             , dest_path
-             , argv[1]
-             , archive_error_string(ar)
-             );
-      return 1;
-    }
-  } while ((err = archive_read_next_header(ar, &ent)) == ARCHIVE_OK);
-  if (err != ARCHIVE_EOF) {
-    fprintf( stderr
-           , "Error reading entry from %s: %s\n"
-           , argv[1]
-           , archive_error_string(ar)
-           );
-    return 1;
-  }
-
-  return 0;
-}
diff --git a/pkgs/desktops/gnome-3/misc/gitg/src.nix b/pkgs/desktops/gnome-3/misc/gitg/src.nix
index 9c6dd2148cc..c72e2830ad1 100644
--- a/pkgs/desktops/gnome-3/misc/gitg/src.nix
+++ b/pkgs/desktops/gnome-3/misc/gitg/src.nix
@@ -1,10 +1,10 @@
 # Autogenerated by maintainers/scripts/gnome.sh update
 
 fetchurl: {
-  name = "gitg-3.24.0";
+  name = "gitg-3.26.0";
 
   src = fetchurl {
-    url = mirror://gnome/sources/gitg/3.24/gitg-3.24.0.tar.xz;
-    sha256 = "3e4ec4a8ae83bc7ced8c7610927ade70e37daa5e8beeb4f357a6ea30b4cc951e";
+    url = mirror://gnome/sources/gitg/3.26/gitg-3.26.0.tar.xz;
+    sha256 = "26730d437d6a30d6e341b9e8da99d2134dce4b96022c195609f45062f82b54d5";
   };
 }
diff --git a/pkgs/desktops/gnome-3/misc/libgit2-glib/default.nix b/pkgs/desktops/gnome-3/misc/libgit2-glib/default.nix
index a71dbf5494d..36feb09d7ee 100644
--- a/pkgs/desktops/gnome-3/misc/libgit2-glib/default.nix
+++ b/pkgs/desktops/gnome-3/misc/libgit2-glib/default.nix
@@ -1,12 +1,14 @@
-{ stdenv, fetchurl, gnome3, libtool, pkgconfig, vala_0_32, libssh2
+{ stdenv, fetchurl, gnome3, libtool, pkgconfig, vala, libssh2
 , gtk_doc, gobjectIntrospection, libgit2, glib }:
 
 stdenv.mkDerivation rec {
   inherit (import ./src.nix fetchurl) name src;
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ gnome3.gnome_common libtool vala_0_32 libssh2
-                  gtk_doc gobjectIntrospection libgit2 glib ];
+  nativeBuildInputs = [
+    gnome3.gnome_common libtool pkgconfig vala gtk_doc gobjectIntrospection
+  ];
+
+  buildInputs = [ libssh2 libgit2 glib ];
 
   meta = with stdenv.lib; {
     platforms = platforms.linux;
diff --git a/pkgs/desktops/gnome-3/misc/libgit2-glib/src.nix b/pkgs/desktops/gnome-3/misc/libgit2-glib/src.nix
index b9abde42cbd..00e747500c6 100644
--- a/pkgs/desktops/gnome-3/misc/libgit2-glib/src.nix
+++ b/pkgs/desktops/gnome-3/misc/libgit2-glib/src.nix
@@ -1,12 +1,10 @@
 # Autogenerated by maintainers/scripts/gnome.sh update
 
-fetchurl: rec {
-  major = "0.25";
-  minor = "0";
-  name = "libgit2-glib-${major}.${minor}";
+fetchurl: {
+  name = "libgit2-glib-0.26.0";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/libgit2-glib/${major}/${name}.tar.xz";
-    sha256 = "0rf5gcr3khp35wj9ax9cbyq5j3iiwa1l0fi16w6sfgmrryd6n9aa";
+    url = mirror://gnome/sources/libgit2-glib/0.26/libgit2-glib-0.26.0.tar.xz;
+    sha256 = "06b16cfcc3a53d9804858618d690e5509e9af2e2245b75f0479cadbbe39745c3";
   };
 }
diff --git a/pkgs/development/beam-modules/hex-packages.nix b/pkgs/development/beam-modules/hex-packages.nix
index d8d55c01120..df781d3e247 100644
--- a/pkgs/development/beam-modules/hex-packages.nix
+++ b/pkgs/development/beam-modules/hex-packages.nix
@@ -11,6 +11,15 @@
  * airbrakex_0_0_8
  * alembic_2_1_0
  * algolia_0_3_2
+ * alice_0_3_6
+ * alice_against_humanity_0_1_2
+ * alice_google_images_0_1_3
+ * alice_karma_0_2_0
+ * alice_personable_0_0_2
+ * alice_reddit_0_0_3
+ * alice_shizzle_0_1_2
+ * alice_tielurs_heart_rate_0_0_5
+ * alice_xkcd_0_0_3
  * alphonse_0_1_0
  * amqp_0_1_1
  * amqp_0_1_4
@@ -31,6 +40,7 @@
  * aws_http_0_2_4
  * b2_client_0_0_1
  * backoff_1_1_3
+ * backy_0_0_5
  * balanced_3_1_0
  * bamboo_sendgrid_0_1_0
  * bandwidth_1_2_1
@@ -51,6 +61,7 @@
  * blackbook_0_3_1
  * block_timer_0_0_1
  * bno055_0_0_1
+ * boltun_1_0_1
  * booter_0_1_0
  * bottler_0_5_0
  * bouncer_0_1_5
@@ -119,6 +130,7 @@
  * cloudi_service_validate_1_5_1
  * cloudi_service_zeromq_1_5_1
  * clox_0_1_3
+ * coffee_rotor_0_2_1
  * coinbase_0_0_1
  * comeonin_ecto_password_2_0_0_rc_0
  * commerce_billing_0_0_2
@@ -142,6 +154,8 @@
  * cpg_1_4_0
  * cpg_1_5_1
  * cqrex_0_0_1
+ * cqrs_0_0_7
+ * cqrs_events_0_0_4
  * craterl_0_2_3
  * crudex_0_0_2
  * crypto_ext_0_1_3
@@ -151,6 +165,7 @@
  * datomic_gen_server_2_0_1
  * dayron_0_1_1
  * db_0_9_0
+ * db_connection_1_0_0_rc_0
  * dbschema_0_2_0
  * dbus_0_5_0
  * ddb_client_0_1_17
@@ -205,6 +220,7 @@
  * ectograph_0_0_8
  * ectoo_0_0_4
  * ectophile_0_3_0
+ * edeliver_1_2_9
  * eden_0_1_3
  * edgarex_0_0_2
  * efrisby_0_2_0
@@ -222,12 +238,15 @@
  * elixir_drawille_0_0_3
  * elixir_ipfs_api_0_1_0
  * elixir_locker_0_1_4
+ * elixir_nsq_1_0_3
  * elixometer_1_2_1
  * elixtagram_0_2_7
  * elixush_0_0_4
  * elli_xpblfe_0_1_1
  * elmit_0_0_1
+ * email_checker_0_0_3
  * emodel_1_3_1
+ * eno_0_0_1
  * enotify_0_1_0
  * ensq_0_1_6
  * env_conf_0_3_0
@@ -252,9 +271,11 @@
  * esip_1_0_4
  * espec_phoenix_0_2_1
  * etcd_0_0_2
+ * etude_0_1_5
  * etude_request_0_1_0
  * euler_0_0_1
  * event_source_encoder_0_0_3
+ * eventstore_0_2_1
  * everex_0_1_1
  * everyoneapi_0_0_1
  * everything_location_0_0_1
@@ -315,6 +336,8 @@
  * exprotobuf_0_10_2
  * exprotobuf_0_13_0
  * exprotobuf_1_0_0
+ * exq_0_7_1
+ * exq_ui_0_7_1
  * exquery_0_0_11
  * exrabbit_0_0_2
  * exrecaptcha_0_0_3
@@ -322,6 +345,12 @@
  * exrm_0_14_17
  * exrm_0_18_8
  * exrm_0_19_9
+ * exrm_1_0_5
+ * exrm_deb_0_0_6
+ * exrm_docker_0_1_0
+ * exrm_heroku_0_1_1
+ * exrm_rpm_0_3_3
+ * exrm_smartos_gz_1_0_0
  * exseed_0_0_3
  * exsentry_0_5_0
  * exsyslog_1_0_1
@@ -357,6 +386,7 @@
  * fleet_api_0_0_15
  * floorplan_0_1_1
  * flower_power_0_3_2
+ * flub_0_9_0
  * fluent_client_0_1_0
  * folsom_ddb_0_1_22
  * font_awesome_phoenix_0_3_2
@@ -442,6 +472,7 @@
  * kalends_0_6_5
  * kane_0_1_1
  * katipo_0_3_4
+ * kcl_0_6_2
  * keccakf1600_2_0_0
  * keelless_0_1_0
  * keenex_0_3_0
@@ -463,6 +494,7 @@
  * libex_config_0_2_0
  * libhowl_0_1_36
  * libleofs_0_1_2
+ * librex_1_0_1
  * libsnarl_0_3_40
  * libsnarl_0_3_46
  * libsniffle_0_3_47
@@ -478,7 +510,9 @@
  * mailgun_webhook_auth_1_0_0
  * mailibex_0_1_0
  * mailman_0_2_2
+ * mandrag_0_1_1
  * mandrillex_0_2_0
+ * mariaex_0_7_5
  * maru_0_10_1
  * maru_swagger_0_8_0
  * marvel_1_0_0
@@ -489,6 +523,7 @@
  * mdns_client_lib_0_1_33
  * mdns_client_lib_0_1_39
  * medex_0_1_2
+ * merkle_0_0_4
  * message_pack_0_2_0
  * meta_0_0_1
  * migratrex_0_0_1
@@ -496,6 +531,7 @@
  * mixstar_0_0_1
  * mmath_0_1_15
  * mobiledoc_0_0_1
+ * moebius_2_0_1
  * monetized_0_4_0
  * money_1_0_0
  * mongo_0_5_4
@@ -586,6 +622,7 @@
  * phoenix_linguist_0_0_1
  * phoenix_live_reload_1_0_5
  * phoenix_microsoftbot_0_1_0
+ * phoenix_pubsub_postgres_0_0_2
  * phoenix_pubsub_rabbitmq_0_0_1
  * phoenix_pubsub_redis_2_0_0
  * phoenix_ratchet_0_2_0
@@ -617,6 +654,7 @@
  * plug_newrelic_0_0_5
  * plug_secure_headers_0_0_1
  * plug_session_memcached_0_3_3
+ * plug_session_redis_0_1_0
  * png_0_1_1
  * poison_1_0_3
  * poison_1_1_1
@@ -626,13 +664,17 @@
  * portal_0_0_1
  * porterstemmer_0_0_1
  * portmidi_5_0_0
+ * posterize_0_11_0
+ * postgrex_0_11_1
  * postgrex_0_6_0
  * pqueue_1_4_0
  * proper_1_1_1_beta
  * protego_0_1_0
  * protobuffs_0_8_2
  * provider_asn1_0_2_1
+ * pulse_0_1_3
  * pulse_libs_1_0_0
+ * pusher_0_1_3
  * pushex_0_0_5
  * pynchon_0_1_1
  * quick_chex_0_2_1
@@ -645,6 +687,7 @@
  * raygun_0_3_0
  * reactive_0_0_1
  * readme_md_doc_0_1_2
+ * reagent_0_1_9
  * reaxt_0_3_2
  * rebar3_abnfc_plugin_0_1_0
  * rebar3_auto_0_3_0
@@ -1545,267 +1588,6 @@ let
 
     algae = algae_0_10_0;
 
-    alice_0_3_6 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          poison_2_1_0,
-          redix_0_3_6,
-          poolboy_1_5_1,
-          slack_0_4_2
-        }:
-          buildMix ({
-            name = "alice";
-            version = "0.3.6";
-            src = fetchHex {
-              pkg = "alice";
-              version = "0.3.6";
-              sha256 =
-                "f5c549f6983a5cc5f13320728315d101c8117f939df29e51c10ed3ff26809d54";
-            };
-            beamDeps  = [ poison_2_1_0 redix_0_3_6 poolboy_1_5_1 slack_0_4_2
-                      ];
-
-            meta = {
-              description = ''A Slack bot'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/adamzaninovich/alice";
-            };
-          } // packageOverrides)
-      ) {};
-
-    alice = alice_0_3_6;
-
-    alice_against_humanity_0_1_2 = callPackage
-      (
-        {  buildMix, packageOverrides ? {}, fetchHex, alice_0_3_6 }:
-          buildMix ({
-            name = "alice_against_humanity";
-            version = "0.1.2";
-            src = fetchHex {
-              pkg = "alice_against_humanity";
-              version = "0.1.2";
-              sha256 =
-                "aac5f049b59d0eaaea2383e1fc8fec28125b9a29ffda7fbe214d829738ad3935";
-            };
-            beamDeps  = [ alice_0_3_6 ];
-
-            meta = {
-              description = ''A handler for the Alice Slack bot. Play Cards
-                            Against Humanity with Alice.'';
-              license = stdenv.lib.licenses.mit;
-              homepage =
-                "https://github.com/adamzaninovich/alice_against_humanity";
-            };
-          } // packageOverrides)
-      ) {};
-
-    alice_against_humanity = alice_against_humanity_0_1_2;
-
-    alice_google_images_0_1_3 = callPackage
-      (
-        {  buildMix, packageOverrides ? {}, fetchHex, alice_0_3_6 }:
-          buildMix ({
-            name = "alice_google_images";
-            version = "0.1.3";
-            src = fetchHex {
-              pkg = "alice_google_images";
-              version = "0.1.3";
-              sha256 =
-                "04b4e23c44a67c032c1ac8e2da4ca0fca03ec20cf207b4cb40eba0cb17e975e8";
-            };
-            beamDeps  = [ alice_0_3_6 ];
-
-            meta = {
-              description = ''A handler for the Alice Slack bot. Get random
-                            images from Google'';
-              license = stdenv.lib.licenses.mit;
-              homepage =
-                "https://github.com/adamzaninovich/alice_google_images";
-            };
-          } // packageOverrides)
-      ) {};
-
-    alice_google_images = alice_google_images_0_1_3;
-
-    alice_karma_0_2_0 = callPackage
-      (
-        {  buildMix, packageOverrides ? {}, fetchHex, alice_0_3_6 }:
-          buildMix ({
-            name = "alice_karma";
-            version = "0.2.0";
-            src = fetchHex {
-              pkg = "alice_karma";
-              version = "0.2.0";
-              sha256 =
-                "8b1a6da30511fbc9c6df4035994407813af5ff194768ad64ebc1379cd923591d";
-            };
-            beamDeps  = [ alice_0_3_6 ];
-
-            meta = {
-              longDescription = ''A handler for the Alice Slack bot. Allows
-                                Alice to keep track of karma points for
-                                arbitrary terms.'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/adamzaninovich/alice_karma";
-            };
-          } // packageOverrides)
-      ) {};
-
-    alice_karma = alice_karma_0_2_0;
-
-    alice_personable_0_0_2 = callPackage
-      (
-        {  buildMix, packageOverrides ? {}, fetchHex, alice_0_3_6 }:
-          buildMix ({
-            name = "alice_personable";
-            version = "0.0.2";
-            src = fetchHex {
-              pkg = "alice_personable";
-              version = "0.0.2";
-              sha256 =
-                "fb80938b27c3ae374b3d0bf284de9902d65e85dd8da2d4c80238a03b819b8aad";
-            };
-            beamDeps  = [ alice_0_3_6 ];
-
-            meta = {
-              description = ''A plugin for the Alice chat bot to make her seem
-                            a bit more human.'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/mattr-/alice_personable";
-            };
-          } // packageOverrides)
-      ) {};
-
-    alice_personable = alice_personable_0_0_2;
-
-    alice_reddit_0_0_3 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          readit_0_0_3,
-          alice_0_3_6
-        }:
-          buildMix ({
-            name = "alice_reddit";
-            version = "0.0.3";
-            src = fetchHex {
-              pkg = "alice_reddit";
-              version = "0.0.3";
-              sha256 =
-                "bd1d16dde4cb066b4ae7486da425148fab23ae5bece0d283e1c27352b7707dbc";
-            };
-            beamDeps  = [ readit_0_0_3 alice_0_3_6 ];
-
-            meta = {
-              description = ''Alice does Reddit'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/adamzaninovich/alice_reddit";
-            };
-          } // packageOverrides)
-      ) {};
-
-    alice_reddit = alice_reddit_0_0_3;
-
-    alice_shizzle_0_1_2 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          gizoogle_0_0_2,
-          alice_0_3_6
-        }:
-          buildMix ({
-            name = "alice_shizzle";
-            version = "0.1.2";
-            src = fetchHex {
-              pkg = "alice_shizzle";
-              version = "0.1.2";
-              sha256 =
-                "c98481d59c004f905958b9412bff1d288a649cf373afb4fea307222af2597c19";
-            };
-            beamDeps  = [ gizoogle_0_0_2 alice_0_3_6 ];
-
-            meta = {
-              longDescription = ''A handlez fo` tha Alice Slack bot fo` realz.
-                                Uses Gizoogle ta allow you ta drop a rhyme like
-                                a thug n` retrieve links fo` translated sitez'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/notdevinclark/alice_shizzle";
-            };
-          } // packageOverrides)
-      ) {};
-
-    alice_shizzle = alice_shizzle_0_1_2;
-
-    alice_tielurs_heart_rate_0_0_5 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          alice_0_3_6,
-          timex_2_1_6,
-          httpoison_0_8_3
-        }:
-          buildMix ({
-            name = "alice_tielurs_heart_rate";
-            version = "0.0.5";
-            src = fetchHex {
-              pkg = "alice_tielurs_heart_rate";
-              version = "0.0.5";
-              sha256 =
-                "691b49b417029034d5b1905e06fa266c114d41fc9066047aa65212224e0bb5cc";
-            };
-            beamDeps  = [ alice_0_3_6 timex_2_1_6 httpoison_0_8_3 ];
-
-            meta = {
-              description = ''A handler for the Alice Slack bot. Allows Alice
-                            to check Tielur`s heart rate'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/tielur/alice_tielurs_heart_rate";
-            };
-          } // packageOverrides)
-      ) {};
-
-    alice_tielurs_heart_rate = alice_tielurs_heart_rate_0_0_5;
-
-    alice_xkcd_0_0_3 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          xkcd_0_0_1,
-          alice_0_3_6
-        }:
-          buildMix ({
-            name = "alice_xkcd";
-            version = "0.0.3";
-            src = fetchHex {
-              pkg = "alice_xkcd";
-              version = "0.0.3";
-              sha256 =
-                "13562b43fd99c7d9cdc568d7511c154842b9a59a19eca9df019069193bd94842";
-            };
-            beamDeps  = [ xkcd_0_0_1 alice_0_3_6 ];
-
-            meta = {
-              longDescription = ''A handler for the Alice Slack bot. Retrieves
-                                latest, specific and random XKCD comics.'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/notdevinclark/alice_xkcd";
-            };
-          } // packageOverrides)
-      ) {};
-
-    alice_xkcd = alice_xkcd_0_0_3;
-
     amazon_product_advertising_client_0_1_1 = callPackage
       (
         {
@@ -2591,37 +2373,6 @@ let
 
     b2 = b2_0_0_6;
 
-    backy_0_0_5 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          poison_2_1_0,
-          postgrex_0_11_1
-        }:
-          buildMix ({
-            name = "backy";
-            version = "0.0.5";
-            src = fetchHex {
-              pkg = "backy";
-              version = "0.0.5";
-              sha256 =
-                "e581cc209ec08e61f0ba2205b39b7154f9fb3d12f6636e76ebd3ddce5e85a0e6";
-            };
-            beamDeps  = [ poison_2_1_0 postgrex_0_11_1 ];
-
-            meta = {
-              description = ''A simple background job queue backed by
-                            postgresql.'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/kuon/backy";
-            };
-          } // packageOverrides)
-      ) {};
-
-    backy = backy_0_0_5;
-
     bamboo_0_3_2 = callPackage
       (
         {
@@ -4303,32 +4054,6 @@ let
 
     bmfont = bmfont_0_0_1;
 
-    boltun_1_0_1 = callPackage
-      (
-        {  buildMix, packageOverrides ? {}, fetchHex, postgrex_0_11_1 }:
-          buildMix ({
-            name = "boltun";
-            version = "1.0.1";
-            src = fetchHex {
-              pkg = "boltun";
-              version = "1.0.1";
-              sha256 =
-                "4b787aa6cafedca1a3a35b40ca8fee944641b1577b18c4e9e8c234ffd728e8d9";
-            };
-            beamDeps  = [ postgrex_0_11_1 ];
-
-            meta = {
-              longDescription = ''Transforms notifications from the Postgres
-                                LISTEN/NOTIFY mechanism into callback
-                                execution'';
-              license = stdenv.lib.licenses.isc;
-              homepage = "https://github.com/bitgamma/boltun";
-            };
-          } // packageOverrides)
-      ) {};
-
-    boltun = boltun_1_0_1;
-
     bookingsync_api_client_v3_0_0_1 = callPackage
       (
         {
@@ -5871,31 +5596,6 @@ let
 
     codepagex = codepagex_0_1_2;
 
-    coffee_rotor_0_2_1 = callPackage
-      (
-        {  buildMix, packageOverrides ? {}, fetchHex, rotor_0_2_2 }:
-          buildMix ({
-            name = "coffee_rotor";
-            version = "0.2.1";
-            src = fetchHex {
-              pkg = "coffee_rotor";
-              version = "0.2.1";
-              sha256 =
-                "cb2f786c1abf109ed4d86ec175c02cb09adb1f1ee52d7a4ef0c9e65979d4f365";
-            };
-            beamDeps  = [ rotor_0_2_2 ];
-
-            meta = {
-              description = ''A [rotor](https://github.com/HashNuke/rotor) to
-                            compile CoffeeScript files '';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/HashNuke/coffee_rotor";
-            };
-          } // packageOverrides)
-      ) {};
-
-    coffee_rotor = coffee_rotor_0_2_1;
-
     coincap_io_0_0_2 = callPackage
       (
         {
@@ -7022,37 +6722,6 @@ let
 
     cqex = cqex_0_2_0;
 
-    cqrs_0_0_7 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          cqrs_events_0_0_4,
-          cqrs_commands_0_0_6
-        }:
-          buildMix ({
-            name = "cqrs";
-            version = "0.0.7";
-            src = fetchHex {
-              pkg = "cqrs";
-              version = "0.0.7";
-              sha256 =
-                "feb8f5b6e8bb0a7bbc622ad6b0b518e218d3adfad6ef55b16d531c992240c41f";
-            };
-            beamDeps  = [ cqrs_events_0_0_4 cqrs_commands_0_0_6 ];
-
-            meta = {
-              description = ''This is not production ready yet but I want your
-                            feedback.'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/amberbit/cqrs_commands";
-            };
-          } // packageOverrides)
-      ) {};
-
-    cqrs = cqrs_0_0_7;
-
     cqrs_commands_0_0_6 = callPackage
       (
         {
@@ -7093,38 +6762,6 @@ let
 
     cqrs_commands = cqrs_commands_0_0_6;
 
-    cqrs_events_0_0_4 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          syn_1_4_0,
-          poison_2_0_1,
-          moebius_2_0_1
-        }:
-          buildMix ({
-            name = "cqrs_events";
-            version = "0.0.4";
-            src = fetchHex {
-              pkg = "cqrs_events";
-              version = "0.0.4";
-              sha256 =
-                "21c5ee4b8b814abf7ced3c88069511dd1a9a5c1c16a17c175228bfe5a9e4b7f8";
-            };
-            beamDeps  = [ syn_1_4_0 poison_2_0_1 moebius_2_0_1 ];
-
-            meta = {
-              description = ''This is not production ready yet but I want your
-                            feedback.'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/amberbit/cqrs_commands";
-            };
-          } // packageOverrides)
-      ) {};
-
-    cqrs_events = cqrs_events_0_0_4;
-
     crazy_pants_0_0_1 = callPackage
       (
         {  buildMix, packageOverrides ? {}, fetchHex }:
@@ -7950,38 +7587,6 @@ let
 
     datastructures = datastructures_0_2_5;
 
-    db_connection_1_0_0_rc_0 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          sbroker_0_6_2,
-          poolboy_1_5_1,
-          connection_1_0_2
-        }:
-          buildMix ({
-            name = "db_connection";
-            version = "1.0.0-rc.0";
-            src = fetchHex {
-              pkg = "db_connection";
-              version = "1.0.0-rc.0";
-              sha256 =
-                "ff4e4805da74db0fe9dbe751ce39e1549c7bf80593dd1cd53b31458df801026d";
-            };
-            beamDeps  = [ sbroker_0_6_2 poolboy_1_5_1 connection_1_0_2 ];
-
-            meta = {
-              description = ''Database connection behaviour for database
-                            transactions and connection pooling'';
-              license = stdenv.lib.licenses.asl20;
-              homepage = "https://github.com/fishcakez/db_connection";
-            };
-          } // packageOverrides)
-      ) {};
-
-    db_connection = db_connection_1_0_0_rc_0;
-
     dbg_1_0_1 = callPackage
       (
         {  buildMix, packageOverrides ? {}, fetchHex }:
@@ -9759,32 +9364,6 @@ let
 
     ed25519 = ed25519_0_2_0;
 
-    edeliver_1_2_9 = callPackage
-      (
-        {  buildMix, packageOverrides ? {}, fetchHex, exrm_1_0_5 }:
-          buildMix ({
-            name = "edeliver";
-            version = "1.2.9";
-            src = fetchHex {
-              pkg = "edeliver";
-              version = "1.2.9";
-              sha256 =
-                "0673ffc1f6eb6f2c29097afa81baa7f9be18cf54bd796724b16656297aff85df";
-            };
-            beamDeps  = [ exrm_1_0_5 ];
-
-            meta = {
-              longDescription = ''Build and Deploy Elixir Applications and
-                                perform Hot-Code Upgrades and Schema
-                                Migrations'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/boldpoker/edeliver";
-            };
-          } // packageOverrides)
-      ) {};
-
-    edeliver = edeliver_1_2_9;
-
     edib_0_7_0 = callPackage
       (
         {  buildMix, packageOverrides ? {}, fetchHex }:
@@ -10446,42 +10025,6 @@ let
 
     elixir_mod_event = elixir_mod_event_0_0_5;
 
-    elixir_nsq_1_0_3 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          uuid_1_1_4,
-          socket_0_3_4,
-          poison_1_5_2,
-          httpotion_2_2_2
-        }:
-          buildMix ({
-            name = "elixir_nsq";
-            version = "1.0.3";
-            src = fetchHex {
-              pkg = "elixir_nsq";
-              version = "1.0.3";
-              sha256 =
-                "6d30c3754dfdd988f927b9c6ae51d3e0ec4b0d2477b99047baf7a52c96bf9494";
-            };
-            beamDeps  = [
-                          uuid_1_1_4 socket_0_3_4 poison_1_5_2 httpotion_2_2_2
-                        ];
-
-            meta = {
-              longDescription = ''A client library for NSQ, `elixir_nsq` aims
-                                to be complete, easy to use, and well tested.
-                                Developed at Wistia (http://wistia.com).'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/wistia/elixir_nsq";
-            };
-          } // packageOverrides)
-      ) {};
-
-    elixir_nsq = elixir_nsq_1_0_3;
-
     elixir_prelude_0_2_1 = callPackage
       (
         {  buildMix, packageOverrides ? {}, fetchHex }:
@@ -10761,36 +10304,6 @@ let
 
     elmxir = elmxir_0_0_1;
 
-    email_checker_0_0_3 = callPackage
-      (
-        {  buildMix, packageOverrides ? {}, fetchHex, socket_0_3_4 }:
-          buildMix ({
-            name = "email_checker";
-            version = "0.0.3";
-            src = fetchHex {
-              pkg = "email_checker";
-              version = "0.0.3";
-              sha256 =
-                "feac6fa5cc1343b437221ace18fa8fa7251dfa777e986063e13f435d6aff990c";
-            };
-            beamDeps  = [ socket_0_3_4 ];
-
-            meta = {
-              longDescription = ''Simple library checking the validity of an
-                                email. Checks are performed in the following
-                                order: - REGEX: validate the emails has a good
-                                looking format - MX: validate the domain sever
-                                contains MX records - SMTP: validate the SMTP
-                                behind the MX records knows this email address
-                                (no email sent)'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/kdisneur/email_checker";
-            };
-          } // packageOverrides)
-      ) {};
-
-    email_checker = email_checker_0_0_3;
-
     eministat_0_10_1 = callPackage
       (
         {  buildErlangMk, packageOverrides ? {}, fetchHex }:
@@ -10842,37 +10355,6 @@ let
 
     eml = eml_0_7_1;
 
-    eno_0_0_1 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          postgrex_0_11_1,
-          mariaex_0_7_5,
-          combine_0_7_0
-        }:
-          buildMix ({
-            name = "eno";
-            version = "0.0.1";
-            src = fetchHex {
-              pkg = "eno";
-              version = "0.0.1";
-              sha256 =
-                "217cabaf3d3a4f5e46d9b48a88a2cafded20a04a2f477f6bec37b3a82b40424a";
-            };
-            beamDeps  = [ postgrex_0_11_1 mariaex_0_7_5 combine_0_7_0 ];
-
-            meta = {
-              description = ''lightweight SQL toolkit'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/zweifisch/eno";
-            };
-          } // packageOverrides)
-      ) {};
-
-    eno = eno_0_0_1;
-
     env_0_1_0 = callPackage
       (
         {  buildMix, packageOverrides ? {}, fetchHex }:
@@ -11990,35 +11472,6 @@ let
 
     ets_owner = ets_owner_1_0_0;
 
-    etude_0_1_5 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          rebind_0_1_3,
-          lineo_0_0_1
-        }:
-          buildMix ({
-            name = "etude";
-            version = "0.1.5";
-            src = fetchHex {
-              pkg = "etude";
-              version = "0.1.5";
-              sha256 =
-                "4600f34a15fe85e74e181e4af9e4504ba1fedf42fcad77fd9d571b7443038355";
-            };
-            beamDeps  = [ rebind_0_1_3 lineo_0_0_1 ];
-
-            meta = {
-              description = ''parallel computation coordination utilities for
-                            erlang/elixir'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/camshaft/etude";
-            };
-          } // packageOverrides)
-      ) {};
-
     etude_1_0_0_beta_0 = callPackage
       (
         {
@@ -12176,37 +11629,6 @@ let
 
     event_nanny = event_nanny_0_1_1;
 
-    eventstore_0_2_1 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          postgrex_0_11_1,
-          poolboy_1_5_1,
-          fsm_0_2_0
-        }:
-          buildMix ({
-            name = "eventstore";
-            version = "0.2.1";
-            src = fetchHex {
-              pkg = "eventstore";
-              version = "0.2.1";
-              sha256 =
-                "ca035c60f925868826eb81bc85a91a7fa5e0637e3232d68e2d7aef248bf2ca35";
-            };
-            beamDeps  = [ postgrex_0_11_1 poolboy_1_5_1 fsm_0_2_0 ];
-
-            meta = {
-              description = ''EventStore using PostgreSQL for persistence.'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/slashdotdash/eventstore";
-            };
-          } // packageOverrides)
-      ) {};
-
-    eventstore = eventstore_0_2_1;
-
     eventstore_client_0_1_4 = callPackage
       (
         {
@@ -15191,73 +14613,6 @@ let
 
     exprof = exprof_0_2_0;
 
-    exq_0_7_1 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          uuid_1_1_4,
-          timex_2_1_6,
-          redix_0_3_6,
-          poison_2_1_0
-        }:
-          buildMix ({
-            name = "exq";
-            version = "0.7.1";
-            src = fetchHex {
-              pkg = "exq";
-              version = "0.7.1";
-              sha256 =
-                "d6694cddf4a6808c7bb9d8bcc9b917fe1a3720a22a917767a4f0ddcaa5b6d148";
-            };
-            beamDeps  = [ uuid_1_1_4 timex_2_1_6 redix_0_3_6 poison_2_1_0 ];
-
-            meta = {
-              longDescription = ''Exq is a job processing library compatible
-                                with Resque / Sidekiq for the Elixir
-                                language.'';
-              license = stdenv.lib.licenses.free;
-              homepage = "https://github.com/akira/exq";
-            };
-          } // packageOverrides)
-      ) {};
-
-    exq = exq_0_7_1;
-
-    exq_ui_0_7_1 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          plug_1_1_5,
-          exq_0_7_1,
-          cowboy_1_0_4
-        }:
-          buildMix ({
-            name = "exq_ui";
-            version = "0.7.1";
-            src = fetchHex {
-              pkg = "exq_ui";
-              version = "0.7.1";
-              sha256 =
-                "5ff47501d6280afd4a07b74190f96e94345653db617d24e3ffc1c5cbb2f1de72";
-            };
-            beamDeps  = [ plug_1_1_5 exq_0_7_1 cowboy_1_0_4 ];
-
-            meta = {
-              longDescription = ''Exq UI is the UI component for Exq, a job
-                                processing library. Exq UI provides the UI
-                                dashboard to display stats on job processing.'';
-
-              homepage = "https://github.com/akira/exq";
-            };
-          } // packageOverrides)
-      ) {};
-
-    exq_ui = exq_ui_0_7_1;
-
     exql_0_0_3 = callPackage
       (
         {  buildMix, packageOverrides ? {}, fetchHex, tds_0_5_4 }:
@@ -15406,167 +14761,6 @@ let
 
     exrethinkdb = exrethinkdb_0_0_3;
 
-    exrm_1_0_5 = callPackage
-      (
-        {  buildMix, packageOverrides ? {}, fetchHex, relx_3_19_0 }:
-          buildMix ({
-            name = "exrm";
-            version = "1.0.5";
-            src = fetchHex {
-              pkg = "exrm";
-              version = "1.0.5";
-              sha256 =
-                "fef4ec90a6cafcff138cf51a5acc882392b7b34bd13372373ad8abc09ea0ef47";
-            };
-            beamDeps  = [ relx_3_19_0 ];
-
-            meta = {
-              longDescription = ''Exrm, or Elixir Release Manager, provides mix
-                                tasks for building, upgrading, and controlling
-                                release packages for your application.'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/bitwalker/exrm";
-            };
-          } // packageOverrides)
-      ) {};
-
-    exrm = exrm_1_0_5;
-
-    exrm_deb_0_0_6 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          vex_0_5_5,
-          timex_2_1_6,
-          exrm_1_0_5
-        }:
-          buildMix ({
-            name = "exrm_deb";
-            version = "0.0.6";
-            src = fetchHex {
-              pkg = "exrm_deb";
-              version = "0.0.6";
-              sha256 =
-                "f78edff8a5b6ef41a007869fc23614ebf577f679849fb5b3a6ce4013cd861d2c";
-            };
-            beamDeps  = [ vex_0_5_5 timex_2_1_6 exrm_1_0_5 ];
-
-            meta = {
-              description = ''Create a deb for your elixir release with ease'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/johnhamelink/exrm_deb";
-            };
-          } // packageOverrides)
-      ) {};
-
-    exrm_deb = exrm_deb_0_0_6;
-
-    exrm_docker_0_1_0 = callPackage
-      (
-        {  buildMix, packageOverrides ? {}, fetchHex, exrm_1_0_5 }:
-          buildMix ({
-            name = "exrm_docker";
-            version = "0.1.0";
-            src = fetchHex {
-              pkg = "exrm_docker";
-              version = "0.1.0";
-              sha256 =
-                "a10f0334d9d93f8e97bde71c2638e725f1e36790a817b40ca26da0771366a3a3";
-            };
-            beamDeps  = [ exrm_1_0_5 ];
-
-            meta = {
-              description = ''Exrm plugin to push your release into a Docker
-                            image.'';
-              license = stdenv.lib.licenses.free;
-              homepage = "https://github.com/kwrooijen/exrm_docker";
-            };
-          } // packageOverrides)
-      ) {};
-
-    exrm_docker = exrm_docker_0_1_0;
-
-    exrm_heroku_0_1_1 = callPackage
-      (
-        {  buildMix, packageOverrides ? {}, fetchHex, exrm_1_0_5 }:
-          buildMix ({
-            name = "exrm_heroku";
-            version = "0.1.1";
-            src = fetchHex {
-              pkg = "exrm_heroku";
-              version = "0.1.1";
-              sha256 =
-                "19fc16f1cfcc1c86bc64796a287028b8a8d951f7737024893c1772ba658da76d";
-            };
-            beamDeps  = [ exrm_1_0_5 ];
-
-            meta = {
-              description = ''Publish Elixir releases created with exrm release
-                            manager to Heroku. '';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/ride/exrm-heroku";
-            };
-          } // packageOverrides)
-      ) {};
-
-    exrm_heroku = exrm_heroku_0_1_1;
-
-    exrm_rpm_0_3_3 = callPackage
-      (
-        {  buildMix, packageOverrides ? {}, fetchHex, exrm_1_0_5 }:
-          buildMix ({
-            name = "exrm_rpm";
-            version = "0.3.3";
-            src = fetchHex {
-              pkg = "exrm_rpm";
-              version = "0.3.3";
-              sha256 =
-                "11de82ed0ba9e265577f255cdad0693bf191b30d56dbd85977201882e3652e53";
-            };
-            beamDeps  = [ exrm_1_0_5 ];
-
-            meta = {
-              longDescription = ''Adds simple Red Hat Package Manager (RPM)
-                                generation to the exrm package manager. The
-                                generated RPM file includes the Elixir release
-                                and an init.d script to manage the project`s
-                                service.'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/smpallen99/exrm-rpm";
-            };
-          } // packageOverrides)
-      ) {};
-
-    exrm_rpm = exrm_rpm_0_3_3;
-
-    exrm_smartos_gz_1_0_0 = callPackage
-      (
-        {  buildMix, packageOverrides ? {}, fetchHex, exrm_1_0_5 }:
-          buildMix ({
-            name = "exrm_smartos_gz";
-            version = "1.0.0";
-            src = fetchHex {
-              pkg = "exrm_smartos_gz";
-              version = "1.0.0";
-              sha256 =
-                "700c3c9e80d24d1e0404c54391e582d786dbb3f8da9a3bf5d2b7f082841ba5af";
-            };
-            beamDeps  = [ exrm_1_0_5 ];
-
-            meta = {
-              longDescription = ''Trying to package an Elixir application for a
-                                SmartOS GZ but getting errors about ncurses?
-                                This will cure what ails you.'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/adam12/exrm_smartos_gz";
-            };
-          } // packageOverrides)
-      ) {};
-
-    exrm_smartos_gz = exrm_smartos_gz_1_0_0;
-
     exromaji_0_3_0 = callPackage
       (
         {  buildMix, packageOverrides ? {}, fetchHex }:
@@ -16801,38 +15995,6 @@ let
 
     floki = floki_0_8_1;
 
-    flub_0_9_0 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          shorter_maps_1_0_0,
-          ex2ms_1_4_0,
-          ets_owner_1_0_0
-        }:
-          buildMix ({
-            name = "flub";
-            version = "0.9.0";
-            src = fetchHex {
-              pkg = "flub";
-              version = "0.9.0";
-              sha256 =
-                "8bb3936f7acbf813eee74b628fbe33e8d114c5a40c7b96540e53db4a66b3fa61";
-            };
-            beamDeps  = [ shorter_maps_1_0_0 ex2ms_1_4_0 ets_owner_1_0_0 ];
-
-            meta = {
-              description = ''Flub does Pub. Flub does Sub. Flub does PubSub,
-                            bub.'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/meyercm/shorter_maps";
-            };
-          } // packageOverrides)
-      ) {};
-
-    flub = flub_0_9_0;
-
     fluxter_0_3_1 = callPackage
       (
         {  buildMix, packageOverrides ? {}, fetchHex }:
@@ -22694,44 +21856,6 @@ let
 
     kaguya = kaguya_0_4_7;
 
-    kcl_0_6_2 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          salsa20_0_3_0,
-          poly1305_0_4_1,
-          ed25519_0_2_0,
-          curve25519_0_1_0
-        }:
-          buildMix ({
-            name = "kcl";
-            version = "0.6.2";
-            src = fetchHex {
-              pkg = "kcl";
-              version = "0.6.2";
-              sha256 =
-                "20dfbd4fb5fd71d612d9c4989adbb35a8d1ffabc70bc0729f2648c9489344e9f";
-            };
-            beamDeps  = [
-                          salsa20_0_3_0
-                          poly1305_0_4_1
-                          ed25519_0_2_0
-                          curve25519_0_1_0
-                        ];
-
-            meta = {
-              description = ''KCl - a less savory pure Elixir NaCl crypto suite
-                            substitute'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/mwmiller/kcl";
-            };
-          } // packageOverrides)
-      ) {};
-
-    kcl = kcl_0_6_2;
-
     kennitala_1_0_0 = callPackage
       (
         {  buildMix, packageOverrides ? {}, fetchHex }:
@@ -23369,33 +22493,6 @@ let
 
     lhttpc = lhttpc_1_4_0;
 
-    librex_1_0_1 = callPackage
-      (
-        {
-          buildMix, packageOverrides ? {}, fetchHex, secure_random_0_3_0
-        }:
-          buildMix ({
-            name = "librex";
-            version = "1.0.1";
-            src = fetchHex {
-              pkg = "librex";
-              version = "1.0.1";
-              sha256 =
-                "70a33754fed13f653cc26f91bac47bef90e793f1283d0cef946d14fe17f2ff70";
-            };
-            beamDeps  = [ secure_random_0_3_0 ];
-
-            meta = {
-              description = ''Convert office documents to other formats using
-                            LibreOffice'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/ricn/librex";
-            };
-          } // packageOverrides)
-      ) {};
-
-    librex = librex_1_0_1;
-
     libsnarlmatch_0_1_7 = callPackage
       (
         {  buildRebar3, packageOverrides ? {}, fetchHex }:
@@ -24257,31 +23354,6 @@ let
 
     majremind = majremind_0_0_1;
 
-    mandrag_0_1_1 = callPackage
-      (
-        {  buildMix, packageOverrides ? {}, fetchHex, exrm_1_0_5 }:
-          buildMix ({
-            name = "mandrag";
-            version = "0.1.1";
-            src = fetchHex {
-              pkg = "mandrag";
-              version = "0.1.1";
-              sha256 =
-                "e9e9fcbb844a2a86ecd95f5f8fa7db9f6ff88f3e2a6dca2bd996f4f71bbf125d";
-            };
-            beamDeps  = [ exrm_1_0_5 ];
-
-            meta = {
-              description = ''A simple, extremely assumptive deploy script for
-                            Phoenix apps'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/cschiewek/mandrag";
-            };
-          } // packageOverrides)
-      ) {};
-
-    mandrag = mandrag_0_1_1;
-
     mandrake_0_0_4 = callPackage
       (
         {  buildMix, packageOverrides ? {}, fetchHex }:
@@ -24415,37 +23487,6 @@ let
           } // packageOverrides)
       ) {};
 
-    mariaex_0_7_5 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          decimal_1_1_2,
-          db_connection_1_0_0_rc_0
-        }:
-          buildMix ({
-            name = "mariaex";
-            version = "0.7.5";
-            src = fetchHex {
-              pkg = "mariaex";
-              version = "0.7.5";
-              sha256 =
-                "36a09e08ff2583d4cb2f9fbeec720730a04c202bb486726276368a2be1e4cb95";
-            };
-            beamDeps  = [ decimal_1_1_2 db_connection_1_0_0_rc_0 ];
-
-            meta = {
-              description = ''Pure elixir database driver for MariaDB /
-                            MySQL.'';
-              license = stdenv.lib.licenses.asl20;
-              homepage = "https://github.com/xerions/mariaex";
-            };
-          } // packageOverrides)
-      ) {};
-
-    mariaex = mariaex_0_7_5;
-
     marked_0_0_1 = callPackage
       (
         {  buildMix, packageOverrides ? {}, fetchHex }:
@@ -25079,37 +24120,6 @@ let
 
     memcache_client = memcache_client_1_1_0;
 
-    merkle_0_0_4 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          sha3_1_0_0,
-          rlist_0_0_1
-        }:
-          buildMix ({
-            name = "merkle";
-            version = "0.0.4";
-            src = fetchHex {
-              pkg = "merkle";
-              version = "0.0.4";
-              sha256 =
-                "76e33e4736f670ac380a0e46914143ae83429f6fc2355d05dfbdf4cd8bbc29d1";
-            };
-            beamDeps  = [ sha3_1_0_0 rlist_0_0_1 ];
-
-            meta = {
-              description = ''Implementation of binary Merkle Tree in
-                            Elixir.'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/stampery/elixir-merkle";
-            };
-          } // packageOverrides)
-      ) {};
-
-    merkle = merkle_0_0_4;
-
     merkle_tree_1_1_1 = callPackage
       (
         {  buildMix, packageOverrides ? {}, fetchHex }:
@@ -26185,46 +25195,6 @@ let
 
     module_mocker = module_mocker_0_2_0;
 
-    moebius_2_0_1 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          timex_2_1_6,
-          postgrex_0_11_1,
-          poolboy_1_5_1,
-          poison_2_0_1,
-          inflex_1_5_0
-        }:
-          buildMix ({
-            name = "moebius";
-            version = "2.0.1";
-            src = fetchHex {
-              pkg = "moebius";
-              version = "2.0.1";
-              sha256 =
-                "00e6dbde61bae910463d5a0a7334776946b14c4de390b6f7d839fe6e31089add";
-            };
-            beamDeps  = [
-                          timex_2_1_6
-                          postgrex_0_11_1
-                          poolboy_1_5_1
-                          poison_2_0_1
-                          inflex_1_5_0
-                        ];
-
-            meta = {
-              description = ''A functional approach to data access with
-                            Elixir'';
-              license = stdenv.lib.licenses.free;
-              homepage = "https://github.com/robconery/moebius";
-            };
-          } // packageOverrides)
-      ) {};
-
-    moebius = moebius_2_0_1;
-
     mogrify_0_3_0 = callPackage
       (
         {  buildMix, packageOverrides ? {}, fetchHex }:
@@ -29437,37 +28407,6 @@ let
 
     phoenix_pubsub = phoenix_pubsub_1_0_0_rc_0;
 
-    phoenix_pubsub_postgres_0_0_2 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          postgrex_0_11_1,
-          poolboy_1_4_2
-        }:
-          buildMix ({
-            name = "phoenix_pubsub_postgres";
-            version = "0.0.2";
-            src = fetchHex {
-              pkg = "phoenix_pubsub_postgres";
-              version = "0.0.2";
-              sha256 =
-                "85b43b941b8c3dcf3f967dcd5bca1e29716235398b8b6c03d52d6611d5cf82ad";
-            };
-            beamDeps  = [ postgrex_0_11_1 poolboy_1_4_2 ];
-
-            meta = {
-              description = ''Postgresql PubSub adapter for Phoenix apps'';
-              license = stdenv.lib.licenses.mit;
-              homepage =
-                "https://github.com/opendrops/phoenix-pubsub-postgres";
-            };
-          } // packageOverrides)
-      ) {};
-
-    phoenix_pubsub_postgres = phoenix_pubsub_postgres_0_0_2;
-
     phoenix_pubsub_vernemq_0_0_3 = callPackage
       (
         {  buildMix, packageOverrides ? {}, fetchHex }:
@@ -30635,37 +29574,6 @@ let
 
     plug_runtime = plug_runtime_1_0_0;
 
-    plug_session_redis_0_1_0 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          redo_2_0_1,
-          poolboy_1_5_1
-        }:
-          buildMix ({
-            name = "plug_session_redis";
-            version = "0.1.0";
-            src = fetchHex {
-              pkg = "plug_session_redis";
-              version = "0.1.0";
-              sha256 =
-                "8a101a1e36cb9212153191e44963f052b7478b0bfaff5a85e331afe0ae56dbeb";
-            };
-            beamDeps  = [ redo_2_0_1 poolboy_1_5_1 ];
-
-            meta = {
-              description = ''The Redis Plug.Session adapter for the Phoenix
-                            framework.'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/aposto/plug_session_redis";
-            };
-          } // packageOverrides)
-      ) {};
-
-    plug_session_redis = plug_session_redis_0_1_0;
-
     plug_statsd_0_4_1 = callPackage
       (
         {
@@ -31600,72 +30508,6 @@ let
 
     positive = positive_13_3_7;
 
-    posterize_0_11_0 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          sbroker_0_7_0,
-          postgrex_0_11_1
-        }:
-          buildMix ({
-            name = "posterize";
-            version = "0.11.0";
-            src = fetchHex {
-              pkg = "posterize";
-              version = "0.11.0";
-              sha256 =
-                "9c6b189d0924788edb42f3fff493caec10c36bc0e457983a33045cc891cf589d";
-            };
-            beamDeps  = [ sbroker_0_7_0 postgrex_0_11_1 ];
-
-            meta = {
-              description = ''erlang wrapper for the postgrex postgres
-                            client'';
-              license = with stdenv.lib.licenses; [ asl20 mit ];
-              homepage = "https://github.com/talentdeficit/posterize";
-            };
-          } // packageOverrides)
-      ) {};
-
-    posterize = posterize_0_11_0;
-
-    postgrex_0_11_1 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          decimal_1_1_2,
-          db_connection_1_0_0_rc_0,
-          connection_1_0_2
-        }:
-          buildMix ({
-            name = "postgrex";
-            version = "0.11.1";
-            src = fetchHex {
-              pkg = "postgrex";
-              version = "0.11.1";
-              sha256 =
-                "f56d47038f4f642cee0f9c40eeea0ef9ba645b7fc77723b4764f282df95baeb8";
-            };
-            beamDeps  = [
-                          decimal_1_1_2
-                          db_connection_1_0_0_rc_0
-                          connection_1_0_2
-                        ];
-
-            meta = {
-              description = ''PostgreSQL driver for Elixir.'';
-              license = stdenv.lib.licenses.asl20;
-              homepage = "https://github.com/ericmj/postgrex";
-            };
-          } // packageOverrides)
-      ) {};
-
-    postgrex = postgrex_0_11_1;
-
     postgrex_0_9_1 = callPackage
       (
         {  buildMix, packageOverrides ? {}, fetchHex, decimal_1_1_2 }:
@@ -32356,63 +31198,6 @@ let
 
     pubsub = pubsub_0_0_2;
 
-    pulse_0_1_3 = callPackage
-      (
-        {  buildMix, packageOverrides ? {}, fetchHex, sonic_0_1_3 }:
-          buildMix ({
-            name = "pulse";
-            version = "0.1.3";
-            src = fetchHex {
-              pkg = "pulse";
-              version = "0.1.3";
-              sha256 =
-                "8d9ab6b8f5b3e8da2feedb32062b97243bfc8c250ad5bab09fd61944e51e6aa0";
-            };
-            beamDeps  = [ sonic_0_1_3 ];
-
-            meta = {
-              longDescription = ''Service registration and discovery library
-                                for Elixir. Relies on etcd as an external
-                                service registry.'';
-              license = stdenv.lib.licenses.asl20;
-              homepage = "https://github.com/heroiclabs/pulse";
-            };
-          } // packageOverrides)
-      ) {};
-
-    pulse = pulse_0_1_3;
-
-    pusher_0_1_3 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          signaturex_1_0_1,
-          httpoison_0_8_3,
-          exjsx_3_2_0
-        }:
-          buildMix ({
-            name = "pusher";
-            version = "0.1.3";
-            src = fetchHex {
-              pkg = "pusher";
-              version = "0.1.3";
-              sha256 =
-                "1443c9652d3a3d03fcfef0e8dca817affa80d1c4e0eb582282af0d9c69a087f3";
-            };
-            beamDeps  = [ signaturex_1_0_1 httpoison_0_8_3 exjsx_3_2_0 ];
-
-            meta = {
-              description = ''Pusher HTTP client'';
-              license = stdenv.lib.licenses.mit;
-              homepage = "https://github.com/edgurgel/pusher";
-            };
-          } // packageOverrides)
-      ) {};
-
-    pusher = pusher_0_1_3;
-
     qdate_0_4_3 = callPackage
       (
         {
@@ -33262,36 +32047,6 @@ let
 
     readit = readit_0_0_3;
 
-    reagent_0_1_9 = callPackage
-      (
-        {
-          buildMix,
-          packageOverrides ? {},
-          fetchHex,
-          socket_0_3_4,
-          exts_0_3_1
-        }:
-          buildMix ({
-            name = "reagent";
-            version = "0.1.9";
-            src = fetchHex {
-              pkg = "reagent";
-              version = "0.1.9";
-              sha256 =
-                "c76c57437dff9d46fcc617a2c2ae9d87bef1c3619c2e6da84fa0bd2392591e5b";
-            };
-            beamDeps  = [ socket_0_3_4 exts_0_3_1 ];
-
-            meta = {
-              description = ''You need more reagents to conjure this server'';
-              license = stdenv.lib.licenses.wtfpl;
-              homepage = "https://github.com/meh/reagent";
-            };
-          } // packageOverrides)
-      ) {};
-
-    reagent = reagent_0_1_9;
-
     reap_0_1_3 = callPackage
       (
         {  buildMix, packageOverrides ? {}, fetchHex, jsex_2_0_0 }:
diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix
index 5bad03d3025..e7b188ad71b 100644
--- a/pkgs/development/compilers/gcc/4.5/default.nix
+++ b/pkgs/development/compilers/gcc/4.5/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, noSysDirs
+{ stdenv, targetPackages, fetchurl, noSysDirs
 , langC ? true, langCC ? true, langFortran ? false
 , langJava ? false
 , langAda ? false
@@ -77,8 +77,8 @@ let version = "4.5.4";
       withCpu +
       withAbi +
       # Ensure that -print-prog-name is able to find the correct programs.
-      " --with-as=${binutils}/bin/${targetPlatform.config}-as" +
-      " --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +
+      " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" +
+      " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" +
       (if crossMingw && crossStageStatic then
         " --with-headers=${libcCross}/include" +
         " --with-gcc" +
@@ -153,6 +153,7 @@ stdenv.mkDerivation ({
     # target libraries and tools.
     ++ optional langAda ../gnat-cflags.patch
     ++ optional langVhdl ./ghdl-ortho-cflags.patch
+    ++ [ ../struct-ucontext-4.5.patch ] # glibc-2.26
     ;
 
   postPatch =
@@ -228,7 +229,7 @@ stdenv.mkDerivation ({
     ++ (optional langJava boehmgc)
     ++ (optionals langJava [zip unzip])
     ++ (optionals javaAwtGtk ([gtk2 pkgconfig libart_lgpl] ++ xlibs))
-    ++ (optionals (targetPlatform != hostPlatform) [binutils])
+    ++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
     ++ (optionals langAda [gnatboot])
     ++ (optionals langVhdl [gnat])
     ;
diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix
index 72e37f18a17..ab91528049c 100644
--- a/pkgs/development/compilers/gcc/4.8/default.nix
+++ b/pkgs/development/compilers/gcc/4.8/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, noSysDirs
+{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
 , langC ? true, langCC ? true, langFortran ? false
 , langObjC ? targetPlatform.isDarwin
 , langObjCpp ? targetPlatform.isDarwin
@@ -78,7 +78,11 @@ let version = "4.8.5";
           sha256 = "01jd7pdarh54ki498g6sz64ijl9a1l5f9v8q2696aaxalvh2vwzl";
           excludes = [ "gcc/cp/ChangeLog" ];
         })]
-      ;
+      ++ [ # glibc-2.26
+        ../struct-ucontext-4.8.patch
+        ../sigsegv-not-declared.patch
+        ../res_state-not-declared.patch
+      ];
 
     javaEcj = fetchurl {
       # The `$(top_srcdir)/ecj.jar' file is automatically picked up at
@@ -149,8 +153,8 @@ let version = "4.8.5";
         withFloat +
         withMode +
         # Ensure that -print-prog-name is able to find the correct programs.
-        " --with-as=${binutils}/bin/${targetPlatform.config}-as" +
-        " --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +
+        " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" +
+        " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" +
         (if crossMingw && crossStageStatic then
           " --with-headers=${libcCross}/include" +
           " --with-gcc" +
@@ -299,7 +303,7 @@ stdenv.mkDerivation ({
     ++ (optional (zlib != null) zlib)
     ++ (optionals langJava [ boehmgc zip unzip ])
     ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
-    ++ (optionals (targetPlatform != hostPlatform) [binutils])
+    ++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
     ++ (optionals langAda [gnatboot])
     ++ (optionals langVhdl [gnat])
 
diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix
index d7684a61a2a..794d809fa72 100644
--- a/pkgs/development/compilers/gcc/4.9/default.nix
+++ b/pkgs/development/compilers/gcc/4.9/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, noSysDirs
+{ stdenv, targetPackages, fetchurl, noSysDirs
 , langC ? true, langCC ? true, langFortran ? false
 , langObjC ? targetPlatform.isDarwin
 , langObjCpp ? targetPlatform.isDarwin
@@ -72,6 +72,7 @@ let version = "4.9.4";
       # target libraries and tools.
       ++ optional langAda ../gnat-cflags.patch
       ++ optional langFortran ../gfortran-driving.patch
+      ++ [ ../struct-ucontext.patch ../struct-sigaltstack-4.9.patch ] # glibc-2.26
       ;
 
     javaEcj = fetchurl {
@@ -143,8 +144,8 @@ let version = "4.9.4";
         withFloat +
         withMode +
         # Ensure that -print-prog-name is able to find the correct programs.
-        " --with-as=${binutils}/bin/${targetPlatform.config}-as" +
-        " --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +
+        " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" +
+        " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" +
         (if crossMingw && crossStageStatic then
           " --with-headers=${libcCross}/include" +
           " --with-gcc" +
@@ -295,7 +296,7 @@ stdenv.mkDerivation ({
     ++ (optional (zlib != null) zlib)
     ++ (optionals langJava [ boehmgc zip unzip ])
     ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
-    ++ (optionals (targetPlatform != hostPlatform) [binutils])
+    ++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
     ++ (optionals langAda [gnatboot])
     ++ (optionals langVhdl [gnat])
 
diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix
index 346ea928b76..345e2baf671 100644
--- a/pkgs/development/compilers/gcc/5/default.nix
+++ b/pkgs/development/compilers/gcc/5/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, noSysDirs
+{ stdenv, targetPackages, fetchurl, noSysDirs
 , langC ? true, langCC ? true, langFortran ? false
 , langObjC ? targetPlatform.isDarwin
 , langObjCpp ? targetPlatform.isDarwin
@@ -31,7 +31,6 @@
 , libpthread ? null, libpthreadCross ? null  # required for GNU/Hurd
 , stripped ? true
 , gnused ? null
-, binutils ? null
 , cloog # unused; just for compat with gcc4, as we override the parameter on some places
 , darwin ? null
 , buildPlatform, hostPlatform, targetPlatform
@@ -51,7 +50,7 @@ assert libelf != null -> zlib != null;
 assert hostPlatform.isDarwin -> gnused != null;
 
 # Need c++filt on darwin
-assert hostPlatform.isDarwin -> binutils != null;
+assert hostPlatform.isDarwin -> targetPackages.stdenv.cc.bintools or null != null;
 
 # The go frontend is written in c++
 assert langGo -> langCC;
@@ -149,8 +148,8 @@ let version = "5.5.0";
         withFloat +
         withMode +
         # Ensure that -print-prog-name is able to find the correct programs.
-        " --with-as=${binutils}/bin/${targetPlatform.config}-as" +
-        " --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +
+        " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" +
+        " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" +
         (if crossMingw && crossStageStatic then
           " --with-headers=${libcCross}/include" +
           " --with-gcc" +
@@ -312,7 +311,7 @@ stdenv.mkDerivation ({
     ++ (optional (zlib != null) zlib)
     ++ (optionals langJava [ boehmgc zip unzip ])
     ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
-    ++ (optionals (targetPlatform != hostPlatform) [binutils])
+    ++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
     ++ (optionals (buildPlatform != hostPlatform) [buildPackages.stdenv.cc])
     ++ (optionals langAda [gnatboot])
     ++ (optionals langVhdl [gnat])
@@ -320,7 +319,7 @@ stdenv.mkDerivation ({
     # The builder relies on GNU sed (for instance, Darwin's `sed' fails with
     # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
     ++ (optional hostPlatform.isDarwin gnused)
-    ++ (optional hostPlatform.isDarwin binutils)
+    ++ (optional hostPlatform.isDarwin targetPackages.stdenv.cc.bintools)
     ;
 
   NIX_LDFLAGS = stdenv.lib.optionalString  hostPlatform.isSunOS "-lm -ldl";
diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix
index 47cb93c1995..3ae478c4ecf 100644
--- a/pkgs/development/compilers/gcc/6/default.nix
+++ b/pkgs/development/compilers/gcc/6/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, noSysDirs
+{ stdenv, targetPackages, fetchurl, noSysDirs
 , langC ? true, langCC ? true, langFortran ? false
 , langObjC ? targetPlatform.isDarwin
 , langObjCpp ? targetPlatform.isDarwin
@@ -31,7 +31,6 @@
 , libpthread ? null, libpthreadCross ? null  # required for GNU/Hurd
 , stripped ? true
 , gnused ? null
-, binutils ? null
 , cloog # unused; just for compat with gcc4, as we override the parameter on some places
 , darwin ? null
 , buildPlatform, hostPlatform, targetPlatform
@@ -50,7 +49,7 @@ assert libelf != null -> zlib != null;
 assert hostPlatform.isDarwin -> gnused != null;
 
 # Need c++filt on darwin
-assert hostPlatform.isDarwin -> binutils != null;
+assert hostPlatform.isDarwin -> targetPackages.stdenv.cc.bintools or null != null;
 
 # The go frontend is written in c++
 assert langGo -> langCC;
@@ -72,7 +71,9 @@ let version = "6.4.0";
       # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
       # target libraries and tools.
       ++ optional langAda ../gnat-cflags.patch
-      ++ optional langFortran ../gfortran-driving.patch;
+      ++ optional langFortran ../gfortran-driving.patch
+      ++ [ ../struct-ucontext.patch ../struct-sigaltstack.patch ] # glibc-2.26
+      ;
 
     javaEcj = fetchurl {
       # The `$(top_srcdir)/ecj.jar' file is automatically picked up at
@@ -143,8 +144,8 @@ let version = "6.4.0";
         withFloat +
         withMode +
         # Ensure that -print-prog-name is able to find the correct programs.
-        " --with-as=${binutils}/bin/${targetPlatform.config}-as" +
-        " --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +
+        " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" +
+        " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" +
         (if crossMingw && crossStageStatic then
           " --with-headers=${libcCross}/include" +
           " --with-gcc" +
@@ -307,14 +308,14 @@ stdenv.mkDerivation ({
     ++ (optional (zlib != null) zlib)
     ++ (optionals langJava [ boehmgc zip unzip ])
     ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
-    ++ (optionals (targetPlatform != hostPlatform) [binutils])
+    ++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
     ++ (optionals langAda [gnatboot])
     ++ (optionals langVhdl [gnat])
 
     # The builder relies on GNU sed (for instance, Darwin's `sed' fails with
     # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
     ++ (optional hostPlatform.isDarwin gnused)
-    ++ (optional hostPlatform.isDarwin binutils)
+    ++ (optional hostPlatform.isDarwin targetPackages.stdenv.cc.bintools)
     ;
 
   NIX_LDFLAGS = stdenv.lib.optionalString  hostPlatform.isSunOS "-lm -ldl";
diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix
index 064f2ab00d4..3a7c0eb6443 100644
--- a/pkgs/development/compilers/gcc/7/default.nix
+++ b/pkgs/development/compilers/gcc/7/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, noSysDirs
+{ stdenv, targetPackages, fetchurl, noSysDirs
 , langC ? true, langCC ? true, langFortran ? false
 , langObjC ? targetPlatform.isDarwin
 , langObjCpp ? targetPlatform.isDarwin
@@ -31,7 +31,6 @@
 , libpthread ? null, libpthreadCross ? null  # required for GNU/Hurd
 , stripped ? true
 , gnused ? null
-, binutils ? null
 , cloog # unused; just for compat with gcc4, as we override the parameter on some places
 , darwin ? null
 , flex ? null
@@ -51,7 +50,7 @@ assert libelf != null -> zlib != null;
 assert hostPlatform.isDarwin -> gnused != null;
 
 # Need c++filt on darwin
-assert hostPlatform.isDarwin -> binutils != null;
+assert hostPlatform.isDarwin -> targetPackages.stdenv.cc.bintools or null != null;
 
 # The go frontend is written in c++
 assert langGo -> langCC;
@@ -144,8 +143,8 @@ let version = "7.2.0";
         withFloat +
         withMode +
         # Ensure that -print-prog-name is able to find the correct programs.
-        " --with-as=${binutils}/bin/${targetPlatform.config}-as" +
-        " --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +
+        " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" +
+        " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" +
         (if crossMingw && crossStageStatic then
           " --with-headers=${libcCross}/include" +
           " --with-gcc" +
@@ -308,14 +307,14 @@ stdenv.mkDerivation ({
     ++ (optional (zlib != null) zlib)
     ++ (optionals langJava [ boehmgc zip unzip ])
     ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
-    ++ (optionals (targetPlatform != hostPlatform) [binutils])
+    ++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
     ++ (optionals langAda [gnatboot])
     ++ (optionals langVhdl [gnat])
 
     # The builder relies on GNU sed (for instance, Darwin's `sed' fails with
     # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
     ++ (optional hostPlatform.isDarwin gnused)
-    ++ (optional hostPlatform.isDarwin binutils)
+    ++ (optional hostPlatform.isDarwin targetPackages.stdenv.cc.bintools)
     ;
 
   NIX_LDFLAGS = stdenv.lib.optionalString  hostPlatform.isSunOS "-lm -ldl";
diff --git a/pkgs/development/compilers/gcc/res_state-not-declared.patch b/pkgs/development/compilers/gcc/res_state-not-declared.patch
new file mode 100644
index 00000000000..e970487786d
--- /dev/null
+++ b/pkgs/development/compilers/gcc/res_state-not-declared.patch
@@ -0,0 +1,13 @@
+diff --git a/libsanitizer/tsan/tsan_platform_linux.cc b/libsanitizer/tsan/tsan_platform_linux.cc
+index fe69430..49f5270 100644
+--- a/libsanitizer/tsan/tsan_platform_linux.cc
++++ b/libsanitizer/tsan/tsan_platform_linux.cc
+@@ -351,7 +351,7 @@ bool IsGlobalVar(uptr addr) {
+ // closes within glibc. The code is a pure hack.
+ int ExtractResolvFDs(void *state, int *fds, int nfd) {
+   int cnt = 0;
+-  __res_state *statp = (__res_state*)state;
++  struct __res_state *statp = (struct __res_state*)state;
+   for (int i = 0; i < MAXNS && cnt < nfd; i++) {
+     if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1)
+       fds[cnt++] = statp->_u._ext.nssocks[i];
diff --git a/pkgs/development/compilers/gcc/sigsegv-not-declared.patch b/pkgs/development/compilers/gcc/sigsegv-not-declared.patch
new file mode 100644
index 00000000000..f9cfaec8202
--- /dev/null
+++ b/pkgs/development/compilers/gcc/sigsegv-not-declared.patch
@@ -0,0 +1,13 @@
+error: 'SIGSEGV' was not declared in this scope
+diff --git a/libsanitizer/asan/asan_linux.cc b/libsanitizer/asan/asan_linux.cc
+index 0692eb1..472f734 100644
+--- a/libsanitizer/asan/asan_linux.cc
++++ b/libsanitizer/asan/asan_linux.cc
+@@ -26,6 +26,7 @@
+ #include <sys/types.h>
+ #include <fcntl.h>
+ #include <pthread.h>
++#include <signal.h>
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <unwind.h>
diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix
index 696417a4956..e235be639c6 100644
--- a/pkgs/development/compilers/gcc/snapshot/default.nix
+++ b/pkgs/development/compilers/gcc/snapshot/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, noSysDirs
+{ stdenv, targetPackages, fetchurl, noSysDirs
 , langC ? true, langCC ? true, langFortran ? false
 , langObjC ? targetPlatform.isDarwin
 , langObjCpp ? targetPlatform.isDarwin
@@ -31,7 +31,6 @@
 , libpthread ? null, libpthreadCross ? null  # required for GNU/Hurd
 , stripped ? true
 , gnused ? null
-, binutils ? null
 , cloog # unused; just for compat with gcc4, as we override the parameter on some places
 , darwin ? null
 , flex ? null
@@ -51,7 +50,7 @@ assert libelf != null -> zlib != null;
 assert hostPlatform.isDarwin -> gnused != null;
 
 # Need c++filt on darwin
-assert hostPlatform.isDarwin -> binutils != null;
+assert hostPlatform.isDarwin -> targetPackages.stdenv.cc.bintools or null != null;
 
 # The go frontend is written in c++
 assert langGo -> langCC;
@@ -144,8 +143,8 @@ let version = "7-20170409";
         withFloat +
         withMode +
         # Ensure that -print-prog-name is able to find the correct programs.
-        " --with-as=${binutils}/bin/${targetPlatform.config}-as" +
-        " --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +
+        " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" +
+        " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" +
         (if crossMingw && crossStageStatic then
           " --with-headers=${libcCross}/include" +
           " --with-gcc" +
@@ -295,14 +294,14 @@ stdenv.mkDerivation ({
     ++ (optional (zlib != null) zlib)
     ++ (optionals langJava [ boehmgc zip unzip ])
     ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
-    ++ (optionals (targetPlatform != hostPlatform) [binutils])
+    ++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
     ++ (optionals langAda [gnatboot])
     ++ (optionals langVhdl [gnat])
 
     # The builder relies on GNU sed (for instance, Darwin's `sed' fails with
     # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
     ++ (optional hostPlatform.isDarwin gnused)
-    ++ (optional hostPlatform.isDarwin binutils)
+    ++ (optional hostPlatform.isDarwin targetPackages.stdenv.cc.bintools)
     ;
 
   NIX_LDFLAGS = stdenv.lib.optionalString  hostPlatform.isSunOS "-lm -ldl";
diff --git a/pkgs/development/compilers/gcc/struct-sigaltstack-4.9.patch b/pkgs/development/compilers/gcc/struct-sigaltstack-4.9.patch
new file mode 100644
index 00000000000..fc126b4813d
--- /dev/null
+++ b/pkgs/development/compilers/gcc/struct-sigaltstack-4.9.patch
@@ -0,0 +1,78 @@
+hand-resolved trivial conflicts for 4.9 from the upstream patch
+72edc2c02f8b4768ad660f46a1c7e2400c0a8e06
+diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.cc b/libsanitizer/sanitizer_common/sanitizer_linux.cc
+index 69c9c10..8e53673 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_linux.cc
++++ b/libsanitizer/sanitizer_common/sanitizer_linux.cc
+@@ -599,8 +599,7 @@ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5) {
+   return internal_syscall(__NR_prctl, option, arg2, arg3, arg4, arg5);
+ }
+ 
+-uptr internal_sigaltstack(const struct sigaltstack *ss,
+-                         struct sigaltstack *oss) {
++uptr internal_sigaltstack(const void *ss, void *oss) {
+   return internal_syscall(__NR_sigaltstack, (uptr)ss, (uptr)oss);
+ }
+ 
+diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.h b/libsanitizer/sanitizer_common/sanitizer_linux.h
+index 6422df1..8e111d1 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_linux.h
++++ b/libsanitizer/sanitizer_common/sanitizer_linux.h
+@@ -18,7 +18,6 @@
+ #include "sanitizer_platform_limits_posix.h"
+ 
+ struct link_map;  // Opaque type returned by dlopen().
+-struct sigaltstack;
+ 
+ namespace __sanitizer {
+ // Dirent structure for getdents(). Note that this structure is different from
+@@ -28,8 +27,7 @@ struct linux_dirent;
+ // Syscall wrappers.
+ uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count);
+ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5);
+-uptr internal_sigaltstack(const struct sigaltstack* ss,
+-                          struct sigaltstack* oss);
++uptr internal_sigaltstack(const void* ss, void* oss);
+ uptr internal_sigaction(int signum, const __sanitizer_kernel_sigaction_t *act,
+     __sanitizer_kernel_sigaction_t *oldact);
+ uptr internal_sigprocmask(int how, __sanitizer_kernel_sigset_t *set,
+diff --git a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
+index 891386dc..234e8c6 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
++++ b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
+@@ -273,7 +273,7 @@ static int TracerThread(void* argument) {
+ 
+   // Alternate stack for signal handling.
+   InternalScopedBuffer<char> handler_stack_memory(kHandlerStackSize);
+-  struct sigaltstack handler_stack;
++  stack_t handler_stack;
+   internal_memset(&handler_stack, 0, sizeof(handler_stack));
+   handler_stack.ss_sp = handler_stack_memory.data();
+   handler_stack.ss_size = kHandlerStackSize;
+diff --git a/libsanitizer/tsan/tsan_platform_linux.cc b/libsanitizer/tsan/tsan_platform_linux.cc
+index 2ed5718..6f972ab 100644
+--- a/libsanitizer/tsan/tsan_platform_linux.cc
++++ b/libsanitizer/tsan/tsan_platform_linux.cc
+@@ -287,7 +287,7 @@ void InitializePlatform() {
+ int ExtractResolvFDs(void *state, int *fds, int nfd) {
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+   int cnt = 0;
+-  __res_state *statp = (__res_state*)state;
++  struct __res_state *statp = (struct __res_state*)state;
+   for (int i = 0; i < MAXNS && cnt < nfd; i++) {
+     if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1)
+       fds[cnt++] = statp->_u._ext.nssocks[i];
+
+error: 'SIGSEGV' was not declared in this scope
+diff --git a/libsanitizer/asan/asan_linux.cc b/libsanitizer/asan/asan_linux.cc
+index 0692eb1..472f734 100644
+--- a/libsanitizer/asan/asan_linux.cc
++++ b/libsanitizer/asan/asan_linux.cc
+@@ -26,6 +26,7 @@
+ #include <sys/types.h>
+ #include <fcntl.h>
+ #include <pthread.h>
++#include <signal.h>
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <unwind.h>
diff --git a/pkgs/development/compilers/gcc/struct-sigaltstack.patch b/pkgs/development/compilers/gcc/struct-sigaltstack.patch
new file mode 100644
index 00000000000..6e1ddb252c2
--- /dev/null
+++ b/pkgs/development/compilers/gcc/struct-sigaltstack.patch
@@ -0,0 +1,87 @@
+From 72edc2c02f8b4768ad660f46a1c7e2400c0a8e06 Mon Sep 17 00:00:00 2001
+From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Mon, 17 Jul 2017 19:41:08 +0000
+Subject: [PATCH] 	Backported from mainline 	2017-07-14  Jakub
+ Jelinek  <jakub@redhat.com>
+
+	PR sanitizer/81066
+	* sanitizer_common/sanitizer_linux.h: Cherry-pick upstream r307969.
+	* sanitizer_common/sanitizer_linux.cc: Likewise.
+	* sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc: Likewise.
+	* tsan/tsan_platform_linux.cc: Likewise.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@250287 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+ libsanitizer/ChangeLog  (REMOVED)                             | 11 +++++++++++
+ libsanitizer/sanitizer_common/sanitizer_linux.cc              |  3 +--
+ libsanitizer/sanitizer_common/sanitizer_linux.h               |  4 +---
+ .../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc  |  2 +-
+ libsanitizer/tsan/tsan_platform_linux.cc                      |  2 +-
+ 5 files changed, 15 insertions(+), 7 deletions(-)
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.cc b/libsanitizer/sanitizer_common/sanitizer_linux.cc
+index 806fcd5..5b6f186 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_linux.cc
++++ b/libsanitizer/sanitizer_common/sanitizer_linux.cc
+@@ -605,8 +605,7 @@ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5) {
+ }
+ #endif
+ 
+-uptr internal_sigaltstack(const struct sigaltstack *ss,
+-                         struct sigaltstack *oss) {
++uptr internal_sigaltstack(const void *ss, void *oss) {
+   return internal_syscall(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss);
+ }
+ 
+diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.h b/libsanitizer/sanitizer_common/sanitizer_linux.h
+index 895bfc1..a42df57 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_linux.h
++++ b/libsanitizer/sanitizer_common/sanitizer_linux.h
+@@ -19,7 +19,6 @@
+ #include "sanitizer_platform_limits_posix.h"
+ 
+ struct link_map;  // Opaque type returned by dlopen().
+-struct sigaltstack;
+ 
+ namespace __sanitizer {
+ // Dirent structure for getdents(). Note that this structure is different from
+@@ -28,8 +27,7 @@ struct linux_dirent;
+ 
+ // Syscall wrappers.
+ uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count);
+-uptr internal_sigaltstack(const struct sigaltstack* ss,
+-                          struct sigaltstack* oss);
++uptr internal_sigaltstack(const void* ss, void* oss);
+ uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set,
+     __sanitizer_sigset_t *oldset);
+ 
+diff --git a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
+index 891386dc..234e8c6 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
++++ b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
+@@ -273,7 +273,7 @@ static int TracerThread(void* argument) {
+ 
+   // Alternate stack for signal handling.
+   InternalScopedBuffer<char> handler_stack_memory(kHandlerStackSize);
+-  struct sigaltstack handler_stack;
++  stack_t handler_stack;
+   internal_memset(&handler_stack, 0, sizeof(handler_stack));
+   handler_stack.ss_sp = handler_stack_memory.data();
+   handler_stack.ss_size = kHandlerStackSize;
+diff --git a/libsanitizer/tsan/tsan_platform_linux.cc b/libsanitizer/tsan/tsan_platform_linux.cc
+index 2ed5718..6f972ab 100644
+--- a/libsanitizer/tsan/tsan_platform_linux.cc
++++ b/libsanitizer/tsan/tsan_platform_linux.cc
+@@ -287,7 +287,7 @@ void InitializePlatform() {
+ int ExtractResolvFDs(void *state, int *fds, int nfd) {
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+   int cnt = 0;
+-  __res_state *statp = (__res_state*)state;
++  struct __res_state *statp = (struct __res_state*)state;
+   for (int i = 0; i < MAXNS && cnt < nfd; i++) {
+     if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1)
+       fds[cnt++] = statp->_u._ext.nssocks[i];
+-- 
+2.9.3
+
diff --git a/pkgs/development/compilers/gcc/struct-ucontext-4.5.patch b/pkgs/development/compilers/gcc/struct-ucontext-4.5.patch
new file mode 100644
index 00000000000..a84e9ffe268
--- /dev/null
+++ b/pkgs/development/compilers/gcc/struct-ucontext-4.5.patch
@@ -0,0 +1,107 @@
+Trivally backported the upstream commit
+b685411208e0aaa79190d54faf945763514706b8
+(different directory, some files not present, etc.)
+We only really use x86* from those, probably, so I didn't bother much.
+diff --git a/gcc/config/alpha/linux-unwind.h b/gcc/config/alpha/linux-unwind.h
+index bdbba4a..e84812e 100644
+--- a/gcc/config/alpha/linux-unwind.h
++++ b/gcc/config/alpha/linux-unwind.h
+@@ -51,7 +51,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       sc = &rt_->uc.uc_mcontext;
+     }
+diff --git a/gcc/config/bfin/linux-unwind.h b/gcc/config/bfin/linux-unwind.h
+index 77b7c23..8bf5e82 100644
+--- a/gcc/config/bfin/linux-unwind.h
++++ b/gcc/config/bfin/linux-unwind.h
+@@ -52,7 +52,7 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
+ 	void *puc;
+ 	char retcode[8];
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+ 
+       /* The void * cast is necessary to avoid an aliasing warning.
+diff --git a/gcc/config/i386/linux-unwind.h b/gcc/config/i386/linux-unwind.h
+index 540a0a2..29efbe3 100644
+--- a/gcc/config/i386/linux-unwind.h
++++ b/gcc/config/i386/linux-unwind.h
+@@ -58,7 +58,7 @@ x86_64_fallback_frame_state (struct _Unwind_Context *context,
+   if (*(unsigned char *)(pc+0) == 0x48
+       && *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL)
+     {
+-      struct ucontext *uc_ = context->cfa;
++      ucontext_t *uc_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+          because it does not alias anything.  */
+@@ -138,7 +138,7 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
+ 	siginfo_t *pinfo;
+ 	void *puc;
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+diff --git a/gcc/config/m68k/linux-unwind.h b/gcc/config/m68k/linux-unwind.h
+index 75b7cf7..f964e24 100644
+--- a/gcc/config/m68k/linux-unwind.h
++++ b/gcc/config/m68k/linux-unwind.h
+@@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+ /* <sys/ucontext.h> is unfortunately broken right now.  */
+ struct uw_ucontext {
+ 	unsigned long	  uc_flags;
+-	struct ucontext  *uc_link;
++	ucontext_t	 *uc_link;
+ 	stack_t		  uc_stack;
+ 	mcontext_t	  uc_mcontext;
+ 	unsigned long	  uc_filler[80];
+diff --git a/gcc/config/pa/linux-unwind.h b/gcc/config/pa/linux-unwind.h
+index 9a2657f..e47493d 100644
+--- a/gcc/config/pa/linux-unwind.h
++++ b/gcc/config/pa/linux-unwind.h
+@@ -80,7 +80,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
+   struct sigcontext *sc;
+   struct rt_sigframe {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *frame;
+ 
+   /* rt_sigreturn trampoline:
+diff --git a/gcc/config/sh/linux-unwind.h b/gcc/config/sh/linux-unwind.h
+index e389cac..0bf43ba 100644
+--- a/gcc/config/sh/linux-unwind.h
++++ b/gcc/config/sh/linux-unwind.h
+@@ -180,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+diff --git a/gcc/config/xtensa/linux-unwind.h b/gcc/config/xtensa/linux-unwind.h
+index 9872492..586a9d4 100644
+--- a/gcc/config/xtensa/linux-unwind.h
++++ b/gcc/config/xtensa/linux-unwind.h
+@@ -67,7 +67,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
+ 
+   struct rt_sigframe {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *rt_;
+ 
+   /* movi a2, __NR_rt_sigreturn; syscall */
+-- 
+2.9.3
+
diff --git a/pkgs/development/compilers/gcc/struct-ucontext-4.8.patch b/pkgs/development/compilers/gcc/struct-ucontext-4.8.patch
new file mode 100644
index 00000000000..630ef6586e4
--- /dev/null
+++ b/pkgs/development/compilers/gcc/struct-ucontext-4.8.patch
@@ -0,0 +1,177 @@
+From b685411208e0aaa79190d54faf945763514706b8 Mon Sep 17 00:00:00 2001
+From: jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 4 Jul 2017 10:23:57 +0000
+Subject: [PATCH] Use ucontext_t not struct ucontext in linux-unwind.h files.
+
+Current glibc no longer gives the ucontext_t type the tag struct
+ucontext, to conform with POSIX namespace rules.  This requires
+various linux-unwind.h files in libgcc, that were previously using
+struct ucontext, to be fixed to use ucontext_t instead.  This is
+similar to the removal of the struct siginfo tag from siginfo_t some
+years ago.
+
+This patch changes those files to use ucontext_t instead.  As the
+standard name that should be unconditionally safe, so this is not
+restricted to architectures supported by glibc, or conditioned on the
+glibc version.
+
+Tested compilation together with current glibc with glibc's
+build-many-glibcs.py.
+
+	* config/aarch64/linux-unwind.h (aarch64_fallback_frame_state),
+	config/alpha/linux-unwind.h (alpha_fallback_frame_state),
+	config/bfin/linux-unwind.h (bfin_fallback_frame_state),
+	config/i386/linux-unwind.h (x86_64_fallback_frame_state,
+	x86_fallback_frame_state), config/m68k/linux-unwind.h (struct
+	uw_ucontext), config/nios2/linux-unwind.h (struct nios2_ucontext),
+	config/pa/linux-unwind.h (pa32_fallback_frame_state),
+	config/sh/linux-unwind.h (sh_fallback_frame_state),
+	config/tilepro/linux-unwind.h (tile_fallback_frame_state),
+	config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Use
+	ucontext_t instead of struct ucontext.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@249957 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+ libgcc/ChangeLog     (REMOVED)       | 14 ++++++++++++++
+ libgcc/config/aarch64/linux-unwind.h |  2 +-
+ libgcc/config/alpha/linux-unwind.h   |  2 +-
+ libgcc/config/bfin/linux-unwind.h    |  2 +-
+ libgcc/config/i386/linux-unwind.h    |  4 ++--
+ libgcc/config/m68k/linux-unwind.h    |  2 +-
+ libgcc/config/nios2/linux-unwind.h   |  2 +-
+ libgcc/config/pa/linux-unwind.h      |  2 +-
+ libgcc/config/sh/linux-unwind.h      |  2 +-
+ libgcc/config/tilepro/linux-unwind.h |  2 +-
+ libgcc/config/xtensa/linux-unwind.h  |  2 +-
+ 11 files changed, 25 insertions(+), 11 deletions(-)
+
+diff --git a/libgcc/config/aarch64/linux-unwind.h b/libgcc/config/aarch64/linux-unwind.h
+index 4512efb..06de45a 100644
+--- a/libgcc/config/aarch64/linux-unwind.h
++++ b/libgcc/config/aarch64/linux-unwind.h
+@@ -52,7 +52,7 @@ aarch64_fallback_frame_state (struct _Unwind_Context *context,
+   struct rt_sigframe
+   {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   };
+ 
+   struct rt_sigframe *rt_;
+diff --git a/libgcc/config/alpha/linux-unwind.h b/libgcc/config/alpha/linux-unwind.h
+index bdbba4a..e84812e 100644
+--- a/libgcc/config/alpha/linux-unwind.h
++++ b/libgcc/config/alpha/linux-unwind.h
+@@ -51,7 +51,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       sc = &rt_->uc.uc_mcontext;
+     }
+diff --git a/libgcc/config/bfin/linux-unwind.h b/libgcc/config/bfin/linux-unwind.h
+index 77b7c23..8bf5e82 100644
+--- a/libgcc/config/bfin/linux-unwind.h
++++ b/libgcc/config/bfin/linux-unwind.h
+@@ -52,7 +52,7 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
+ 	void *puc;
+ 	char retcode[8];
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+ 
+       /* The void * cast is necessary to avoid an aliasing warning.
+diff --git a/libgcc/config/i386/linux-unwind.h b/libgcc/config/i386/linux-unwind.h
+index 540a0a2..29efbe3 100644
+--- a/libgcc/config/i386/linux-unwind.h
++++ b/libgcc/config/i386/linux-unwind.h
+@@ -58,7 +58,7 @@ x86_64_fallback_frame_state (struct _Unwind_Context *context,
+   if (*(unsigned char *)(pc+0) == 0x48
+       && *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL)
+     {
+-      struct ucontext *uc_ = context->cfa;
++      ucontext_t *uc_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+          because it does not alias anything.  */
+@@ -138,7 +138,7 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
+ 	siginfo_t *pinfo;
+ 	void *puc;
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+diff --git a/libgcc/config/m68k/linux-unwind.h b/libgcc/config/m68k/linux-unwind.h
+index 75b7cf7..f964e24 100644
+--- a/libgcc/config/m68k/linux-unwind.h
++++ b/libgcc/config/m68k/linux-unwind.h
+@@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+ /* <sys/ucontext.h> is unfortunately broken right now.  */
+ struct uw_ucontext {
+ 	unsigned long	  uc_flags;
+-	struct ucontext  *uc_link;
++	ucontext_t	 *uc_link;
+ 	stack_t		  uc_stack;
+ 	mcontext_t	  uc_mcontext;
+ 	unsigned long	  uc_filler[80];
+diff --git a/libgcc/config/pa/linux-unwind.h b/libgcc/config/pa/linux-unwind.h
+index 9a2657f..e47493d 100644
+--- a/libgcc/config/pa/linux-unwind.h
++++ b/libgcc/config/pa/linux-unwind.h
+@@ -80,7 +80,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
+   struct sigcontext *sc;
+   struct rt_sigframe {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *frame;
+ 
+   /* rt_sigreturn trampoline:
+diff --git a/libgcc/config/sh/linux-unwind.h b/libgcc/config/sh/linux-unwind.h
+index e389cac..0bf43ba 100644
+--- a/libgcc/config/sh/linux-unwind.h
++++ b/libgcc/config/sh/linux-unwind.h
+@@ -180,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+diff --git a/libgcc/config/tilepro/linux-unwind.h b/libgcc/config/tilepro/linux-unwind.h
+index 796e976..75f8890 100644
+--- a/libgcc/config/tilepro/linux-unwind.h
++++ b/libgcc/config/tilepro/linux-unwind.h
+@@ -61,7 +61,7 @@ tile_fallback_frame_state (struct _Unwind_Context *context,
+   struct rt_sigframe {
+     unsigned char save_area[C_ABI_SAVE_AREA_SIZE];
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *rt_;
+ 
+   /* Return if this is not a signal handler.  */
+diff --git a/libgcc/config/xtensa/linux-unwind.h b/libgcc/config/xtensa/linux-unwind.h
+index 9872492..586a9d4 100644
+--- a/libgcc/config/xtensa/linux-unwind.h
++++ b/libgcc/config/xtensa/linux-unwind.h
+@@ -67,7 +67,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
+ 
+   struct rt_sigframe {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *rt_;
+ 
+   /* movi a2, __NR_rt_sigreturn; syscall */
+-- 
+2.9.3
+
diff --git a/pkgs/development/compilers/gcc/struct-ucontext.patch b/pkgs/development/compilers/gcc/struct-ucontext.patch
new file mode 100644
index 00000000000..c7fb6d1f71c
--- /dev/null
+++ b/pkgs/development/compilers/gcc/struct-ucontext.patch
@@ -0,0 +1,190 @@
+From b685411208e0aaa79190d54faf945763514706b8 Mon Sep 17 00:00:00 2001
+From: jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 4 Jul 2017 10:23:57 +0000
+Subject: [PATCH] Use ucontext_t not struct ucontext in linux-unwind.h files.
+
+Current glibc no longer gives the ucontext_t type the tag struct
+ucontext, to conform with POSIX namespace rules.  This requires
+various linux-unwind.h files in libgcc, that were previously using
+struct ucontext, to be fixed to use ucontext_t instead.  This is
+similar to the removal of the struct siginfo tag from siginfo_t some
+years ago.
+
+This patch changes those files to use ucontext_t instead.  As the
+standard name that should be unconditionally safe, so this is not
+restricted to architectures supported by glibc, or conditioned on the
+glibc version.
+
+Tested compilation together with current glibc with glibc's
+build-many-glibcs.py.
+
+	* config/aarch64/linux-unwind.h (aarch64_fallback_frame_state),
+	config/alpha/linux-unwind.h (alpha_fallback_frame_state),
+	config/bfin/linux-unwind.h (bfin_fallback_frame_state),
+	config/i386/linux-unwind.h (x86_64_fallback_frame_state,
+	x86_fallback_frame_state), config/m68k/linux-unwind.h (struct
+	uw_ucontext), config/nios2/linux-unwind.h (struct nios2_ucontext),
+	config/pa/linux-unwind.h (pa32_fallback_frame_state),
+	config/sh/linux-unwind.h (sh_fallback_frame_state),
+	config/tilepro/linux-unwind.h (tile_fallback_frame_state),
+	config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Use
+	ucontext_t instead of struct ucontext.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@249957 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+ libgcc/ChangeLog     (REMOVED)       | 14 ++++++++++++++
+ libgcc/config/aarch64/linux-unwind.h |  2 +-
+ libgcc/config/alpha/linux-unwind.h   |  2 +-
+ libgcc/config/bfin/linux-unwind.h    |  2 +-
+ libgcc/config/i386/linux-unwind.h    |  4 ++--
+ libgcc/config/m68k/linux-unwind.h    |  2 +-
+ libgcc/config/nios2/linux-unwind.h   |  2 +-
+ libgcc/config/pa/linux-unwind.h      |  2 +-
+ libgcc/config/sh/linux-unwind.h      |  2 +-
+ libgcc/config/tilepro/linux-unwind.h |  2 +-
+ libgcc/config/xtensa/linux-unwind.h  |  2 +-
+ 11 files changed, 25 insertions(+), 11 deletions(-)
+
+diff --git a/libgcc/config/aarch64/linux-unwind.h b/libgcc/config/aarch64/linux-unwind.h
+index 4512efb..06de45a 100644
+--- a/libgcc/config/aarch64/linux-unwind.h
++++ b/libgcc/config/aarch64/linux-unwind.h
+@@ -52,7 +52,7 @@ aarch64_fallback_frame_state (struct _Unwind_Context *context,
+   struct rt_sigframe
+   {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   };
+ 
+   struct rt_sigframe *rt_;
+diff --git a/libgcc/config/alpha/linux-unwind.h b/libgcc/config/alpha/linux-unwind.h
+index bdbba4a..e84812e 100644
+--- a/libgcc/config/alpha/linux-unwind.h
++++ b/libgcc/config/alpha/linux-unwind.h
+@@ -51,7 +51,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       sc = &rt_->uc.uc_mcontext;
+     }
+diff --git a/libgcc/config/bfin/linux-unwind.h b/libgcc/config/bfin/linux-unwind.h
+index 77b7c23..8bf5e82 100644
+--- a/libgcc/config/bfin/linux-unwind.h
++++ b/libgcc/config/bfin/linux-unwind.h
+@@ -52,7 +52,7 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
+ 	void *puc;
+ 	char retcode[8];
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+ 
+       /* The void * cast is necessary to avoid an aliasing warning.
+diff --git a/libgcc/config/i386/linux-unwind.h b/libgcc/config/i386/linux-unwind.h
+index 540a0a2..29efbe3 100644
+--- a/libgcc/config/i386/linux-unwind.h
++++ b/libgcc/config/i386/linux-unwind.h
+@@ -58,7 +58,7 @@ x86_64_fallback_frame_state (struct _Unwind_Context *context,
+   if (*(unsigned char *)(pc+0) == 0x48
+       && *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL)
+     {
+-      struct ucontext *uc_ = context->cfa;
++      ucontext_t *uc_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+          because it does not alias anything.  */
+@@ -138,7 +138,7 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
+ 	siginfo_t *pinfo;
+ 	void *puc;
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+diff --git a/libgcc/config/m68k/linux-unwind.h b/libgcc/config/m68k/linux-unwind.h
+index 75b7cf7..f964e24 100644
+--- a/libgcc/config/m68k/linux-unwind.h
++++ b/libgcc/config/m68k/linux-unwind.h
+@@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+ /* <sys/ucontext.h> is unfortunately broken right now.  */
+ struct uw_ucontext {
+ 	unsigned long	  uc_flags;
+-	struct ucontext  *uc_link;
++	ucontext_t	 *uc_link;
+ 	stack_t		  uc_stack;
+ 	mcontext_t	  uc_mcontext;
+ 	unsigned long	  uc_filler[80];
+diff --git a/libgcc/config/nios2/linux-unwind.h b/libgcc/config/nios2/linux-unwind.h
+index 2304142..30f25ea 100644
+--- a/libgcc/config/nios2/linux-unwind.h
++++ b/libgcc/config/nios2/linux-unwind.h
+@@ -38,7 +38,7 @@ struct nios2_mcontext {
+ 
+ struct nios2_ucontext {
+   unsigned long uc_flags;
+-  struct ucontext *uc_link;
++  ucontext_t *uc_link;
+   stack_t uc_stack;
+   struct nios2_mcontext uc_mcontext;
+   sigset_t uc_sigmask;	/* mask last for extensibility */
+diff --git a/libgcc/config/pa/linux-unwind.h b/libgcc/config/pa/linux-unwind.h
+index 9a2657f..e47493d 100644
+--- a/libgcc/config/pa/linux-unwind.h
++++ b/libgcc/config/pa/linux-unwind.h
+@@ -80,7 +80,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
+   struct sigcontext *sc;
+   struct rt_sigframe {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *frame;
+ 
+   /* rt_sigreturn trampoline:
+diff --git a/libgcc/config/sh/linux-unwind.h b/libgcc/config/sh/linux-unwind.h
+index e389cac..0bf43ba 100644
+--- a/libgcc/config/sh/linux-unwind.h
++++ b/libgcc/config/sh/linux-unwind.h
+@@ -180,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+diff --git a/libgcc/config/tilepro/linux-unwind.h b/libgcc/config/tilepro/linux-unwind.h
+index 796e976..75f8890 100644
+--- a/libgcc/config/tilepro/linux-unwind.h
++++ b/libgcc/config/tilepro/linux-unwind.h
+@@ -61,7 +61,7 @@ tile_fallback_frame_state (struct _Unwind_Context *context,
+   struct rt_sigframe {
+     unsigned char save_area[C_ABI_SAVE_AREA_SIZE];
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *rt_;
+ 
+   /* Return if this is not a signal handler.  */
+diff --git a/libgcc/config/xtensa/linux-unwind.h b/libgcc/config/xtensa/linux-unwind.h
+index 9872492..586a9d4 100644
+--- a/libgcc/config/xtensa/linux-unwind.h
++++ b/libgcc/config/xtensa/linux-unwind.h
+@@ -67,7 +67,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
+ 
+   struct rt_sigframe {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *rt_;
+ 
+   /* movi a2, __NR_rt_sigreturn; syscall */
+-- 
+2.9.3
+
diff --git a/pkgs/development/compilers/ghc/7.10.2.nix b/pkgs/development/compilers/ghc/7.10.2.nix
index 863f904e4e9..51274dd6059 100644
--- a/pkgs/development/compilers/ghc/7.10.2.nix
+++ b/pkgs/development/compilers/ghc/7.10.2.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
+{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, targetPackages, coreutils
 , libxml2, libxslt, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, hscolour
 
   # If enabled GHC will be build with the GPL-free but slower integer-simple
@@ -70,7 +70,7 @@ stdenv.mkDerivation rec {
     for i in "$out/bin/"*; do
       test ! -h $i || continue
       egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ binutils coreutils ]}"' $i
+      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
     done
   '';
 
diff --git a/pkgs/development/compilers/ghc/7.10.3.nix b/pkgs/development/compilers/ghc/7.10.3.nix
index eb8f1dddd19..d573a22e0ae 100644
--- a/pkgs/development/compilers/ghc/7.10.3.nix
+++ b/pkgs/development/compilers/ghc/7.10.3.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
+{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, targetPackages, coreutils
 , libxml2, libxslt, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, hscolour
 
   # If enabled GHC will be build with the GPL-free but slower integer-simple
@@ -68,7 +68,7 @@ stdenv.mkDerivation rec {
     for i in "$out/bin/"*; do
       test ! -h $i || continue
       egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ binutils coreutils ]}"' $i
+      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
     done
   '';
 
diff --git a/pkgs/development/compilers/ghc/7.6.3.nix b/pkgs/development/compilers/ghc/7.6.3.nix
index 5f951936046..fde4ca2aa37 100644
--- a/pkgs/development/compilers/ghc/7.6.3.nix
+++ b/pkgs/development/compilers/ghc/7.6.3.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ghc, perl, ncurses, binutils, libiconv
+{ stdenv, fetchurl, ghc, perl, ncurses, libiconv
 
   # If enabled GHC will be build with the GPL-free but slower integer-simple
   # library instead of the faster but GPLed integer-gmp library.
diff --git a/pkgs/development/compilers/ghc/8.0.2.nix b/pkgs/development/compilers/ghc/8.0.2.nix
index e50a8df7352..d475e3438b4 100644
--- a/pkgs/development/compilers/ghc/8.0.2.nix
+++ b/pkgs/development/compilers/ghc/8.0.2.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
+{ stdenv, lib, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, targetPackages, coreutils
 , hscolour, patchutils, sphinx
 
   # If enabled GHC will be build with the GPL-free but slower integer-simple
@@ -65,7 +65,7 @@ stdenv.mkDerivation rec {
     for i in "$out/bin/"*; do
       test ! -h $i || continue
       egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ binutils coreutils ]}"' $i
+      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
     done
   '';
 
diff --git a/pkgs/development/compilers/ghc/8.2.1.nix b/pkgs/development/compilers/ghc/8.2.1.nix
index dde56df8131..bcc801c98ea 100644
--- a/pkgs/development/compilers/ghc/8.2.1.nix
+++ b/pkgs/development/compilers/ghc/8.2.1.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
+{ stdenv, lib, fetchurl, bootPkgs, perl, ncurses, libiconv, targetPackages, coreutils
 , autoconf, automake, happy, alex, python3, sphinx, hscolour
 , buildPlatform, targetPlatform , selfPkgs, cross ? null
 
@@ -66,7 +66,7 @@ in stdenv.mkDerivation (rec {
     for i in "$out/bin/"*; do
       test ! -h $i || continue
       egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ binutils coreutils ]}"' $i
+      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
     done
   '';
 
@@ -97,23 +97,23 @@ in stdenv.mkDerivation (rec {
 
   configureFlags = [
     "CC=${stdenv.ccCross}/bin/${cross.config}-cc"
-    "LD=${stdenv.binutils}/bin/${cross.config}-ld"
-    "AR=${stdenv.binutils}/bin/${cross.config}-ar"
-    "NM=${stdenv.binutils}/bin/${cross.config}-nm"
-    "RANLIB=${stdenv.binutils}/bin/${cross.config}-ranlib"
+    "LD=${targetPackages.stdenv.cc.bintools}/bin/${cross.config}-ld"
+    "AR=${targetPackages.stdenv.cc.bintools}/bin/${cross.config}-ar"
+    "NM=${targetPackages.stdenv.cc.bintools}/bin/${cross.config}-nm"
+    "RANLIB=${targetPackages.stdenv.cc.bintools}/bin/${cross.config}-ranlib"
     "--target=${cross.config}"
     "--enable-bootstrap-with-devel-snapshot"
   ] ++
     # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
     lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
 
-  buildInputs = commonBuildInputs ++ [ stdenv.ccCross stdenv.binutils ];
+  buildInputs = commonBuildInputs ++ [ stdenv.ccCross stdenv.targetPackages.stdenv.cc.bintools ];
 
   dontSetConfigureCross = true;
 
   passthru = {
     inherit bootPkgs cross;
     cc = "${stdenv.ccCross}/bin/${cross.config}-cc";
-    ld = "${stdenv.binutils}/bin/${cross.config}-ld";
+    ld = "${stdenv.targetPackages.stdenv.cc.bintools}/bin/${cross.config}-ld";
   };
 })
diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix
index 362b4895b7e..92ba3f6a46e 100644
--- a/pkgs/development/compilers/ghc/head.nix
+++ b/pkgs/development/compilers/ghc/head.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchgit, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
+{ stdenv, lib, fetchgit, bootPkgs, perl, ncurses, libiconv, targetPackages, coreutils
 , autoconf, automake, happy, alex, python3, buildPlatform, targetPlatform
 , selfPkgs, cross ? null
 
@@ -71,7 +71,7 @@ in stdenv.mkDerivation (rec {
     for i in "$out/bin/"*; do
       test ! -h $i || continue
       egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ binutils coreutils ]}"' $i
+      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
     done
   '';
 
diff --git a/pkgs/development/compilers/halvm/2.4.0.nix b/pkgs/development/compilers/halvm/2.4.0.nix
index 24fffcf603c..0c4cef653d8 100644
--- a/pkgs/development/compilers/halvm/2.4.0.nix
+++ b/pkgs/development/compilers/halvm/2.4.0.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, bootPkgs, perl, gmp, ncurses, binutils, autoconf, alex, happy, makeStaticLibraries
+{ stdenv, fetchgit, bootPkgs, perl, gmp, ncurses, targetPackages, autoconf, alex, happy, makeStaticLibraries
 , hscolour, xen, automake, gcc, git, zlib, libtool, enableIntegerSimple ? false
 }:
 
@@ -17,14 +17,14 @@ stdenv.mkDerivation rec {
     sed -i '305 d' Makefile
     sed -i '309,439 d' Makefile # Removes RPM packaging
     sed -i '20 d' src/scripts/halvm-cabal.in
-    sed -ie 's|ld |${binutils}/bin/ld |g' src/scripts/ldkernel.in
+    sed -ie 's|ld |${targetPackages.stdenv.cc.bintools}/bin/ld |g' src/scripts/ldkernel.in
   '';
   configureFlags = stdenv.lib.optional (!enableIntegerSimple) [ "--enable-gmp" ];
   propagatedNativeBuildInputs = [ alex happy ];
   buildInputs =
    let haskellPkgs = [ alex happy bootPkgs.hscolour bootPkgs.cabal-install bootPkgs.haddock bootPkgs.hpc
     ]; in [ bootPkgs.ghc
-            automake perl git binutils
+            automake perl git targetPackages.stdenv.cc.bintools
             autoconf xen zlib ncurses.dev
             libtool gmp ] ++ haskellPkgs;
   preConfigure = ''
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
     inherit bootPkgs;
     cross.config = "halvm";
     cc = "${gcc}/bin/gcc";
-    ld = "${binutils}/bin/ld";
+    ld = "${targetPackages.stdenv.cc.bintools}/bin/ld";
   };
 
   meta = {
diff --git a/pkgs/development/compilers/julia/0.6.nix b/pkgs/development/compilers/julia/0.6.nix
index 9d9f0229e56..99e6f8efff1 100644
--- a/pkgs/development/compilers/julia/0.6.nix
+++ b/pkgs/development/compilers/julia/0.6.nix
@@ -80,6 +80,9 @@ stdenv.mkDerivation rec {
       mv test/$i.jl{,.off}
       touch test/$i.jl
     done
+
+    sed -e 's/Invalid Content-Type:/invalid Content-Type:/g' -i test/libgit2.jl
+    sed -e 's/Failed to resolve /failed to resolve /g' -i test/libgit2.jl
   '';
 
   buildInputs = [
diff --git a/pkgs/development/compilers/llvm/3.5/libc++/default.nix b/pkgs/development/compilers/llvm/3.5/libc++/default.nix
index abc198b0686..1f1129f578f 100644
--- a/pkgs/development/compilers/llvm/3.5/libc++/default.nix
+++ b/pkgs/development/compilers/llvm/3.5/libc++/default.nix
@@ -20,7 +20,11 @@ stdenv.mkDerivation rec {
                 '"${libcxxabi}/lib/libc++abi.dylib"'
   '';
 
-  patches = [ ./darwin.patch ];
+  patches = [
+    ./darwin.patch
+    # glibc 2.26 fix
+    ./xlocale-glibc-2.26.patch
+  ];
 
   buildInputs = [ cmake libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
 
diff --git a/pkgs/development/compilers/llvm/3.5/libc++/xlocale-glibc-2.26.patch b/pkgs/development/compilers/llvm/3.5/libc++/xlocale-glibc-2.26.patch
new file mode 100644
index 00000000000..250bb49fc23
--- /dev/null
+++ b/pkgs/development/compilers/llvm/3.5/libc++/xlocale-glibc-2.26.patch
@@ -0,0 +1,17 @@
+diff --git a/include/__locale b/include/__locale
+index 3daa1f1..cb8e151 100644
+--- a/include/__locale
++++ b/include/__locale
+@@ -29,10 +29,10 @@
+ # if __ANDROID_API__ <= 20
+ #  include <support/android/locale_bionic.h>
+ # endif
+-#elif (defined(__GLIBC__) || defined(__APPLE__)      || defined(__FreeBSD__) \
++#elif (defined(__APPLE__)      || defined(__FreeBSD__) \
+     || defined(__sun__)   || defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
+ # include <xlocale.h>
+-#endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
++#endif // __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
+ 
+ #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+ #pragma GCC system_header
diff --git a/pkgs/development/compilers/llvm/3.7/libc++/default.nix b/pkgs/development/compilers/llvm/3.7/libc++/default.nix
index 69ce87bcbf3..4296c0fd192 100644
--- a/pkgs/development/compilers/llvm/3.7/libc++/default.nix
+++ b/pkgs/development/compilers/llvm/3.7/libc++/default.nix
@@ -17,6 +17,8 @@ stdenv.mkDerivation rec {
   patches = [
     ./darwin.patch
     ./r242056.patch
+    # glibc 2.26 fix
+    ./xlocale-glibc-2.26.patch
   ];
 
   buildInputs = [ cmake libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
diff --git a/pkgs/development/compilers/llvm/3.7/libc++/xlocale-glibc-2.26.patch b/pkgs/development/compilers/llvm/3.7/libc++/xlocale-glibc-2.26.patch
new file mode 100644
index 00000000000..5ee8f6b8230
--- /dev/null
+++ b/pkgs/development/compilers/llvm/3.7/libc++/xlocale-glibc-2.26.patch
@@ -0,0 +1,17 @@
+diff --git a/include/__locale b/include/__locale
+index 1989558..1e42905 100644
+--- a/include/__locale
++++ b/include/__locale
+@@ -34,10 +34,10 @@
+ # include <support/solaris/xlocale.h>
+ #elif defined(_NEWLIB_VERSION)
+ # include <support/newlib/xlocale.h>
+-#elif (defined(__GLIBC__) || defined(__APPLE__)      || defined(__FreeBSD__) \
++#elif (defined(__APPLE__)      || defined(__FreeBSD__) \
+     || defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
+ # include <xlocale.h>
+-#endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
++#endif // __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
+ 
+ #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+ #pragma GCC system_header
diff --git a/pkgs/development/compilers/llvm/3.7/llvm.nix b/pkgs/development/compilers/llvm/3.7/llvm.nix
index b600665cd8f..54ab8c10877 100644
--- a/pkgs/development/compilers/llvm/3.7/llvm.nix
+++ b/pkgs/development/compilers/llvm/3.7/llvm.nix
@@ -1,5 +1,6 @@
 { stdenv
 , fetch
+, fetchpatch
 , perl
 , groff
 , cmake
@@ -45,6 +46,18 @@ in stdenv.mkDerivation rec {
   # those always succeed has the net effect of disabling all bindings.
   prePatch = ''
     substituteInPlace cmake/config-ix.cmake --replace "if(WIN32)" "if(1)"
+  ''
+  + stdenv.lib.optionalString (stdenv ? glibc) ''
+    (
+      cd projects/compiler-rt
+      patch -p1 < ${
+        fetchpatch {
+          name = "sigaltstack.patch"; # for glibc-2.26
+          url = https://github.com/llvm-mirror/compiler-rt/commit/8a5e425a68d.diff;
+          sha256 = "0h4y5vl74qaa7dl54b1fcyqalvlpd8zban2d1jxfkxpzyi7m8ifi";
+        }
+      }
+    )
   '';
 
   # hacky fix: created binaries need to be run before installation
diff --git a/pkgs/development/compilers/llvm/3.8/libc++/default.nix b/pkgs/development/compilers/llvm/3.8/libc++/default.nix
index e4198599904..ea468b3772e 100644
--- a/pkgs/development/compilers/llvm/3.8/libc++/default.nix
+++ b/pkgs/development/compilers/llvm/3.8/libc++/default.nix
@@ -14,7 +14,10 @@ stdenv.mkDerivation rec {
     cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$NIX_BUILD_TOP/libcxxabi-${version}.src/include")
   '';
 
-  patches = lib.optional stdenv.isDarwin ./darwin.patch;
+  patches = [
+    # glibc 2.26 fix
+    ../../3.9/libc++/xlocale-glibc-2.26.patch
+  ] ++ lib.optional stdenv.isDarwin ./darwin.patch;
 
   buildInputs = [ cmake libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
 
diff --git a/pkgs/development/compilers/llvm/3.8/llvm.nix b/pkgs/development/compilers/llvm/3.8/llvm.nix
index f8b8948e749..a0fbdf2b706 100644
--- a/pkgs/development/compilers/llvm/3.8/llvm.nix
+++ b/pkgs/development/compilers/llvm/3.8/llvm.nix
@@ -1,5 +1,6 @@
 { stdenv
 , fetch
+, fetchpatch
 , perl
 , groff
 , cmake
@@ -49,6 +50,18 @@ in stdenv.mkDerivation rec {
     substituteInPlace CMakeLists.txt \
       --replace 'set(CMAKE_INSTALL_NAME_DIR "@rpath")' "set(CMAKE_INSTALL_NAME_DIR "$out/lib")" \
       --replace 'set(CMAKE_INSTALL_RPATH "@executable_path/../lib")' ""
+  ''
+  + stdenv.lib.optionalString (stdenv ? glibc) ''
+    (
+      cd projects/compiler-rt
+      patch -p1 < ${
+        fetchpatch {
+          name = "sigaltstack.patch"; # for glibc-2.26
+          url = https://github.com/llvm-mirror/compiler-rt/commit/8a5e425a68d.diff;
+          sha256 = "0h4y5vl74qaa7dl54b1fcyqalvlpd8zban2d1jxfkxpzyi7m8ifi";
+        }
+      }
+    )
   '';
 
   # hacky fix: created binaries need to be run before installation
diff --git a/pkgs/development/compilers/llvm/3.9/libc++/default.nix b/pkgs/development/compilers/llvm/3.9/libc++/default.nix
index f656f553f16..ad514b0daa5 100644
--- a/pkgs/development/compilers/llvm/3.9/libc++/default.nix
+++ b/pkgs/development/compilers/llvm/3.9/libc++/default.nix
@@ -14,7 +14,10 @@ stdenv.mkDerivation rec {
     cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$NIX_BUILD_TOP/libcxxabi-${version}.src/include")
   '';
 
-  patches = lib.optional stdenv.isDarwin ./darwin.patch;
+  patches = [
+    # glibc 2.26 fix
+    ./xlocale-glibc-2.26.patch
+  ] ++ lib.optional stdenv.isDarwin ./darwin.patch;
 
   buildInputs = [ cmake libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
 
diff --git a/pkgs/development/compilers/llvm/3.9/libc++/xlocale-glibc-2.26.patch b/pkgs/development/compilers/llvm/3.9/libc++/xlocale-glibc-2.26.patch
new file mode 100644
index 00000000000..4cc042554c8
--- /dev/null
+++ b/pkgs/development/compilers/llvm/3.9/libc++/xlocale-glibc-2.26.patch
@@ -0,0 +1,19 @@
+diff --git a/include/__locale b/include/__locale
+index 7bc701d..ea75c86 100644
+--- a/include/__locale
++++ b/include/__locale
+@@ -34,12 +34,12 @@
+ # include <support/solaris/xlocale.h>
+ #elif defined(_NEWLIB_VERSION)
+ # include <support/newlib/xlocale.h>
+-#elif (defined(__GLIBC__) || defined(__APPLE__)      || defined(__FreeBSD__) \
++#elif (defined(__APPLE__)      || defined(__FreeBSD__) \
+     || defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
+ # include <xlocale.h>
+ #elif defined(_LIBCPP_HAS_MUSL_LIBC)
+ # include <support/musl/xlocale.h>
+-#endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
++#endif // __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
+ 
+ #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+ #pragma GCC system_header
diff --git a/pkgs/development/compilers/llvm/3.9/llvm.nix b/pkgs/development/compilers/llvm/3.9/llvm.nix
index 809c49ac24a..495f95a5bbd 100644
--- a/pkgs/development/compilers/llvm/3.9/llvm.nix
+++ b/pkgs/development/compilers/llvm/3.9/llvm.nix
@@ -91,6 +91,20 @@ in stdenv.mkDerivation rec {
   + stdenv.lib.optionalString (enableSharedLibraries) ''
     substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib
     patch -p1 < ./llvm-outputs.patch
+  ''
+  + stdenv.lib.optionalString (stdenv ? glibc) ''
+    (
+      cd projects/compiler-rt
+      patch -p1 < ${
+        fetchpatch {
+          name = "sigaltstack.patch"; # for glibc-2.26
+          url = https://github.com/llvm-mirror/compiler-rt/commit/8a5e425a68d.diff;
+          sha256 = "0h4y5vl74qaa7dl54b1fcyqalvlpd8zban2d1jxfkxpzyi7m8ifi";
+        }
+      }
+      substituteInPlace lib/esan/esan_sideline_linux.cpp \
+        --replace 'struct sigaltstack' 'stack_t'
+    )
   '';
 
   # hacky fix: created binaries need to be run before installation
diff --git a/pkgs/development/compilers/llvm/4/libc++/default.nix b/pkgs/development/compilers/llvm/4/libc++/default.nix
index b74d2fb89dc..db751bcffd4 100644
--- a/pkgs/development/compilers/llvm/4/libc++/default.nix
+++ b/pkgs/development/compilers/llvm/4/libc++/default.nix
@@ -10,8 +10,12 @@ stdenv.mkDerivation rec {
     export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include"
   '';
 
-  # https://github.com/llvm-mirror/libcxx/commit/bcc92d75df0274b9593ebd097fcae60494e3bffc
-  patches = [ ./pthread_mach_thread_np.patch ];
+  patches = [
+    # https://github.com/llvm-mirror/libcxx/commit/bcc92d75df0274b9593ebd097fcae60494e3bffc
+    ./pthread_mach_thread_np.patch
+    # glibc 2.26 fix
+    ./xlocale-glibc-2.26.patch
+  ];
 
   prePatch = ''
     substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++"
diff --git a/pkgs/development/compilers/llvm/4/libc++/xlocale-glibc-2.26.patch b/pkgs/development/compilers/llvm/4/libc++/xlocale-glibc-2.26.patch
new file mode 100644
index 00000000000..e411d85066b
--- /dev/null
+++ b/pkgs/development/compilers/llvm/4/libc++/xlocale-glibc-2.26.patch
@@ -0,0 +1,19 @@
+diff --git a/include/__locale b/include/__locale
+index f4882de..29443b4 100644
+--- a/include/__locale
++++ b/include/__locale
+@@ -34,12 +34,12 @@
+ # include <support/solaris/xlocale.h>
+ #elif defined(_NEWLIB_VERSION)
+ # include <support/newlib/xlocale.h>
+-#elif (defined(__GLIBC__) || defined(__APPLE__)      || defined(__FreeBSD__) \
++#elif (defined(__APPLE__)      || defined(__FreeBSD__) \
+     || defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
+ # include <xlocale.h>
+ #elif defined(_LIBCPP_HAS_MUSL_LIBC)
+ # include <support/musl/xlocale.h>
+-#endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
++#endif // __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
+ 
+ #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+ #pragma GCC system_header
diff --git a/pkgs/development/compilers/llvm/4/llvm.nix b/pkgs/development/compilers/llvm/4/llvm.nix
index e90603ffefa..332fee8529b 100644
--- a/pkgs/development/compilers/llvm/4/llvm.nix
+++ b/pkgs/development/compilers/llvm/4/llvm.nix
@@ -67,6 +67,20 @@ in stdenv.mkDerivation rec {
   + stdenv.lib.optionalString (enableSharedLibraries) ''
     substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib
     patch -p1 < ./llvm-outputs.patch
+  ''
+  + stdenv.lib.optionalString (stdenv ? glibc) ''
+    (
+      cd projects/compiler-rt
+      patch -p1 < ${
+        fetchpatch {
+          name = "sigaltstack.patch"; # for glibc-2.26
+          url = https://github.com/llvm-mirror/compiler-rt/commit/8a5e425a68d.diff;
+          sha256 = "0h4y5vl74qaa7dl54b1fcyqalvlpd8zban2d1jxfkxpzyi7m8ifi";
+        }
+      }
+      substituteInPlace lib/esan/esan_sideline_linux.cpp \
+        --replace 'struct sigaltstack' 'stack_t'
+    )
   '';
 
   # hacky fix: created binaries need to be run before installation
diff --git a/pkgs/development/compilers/neko/default.nix b/pkgs/development/compilers/neko/default.nix
index e90f3af704d..5b90dc7debc 100644
--- a/pkgs/development/compilers/neko/default.nix
+++ b/pkgs/development/compilers/neko/default.nix
@@ -30,6 +30,9 @@ stdenv.mkDerivation rec {
           + "c6d9c6d796200990b3b6a53a4dc716c9192398e6.patch";
       sha256 = "1pq0qhhb9gbhc3zbgylwp0amhwsz0q0ggpj6v2xgv0hfy7d63rcd";
     })
+    # Glibc 2.26 no longer has xlocale.h, patch backported from upstream commit
+    # e286c8f3301fa443255a3101d14b7392467051b8.
+    ./xlocale-fix.patch
   ];
 
   buildInputs =
diff --git a/pkgs/development/compilers/neko/xlocale-fix.patch b/pkgs/development/compilers/neko/xlocale-fix.patch
new file mode 100644
index 00000000000..f4c53f3a43d
--- /dev/null
+++ b/pkgs/development/compilers/neko/xlocale-fix.patch
@@ -0,0 +1,59 @@
+commit 31d3ac3d691b2a1b07991e67302fd52b0f409cac
+Author: Andy Li <andy@onthewings.net>
+Date:   Thu Jul 13 13:23:33 2017 +0800
+
+    include xlocale.h only if it is available since it is removed in recent glibc
+    
+    see: https://bugzilla.redhat.com/show_bug.cgi?id=1464244
+    
+    (Backported from e286c8f3301fa443255a3101d14b7392467051b8)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8de1702..d64cab9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,5 +1,6 @@
+ cmake_minimum_required(VERSION 2.8.7)
+ 
++include(CheckIncludeFile)
+ project(neko C)
+ 
+ set(CMAKE_OSX_ARCHITECTURES x86_64)
+@@ -48,6 +49,8 @@ set(NEKO_VERSION_MAJOR 2)
+ set(NEKO_VERSION_MINOR 1)
+ set(NEKO_VERSION_PATCH 0)
+ 
++check_include_file(xlocale.h HAVE_XLOCALE_H)
++
+ configure_file (
+ 	"${CMAKE_SOURCE_DIR}/vm/neko.h.in"
+ 	"${CMAKE_BINARY_DIR}/neko.h"
+diff --git a/libs/std/sys.c b/libs/std/sys.c
+index 8003d41..ae0cfee 100644
+--- a/libs/std/sys.c
++++ b/libs/std/sys.c
+@@ -41,7 +41,11 @@
+ #	include <sys/time.h>
+ #	include <sys/times.h>
+ #	include <sys/wait.h>
++#ifdef HAVE_XLOCALE_H
+ #	include <xlocale.h>
++#else
++#	include <locale.h>
++#endif
+ #endif
+ 
+ #ifdef NEKO_MAC
+diff --git a/vm/neko.h.in b/vm/neko.h.in
+index bb9ec1b..147ecce 100644
+--- a/vm/neko.h.in
++++ b/vm/neko.h.in
+@@ -88,6 +88,8 @@
+ #	include <stdint.h>
+ #endif
+ 
++#cmakedefine HAVE_XLOCALE_H
++
+ #define NEKO_VERSION_MAJOR	@NEKO_VERSION_MAJOR@
+ #define NEKO_VERSION_MINOR	@NEKO_VERSION_MINOR@
+ #define NEKO_VERSION_PATCH	@NEKO_VERSION_PATCH@
diff --git a/pkgs/development/compilers/ponyc/pony-stable.nix b/pkgs/development/compilers/ponyc/pony-stable.nix
index 21488361f4a..0e382efd707 100644
--- a/pkgs/development/compilers/ponyc/pony-stable.nix
+++ b/pkgs/development/compilers/ponyc/pony-stable.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "pony-stable-${version}";
-  version = "0.0.1";
+  version = "0.1.1";
 
   src = fetchFromGitHub {
     owner = "ponylang";
     repo = "pony-stable";
     rev = version;
-    sha256 = "0q05135mnzzdwam7cnmxq34clqhmc83yp2gi63sx20c74rcw3p6v";
+    sha256 = "0v4039iijjv93m89s3dsikcbp1y0hml6g1agj44s6w2g4m8kiiw3";
   };
 
   buildInputs = [ ponyc ];
diff --git a/pkgs/development/compilers/purescript/psc-package/default.nix b/pkgs/development/compilers/purescript/psc-package/default.nix
index 306eaa93958..8b2a0a0eb39 100644
--- a/pkgs/development/compilers/purescript/psc-package/default.nix
+++ b/pkgs/development/compilers/purescript/psc-package/default.nix
@@ -4,13 +4,13 @@ with lib;
 
 mkDerivation rec {
   pname = "psc-package";
-  version = "0.2.0";
+  version = "0.2.4";
 
   src = fetchFromGitHub {
     owner = "purescript";
     repo = pname;
     rev = "v${version}";
-    sha256 = "0vid8vc8n8xj0qa4gnm1any9s18rdh7yn960vgix17r7a3bdndwb";
+    sha256 = "0m1vcxa5zs4sqnnwgmxkhw1isdlmirp12yimn5345vwfvlxkc8kp";
   };
 
   isLibrary = false;
diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix
index a113f5db480..9f96d05c116 100644
--- a/pkgs/development/compilers/rust/rustc.nix
+++ b/pkgs/development/compilers/rust/rustc.nix
@@ -1,5 +1,6 @@
-{ stdenv, fetchurl, fetchgit, fetchzip, file, python2, tzdata, procps
-, llvm, jemalloc, ncurses, darwin, binutils, rustPlatform, git, cmake, curl
+{ stdenv, targetPackages
+, fetchurl, fetchgit, fetchzip, file, python2, tzdata, procps
+, llvm, jemalloc, ncurses, darwin, rustPlatform, git, cmake, curl
 , which, libffi, gdb
 , version
 , forceBundledLLVM ? false
@@ -49,7 +50,7 @@ stdenv.mkDerivation {
                 ++ [ "--enable-local-rust" "--local-rust-root=${rustPlatform.rust.rustc}" "--enable-rpath" ]
                 ++ [ "--enable-vendor" "--disable-locked-deps" ]
                 # ++ [ "--jemalloc-root=${jemalloc}/lib"
-                ++ [ "--default-linker=${stdenv.cc}/bin/cc" "--default-ar=${binutils.out}/bin/ar" ]
+                ++ [ "--default-linker=${targetPackages.stdenv.cc}/bin/cc" "--default-ar=${targetPackages.stdenv.cc.bintools}/bin/ar" ]
                 ++ optional (!forceBundledLLVM) [ "--enable-llvm-link-shared" ]
                 ++ optional (stdenv.cc.cc ? isClang) "--enable-clang"
                 ++ optional (targets != []) "--target=${target}"
diff --git a/pkgs/development/compilers/swift/default.nix b/pkgs/development/compilers/swift/default.nix
index 7484d2568be..937977b0a97 100644
--- a/pkgs/development/compilers/swift/default.nix
+++ b/pkgs/development/compilers/swift/default.nix
@@ -1,4 +1,5 @@
 { stdenv
+, targetPackages
 , cmake
 , coreutils
 , glibc
@@ -26,7 +27,6 @@
 , rsync
 , git
 , libgit2
-, binutils
 , fetchFromGitHub
 , paxctl
 , findutils
@@ -250,7 +250,7 @@ stdenv.mkDerivation rec {
 
     # TODO: Use wrappers to get these on the PATH for swift tools, instead
     ln -s ${clang}/bin/* $out/bin/
-    ln -s ${binutils}/bin/ar $out/bin/ar
+    ln -s ${targetPackages.stdenv.cc.bintools}/bin/ar $out/bin/ar
   '';
 
   # Hack to avoid TMPDIR in RPATHs.
diff --git a/pkgs/development/coq-modules/mathcomp/default.nix b/pkgs/development/coq-modules/mathcomp/default.nix
index 046c3b2f795..a80c934c6c1 100644
--- a/pkgs/development/coq-modules/mathcomp/default.nix
+++ b/pkgs/development/coq-modules/mathcomp/default.nix
@@ -2,9 +2,9 @@
 
 let param =
   {
-    version = "1.6.4";
-    url = https://github.com/math-comp/math-comp/archive/mathcomp-1.6.4.tar.gz;
-    sha256 = "0qmjjb6jsxmmf4gpw10r30rmrvwqgzirvvgyy41mz2vhgwis8wn6";
+    version = "1.6.1";
+    url = https://github.com/math-comp/math-comp/archive/mathcomp-1.6.1.tar.gz;
+    sha256 = "1j9ylggjzrxz1i2hdl2yhsvmvy5z6l4rprwx7604401080p5sgjw";
   }; in
 
 callPackage ./generic.nix {
diff --git a/pkgs/development/coq-modules/ssreflect/default.nix b/pkgs/development/coq-modules/ssreflect/default.nix
index 49f999fc20b..352b98ab88b 100644
--- a/pkgs/development/coq-modules/ssreflect/default.nix
+++ b/pkgs/development/coq-modules/ssreflect/default.nix
@@ -2,9 +2,9 @@
 
 let param =
   {
-    version = "1.6.4";
-    url = https://github.com/math-comp/math-comp/archive/mathcomp-1.6.4.tar.gz;
-    sha256 = "0qmjjb6jsxmmf4gpw10r30rmrvwqgzirvvgyy41mz2vhgwis8wn6";
+    version = "1.6.1";
+    url = https://github.com/math-comp/math-comp/archive/mathcomp-1.6.1.tar.gz;
+    sha256 = "1j9ylggjzrxz1i2hdl2yhsvmvy5z6l4rprwx7604401080p5sgjw";
   }; in
 
 callPackage ./generic.nix {
diff --git a/pkgs/development/haskell-modules/make-package-set.nix b/pkgs/development/haskell-modules/make-package-set.nix
index ebfe44dd25a..61043252155 100644
--- a/pkgs/development/haskell-modules/make-package-set.nix
+++ b/pkgs/development/haskell-modules/make-package-set.nix
@@ -118,23 +118,16 @@ let
       '';
   };
 
-  all-cabal-hashes-component = name: import (pkgs.runCommand "all-cabal-hashes-component-${name}.nix" {}
-    ''
-      set +o pipefail
-      for component in ${all-cabal-hashes}/*; do
-        if ls $component | grep -q "^${name}$"; then
-          echo "builtins.storePath $component" > $out
-          exit 0
-        fi
-      done
-      echo "${name} not found in any all-cabal-hashes component, are you sure it's in hackage?" >&2
-      exit 1
-    '');
-
-  hackage2nix = name: version: let component = all-cabal-hashes-component name; in self.haskellSrc2nix {
+  all-cabal-hashes-component = name: version: pkgs.runCommand "all-cabal-hashes-component-${name}-${version}" {} ''
+    tar --wildcards -xzvf ${all-cabal-hashes} \*/${name}/${version}/${name}.{json,cabal}
+    mkdir -p $out
+    mv */${name}/${version}/${name}.{json,cabal} $out
+  '';
+
+  hackage2nix = name: version: let component = all-cabal-hashes-component name version; in self.haskellSrc2nix {
     name   = "${name}-${version}";
-    sha256 = ''$(sed -e 's/.*"SHA256":"//' -e 's/".*$//' "${component}/${name}/${version}/${name}.json")'';
-    src    = "${component}/${name}/${version}/${name}.cabal";
+    sha256 = ''$(sed -e 's/.*"SHA256":"//' -e 's/".*$//' "${component}/${name}.json")'';
+    src    = "${component}/${name}.cabal";
   };
 
 in package-set { inherit pkgs stdenv callPackage; } self // {
diff --git a/pkgs/development/interpreters/clisp/default.nix b/pkgs/development/interpreters/clisp/default.nix
index 2386cc27155..9ab43e7392d 100644
--- a/pkgs/development/interpreters/clisp/default.nix
+++ b/pkgs/development/interpreters/clisp/default.nix
@@ -48,7 +48,11 @@ stdenv.mkDerivation rec {
     libX11 libXau libXt libXpm xproto libXext xextproto
   ];
 
-  patches = [ ./bits_ipctypes_to_sys_ipc.patch ]; # from Gentoo
+  patches = [
+    ./bits_ipctypes_to_sys_ipc.patch # from Gentoo
+    # The cfree alias no longer exists since glibc 2.26
+    ./remove-cfree-binding.patch
+  ];
 
   # First, replace port 9090 (rather low, can be used)
   # with 64237 (much higher, IANA private area, not
diff --git a/pkgs/development/interpreters/clisp/remove-cfree-binding.patch b/pkgs/development/interpreters/clisp/remove-cfree-binding.patch
new file mode 100644
index 00000000000..4b570c3a467
--- /dev/null
+++ b/pkgs/development/interpreters/clisp/remove-cfree-binding.patch
@@ -0,0 +1,12 @@
+diff --git a/modules/bindings/glibc/linux.lisp b/modules/bindings/glibc/linux.lisp
+index c40b4f8..1c8edca 100644
+--- a/modules/bindings/glibc/linux.lisp
++++ b/modules/bindings/glibc/linux.lisp
+@@ -648,7 +648,6 @@
+ (def-call-out calloc (:arguments (nmemb size_t) (size size_t))
+   (:return-type c-pointer))
+ (def-call-out free (:arguments (ptr c-pointer)) (:return-type nil))
+-(def-call-out cfree (:arguments (ptr c-pointer)) (:return-type nil))
+ (def-call-out valloc (:arguments (size size_t)) (:return-type c-pointer))
+ 
+ (def-call-out abort (:arguments) (:return-type nil))
diff --git a/pkgs/development/interpreters/erlang/R20.nix b/pkgs/development/interpreters/erlang/R20.nix
index 8866d9848e7..cf94a8800f9 100644
--- a/pkgs/development/interpreters/erlang/R20.nix
+++ b/pkgs/development/interpreters/erlang/R20.nix
@@ -1,8 +1,8 @@
 { mkDerivation, fetchurl }:
 
 mkDerivation rec {
-  version = "20.0";
-  sha256 = "12dbay254ivnakwknjn5h55wndb0a0wqx55p156h8hwjhykj2kn0";
+  version = "20.1";
+  sha256 = "13f53lzgq2himg9kax41f66rzv5pjfrb1ln8b54yv9spkqx2hqqi";
 
   prePatch = ''
     substituteInPlace configure.in --replace '`sw_vers -productVersion`' '10.10'
diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix
index c967ed2b862..b28d5acf978 100644
--- a/pkgs/development/interpreters/php/default.nix
+++ b/pkgs/development/interpreters/php/default.nix
@@ -20,10 +20,12 @@ let
 
       enableParallelBuilding = true;
 
-  nativeBuildInputs = [ pkgconfig ];
+      nativeBuildInputs = [ pkgconfig ];
       buildInputs = [ flex bison ]
         ++ lib.optional stdenv.isLinux systemd;
 
+      CXXFLAGS = lib.optional stdenv.cc.isClang "-std=c++11";
+
       flags = {
 
         # much left to do here...
diff --git a/pkgs/development/libraries/SDL2/default.nix b/pkgs/development/libraries/SDL2/default.nix
index 3216a130f67..d2ffa45626b 100644
--- a/pkgs/development/libraries/SDL2/default.nix
+++ b/pkgs/development/libraries/SDL2/default.nix
@@ -2,6 +2,7 @@
 , openglSupport ? false, mesa_noglu
 , alsaSupport ? true, alsaLib
 , x11Support ? true, libICE, libXi, libXScrnSaver, libXcursor, libXinerama, libXext, libXxf86vm, libXrandr
+, waylandSupport ? true, wayland, wayland-protocols, libxkbcommon
 , dbusSupport ? false, dbus
 , udevSupport ? false, udev
 , ibusSupport ? false, ibus
@@ -17,7 +18,7 @@ assert openglSupport -> (stdenv.isDarwin || mesa_noglu != null && x11Support);
 
 let
   configureFlagsFun = attrs: [
-      "--disable-oss" "--disable-x11-shared"
+      "--disable-oss" "--disable-x11-shared" "--disable-wayland-shared"
       "--disable-pulseaudio-shared" "--disable-alsa-shared"
     ] ++ lib.optional alsaSupport "--with-alsa-prefix=${attrs.alsaLib.out}/lib"
       ++ lib.optional (!x11Support) "--without-x";
@@ -39,6 +40,7 @@ stdenv.mkDerivation rec {
 
   # Since `libpulse*.la' contain `-lgdbm', PulseAudio must be propagated.
   propagatedBuildInputs = lib.optionals x11Support [ libICE libXi libXScrnSaver libXcursor libXinerama libXext libXrandr libXxf86vm ] ++
+    lib.optionals waylandSupport [ wayland wayland-protocols libxkbcommon ] ++
     lib.optional pulseaudioSupport libpulseaudio;
 
   buildInputs = [ audiofile ] ++
diff --git a/pkgs/development/libraries/expat/default.nix b/pkgs/development/libraries/expat/default.nix
index 77b826acc03..01f3c11ac73 100644
--- a/pkgs/development/libraries/expat/default.nix
+++ b/pkgs/development/libraries/expat/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchpatch, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "expat-2.2.4";
+  name = "expat-2.2.5";
 
   src = fetchurl {
     url = "mirror://sourceforge/expat/${name}.tar.bz2";
-    sha256 = "17h1fb9zvqvf0sr78j211bngc6jpql5wzar8fg9b52jzjvdqbb83";
+    sha256 = "1xpd78sp7m34jqrw5x13bz7kgz0n6aj15wn4zj4gfx3ypbpk5p6r";
   };
 
   outputs = [ "out" "dev" ]; # TODO: fix referrers
diff --git a/pkgs/development/libraries/git2/0.25.nix b/pkgs/development/libraries/git2/0.25.nix
new file mode 100644
index 00000000000..679049a0e13
--- /dev/null
+++ b/pkgs/development/libraries/git2/0.25.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchFromGitHub, cmake, pkgconfig, python
+, zlib, libssh2, openssl, http-parser, curl, libiconv
+}:
+
+stdenv.mkDerivation (rec {
+  version = "0.25.1";
+  name = "libgit2-${version}";
+
+  src = fetchFromGitHub {
+    owner = "libgit2";
+    repo = "libgit2";
+    rev = "v${version}";
+    sha256 = "1jhikg0gqpdzfzhgv44ybdpm24lvgkc7ki4306lc5lvmj1s2nylj";
+  };
+
+  cmakeFlags = "-DTHREADSAFE=ON";
+
+  nativeBuildInputs = [ cmake python pkgconfig ];
+
+  buildInputs = [ zlib libssh2 openssl http-parser curl ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "The Git linkable library";
+    homepage = https://libgit2.github.com/;
+    license = stdenv.lib.licenses.gpl2;
+    platforms = with stdenv.lib.platforms; all;
+  };
+} // stdenv.lib.optionalAttrs (!stdenv.isLinux) {
+  NIX_LDFLAGS = "-liconv";
+  propagatedBuildInputs = [ libiconv ];
+})
diff --git a/pkgs/development/libraries/git2/default.nix b/pkgs/development/libraries/git2/default.nix
index 0d53d00737b..42cf181f84f 100644
--- a/pkgs/development/libraries/git2/default.nix
+++ b/pkgs/development/libraries/git2/default.nix
@@ -1,35 +1,30 @@
-{ stdenv, fetchurl, pkgconfig, cmake, zlib, python, libssh2, openssl, curl, http-parser, libiconv }:
+{ stdenv, fetchFromGitHub, pkgconfig, cmake, zlib, python, libssh2, openssl, curl, http-parser, libiconv }:
 
 stdenv.mkDerivation (rec {
-  version = "0.25.1";
   name = "libgit2-${version}";
+  version = "0.26.0";
+  # keep the version in sync with pythonPackages.pygit2 and gnome3.libgit2-glib
 
-  src = fetchurl {
-    name = "${name}.tar.gz";
-    url = "https://github.com/libgit2/libgit2/tarball/v${version}";
-    sha256 = "100bah8picqjzyhpw4wd7z5vyidcb8aggin50bhbpn607h8n8bml";
+  src = fetchFromGitHub {
+    owner = "libgit2";
+    repo = "libgit2";
+    rev = "v${version}";
+    sha256 = "0zrrmfkfhd2xb4879z5khjb6xsdklrm01f1lscrs2ks68v25fk78";
   };
 
-  # TODO: `cargo` (rust's package manager) surfaced a serious bug in
-  # libgit2 when the `Security.framework` transport is used on Darwin.
-  # The upstream issue is tracked at
-  # https://github.com/libgit2/libgit2/issues/3885 - feel free to
-  # remove this patch as soon as it's resolved (i.E. when cargo is
-  # working fine without this patch)
-  patches = stdenv.lib.optionals stdenv.isDarwin [
-    ./disable-security.framework.patch
-  ];
-
   cmakeFlags = "-DTHREADSAFE=ON";
 
   nativeBuildInputs = [ cmake python pkgconfig ];
+
   buildInputs = [ zlib libssh2 openssl http-parser curl ];
 
-  meta = {
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
     description = "The Git linkable library";
     homepage = https://libgit2.github.com/;
-    license = stdenv.lib.licenses.gpl2;
-    platforms = with stdenv.lib.platforms; all;
+    license = licenses.gpl2;
+    platforms = with platforms; all;
   };
 } // stdenv.lib.optionalAttrs (!stdenv.isLinux) {
   NIX_LDFLAGS = "-liconv";
diff --git a/pkgs/development/libraries/git2/disable-security.framework.patch b/pkgs/development/libraries/git2/disable-security.framework.patch
deleted file mode 100644
index ce6a008b1c4..00000000000
--- a/pkgs/development/libraries/git2/disable-security.framework.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From fbc2ea65406236a740b8734dd41dc5ddbc24f8c9 Mon Sep 17 00:00:00 2001
-From: mulrich <mulrich@entwicklerheld.local>
-Date: Mon, 8 Aug 2016 15:36:07 +0200
-Subject: [PATCH] disable security.framework
-
----
- CMakeLists.txt    | 7 +++----
- src/curl_stream.c | 9 ++++++++-
- 2 files changed, 11 insertions(+), 5 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 93a9e47..331e148 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -49,7 +49,8 @@ ENDIF()
- 
- IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- 	SET( USE_ICONV ON )
--	FIND_PACKAGE(Security)
-+	# FIND_PACKAGE(Security)
-+  SET(SECURITY_FOUND "NO")
- 	FIND_PACKAGE(CoreFoundation REQUIRED)
- ENDIF()
- 
-@@ -87,9 +88,7 @@ IF(MSVC)
- 	OPTION(MSVC_CRTDBG "Enable CRTDBG memory leak reporting" OFF)
- ENDIF()
- 
--IF (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
--	OPTION( USE_OPENSSL                     "Link with and use openssl library"             ON )
--ENDIF()
-+OPTION( USE_OPENSSL                     "Link with and use openssl library"             ON )
- 
- CHECK_STRUCT_HAS_MEMBER ("struct stat" st_mtim "sys/types.h;sys/stat.h"
- 	HAVE_STRUCT_STAT_ST_MTIM LANGUAGE C)
-diff --git a/src/curl_stream.c b/src/curl_stream.c
-index 98de187..a8a9f4c 100644
---- a/src/curl_stream.c
-+++ b/src/curl_stream.c
-@@ -309,7 +309,14 @@ int git_curl_stream_new(git_stream **out, const char *host, const char *port)
- 	curl_easy_setopt(handle, CURLOPT_HTTPPROXYTUNNEL, 1);
- 	curl_easy_setopt(handle, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
- 
--	/* curl_easy_setopt(handle, CURLOPT_VERBOSE, 1); */
-+  const char* cainfo = getenv("SSL_CERT_FILE");
-+  if(cainfo != NULL) {
-+    curl_easy_setopt(handle, CURLOPT_CAINFO, cainfo);
-+  }
-+
-+  /*
-+	curl_easy_setopt(handle, CURLOPT_VERBOSE, 1);
-+  */
- 
- 	st->parent.version = GIT_STREAM_VERSION;
- 	st->parent.encrypted = 0; /* we don't encrypt ourselves */
--- 
-2.3.8 (Apple Git-58)
-
diff --git a/pkgs/development/libraries/glibc/2.25-49.patch.gz b/pkgs/development/libraries/glibc/2.25-49.patch.gz
deleted file mode 100644
index 6796347e379..00000000000
--- a/pkgs/development/libraries/glibc/2.25-49.patch.gz
+++ /dev/null
Binary files differdiff --git a/pkgs/development/libraries/glibc/2.26-75.patch.gz b/pkgs/development/libraries/glibc/2.26-75.patch.gz
new file mode 100644
index 00000000000..e2a8867e4ff
--- /dev/null
+++ b/pkgs/development/libraries/glibc/2.26-75.patch.gz
Binary files differdiff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix
index 5c7bbb32c33..7894d75fbe6 100644
--- a/pkgs/development/libraries/glibc/common.nix
+++ b/pkgs/development/libraries/glibc/common.nix
@@ -19,9 +19,9 @@
 } @ args:
 
 let
-  version = "2.25";
-  patchSuffix = "-49";
-  sha256 = "067bd9bb3390e79aa45911537d13c3721f1d9d3769931a30c2681bfee66f23a0";
+  version = "2.26";
+  patchSuffix = "-75";
+  sha256 = "1ggnj1hzjym7sn93rbwydcqd562q73lsb7g7kd199g6j9j9hlkp5";
   cross = if buildPlatform != hostPlatform then hostPlatform else null;
 in
 
@@ -46,7 +46,7 @@ stdenv.mkDerivation ({
           glibc-2.25-49-gbc5ace67fe
           $ git show --reverse glibc-2.25..release/2.25/master | gzip -n -9 --rsyncable - > 2.25-49.patch.gz
       */
-      ./2.25-49.patch.gz
+      ./2.26-75.patch.gz
 
       /* Have rpcgen(1) look for cpp(1) in $PATH.  */
       ./rpcgen-path.patch
@@ -100,15 +100,12 @@ stdenv.mkDerivation ({
       (if profilingLibraries
        then "--enable-profile"
        else "--disable-profile")
-    ] ++ lib.optionals (cross == null && withLinuxHeaders) [
-      "--enable-kernel=2.6.32"
+    ] ++ lib.optionals withLinuxHeaders [
+      "--enable-kernel=3.2.0" # can't get below with glibc >= 2.26
     ] ++ lib.optionals (cross != null) [
       (if cross.withTLS then "--with-tls" else "--without-tls")
       (if cross ? float && cross.float == "soft" then "--without-fp" else "--with-fp")
-    ] ++ lib.optionals (cross != null
-          && cross.platform ? kernelMajor
-          && cross.platform.kernelMajor == "2.6") [
-      "--enable-kernel=2.6.0"
+    ] ++ lib.optionals (cross != null) [
       "--with-__thread"
     ] ++ lib.optionals (cross == null && stdenv.isArm) [
       "--host=arm-linux-gnueabi"
diff --git a/pkgs/development/libraries/icu/base.nix b/pkgs/development/libraries/icu/base.nix
index 78e0c574044..8a7cf8365a5 100644
--- a/pkgs/development/libraries/icu/base.nix
+++ b/pkgs/development/libraries/icu/base.nix
@@ -25,6 +25,11 @@ stdenv.mkDerivation {
     echo Source root reset to ''${sourceRoot}
   '';
 
+  # https://sourceware.org/glibc/wiki/Release/2.26#Removal_of_.27xlocale.h.27
+  postPatch = if stdenv ? glibc
+    then "substituteInPlace i18n/digitlst.cpp --replace '<xlocale.h>' '<locale.h>'"
+    else null; # won't find locale_t on darwin
+
   inherit patchFlags patches;
 
   preConfigure = ''
diff --git a/pkgs/development/libraries/libmediainfo/default.nix b/pkgs/development/libraries/libmediainfo/default.nix
index 9e4b23a0919..25a597ea4da 100644
--- a/pkgs/development/libraries/libmediainfo/default.nix
+++ b/pkgs/development/libraries/libmediainfo/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, autoreconfHook, pkgconfig, libzen, zlib }:
 
 stdenv.mkDerivation rec {
-  version = "0.7.99";
+  version = "17.10";
   name = "libmediainfo-${version}";
   src = fetchurl {
     url = "https://mediaarea.net/download/source/libmediainfo/${version}/libmediainfo_${version}.tar.xz";
-    sha256 = "126nkxrzs6dxzm3hzx6smvw6xgrqr3zs6hdqvl2xmvqy10p8z6pc";
+    sha256 = "00m1b4m37c9lm16yhh63p5pidg2sr3qvsw36672lklmcv3y1ic30";
   };
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
@@ -15,6 +15,8 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--enable-shared" ];
 
+  enableParallelBuilding = true;
+
   postInstall = ''
     install -vD -m 644 libmediainfo.pc "$out/lib/pkgconfig/libmediainfo.pc"
   '';
diff --git a/pkgs/development/libraries/libnsl/default.nix b/pkgs/development/libraries/libnsl/default.nix
new file mode 100644
index 00000000000..d4af280c3cd
--- /dev/null
+++ b/pkgs/development/libraries/libnsl/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, libtirpc, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  name = "libnsl-${version}";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "thkukuk";
+    repo = "libnsl";
+    rev = "libnsl-${version}";
+    sha256 = "0h8br0gmgw3fp5fmy6bfbj1qlk9hry1ssg25ssjgxbd8spczpscs";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  buildInputs = [ libtirpc ];
+
+  meta = with stdenv.lib; {
+    description = "Client interface library for NIS(YP) and NIS+";
+    homepage = https://github.com/thkukuk/libnsl;
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.dezgeg ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/libstdc++5/default.nix b/pkgs/development/libraries/libstdc++5/default.nix
index abe0538b8a9..baea981ca4a 100644
--- a/pkgs/development/libraries/libstdc++5/default.nix
+++ b/pkgs/development/libraries/libstdc++5/default.nix
@@ -29,6 +29,8 @@ stdenv.mkDerivation rec {
       sha256 = "11m5lc51b0addhc4yq4rz0dwpv6k73rrj73wya3lqdk8rly6cjpm";
       addPrefixes = true;
     })
+    # Required because of glibc 2.26
+    ./struct-ucontext.patch
   ];
 
   postPatch = ''
diff --git a/pkgs/development/libraries/libstdc++5/struct-ucontext.patch b/pkgs/development/libraries/libstdc++5/struct-ucontext.patch
new file mode 100644
index 00000000000..5462e0e33ec
--- /dev/null
+++ b/pkgs/development/libraries/libstdc++5/struct-ucontext.patch
@@ -0,0 +1,61 @@
+diff --git a/gcc/config/alpha/linux.h b/gcc/config/alpha/linux.h
+index 3a2940c..67f9899 100644
+--- a/gcc/config/alpha/linux.h
++++ b/gcc/config/alpha/linux.h
+@@ -89,7 +89,7 @@ Boston, MA 02111-1307, USA.  */
+       {									\
+ 	struct rt_sigframe {						\
+ 	  struct siginfo info;						\
+-	  struct ucontext uc;						\
++	  ucontext_t uc;						\
+ 	} *rt_ = (CONTEXT)->cfa;					\
+ 	sc_ = &rt_->uc.uc_mcontext;					\
+       }									\
+diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
+index e86ab3d..30797a7 100644
+--- a/gcc/config/i386/linux.h
++++ b/gcc/config/i386/linux.h
+@@ -260,7 +260,7 @@ Boston, MA 02111-1307, USA.  */
+ 	  siginfo_t *pinfo;					\
+ 	  void *puc;							\
+ 	  siginfo_t info;						\
+-	  struct ucontext uc;						\
++	  ucontext_t uc;						\
+ 	} *rt_ = (CONTEXT)->cfa;					\
+ 	sc_ = (struct sigcontext *) &rt_->uc.uc_mcontext;		\
+       }									\
+diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
+index fbfaa58..200c8dc 100644
+--- a/gcc/config/i386/linux64.h
++++ b/gcc/config/i386/linux64.h
+@@ -112,7 +112,7 @@ Boston, MA 02111-1307, USA.  */
+     if (*(unsigned char *)(pc_+0) == 0x48				\
+ 	&& *(unsigned long *)(pc_+1) == 0x050f0000000fc0c7)		\
+       {									\
+-	struct ucontext *uc_ = (CONTEXT)->cfa;				\
++	ucontext_t *uc_ = (CONTEXT)->cfa;				\
+ 	sc_ = (struct sigcontext *) &uc_->uc_mcontext;			\
+       }									\
+     else								\
+@@ -182,7 +182,7 @@ Boston, MA 02111-1307, USA.  */
+ 	  struct siginfo *pinfo;					\
+ 	  void *puc;							\
+ 	  struct siginfo info;						\
+-	  struct ucontext uc;						\
++	  ucontext_t uc;						\
+ 	} *rt_ = (CONTEXT)->cfa;					\
+ 	sc_ = (struct sigcontext *) &rt_->uc.uc_mcontext;		\
+       }									\
+diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h
+index ba70ec1..0fff8b1 100644
+--- a/gcc/config/rs6000/linux.h
++++ b/gcc/config/rs6000/linux.h
+@@ -101,7 +101,7 @@ Boston, MA 02111-1307, USA.  */
+ 
+ struct kernel_old_ucontext {
+   unsigned long     uc_flags;
+-  struct ucontext  *uc_link;
++  ucontext_t       *uc_link;
+   stack_t           uc_stack;
+   struct sigcontext_struct uc_mcontext;
+   sigset_t          uc_sigmask;
diff --git a/pkgs/development/libraries/libzen/default.nix b/pkgs/development/libraries/libzen/default.nix
index ab473bbe85c..afa7696aca9 100644
--- a/pkgs/development/libraries/libzen/default.nix
+++ b/pkgs/development/libraries/libzen/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, autoreconfHook }:
 
 stdenv.mkDerivation rec {
-  version = "0.4.35";
+  version = "0.4.37";
   name = "libzen-${version}";
   src = fetchurl {
     url = "https://mediaarea.net/download/source/libzen/${version}/libzen_${version}.tar.bz2";
-    sha256 = "12a1icgcffgv503ii2k1453kxg5hfly09mf4zjcc80aq8a6rf8by";
+    sha256 = "1hcsrmn85b0xp0mp33aazk7g071q1v3f163nnhv8b0mv9c4bgsfn";
   };
 
   nativeBuildInputs = [ autoreconfHook ];
@@ -15,6 +15,8 @@ stdenv.mkDerivation rec {
 
   preConfigure = "sh autogen.sh";
 
+  enableParallelBuilding = true;
+
   meta = with stdenv.lib; {
     description = "Shared library for libmediainfo and mediainfo";
     homepage = https://mediaarea.net/;
diff --git a/pkgs/development/libraries/live555/default.nix b/pkgs/development/libraries/live555/default.nix
index de4d295ebe3..e0f84f5080d 100644
--- a/pkgs/development/libraries/live555/default.nix
+++ b/pkgs/development/libraries/live555/default.nix
@@ -12,7 +12,12 @@ stdenv.mkDerivation {
     sha256 = "02z2f8z5cy0ajnh9pgar40lsxdknfw5cbyw52138hxnpr6adrvak";
   };
 
-  postPatch = "sed 's,/bin/rm,rm,g' -i genMakefiles";
+  postPatch = "sed 's,/bin/rm,rm,g' -i genMakefiles"
+  + stdenv.lib.optionalString (stdenv ? glibc) ''
+
+    substituteInPlace liveMedia/include/Locale.hh \
+      --replace '<xlocale.h>' '<locale.h>'
+  '';
 
   configurePhase = ''
     sed \
diff --git a/pkgs/development/libraries/mlt/default.nix b/pkgs/development/libraries/mlt/default.nix
index 168b94495a9..6eee8df5a23 100644
--- a/pkgs/development/libraries/mlt/default.nix
+++ b/pkgs/development/libraries/mlt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, makeWrapper
+{ stdenv, fetchFromGitHub, fetchurl, makeWrapper
 , SDL, ffmpeg, frei0r, libjack2, libdv, libsamplerate
 , libvorbis, libxml2, movit, pkgconfig, sox
 , gtk2
@@ -15,6 +15,19 @@ stdenv.mkDerivation rec {
     sha256 = "0k9vj21n6qxdjd0vvj22cwi35igajjzh5fbjza766izdbijv2i2w";
   };
 
+  patches = [
+    # fix for glibc-2.26
+    (fetchurl {
+      url = "https://github.com/mltframework/mlt/commit/2125e3955a0d0be61571cf43b674f74b4b93c6f8.patch";
+      sha256 = "1bgs5a3dblsmdmb7hwval9nmq1as4r4f48b3amsc23v69nsl2g0a";
+    })
+    # fix for glibc-2.26
+    (fetchurl {
+      url = "https://github.com/mltframework/mlt/commit/fbf6a5187776f2f392cf258935ff49e4c0e87024.patch";
+      sha256 = "045vchpcznzsz47j67kxwdbg133kar66ssna3parnzrxdfqi72pv";
+    })
+  ];
+
   buildInputs = [
     SDL ffmpeg frei0r libjack2 libdv libsamplerate libvorbis libxml2
     makeWrapper movit pkgconfig sox
diff --git a/pkgs/development/libraries/mlt/qt-5.nix b/pkgs/development/libraries/mlt/qt-5.nix
index 60ed5ef8ac8..f3bdc005247 100644
--- a/pkgs/development/libraries/mlt/qt-5.nix
+++ b/pkgs/development/libraries/mlt/qt-5.nix
@@ -13,6 +13,18 @@ stdenv.mkDerivation rec {
     url = "https://github.com/mltframework/mlt/archive/v${version}.tar.gz";
     sha256 = "10m3ry0b2pvqx3bk34qh5dq337nn8pkc2gzfyhsj4nv9abskln47";
   };
+  patches = [
+    # fix for glibc-2.26
+    (fetchurl {
+      url = "https://github.com/mltframework/mlt/commit/2125e3955a0d0be61571cf43b674f74b4b93c6f8.patch";
+      sha256 = "1bgs5a3dblsmdmb7hwval9nmq1as4r4f48b3amsc23v69nsl2g0a";
+    })
+    # fix for glibc-2.26
+    (fetchurl {
+      url = "https://github.com/mltframework/mlt/commit/fbf6a5187776f2f392cf258935ff49e4c0e87024.patch";
+      sha256 = "045vchpcznzsz47j67kxwdbg133kar66ssna3parnzrxdfqi72pv";
+    })
+  ];
 
   buildInputs = [
     SDL ffmpeg frei0r libjack2 libdv libsamplerate libvorbis libxml2
diff --git a/pkgs/development/libraries/ti-rpc/default.nix b/pkgs/development/libraries/ti-rpc/default.nix
index d66b5d82ff5..0d6674cce81 100644
--- a/pkgs/development/libraries/ti-rpc/default.nix
+++ b/pkgs/development/libraries/ti-rpc/default.nix
@@ -8,6 +8,10 @@ stdenv.mkDerivation rec {
     sha256 = "1xchbxy0xql7yl7z4n1icj8r7dmly46i22fvm00vdjq64zlmqg3j";
   };
 
+  postPatch = ''
+    sed '1i#include <stdint.h>' -i src/xdr_sizeof.c
+  '';
+
   nativeBuildInputs = [ autoreconfHook ];
   propagatedBuildInputs = [ libkrb5 ];
 
diff --git a/pkgs/development/libraries/vigra/default.nix b/pkgs/development/libraries/vigra/default.nix
index 2910e8b7dbb..324d977c72e 100644
--- a/pkgs/development/libraries/vigra/default.nix
+++ b/pkgs/development/libraries/vigra/default.nix
@@ -24,6 +24,8 @@ in stdenv.mkDerivation rec {
             ++ stdenv.lib.optionals (stdenv.system == "x86_64-linux")
                   [ "-DCMAKE_CXX_FLAGS=-fPIC" "-DCMAKE_C_FLAGS=-fPIC" ];
 
+  enableParallelBuilding = true;
+
   meta = with stdenv.lib; {
     description = "Novel computer vision C++ library with customizable algorithms and data structures";
     homepage = http://hci.iwr.uni-heidelberg.de/vigra;
diff --git a/pkgs/development/libraries/wlc/default.nix b/pkgs/development/libraries/wlc/default.nix
index 7fcf4fbbe5f..02066253d0f 100644
--- a/pkgs/development/libraries/wlc/default.nix
+++ b/pkgs/development/libraries/wlc/default.nix
@@ -5,28 +5,18 @@
 , withOptionalPackages ? true, zlib, valgrind, doxygen
 }:
 
-let
-  # for 0.0.10
-  xwaylandPatch = fetchpatch {
-    url = "https://github.com/Cloudef/wlc/commit/a130f6006560fb8ac02fb59a90ced1659563f9ca.diff";
-    sha256 = "0kzcbqklcyg8bganm65di8cif6dpc8bkrsvkjia09kr92lymxm2c";
-  };
-in stdenv.mkDerivation rec {
+stdenv.mkDerivation rec {
   name = "wlc-${version}";
-  version = "0.0.10";
+  version = "0.0.11";
 
   src = fetchFromGitHub {
     owner = "Cloudef";
     repo = "wlc";
     rev = "v${version}";
     fetchSubmodules = true;
-    sha256 = "09kvwhrpgkxlagn9lgqxc80jbg56djn29a6z0n6h0dsm90ysyb2k";
+    sha256 = "1qnak907gjd35hq4b0rrhgb7kz5iwnirh8yk372yzxpgk7dq0gz9";
   };
 
-  patches = [
-    xwaylandPatch
-  ];
-
   nativeBuildInputs = [ cmake pkgconfig ];
 
   buildInputs = [
diff --git a/pkgs/development/python-modules/h2/default.nix b/pkgs/development/python-modules/h2/default.nix
new file mode 100644
index 00000000000..08cd1943eff
--- /dev/null
+++ b/pkgs/development/python-modules/h2/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, buildPythonPackage, fetchPypi
+, enum34, hpack, hyperframe }:
+
+buildPythonPackage rec {
+  name = "${pname}-${version}";
+  pname = "h2";
+  version = "3.0.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0r3f43r0v7sqgdjjg5ngw0dndk2v6cyd0jncpwya54m37y42z5mj";
+  };
+
+  propagatedBuildInputs = [ enum34 hpack hyperframe ];
+
+  meta = with stdenv.lib; {
+    description = "HTTP/2 State-Machine based protocol implementation";
+    homepage = "http://hyper.rtfd.org/";
+    license = licenses.mit;
+  };
+}
diff --git a/pkgs/development/python-modules/hyperframe/default.nix b/pkgs/development/python-modules/hyperframe/default.nix
new file mode 100644
index 00000000000..91e00a7a146
--- /dev/null
+++ b/pkgs/development/python-modules/hyperframe/default.nix
@@ -0,0 +1,17 @@
+{ stdenv, buildPythonPackage, fetchPypi }:
+buildPythonPackage rec {
+  name = "${pname}-${version}";
+  pname = "hyperframe";
+  version = "5.1.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "017vjbb1xjak1pxcvihhilzjnmpfvhapk7k88wp6lvdkkm9l8nd2";
+  };
+
+  meta = with stdenv.lib; {
+    description = "HTTP/2 framing layer for Python";
+    homepage = "http://hyper.rtfd.org/";
+    license = licenses.mit;
+  };
+}
diff --git a/pkgs/development/python-modules/kaitaistruct/default.nix b/pkgs/development/python-modules/kaitaistruct/default.nix
new file mode 100644
index 00000000000..c9961956617
--- /dev/null
+++ b/pkgs/development/python-modules/kaitaistruct/default.nix
@@ -0,0 +1,18 @@
+{ stdenv, kaitaistruct, buildPythonPackage, fetchPypi }:
+
+buildPythonPackage rec {
+  name = "${pname}-${version}";
+  pname = "kaitaistruct";
+  version = "0.7";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "19j3snmr0qbd48f7yd3cc21ffv13dahf8ys591dnalbhvnkar71i";
+  };
+
+  meta = with stdenv.lib; {
+    description = "Kaitai Struct: runtime library for Python";
+    homepage = "https://github.com/kaitai-io/kaitai_struct_python_runtime";
+    license = licenses.mit;
+  };
+}
diff --git a/pkgs/development/python-modules/keepkey/default.nix b/pkgs/development/python-modules/keepkey/default.nix
index 8eba12dfcea..9ea6840c4d2 100644
--- a/pkgs/development/python-modules/keepkey/default.nix
+++ b/pkgs/development/python-modules/keepkey/default.nix
@@ -1,21 +1,25 @@
-{ stdenv, fetchPypi, buildPythonPackage, ecdsa
-, mnemonic, protobuf, hidapi }:
+{ stdenv, fetchFromGitHub, buildPythonPackage, pytest
+, ecdsa , mnemonic, protobuf, hidapi, trezor }:
 
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "keepkey";
   version = "4.0.0";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "95c8d5127919f9fc4bb0120b05f92efc8f526d4a68122ac18e63509571ac45a2";
+  src = fetchFromGitHub {
+    owner = "keepkey";
+    repo = "python-keepkey";
+    rev = "v${version}";
+    sha256 = "144awjkc169z2n1ffirs697y6m97izh3pbh3sjhy3nji7jszh592";
   };
 
-  propagatedBuildInputs = [ protobuf hidapi ];
+  propagatedBuildInputs = [ protobuf hidapi trezor ];
 
   buildInputs = [ ecdsa mnemonic ];
 
-  # There are no actual tests: "ImportError: No module named tests"
+  checkInputs = [ pytest ];
+
+  # tests requires hardware
   doCheck = false;
 
   # Remove impossible dependency constraint
diff --git a/pkgs/development/python-modules/ldap3/default.nix b/pkgs/development/python-modules/ldap3/default.nix
new file mode 100644
index 00000000000..895272f351d
--- /dev/null
+++ b/pkgs/development/python-modules/ldap3/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchPypi, buildPythonPackage, gssapi, pyasn1 }:
+
+buildPythonPackage rec {
+  version = "2.3";
+  pname = "ldap3";
+  name = "${pname}-${version}";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1b36lwil4iflk2ay8gi663abpnfm8id7qg4n3jkmmqbnc1sv6mn0";
+  };
+
+  buildInputs = [ gssapi ];
+
+  propagatedBuildInputs = [ pyasn1 ];
+
+  doCheck = false; # requires network
+
+  meta = with stdenv.lib; {
+    homepage = https://pypi.python.org/pypi/ldap3;
+    description = "A strictly RFC 4510 conforming LDAP V3 pure Python client library";
+    license = licenses.lgpl3;
+  };
+}
diff --git a/pkgs/development/python-modules/libagent/default.nix b/pkgs/development/python-modules/libagent/default.nix
index cca10794258..e8cecda7589 100644
--- a/pkgs/development/python-modules/libagent/default.nix
+++ b/pkgs/development/python-modules/libagent/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchPypi, buildPythonPackage, ed25519, ecdsa
-, semver, keepkey, trezor, mnemonic, ledgerblue
+, semver, keepkey, trezor, mnemonic, ledgerblue, unidecode, mock, pytest
 }:
 
 buildPythonPackage rec {
@@ -17,6 +17,14 @@ buildPythonPackage rec {
     trezor mnemonic ledgerblue
   ];
 
+  propagatedBuildInputs = [ unidecode ];
+
+  checkInputs = [ mock pytest ];
+
+  checkPhase = ''
+    py.test libagent/tests
+  '';
+
   meta = with stdenv.lib; {
     description = "Using hardware wallets as SSH/GPG agent";
     homepage = https://github.com/romanz/trezor-agent;
diff --git a/pkgs/development/python-modules/meliae/default.nix b/pkgs/development/python-modules/meliae/default.nix
index 2a1c4f4341f..ec6c15b2501 100644
--- a/pkgs/development/python-modules/meliae/default.nix
+++ b/pkgs/development/python-modules/meliae/default.nix
@@ -8,7 +8,7 @@
 
 buildPythonPackage rec {
   pname = "meliae";
-  version = "0.4.0.final.0";
+  version = "0.4.0";
   name = "${pname}-${version}";
 
   src = fetchPypi {
diff --git a/pkgs/development/python-modules/pyasn1-modules/default.nix b/pkgs/development/python-modules/pyasn1-modules/default.nix
new file mode 100644
index 00000000000..a7ee15d6a18
--- /dev/null
+++ b/pkgs/development/python-modules/pyasn1-modules/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, buildPythonPackage, fetchPypi, pyasn1, isPyPy }:
+
+buildPythonPackage rec {
+  name = "${pname}-${version}";
+  pname = "pyasn1-modules";
+  version = "0.1.5";
+  disabled = isPyPy;
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1239h6h67vg0wazg2qgv6m3hdim2gs66pl89lbnayk55bbnkwc0x";
+  };
+
+  propagatedBuildInputs = [ pyasn1 ];
+
+  meta = with stdenv.lib; {
+    description = "A collection of ASN.1-based protocols modules";
+    homepage = https://pypi.python.org/pypi/pyasn1-modules;
+    license = licenses.bsd3;
+    platforms = platforms.unix;  # same as pyasn1
+  };
+}
diff --git a/pkgs/development/python-modules/pyasn1/default.nix b/pkgs/development/python-modules/pyasn1/default.nix
new file mode 100644
index 00000000000..d0122a5b7e4
--- /dev/null
+++ b/pkgs/development/python-modules/pyasn1/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, buildPythonPackage, fetchPypi, }:
+
+buildPythonPackage rec {
+  name = "${pname}-${version}";
+  pname = "pyasn1";
+  version = "0.3.4";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "06hhy38jhwh95gpn8f03cr439273fsfsh4vhd5024r86nh5gyiir";
+  };
+
+  meta = with stdenv.lib; {
+    description = "ASN.1 tools for Python";
+    homepage = http://pyasn1.sourceforge.net/;
+    license = "mBSD";
+    platforms = platforms.unix;  # arbitrary choice
+  };
+}
diff --git a/pkgs/development/python-modules/pygit2/default.nix b/pkgs/development/python-modules/pygit2/default.nix
new file mode 100644
index 00000000000..90bfe978391
--- /dev/null
+++ b/pkgs/development/python-modules/pygit2/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, lib, buildPythonPackage, fetchPypi, isPyPy, libgit2, six, cffi }:
+
+buildPythonPackage rec {
+  name = "${pname}-${version}";
+  pname = "pygit2";
+  version = "0.26.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1cbc488ra3kg7r3qky17ms0szi3cda2d96qfkv1l9djsy9hnvw57";
+  };
+
+  preConfigure = lib.optionalString stdenv.isDarwin ''
+    export DYLD_LIBRARY_PATH="${libgit2}/lib"
+  '';
+
+  propagatedBuildInputs = [ libgit2 six ] ++ lib.optional (!isPyPy) cffi;
+
+  preCheck = ''
+    # disable tests that require networking
+    rm test/test_repository.py
+    rm test/test_credentials.py
+    rm test/test_submodule.py
+  '';
+
+  meta = with lib; {
+    description = "A set of Python bindings to the libgit2 shared library";
+    homepage = https://pypi.python.org/pypi/pygit2;
+    license = licenses.gpl2;
+  };
+}
diff --git a/pkgs/development/python-modules/selenium/default.nix b/pkgs/development/python-modules/selenium/default.nix
new file mode 100644
index 00000000000..d33e86a3f07
--- /dev/null
+++ b/pkgs/development/python-modules/selenium/default.nix
@@ -0,0 +1,50 @@
+{ lib
+, stdenv
+, fetchurl
+, fetchFromGitHub
+, buildPythonPackage
+, geckodriver
+, xorg
+}:
+
+buildPythonPackage rec {
+  name = "selenium-3.6.0";
+  src = fetchurl {
+    url = "mirror://pypi/s/selenium/${name}.tar.gz";
+    sha256 = "15qpvz0bdwjvpcj11fm0rw6r5inr66sqw89ww50l025sbhf04qwm";
+  };
+
+  buildInputs = [xorg.libX11];
+
+  propagatedBuildInputs = [
+    geckodriver
+  ];
+
+  # Recompiling x_ignore_nofocus.so as the original one dlopen's libX11.so.6 by some
+  # absolute paths. Replaced by relative path so it is found when used in nix.
+  x_ignore_nofocus =
+    fetchFromGitHub {
+      owner = "SeleniumHQ";
+      repo = "selenium";
+      rev = "selenium-3.6.0";
+      sha256 = "13wf4hx4i7nhl4s8xkziwxl0km1j873syrj4amragj6mpip2wn8v";
+    };
+
+  patchPhase = ''
+    cp "${x_ignore_nofocus}/cpp/linux-specific/"* .
+    substituteInPlace x_ignore_nofocus.c --replace "/usr/lib/libX11.so.6" "${xorg.libX11.out}/lib/libX11.so.6"
+    gcc -c -fPIC x_ignore_nofocus.c -o x_ignore_nofocus.o
+    gcc -shared \
+      -Wl,${if stdenv.isDarwin then "-install_name" else "-soname"},x_ignore_nofocus.so \
+      -o x_ignore_nofocus.so \
+      x_ignore_nofocus.o
+    cp -v x_ignore_nofocus.so selenium/webdriver/firefox/${if stdenv.is64bit then "amd64" else "x86"}/
+  '';
+
+  meta = with lib; {
+    description = "The selenium package is used to automate web browser interaction from Python";
+    homepage = http://www.seleniumhq.org;
+    license = licenses.asl20;
+    maintainers = with maintainers; [ jraygauthier ];
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/trezor/default.nix b/pkgs/development/python-modules/trezor/default.nix
index c473403f53d..cb4b63ade81 100644
--- a/pkgs/development/python-modules/trezor/default.nix
+++ b/pkgs/development/python-modules/trezor/default.nix
@@ -12,9 +12,9 @@ buildPythonPackage rec {
     sha256 = "6bdb69fc125ba705854e21163be6c7da3aa17c2a3a84f40b6d8a3f6e4a8cb314";
   };
 
-  propagatedBuildInputs = [ protobuf hidapi requests ];
+  propagatedBuildInputs = [ protobuf hidapi requests mnemonic ];
 
-  buildInputs = [ ecdsa mnemonic ];
+  buildInputs = [ ecdsa ];
 
   # There are no actual tests: "ImportError: No module named tests"
   doCheck = false;
diff --git a/pkgs/development/python-modules/urwid/default.nix b/pkgs/development/python-modules/urwid/default.nix
index 000cf5ea5ef..d77a212003b 100644
--- a/pkgs/development/python-modules/urwid/default.nix
+++ b/pkgs/development/python-modules/urwid/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildPythonPackage, fetchPypi, fetchurl }:
+{ stdenv, buildPythonPackage, fetchPypi, fetchpatch }:
 
 buildPythonPackage (rec {
   pname = "urwid";
@@ -11,10 +11,16 @@ buildPythonPackage (rec {
   };
 
   patches = [
-    (fetchurl {
-      url = https://github.com/urwid/urwid/commit/4b0ed8b6030450e6d99909a7c683e9642e546387.patch;
-      sha256 = "0ygghd6wzjqij5szg61l1dsk8b0yv8bwyj3bgxxj1lj4m17zsy5q";
-    })
+   # fix tests
+   (fetchpatch {
+     url = "https://github.com/urwid/urwid/commit/4b0ed8b6030450e6d99909a7c683e9642e546387.patch";
+     sha256 = "0azpn0ylbg8mfpr0y27n4lnq0ph75a4d4m9wdv3napnhf1vh9ahx";
+   })
+   # fix tests
+   (fetchpatch {
+     url = "https://github.com/floppym/urwid/commit/f68f2cf089cfd5ec45863baf59a91d5aeb0cf5c3.patch";
+     sha256 = "1b3vz7mrwz2bqvdwvbyv2j835f9lzapgw0j2km4sam76bxmgfpgq";
+   })
   ];
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/tools/continuous-integration/jenkins/default.nix b/pkgs/development/tools/continuous-integration/jenkins/default.nix
index e6f01ba5c93..ea5a5e37017 100644
--- a/pkgs/development/tools/continuous-integration/jenkins/default.nix
+++ b/pkgs/development/tools/continuous-integration/jenkins/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "jenkins-${version}";
-  version = "2.87";
+  version = "2.88";
 
   src = fetchurl {
     url = "http://mirrors.jenkins-ci.org/war/${version}/jenkins.war";
-    sha256 = "1nzs9nn1nr2jav59v1xj39rzmrh1zmwaqnpaiqsll8kixkr9rb8f";
+    sha256 = "062hnbyj73311sxhkwla6sl33zb43v8p7hjssgbh0bfvgmnlayim";
   };
 
   buildCommand = ''
@@ -19,6 +19,6 @@ stdenv.mkDerivation rec {
     homepage = http://jenkins-ci.org;
     license = licenses.mit;
     platforms = platforms.all;
-    maintainers = with maintainers; [ coconnor fpletz ];
+    maintainers = with maintainers; [ coconnor fpletz earldouglas ];
   };
 }
diff --git a/pkgs/development/tools/geckodriver/default.nix b/pkgs/development/tools/geckodriver/default.nix
new file mode 100644
index 00000000000..8f6e0dde589
--- /dev/null
+++ b/pkgs/development/tools/geckodriver/default.nix
@@ -0,0 +1,25 @@
+{ lib
+, fetchurl
+, rustPlatform
+}:
+
+with rustPlatform; 
+
+buildRustPackage rec {
+  version = "0.19.1";
+  name = "geckodriver-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/mozilla/geckodriver/archive/v${version}.tar.gz";
+    sha256 = "04zpv4aiwbig466yj24hhazl5hrapkyvwlhvg0za5599ykzdv47m";
+  };
+
+  cargoSha256 = "1cny8caqcd9p98hra1k7y4d3lb8sxsyaplr0svbwam0d2qc1c257";
+
+  meta = with lib; {
+    description = "Proxy for using W3C WebDriver-compatible clients to interact with Gecko-based browsers";
+    homepage = https://github.com/mozilla/geckodriver;
+    license = licenses.mpl20;
+    maintainers = with maintainers; [ jraygauthier ];
+  };
+}
diff --git a/pkgs/development/tools/git-series/default.nix b/pkgs/development/tools/git-series/default.nix
index 44120ad023a..7d94863ea1c 100644
--- a/pkgs/development/tools/git-series/default.nix
+++ b/pkgs/development/tools/git-series/default.nix
@@ -17,7 +17,7 @@ buildRustPackage rec {
 
   cargoDepsHook = ''
     (
-      cd ${name}-src
+      cd */
       # see https://github.com/git-series/git-series/pull/56
       patch -p1 < ${fetchpatch {
         url = "https://github.com/Mic92/git-series/commit/3aa30a47d74ebf90b444dccdf8c153f07f119483.patch";
diff --git a/pkgs/development/tools/misc/dbench/default.nix b/pkgs/development/tools/misc/dbench/default.nix
index a1c9c11d34d..a1c9e85a83a 100644
--- a/pkgs/development/tools/misc/dbench/default.nix
+++ b/pkgs/development/tools/misc/dbench/default.nix
@@ -11,6 +11,11 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ autoconf popt zlib ];
 
+  patches = [
+    # patch has been also sent upstream and might be included in future versions
+    ./fix-missing-stdint.patch
+  ];
+
   preConfigure = ''
     ./autogen.sh
     configureFlagsArray+=("--datadir=$out/share/dbench")
diff --git a/pkgs/development/tools/misc/dbench/fix-missing-stdint.patch b/pkgs/development/tools/misc/dbench/fix-missing-stdint.patch
new file mode 100644
index 00000000000..96cb28e9e55
--- /dev/null
+++ b/pkgs/development/tools/misc/dbench/fix-missing-stdint.patch
@@ -0,0 +1,10 @@
+--- dbench-65b1987.org/libnfs.c	2017-11-08 12:25:39.652147989 +0000
++++ dbench-65b1987/libnfs.c	2017-11-08 12:26:20.269897054 +0000
+@@ -23,6 +23,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
++#include <stdint.h>
+ 
+ #define discard_const(ptr) ((void *)((intptr_t)(ptr)))
+ 
diff --git a/pkgs/development/tools/parsing/flex/default.nix b/pkgs/development/tools/parsing/flex/default.nix
index 92fba47b756..4ea11a622ea 100644
--- a/pkgs/development/tools/parsing/flex/default.nix
+++ b/pkgs/development/tools/parsing/flex/default.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchurl, bison, m4 }:
+{ stdenv, fetchurl, bison, m4
+, fetchpatch, autoreconfHook, help2man
+}:
 
 stdenv.mkDerivation rec {
   name = "flex-${version}";
@@ -9,6 +11,16 @@ stdenv.mkDerivation rec {
     sha256 = "15g9bv236nzi665p9ggqjlfn4dwck5835vf0bbw2cz7h5c1swyp8";
   };
 
+  # Also upstream, will be part of 2.6.5
+  # https://github.com/westes/flex/commit/24fd0551333e
+  patches = [(fetchpatch {
+    name = "glibc-2.26.patch";
+    url = "https://raw.githubusercontent.com/lede-project/source/0fb14a2b1ab2f82c"
+        + "/tools/flex/patches/200-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch";
+    sha256 = "1aarhcmz7mfrgh15pkj6f7ikxa2m0mllw1i1vscsf1kw5d05lw6f";
+  })];
+  nativeBuildInputs = [ autoreconfHook help2man ];
+
   buildInputs = [ bison ];
 
   propagatedBuildInputs = [ m4 ];
diff --git a/pkgs/development/tools/profiling/systemtap/default.nix b/pkgs/development/tools/profiling/systemtap/default.nix
index 89a1b5fe0aa..b397f02665b 100644
--- a/pkgs/development/tools/profiling/systemtap/default.nix
+++ b/pkgs/development/tools/profiling/systemtap/default.nix
@@ -1,5 +1,7 @@
 { fetchgit, pkgconfig, gettext, runCommand, makeWrapper
-, elfutils, kernel, gnumake, python2, pythonPackages, binutils }:
+, elfutils, kernel, gnumake, python2, pythonPackages
+}:
+
 let
   ## fetchgit info
   url = git://sourceware.org/git/systemtap.git;
@@ -55,5 +57,5 @@ in runCommand "systemtap-${kernel.version}-${version}" {
   rm $out/bin/stap
   makeWrapper $stapBuild/bin/stap $out/bin/stap \
     --add-flags "-r $kernelBuildDir" \
-    --prefix PATH : ${lib.makeBinPath [ stdenv.cc.cc binutils elfutils gnumake ]}
+    --prefix PATH : ${lib.makeBinPath [ stdenv.cc.cc stdenv.cc.bintools elfutils gnumake ]}
 ''
diff --git a/pkgs/games/anki/default.nix b/pkgs/games/anki/default.nix
index 4a531c07efd..e87e59637ed 100644
--- a/pkgs/games/anki/default.nix
+++ b/pkgs/games/anki/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
         # "http://ankisrs.net/download/mirror/${name}.tgz"
         # "http://ankisrs.net/download/mirror/archive/${name}.tgz"
       ];
-      sha256 = "01h51rbnj0r6lmjnn2vzxzaf7mxkc0azmg1v4mvf4pkpsp50a7hr";
+      sha256 = "067bsidqzy1zc301i2pk4biwp2kwvgk4kydp5z5s551acinkbdgv";
     };
 
     pythonPath = [ pyqt4 sqlalchemy pyaudio beautifulsoup4 httplib2 ]
diff --git a/pkgs/games/brogue/default.nix b/pkgs/games/brogue/default.nix
index 814f4f6c82e..d48dc8e8006 100644
--- a/pkgs/games/brogue/default.nix
+++ b/pkgs/games/brogue/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, SDL, ncurses, libtcod, binutils }:
+{ stdenv, fetchurl, SDL, ncurses, libtcod }:
 
 stdenv.mkDerivation rec {
   name = "brogue-${version}";
diff --git a/pkgs/games/steam/runtime.nix b/pkgs/games/steam/runtime.nix
index 82fce93a66a..1fa17c32d6c 100644
--- a/pkgs/games/steam/runtime.nix
+++ b/pkgs/games/steam/runtime.nix
@@ -1,4 +1,4 @@
-{ stdenv, steamArch, fetchurl, writeText, python2, dpkg, binutils }:
+{ stdenv, steamArch, fetchurl, writeText, python2, dpkg }:
 
 let input = builtins.getAttr steamArch (import ./runtime-generated.nix { inherit fetchurl; });
 
@@ -7,7 +7,7 @@ let input = builtins.getAttr steamArch (import ./runtime-generated.nix { inherit
 in stdenv.mkDerivation {
   name = "steam-runtime-2016-08-13";
 
-  nativeBuildInputs = [ python2 dpkg binutils ];
+  nativeBuildInputs = [ python2 dpkg stdenv.cc.bintools ];
 
   buildCommand = ''
     mkdir -p $out
diff --git a/pkgs/games/uqm/3dovideo.nix b/pkgs/games/uqm/3dovideo.nix
index ca5a1197a32..0eb6e02eac5 100644
--- a/pkgs/games/uqm/3dovideo.nix
+++ b/pkgs/games/uqm/3dovideo.nix
@@ -41,9 +41,10 @@ in stdenv.mkDerivation {
     sha256 = "044h0cl69r0kc43vk4n0akk0prwzb7inq324h5yfqb38sd4zkds1";
     message = ''
       In order to get the intro and ending sequences from the 3DO version, you
-      need to have the original 3DO Star Control II CD. Create an image from the
-      CD and use uqm3donix* to extract a tarball with the videos from it. The
-      reason for this is because the 3DO uses its own proprietary disk format.
+      need to have the original 3DO Star Control II CD. Create an image from
+      the CD and use uqm3donix* to extract a tarball with the videos from it.
+      The reason for this is because the 3DO uses its own proprietary disk
+      format.
 
       Save the file as videos.tar and use "nix-prefetch-url file://${name}" to
       add it to the Nix store.
diff --git a/pkgs/games/uqm/default.nix b/pkgs/games/uqm/default.nix
index c6f4b57a033..d8dcdf6b7b6 100644
--- a/pkgs/games/uqm/default.nix
+++ b/pkgs/games/uqm/default.nix
@@ -1,6 +1,5 @@
-{ stdenv, fetchurl
-, pkgconfig, mesa
-, SDL, SDL_image, libpng, zlib, libvorbis, libogg, libmikmod, unzip
+{ stdenv, lib, fetchurl, pkgconfig, mesa
+, SDL, SDL_image, libpng, zlib, libvorbis, libogg, libmikmod
 
 , use3DOVideos ? false, requireFile ? null, writeText ? null
 , haskellPackages ? null
@@ -11,14 +10,12 @@
 assert use3DOVideos -> requireFile != null && writeText != null
                     && haskellPackages != null;
 
-with stdenv.lib;
-
 let
   videos = import ./3dovideo.nix {
     inherit stdenv requireFile writeText fetchurl haskellPackages;
   };
 
-  remixPacks = imap1 (num: sha256: fetchurl rec {
+  remixPacks = lib.imap1 (num: sha256: fetchurl rec {
     name = "uqm-remix-disc${toString num}.uqm";
     url = "mirror://sourceforge/sc2/${name}";
     inherit sha256;
@@ -53,14 +50,8 @@ in stdenv.mkDerivation rec {
     sha256 = "10nbvcrr0lc0mxivxfkcbxnibwk3vwmamabrlvwdsjxd9pk8aw65";
   };
 
-
- /* uses pthread_cancel(), which requires libgcc_s.so.1 to be
-    loadable at run-time. Adding the flag below ensures that the
-    library can be found. Obviously, though, this is a hack. */
-  NIX_LDFLAGS="-lgcc_s";
-
   nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [SDL SDL_image libpng libvorbis libogg libmikmod unzip mesa];
+  buildInputs = [ SDL SDL_image libpng libvorbis libogg libmikmod mesa ];
 
   postUnpack = ''
     mkdir -p uqm-${version}/content/packages
@@ -68,15 +59,19 @@ in stdenv.mkDerivation rec {
     ln -s "$content" "uqm-${version}/content/packages/uqm-0.7.0-content.uqm"
     ln -s "$music" "uqm-${version}/content/addons/uqm-0.7.0-3domusic.uqm"
     ln -s "$voice" "uqm-${version}/content/addons/uqm-0.7.0-voice.uqm"
-  '' + optionalString useRemixPacks (concatMapStrings (disc: ''
+  '' + lib.optionalString useRemixPacks (lib.concatMapStrings (disc: ''
     ln -s "${disc}" "uqm-$version/content/addons/${disc.name}"
-  '') remixPacks) + optionalString use3DOVideos ''
+  '') remixPacks) + lib.optionalString use3DOVideos ''
     ln -s "${videos}" "uqm-${version}/content/addons/3dovideo"
   '';
 
-  /* uqm has a 'unique' build system with a root script incidentally called
- * 'build.sh'. */
+  # Using _STRINGS_H as include guard conflicts with glibc.
+  postPatch = ''
+    sed -i -e '/^#/s/_STRINGS_H/_UQM_STRINGS_H/g' src/uqm/comm/*/strings.h
+  '';
 
+  # uqm has a 'unique' build system with a root script incidentally called
+  # 'build.sh'.
   configurePhase = ''
     echo "INPUT_install_prefix_VALUE='$out'" >> config.state
     echo "INPUT_install_bindir_VALUE='$out/bin'" >> config.state
@@ -97,14 +92,16 @@ in stdenv.mkDerivation rec {
   meta = {
     description = "Remake of Star Control II";
     longDescription = ''
-    The goals for the The Ur-Quan Masters project are:
-      - to bring Star Control II to modern platforms, thereby making a lot of people happy
-      - to make game translations easy, thereby making even more people happy
-      - to adapt the code so that people can more easily make their own spin-offs, thereby making zillions more people happy!
+      The goals for the The Ur-Quan Masters project are:
+        - to bring Star Control II to modern platforms, thereby making a lot of
+          people happy
+        - to make game translations easy, thereby making even more people happy
+        - to adapt the code so that people can more easily make their own
+          spin-offs, thereby making zillions more people happy!
     '';
     homepage = http://sc2.sourceforge.net/;
     license = stdenv.lib.licenses.gpl2;
-    maintainers = with maintainers; [ jcumming aszlig ];
-    platforms = with platforms; linux;
+    maintainers = with lib.maintainers; [ jcumming aszlig ];
+    platforms = with lib.platforms; linux;
   };
 }
diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix
index a01fc74ce47..66ed1d44adc 100644
--- a/pkgs/misc/drivers/hplip/default.nix
+++ b/pkgs/misc/drivers/hplip/default.nix
@@ -11,16 +11,16 @@
 let
 
   name = "hplip-${version}";
-  version = "3.17.9";
+  version = "3.17.10";
 
   src = fetchurl {
     url = "mirror://sourceforge/hplip/${name}.tar.gz";
-    sha256 = "0y46jjq8jdfk9m4vjq55h8yggibvqbi9rl08vni7vbhxym1diamj";
+    sha256 = "0v27hg856b5z2rilczcbfgz8ksxn0n810g1glac3mxkj8qbl8wqg";
   };
 
   plugin = fetchurl {
-    url = "http://hplipopensource.com/hplip-web/plugin/${name}-plugin.run";
-    sha256 = "10z8vzwcwmwni7s4j9xp0fa7l4lwrhl4kp450dga3fj0cck1gxwq";
+    url = "http://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/${name}-plugin.run";
+    sha256 = "07am3dnl0ipgfswz5wndprryljh9rqbfhq7mm4d4yyj3bdnnzlig";
   };
 
   hplipState = substituteAll {
diff --git a/pkgs/misc/vscode-extensions/cpptools/default.nix b/pkgs/misc/vscode-extensions/cpptools/default.nix
new file mode 100644
index 00000000000..87c782222fc
--- /dev/null
+++ b/pkgs/misc/vscode-extensions/cpptools/default.nix
@@ -0,0 +1,128 @@
+{ stdenv, lib, fetchurl, vscode-utils, unzip, dos2unix, mono46, clang-tools, writeScript
+, gdbUseFixed ? true, gdb # The gdb default setting will be fixed to specified. Use version from `PATH` otherwise. 
+}:
+
+assert gdbUseFixed -> null != gdb;
+
+/*
+  Note that this version of the extension still has some nix specific issues
+  which could not be fixed merely by patching (inside a C# dll).
+
+  In particular, the debugger requires either gnome-terminal or xterm. However
+  instead of looking for the terminal executable in `PATH`, for any linux platform
+  the dll uses an hardcoded path to one of these.
+
+  So, in order for debugging to work properly, you merely need to create symlinks
+  to one of these terminals at the appropriate location.
+
+  The good news is the the utility library is open source and with some effort
+  we could build a patched version ourselves. See:
+
+  <https://github.com/Microsoft/MIEngine/blob/2885386dc7f35e0f1e44827269341e786361f28e/src/MICore/TerminalLauncher.cs#L156>
+
+  Also, the extension should eventually no longer require an external terminal. See:
+
+  <https://github.com/Microsoft/vscode-cpptools/issues/35>
+
+  Once the symbolic link temporary solution taken, everything shoud run smootly.
+*/
+
+let
+  gdbDefaultsTo = if gdbUseFixed then "${gdb}/bin/gdb" else "gdb";
+
+  langComponentBinaries = stdenv.mkDerivation {
+    name = "cpptools-language-component-binaries";
+
+    src = fetchurl {
+      url = https://download.visualstudio.microsoft.com/download/pr/11151953/d3cc8b654bffb8a2f3896d101f3c3155/Bin_Linux.zip;
+      sha256 = "12qbxsrdc73cqjb84xdck1xafzhfkcyn6bqbpcy1bxxr3b7hxbii";
+    };
+
+    buildInputs = [ unzip ];
+
+    patchPhase = ''
+      elfInterpreter="${stdenv.glibc.out}/lib/ld-linux-x86-64.so.2"
+      patchelf --set-interpreter "$elfInterpreter" ./Microsoft.VSCode.CPP.Extension.linux
+      patchelf --set-interpreter "$elfInterpreter" ./Microsoft.VSCode.CPP.IntelliSense.Msvc.linux
+      chmod a+x ./Microsoft.VSCode.CPP.Extension.linux ./Microsoft.VSCode.CPP.IntelliSense.Msvc.linux
+    '';
+
+    installPhase = ''
+      mkdir -p "$out/bin"
+      find . -mindepth 1 -maxdepth 1 | xargs cp -a -t "$out/bin"
+    '';
+  };
+
+  cpptoolsJsonFile = fetchurl {
+    url = https://download.visualstudio.microsoft.com/download/pr/11070848/7b97d6724d52cae8377c61bb4601c989/cpptools.json;
+    sha256 = "124f091aic92rzbg2vg831y22zr5wi056c1kh775djqs3qv31ja6";
+  };
+
+
+
+  openDebugAD7Script = writeScript "OpenDebugAD7" ''
+    #!${stdenv.shell}
+    BIN_DIR="$(cd "$(dirname "$0")" && pwd -P)"
+    ${if gdbUseFixed
+        then ''
+          export PATH=''${PATH}''${PATH:+:}${gdb}/bin
+        ''
+        else ""}
+    ${mono46}/bin/mono $BIN_DIR/bin/OpenDebugAD7.exe $*
+  '';
+in
+
+vscode-utils.buildVscodeMarketplaceExtension {
+  mktplcRef = {
+    name = "cpptools";
+    publisher = "ms-vscode";
+    version = "0.12.3";
+    sha256 = "1dcqy54n1w29xhbvxscd41hdrbdwar6g12zx02f6kh2f1kw34z5z";
+  };
+
+  buildInputs = [
+    dos2unix
+  ];
+
+  prePatch = ''
+    dos2unix package.json      
+  '';
+
+  patches = [
+    ./vscode-cpptools-0-12-3-package-json.patch
+  ];
+
+  postPatch = ''
+    # Patch `packages.json` so that nix's *gdb* is used as default value for `miDebuggerPath`.
+    substituteInPlace "./package.json" \
+      --replace "\"default\": \"/usr/bin/gdb\"" "\"default\": \"${gdbDefaultsTo}\""
+
+    # Prevent download/install of extensions
+    touch "./install.lock"
+
+    # Move unused files out of the way.
+    mv ./debugAdapters/bin/OpenDebugAD7.exe.config ./debugAdapters/bin/OpenDebugAD7.exe.config.unused
+
+    # Bring the `cpptools.json` file at the root of the package, same as the extension would do.
+    cp -p "${cpptoolsJsonFile}" "./cpptools.json"
+
+    # Combining the language component binaries as part of our package.
+    find "${langComponentBinaries}/bin" -mindepth 1 -maxdepth 1 | xargs cp -p -t "./bin"
+
+    # Mono runtimes from nix package (used by generated `OpenDebugAD7`).
+    rm "./debugAdapters/OpenDebugAD7"
+    cp -p "${openDebugAD7Script}" "./debugAdapters/OpenDebugAD7"
+
+    # Clang-format from nix package.
+    mkdir -p "./LLVM"
+    find "${clang-tools}" -mindepth 1 -maxdepth 1 | xargs ln -s -t "./LLVM"
+  '';
+
+    meta = with stdenv.lib; {
+      license = licenses.unfree;
+      maintainer = [ maintainers.jraygauthier ];
+      # A 32 bit linux would also be possible with some effort (specific download of binaries + 
+      # patching of the elf files with 32 bit interpreter).
+      platforms = [ "x86_64-linux" ];
+    };
+}
\ No newline at end of file
diff --git a/pkgs/misc/vscode-extensions/cpptools/vscode-cpptools-0-12-3-package-json.patch b/pkgs/misc/vscode-extensions/cpptools/vscode-cpptools-0-12-3-package-json.patch
new file mode 100644
index 00000000000..1873963f460
--- /dev/null
+++ b/pkgs/misc/vscode-extensions/cpptools/vscode-cpptools-0-12-3-package-json.patch
@@ -0,0 +1,82 @@
+diff --git a/package.json b/package.json
+index 518e839..1c17c35 100644
+--- a/package.json
++++ b/package.json
+@@ -37,7 +37,26 @@
+     "Linters"
+   ],
+   "activationEvents": [
+-    "*"
++    "onLanguage:cpp",
++    "onLanguage:c",
++    "onCommand:extension.pickNativeProcess",
++    "onCommand:extension.pickRemoteNativeProcess",
++    "onCommand:extension.provideInitialConfigurations_cppvsdbg",
++    "onCommand:extension.provideInitialConfigurations_cppdbg",
++    "onCommand:C_Cpp.ConfigurationEdit",
++    "onCommand:C_Cpp.ConfigurationSelect",
++    "onCommand:C_Cpp.SwitchHeaderSource",
++    "onCommand:C_Cpp.UnloadLanguageServer",
++    "onCommand:C_Cpp.Navigate",
++    "onCommand:C_Cpp.GoToDeclaration",
++    "onCommand:C_Cpp.PeekDeclaration",
++    "onCommand:C_Cpp.ToggleErrorSquiggles",
++    "onCommand:C_Cpp.ToggleIncludeFallback",
++    "onCommand:C_Cpp.ShowReleaseNotes",
++    "onCommand:C_Cpp.ResetDatabase",
++    "workspaceContains:.vscode/c_cpp_properties.json",
++    "onDebug:cppdbg",
++    "onDebug:cppvsdbg"
+   ],
+   "main": "./out/src/main",
+   "contributes": {
+@@ -281,8 +300,7 @@
+             "cpp"
+           ]
+         },
+-        "runtime": "node",
+-        "program": "./out/src/Debugger/Proxy/debugProxy.js",
++        "program": "./debugAdapters/OpenDebugAD7",
+         "aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
+         "variables": {
+           "pickProcess": "extension.pickNativeProcess",
+@@ -722,7 +740,29 @@
+               }
+             }
+           }
+-        }
++        },
++        "configurationSnippets": [
++          {
++            "label": "C/C++: (gdb) Launch",
++            "description": "Launch with gdb.",
++            "bodyText": "{\n\t\"name\": \"(gdb) Launch\",\n\t\"type\": \"cppdbg\",\n\t\"request\": \"launch\",\n\t\"program\": \"enter program name, for example \\${workspaceRoot}/a.out\",\n\t\"args\": [],\n\t\"stopAtEntry\": false,\n\t\"cwd\": \"\\${workspaceRoot}\",\n\t\"environment\": [],\n\t\"externalConsole\": true,\n\t\"MIMode\": \"gdb\",\n\t\"setupCommands\": [\n\t    {\n\t        \"description\": \"Enable pretty-printing for gdb\",\n\t        \"text\": \"-enable-pretty-printing\",\n\t        \"ignoreFailures\": true\n\t    }\n\t]\n}"
++          },
++          {
++            "label": "C/C++: (gdb) Attach",
++            "description": "Attach with gdb.",
++            "bodyText": "{ \n\t\"name\": \"(gdb) Attach\",\n\t\"type\": \"cppdbg\",\n\t\"request\": \"attach\",\n\t\"program\": \"enter program name, for example \\${workspaceRoot}/a.out\",\n\t\"processId\": \"\\${command:pickProcess}\",\n\t\"MIMode\": \"gdb\"\n}"
++          },
++          {
++            "label": "C/C++: (gdb) Pipe Launch",
++            "description": "Pipe Launch with gdb.",
++            "bodyText": "{\n\t\"name\": \"(gdb) Pipe Launch\",\n\t\"type\": \"cppdbg\",\n\t\"request\": \"launch\",\n\t\"program\": \"enter program name, for example \\${workspaceRoot}/a.out\",\n\t\"args\": [],\n\t\"stopAtEntry\": false,\n\t\"cwd\": \"\\${workspaceRoot}\",\n\t\"environment\": [],\n\t\"externalConsole\": true,\n\t\"pipeTransport\": {\n\t\t\"debuggerPath\": \"/usr/bin/gdb\",\n\t\t\"pipeProgram\": \"/usr/bin/ssh\",\n\t\t\"pipeArgs\": [],\n\t\t\"pipeCwd\": \"\"\n\t},\n\t\"MIMode\": \"gdb\",\n\t\"setupCommands\": [\n\t    {\n\t        \"description\": \"Enable pretty-printing for gdb\",\n\t        \"text\": \"-enable-pretty-printing\",\n\t        \"ignoreFailures\": true\n\t    }\n\t]\n}"
++          },
++          {
++            "label": "C/C++: (gdb) Pipe Attach",
++            "description": "Pipe Attach with gdb.",
++            "bodyText": "{\n\t\"name\": \"(gdb) Pipe Attach\",\n\t\"type\": \"cppdbg\",\n\t\"request\": \"attach\",\n\t\"program\": \"enter program name, for example \\${workspaceRoot}/a.out\",\n\t\"processId\": \"\\${command:pickRemoteProcess}\",\n\t\"pipeTransport\": {\n\t\t\"debuggerPath\": \"/usr/bin/gdb\",\n\t\t\"pipeProgram\": \"/usr/bin/ssh\",\n\t\t\"pipeArgs\": [],\n\t\t\"pipeCwd\": \"\"\n\t},\n\t\"MIMode\": \"gdb\"\n}"
++          }
++        ]
+       },
+       {
+         "type": "cppvsdbg",
+@@ -741,7 +781,7 @@
+         "variables": {
+           "pickProcess": "extension.pickNativeProcess"
+         },
+-        "initialConfigurations": "extension.provideInitialConfigurations_cppvsdbg",
++        "initialConfigurations": "",
+         "configurationAttributes": {
+           "launch": {
+             "required": [
diff --git a/pkgs/misc/vscode-extensions/default.nix b/pkgs/misc/vscode-extensions/default.nix
index d357c43abd8..8047e29ad55 100644
--- a/pkgs/misc/vscode-extensions/default.nix
+++ b/pkgs/misc/vscode-extensions/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, vscode-utils }:
+{ stdenv, lib, fetchurl, callPackage, vscode-utils }:
 
 let
   inherit (vscode-utils) buildVscodeExtension buildVscodeMarketplaceExtension;
@@ -22,4 +22,6 @@ rec {
       license = licenses.mit;
     };
   };
+
+  ms-vscode.cpptools = callPackage ./cpptools {};
 }
\ No newline at end of file
diff --git a/pkgs/os-specific/darwin/apple-source-releases/libsecurity_filedb/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libsecurity_filedb/default.nix
index 0234cbc6279..fb1ea2509d7 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/libsecurity_filedb/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/libsecurity_filedb/default.nix
@@ -6,7 +6,7 @@ appleDerivation {
     libsecurity_cdsa_plugin
   ];
   patchPhase = ''
-    cp ${osx_private_sdk}/PrivateSDK10.9.sparse.sdk/usr/local/include/sandbox_private.h .
+    cp ${osx_private_sdk}/include/sandbox_private.h .
     substituteInPlace sandbox_private.h --replace '<sandbox.h>' '"${apple_sdk.sdk}/include/sandbox.h"'
     substituteInPlace lib/AtomicFile.cpp --replace '<sandbox.h>' '"sandbox_private.h"'
   '';
diff --git a/pkgs/os-specific/darwin/apple-source-releases/libsecurity_generic/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libsecurity_generic/default.nix
index ef449a7d415..93857ea792c 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/libsecurity_generic/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/libsecurity_generic/default.nix
@@ -10,7 +10,7 @@ name: version: sha256: args: let
 
       patchPhase = ''
         # allows including <Security/some-private-header.h>
-        ln -s ${pkgs.darwin.osx_private_sdk}/PrivateSDK10.9.sparse.sdk/System/Library/Frameworks/Security.framework/Versions/A/PrivateHeaders Security
+        cp -R ${pkgs.darwin.osx_private_sdk}/include/SecurityPrivateHeaders Security
 
         grep -Rl MacErrors.h . | while read file; do
           substituteInPlace "''$file" --replace \
diff --git a/pkgs/os-specific/darwin/apple-source-releases/libsecurity_keychain/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libsecurity_keychain/default.nix
index 34a2a49ea0e..06137879410 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/libsecurity_keychain/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/libsecurity_keychain/default.nix
@@ -18,9 +18,9 @@ appleDerivation {
 
     substituteInPlace lib/SecCertificate.cpp --replace '#include <Security/SecCertificatePriv.h>' ""
 
-    cp ${osx_private_sdk}/PrivateSDK10.9.sparse.sdk/usr/include/xpc/private.h xpc
+    cp ${osx_private_sdk}/include/xpc/private.h xpc
     cp ${apple_sdk.sdk}/include/xpc/*.h xpc
-    cp ${osx_private_sdk}/PrivateSDK10.9.sparse.sdk/usr/local/include/sandbox_private.h lib/sandbox.h
+    cp ${osx_private_sdk}/include/sandbox_private.h lib/sandbox.h
 
     substituteInPlace lib/SecItemPriv.h \
       --replace "extern CFTypeRef kSecAttrAccessGroup" "extern const CFTypeRef kSecAttrAccessGroup" \
diff --git a/pkgs/os-specific/darwin/apple-source-releases/libsecurity_utilities/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libsecurity_utilities/default.nix
index 8dae6072413..bb55fd48d8b 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/libsecurity_utilities/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/libsecurity_utilities/default.nix
@@ -17,9 +17,8 @@ appleDerivation {
     substituteInPlace lib/powerwatch.h --replace \
       '<IOKit/pwr_mgt/IOPMLibPrivate.h>' \
       '"${IOKit}/Library/Frameworks/IOKit.framework/Headers/pwr_mgt/IOPMLibPrivate.h"'
-
-    cp ${osx_private_sdk}/PrivateSDK10.9.sparse.sdk/usr/include/security_utilities/utilities_dtrace.h lib
-    cp -R ${osx_private_sdk}/PrivateSDK10.9.sparse.sdk/usr/local/include/bsm lib
+    cp -R ${osx_private_sdk}/include/bsm lib
+    cp ${osx_private_sdk}/include/utilities_dtrace.h lib
   '' + stdenv.lib.optionalString (!stdenv.cc.nativeLibc) ''
     substituteInPlace lib/vproc++.cpp --replace /usr/local/include/vproc_priv.h ${stdenv.libc}/include/vproc_priv.h
   '';
diff --git a/pkgs/os-specific/darwin/cf-private/default.nix b/pkgs/os-specific/darwin/cf-private/default.nix
index 48860504f73..f8c25339370 100644
--- a/pkgs/os-specific/darwin/cf-private/default.nix
+++ b/pkgs/os-specific/darwin/cf-private/default.nix
@@ -1,31 +1,18 @@
 { stdenv, osx_private_sdk, CF }:
 
-let
-  headers = [
-    "CFAvailability.h"
-    "CFAttributedString.h"
-    "CFFileDescriptor.h"
-    "CFFileSecurity.h"
-    "CFNotificationCenter.h"
-    "CFStringTokenizer.h"
-    "CFURLEnumerator.h"
-    "CFURL.h"
-    "CoreFoundation.h"
-  ];
-
-in stdenv.mkDerivation {
+stdenv.mkDerivation {
   name = "${CF.name}-private";
   phases = [ "installPhase" "fixupPhase" ];
   installPhase = ''
     dest=$out/Library/Frameworks/CoreFoundation.framework/Headers
     mkdir -p $dest
     pushd $dest
-    for file in ${CF}/Library/Frameworks/CoreFoundation.framework/Headers/*; do
-      ln -s $file
-    done
+      cp -Lv ${osx_private_sdk}/include/CoreFoundationPrivateHeaders/* $dest
+      for file in ${CF}/Library/Frameworks/CoreFoundation.framework/Headers/*; do
+        ln -sf $file 
+      done
     popd
 
-    install -m 0644 ${osx_private_sdk}/PrivateSDK10.10.sparse.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/{${stdenv.lib.concatStringsSep "," headers}} $dest
   '';
 
   setupHook = ./setup-hook.sh;
diff --git a/pkgs/os-specific/darwin/osx-private-sdk/default.nix b/pkgs/os-specific/darwin/osx-private-sdk/default.nix
index c2c2aea54f8..1eecdbc5618 100644
--- a/pkgs/os-specific/darwin/osx-private-sdk/default.nix
+++ b/pkgs/os-specific/darwin/osx-private-sdk/default.nix
@@ -1,8 +1,27 @@
 { stdenv, fetchFromGitHub }:
 
-fetchFromGitHub {
-  owner = "samdmarshall";
-  repo = "OSXPrivateSDK";
-  rev = "f4d52b60e86b496abfaffa119a7d299562d99783";
-  sha256 = "0bv0884yxpvk2ishxj8gdy1w6wb0gwfq55q5qjp0s8z0z7f63zqh";
+stdenv.mkDerivation {
+  name = "OSXPrivateSDK";
+
+  src = fetchFromGitHub {
+    owner = "samdmarshall";
+    repo = "OSXPrivateSDK";
+    rev = "f4d52b60e86b496abfaffa119a7d299562d99783";
+    sha256 = "0bv0884yxpvk2ishxj8gdy1w6wb0gwfq55q5qjp0s8z0z7f63zqh";
+  };
+
+  # NOTE: we install only headers that are really needed to keep closure sie
+  # reasonable.
+  installPhase = ''
+    mkdir -p $out/include
+    sdk10=PrivateSDK10.10.sparse.sdk
+    sdk=PrivateSDK10.9.sparse.sdk
+    cp $sdk/usr/local/include/sandbox_private.h $out/include/sandbox_private.h
+    # this can be removed once we dtrace binary
+    cp $sdk/usr/local/include/security_utilities/utilities_dtrace.h $out/include/utilities_dtrace.h
+    cp -RL $sdk/usr/include/xpc $out/include/xpc
+    cp -RL $sdk/usr/local/include/bsm $out/include/bsm
+    cp -RL $sdk/System/Library/Frameworks/Security.framework/Versions/A/PrivateHeaders $out/include/SecurityPrivateHeaders
+    cp -RL $sdk10/System/Library/Frameworks/CoreFoundation.framework/Headers $out/include/CoreFoundationPrivateHeaders
+  '';
 }
diff --git a/pkgs/os-specific/darwin/security-tool/default.nix b/pkgs/os-specific/darwin/security-tool/default.nix
index 5a89940c9da..2b8c7718aee 100644
--- a/pkgs/os-specific/darwin/security-tool/default.nix
+++ b/pkgs/os-specific/darwin/security-tool/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   patchPhase = ''
     # copied from libsecurity_generic
-    ln -s ${osx_private_sdk}/PrivateSDK10.9.sparse.sdk/System/Library/Frameworks/Security.framework/Versions/A/PrivateHeaders Security
+    cp -R ${osx_private_sdk}/include/SecurityPrivateHeaders Security
 
     substituteInPlace cmsutil.c --replace \
       '<CoreServices/../Frameworks/CarbonCore.framework/Headers/MacErrors.h>' \
diff --git a/pkgs/os-specific/linux/android-udev-rules/default.nix b/pkgs/os-specific/linux/android-udev-rules/default.nix
index 28b17d7e69c..ffc723e55d2 100644
--- a/pkgs/os-specific/linux/android-udev-rules/default.nix
+++ b/pkgs/os-specific/linux/android-udev-rules/default.nix
@@ -6,13 +6,13 @@
 
 stdenv.mkDerivation rec {
   name = "android-udev-rules-${version}";
-  version = "20171031";
+  version = "20171107";
 
   src = fetchFromGitHub {
     owner = "M0Rf30";
     repo = "android-udev-rules";
     rev = version;
-    sha256 = "0h9rp1bmry81lybly9x7qjdmaq0sj0m1ybl237qly8zqw7ywv5la";
+    sha256 = "17al46an6yhjdpz9gxcxzv3zgzjy5c8yn89jwnjdhbq0gkw28nsy";
   };
 
   installPhase = ''
diff --git a/pkgs/os-specific/linux/checkpolicy/default.nix b/pkgs/os-specific/linux/checkpolicy/default.nix
index 9fbed50f3b9..8e01bb2a5c8 100644
--- a/pkgs/os-specific/linux/checkpolicy/default.nix
+++ b/pkgs/os-specific/linux/checkpolicy/default.nix
@@ -10,16 +10,17 @@ stdenv.mkDerivation rec {
     sha256 = "1m5wjm43lzp6bld8higsvdm2dkddydihhwv9qw2w9r4dm0largcv";
   };
 
+  # Don't build tests
+  postPatch = ''
+    sed '/-C test/d' -i Makefile
+    sed '1i#include <ctype.h>' -i checkpolicy.c
+  '';
+
   nativeBuildInputs = [ bison flex ];
   buildInputs = [ libsepol ];
 
   NIX_CFLAGS_COMPILE = "-fstack-protector-all";
 
-  # Don't build tests
-  postPatch = ''
-    sed -i '/-C test/d' Makefile
-  '';
-
   preBuild = ''
     makeFlagsArray+=("LEX=flex")
     makeFlagsArray+=("LIBDIR=${libsepol}/lib")
diff --git a/pkgs/os-specific/linux/ffado/default.nix b/pkgs/os-specific/linux/ffado/default.nix
index 1ca503f33ec..aa273ec613e 100644
--- a/pkgs/os-specific/linux/ffado/default.nix
+++ b/pkgs/os-specific/linux/ffado/default.nix
@@ -41,7 +41,10 @@ stdenv.mkDerivation rec {
     optXdg_utils libxmlxx glibmm
   ];
 
-  patches = [ ./gcc6.patch ];
+  patches = [
+    ./gcc6.patch
+    ./glibc226.patch
+  ];
 
   postPatch = ''
     # SConstruct checks cpuinfo and an objdump of /bin/mount to determine the appropriate arch
diff --git a/pkgs/os-specific/linux/ffado/glibc226.patch b/pkgs/os-specific/linux/ffado/glibc226.patch
new file mode 100644
index 00000000000..e147ee9aa76
--- /dev/null
+++ b/pkgs/os-specific/linux/ffado/glibc226.patch
@@ -0,0 +1,10 @@
+--- libffado/src/libutil/PosixMessageQueue.cpp  (revision 2705)
++++ libffado/src/libutil/PosixMessageQueue.cpp  (revision 2706)
+@@ -30,6 +30,7 @@
+ #include <errno.h>
+ #include <string.h>
+ #include <poll.h>
++#include <signal.h>
+
+ #define MQ_INVALID_ID ((mqd_t) -1)
+ // one second
diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix
index a528df26964..0f7ad055af8 100644
--- a/pkgs/os-specific/linux/kernel/common-config.nix
+++ b/pkgs/os-specific/linux/kernel/common-config.nix
@@ -573,6 +573,11 @@ with stdenv.lib;
   ''}
   MEDIA_USB_SUPPORT y
   MEDIA_PCI_SUPPORT y
+  MEDIA_ANALOG_TV_SUPPORT y
+  VIDEO_STK1160_COMMON m
+  ${optionalString (versionOlder version "4.11") ''
+    VIDEO_STK1160_AC97 y
+  ''}
 
   # Our initrd init uses shebang scripts, so can't be modular.
   BINFMT_SCRIPT y
diff --git a/pkgs/os-specific/linux/kernel/linux-4.13.nix b/pkgs/os-specific/linux/kernel/linux-4.13.nix
index bb40bbcb72e..d2144225833 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.13.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.13.nix
@@ -1,11 +1,11 @@
 { stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "4.13.11";
+  version = "4.13.12";
   extraMeta.branch = "4.13";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "1vzl2i72c8iidhdc8a490npsbk7q7iphjqil4i9609disqw75gx4";
+    sha256 = "0x6yz5yb25789ky6hm55abja9374gcaqz06hg7rmmap3y1dhd65z";
   };
 } // (args.argsOverride or {}))
diff --git a/pkgs/os-specific/linux/kernel/linux-4.4.nix b/pkgs/os-specific/linux/kernel/linux-4.4.nix
index 3a49c348687..324d2e8291e 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.4.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.4.nix
@@ -1,11 +1,11 @@
 { stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "4.4.96";
+  version = "4.4.97";
   extraMeta.branch = "4.4";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "1asvcqip5w9nkg4c5jllbjygski9cnw7qn6ci7p6zwnd2mfks794";
+    sha256 = "03hnm66nv7l1f21z893rghgpgghs1i2pxzhcahpi7d6nsm5mwqgq";
   };
 } // (args.argsOverride or {}))
diff --git a/pkgs/os-specific/linux/kernel/linux-4.9.nix b/pkgs/os-specific/linux/kernel/linux-4.9.nix
index 7431694e362..86108f553b8 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.9.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.9.nix
@@ -1,11 +1,11 @@
 { stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "4.9.60";
+  version = "4.9.61";
   extraMeta.branch = "4.9";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "015dzkrhadmr3kadz0m3yhjikkmga8dv90f6s5ji5i2ja5f6qchf";
+    sha256 = "17ni4skllgd24ddg1ifj1s9b5mqx38filrabgmlw7w4ff9src8z0";
   };
 } // (args.argsOverride or {}))
diff --git a/pkgs/os-specific/linux/kernel/linux-hardened-copperhead.nix b/pkgs/os-specific/linux/kernel/linux-hardened-copperhead.nix
index 47ef31bd20a..55b40c9cd7d 100644
--- a/pkgs/os-specific/linux/kernel/linux-hardened-copperhead.nix
+++ b/pkgs/os-specific/linux/kernel/linux-hardened-copperhead.nix
@@ -3,9 +3,9 @@
 with stdenv.lib;
 
 let
-  version = "4.13.11";
+  version = "4.13.12";
   revision = "a";
-  sha256 = "1nby5iii1k0vjvs1s2qvlszln2p9sza9ivbjjdhrmvpp1shzwcvx";
+  sha256 = "10zfdv0s5jdpp9nqbxi34wwf1pqh3fjflgcd60f7cbr95ivvkl9r";
 
   # modVersion needs to be x.y.z, will automatically add .0 if needed
   modVersion = concatStrings (intersperse "." (take 3 (splitString "." "${version}.0")));
diff --git a/pkgs/os-specific/linux/libselinux/default.nix b/pkgs/os-specific/linux/libselinux/default.nix
index f20efcb3237..541ead7258f 100644
--- a/pkgs/os-specific/linux/libselinux/default.nix
+++ b/pkgs/os-specific/linux/libselinux/default.nix
@@ -39,6 +39,9 @@ stdenv.mkDerivation rec {
 
   postPatch = optionalString enablePython ''
     sed -i -e 's|\$(LIBDIR)/libsepol.a|${libsepol}/lib/libsepol.a|' src/Makefile
+  ''
+  + ''
+    sed '1i#include <sys/uio.h>' -i src/setrans_client.c
   '';
 
   preBuild = ''
diff --git a/pkgs/os-specific/linux/nfs-utils/default.nix b/pkgs/os-specific/linux/nfs-utils/default.nix
index 294dde2a0a6..e52174c0901 100644
--- a/pkgs/os-specific/linux/nfs-utils/default.nix
+++ b/pkgs/os-specific/linux/nfs-utils/default.nix
@@ -45,6 +45,8 @@ in stdenv.mkDerivation rec {
 
       substituteInPlace utils/mount/Makefile.in \
         --replace "chmod 4511" "chmod 0511"
+
+      sed '1i#include <stdint.h>' -i support/nsm/rpc.c
     '';
 
   makeFlags = [
diff --git a/pkgs/os-specific/linux/tcp-wrappers/default.nix b/pkgs/os-specific/linux/tcp-wrappers/default.nix
index 6a400f1de22..7da4e39ca6c 100644
--- a/pkgs/os-specific/linux/tcp-wrappers/default.nix
+++ b/pkgs/os-specific/linux/tcp-wrappers/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv }:
+{ fetchurl, stdenv, libnsl }:
 
 let
   vanillaVersion = "7.6.q";
@@ -22,6 +22,8 @@ in stdenv.mkDerivation rec {
     patches="$(cat debian/patches/series | sed 's,^,debian/patches/,') $patches"
   '';
 
+  buildInputs = [ libnsl ];
+
   makeFlags = [ "STRINGS=" "REAL_DAEMON_DIR=$(out)/bin" "linux" ];
 
   installPhase = ''
diff --git a/pkgs/servers/asterisk/default.nix b/pkgs/servers/asterisk/default.nix
index 1bea8006e9f..c6cd9f3df4c 100644
--- a/pkgs/servers/asterisk/default.nix
+++ b/pkgs/servers/asterisk/default.nix
@@ -1,6 +1,6 @@
 { stdenv, pkgs, lib, fetchurl, fetchgit, fetchsvn, fetchpatch,
   jansson, libxml2, libxslt, ncurses, openssl, sqlite,
-  utillinux, dmidecode, libuuid, binutils, newt,
+  utillinux, dmidecode, libuuid, newt,
   lua, speex,
   srtp, wget, curl
 }:
@@ -10,7 +10,7 @@ let
     inherit version;
     name = "asterisk-${version}";
 
-    buildInputs = [ jansson libxml2 libxslt ncurses openssl sqlite utillinux dmidecode libuuid binutils newt lua speex srtp wget curl ];
+    buildInputs = [ jansson libxml2 libxslt ncurses openssl sqlite utillinux dmidecode libuuid newt lua speex srtp wget curl ];
 
     patches = [
       # We want the Makefile to install the default /var skeleton
diff --git a/pkgs/servers/gpm/default.nix b/pkgs/servers/gpm/default.nix
index e260ccfb761..6096aa1ed74 100644
--- a/pkgs/servers/gpm/default.nix
+++ b/pkgs/servers/gpm/default.nix
@@ -12,6 +12,11 @@ stdenv.mkDerivation rec {
     sha256 = "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh";
   };
 
+  postPatch = ''
+    sed '1i#include <sys/types.h>' -i src/daemon/open_console.c
+    substituteInPlace src/prog/gpm-root.y --replace __sigemptyset sigemptyset
+  '';
+
   nativeBuildInputs = [ automake autoconf libtool flex bison texinfo ];
   buildInputs = [ ncurses ];
 
diff --git a/pkgs/servers/mattermost/default.nix b/pkgs/servers/mattermost/default.nix
index c99f939437b..2bfe929784b 100644
--- a/pkgs/servers/mattermost/default.nix
+++ b/pkgs/servers/mattermost/default.nix
@@ -1,22 +1,37 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchurl, fetchFromGitHub, buildGoPackage }:
 
-stdenv.mkDerivation rec {
+buildGoPackage rec {
   name = "mattermost-${version}";
-  version = "4.1.0";
+  version = "4.3.0";
 
-  src = fetchurl {
+  src = fetchFromGitHub {
+    owner = "mattermost";
+    repo = "mattermost-server";
+    rev = "v${version}";
+    sha256 = "05119h3x81p8plfjq99khfywc3plv2zynvf83vkhj48zqk61wvbq";
+  };
+
+  webApp = fetchurl {
     url = "https://releases.mattermost.com/${version}/mattermost-team-${version}-linux-amd64.tar.gz";
-    sha256 = "0bp56i108pxsqcswxy1hdz3d8wq83lc29wcq6npimwx566rx4xhf";
+    sha256 = "0d30zj036nz6vwpiv0mn656j5r4br6y4x8iqc5jn785fiwk2pdls";
   };
 
-  installPhase = ''
-    mkdir -p $out
-    mv * $out/
-    ln -s ./platform $out/bin/mattermost-platform
+  goPackagePath = "github.com/mattermost/mattermost-server";
+
+  buildPhase = ''
+    runHook preBuild
+    cd go/src/${goPackagePath}/cmd/platform
+    go install
+    runHook postBuild
+  '';
+
+  preInstall = ''
+    mkdir -p $bin
+    tar --strip 1 -C $bin -xf $webApp
   '';
 
-  postFixup = ''
-    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/bin/platform
+  postInstall = ''
+    ln -s $bin/bin/platform $bin/bin/mattermost-platform
   '';
 
   meta = with stdenv.lib; {
@@ -24,6 +39,6 @@ stdenv.mkDerivation rec {
     homepage = https://www.mattermost.org;
     license = with licenses; [ agpl3 asl20 ];
     maintainers = with maintainers; [ fpletz ];
-    platforms = [ "x86_64-linux" ];
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/servers/openafs-client/default.nix b/pkgs/servers/openafs-client/default.nix
index 263df09ebb5..d7ed2849d60 100644
--- a/pkgs/servers/openafs-client/default.nix
+++ b/pkgs/servers/openafs-client/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, fetchgit, which, autoconf, automake, flex, yacc,
-  kernel, glibc, ncurses, perl, kerberos }:
+  kernel, glibc, ncurses, perl, kerberos, fetchpatch }:
 
 stdenv.mkDerivation rec {
   name = "openafs-${version}-${kernel.version}";
@@ -16,6 +16,14 @@ stdenv.mkDerivation rec {
 
   hardeningDisable = [ "pic" ];
 
+  patches = [
+   (fetchpatch {
+      name = "fix-stdint-include.patch";
+      url = "http://git.openafs.org/?p=openafs.git;a=patch;h=c193e5cba18273a062d4162118c7055b54f7eb5e";
+      sha256 = "1yc4gygcazwsslf6mzk1ai92as5jbsjv7212jcbb2dw83jydhc09";
+    })
+  ];
+
   preConfigure = ''
     ln -s "${kernel.dev}/lib/modules/"*/build $TMP/linux
 
diff --git a/pkgs/servers/rpcbind/default.nix b/pkgs/servers/rpcbind/default.nix
index da59241bad3..dd09985a07b 100644
--- a/pkgs/servers/rpcbind/default.nix
+++ b/pkgs/servers/rpcbind/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, pkgconfig, libtirpc
+{ fetchurl, stdenv, pkgconfig, libnsl, libtirpc
 , useSystemd ? true, systemd }:
 
 stdenv.mkDerivation rec {
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     ./sunrpc.patch
   ];
 
-  buildInputs = [ libtirpc ]
+  buildInputs = [ libnsl libtirpc ]
              ++ stdenv.lib.optional useSystemd systemd;
 
   configureFlags = [
diff --git a/pkgs/stdenv/booter.nix b/pkgs/stdenv/booter.nix
index a1055708f99..7364a586fc2 100644
--- a/pkgs/stdenv/booter.nix
+++ b/pkgs/stdenv/booter.nix
@@ -47,13 +47,13 @@ stageFuns: let
      same as
 
        let
-         f_-1  = lnul;
+         f_-1  = lnul f_0;
          f_0   = op f_-1   x_0  f_1;
          f_1   = op f_0    x_1  f_2;
          f_2   = op f_1    x_2  f_3;
          ...
          f_n   = op f_n-1  x_n  f_n+1;
-         f_n+1 = rnul;
+         f_n+1 = rnul f_n;
        in
          f_0
   */
@@ -62,13 +62,15 @@ stageFuns: let
       len = builtins.length list;
       go = pred: n:
         if n == len
-        then rnul
+        then rnul pred
         else let
           # Note the cycle -- call-by-need ensures finite fold.
           cur  = op pred (builtins.elemAt list n) succ;
           succ = go cur (n + 1);
         in cur;
-    in go lnul 0;
+      lapp = lnul cur;
+      cur = go lapp 0;
+    in cur;
 
   # Take the list and disallow custom overrides in all but the final stage,
   # and allow it in the final flag. Only defaults this boolean field if it
@@ -98,7 +100,18 @@ stageFuns: let
     then args'
     else allPackages ((builtins.removeAttrs args' ["selfBuild"]) // {
       buildPackages = if args.selfBuild or true then null else prevStage;
-      __targetPackages = if args.selfBuild or true then null else nextStage;
+      targetPackages = if args.selfBuild or true then null else nextStage;
     });
 
-in dfold folder {} {} withAllowCustomOverrides
+  # This is a hack for resolving cross-compiled compilers' run-time
+  # deps. (That is, compilers that are themselves cross-compiled, as
+  # opposed to used to cross-compile packages.)
+  postStage = buildPackages: {
+    __raw = true;
+    stdenv.cc =
+      if buildPackages.stdenv.cc.isClang or false
+      then buildPackages.clang
+      else buildPackages.gcc;
+  };
+
+in dfold folder postStage (_: {}) withAllowCustomOverrides
diff --git a/pkgs/tools/audio/mpdas/default.nix b/pkgs/tools/audio/mpdas/default.nix
new file mode 100644
index 00000000000..70ae1f84643
--- /dev/null
+++ b/pkgs/tools/audio/mpdas/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchFromGitHub, pkgconfig, mpd_clientlib, curl }:
+
+stdenv.mkDerivation rec {
+  name = "mpdas-${version}";
+  version = "0.4.4";
+
+  src = fetchFromGitHub {
+    owner = "hrkfdn";
+    repo = "mpdas";
+    rev = version;
+    sha256 = "1i6i36jd582y3nm5plcrswqljf528hd23whp8zw06hwqnsgca5b6";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  buildInputs = [ mpd_clientlib curl ];
+
+  makeFlags = [ "CONFIG=/etc" "DESTDIR=" "PREFIX=$(out)" ];
+
+  meta = with stdenv.lib; {
+    description = "Music Player Daemon AudioScrobbler";
+    homepage = http://50hz.ws/mpdas/;
+    license = licenses.bsd3;
+    maintainers = [ maintainers.taketwo ];
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/tools/graphics/gnuplot/default.nix b/pkgs/tools/graphics/gnuplot/default.nix
index 10170b41bbe..7594474538d 100644
--- a/pkgs/tools/graphics/gnuplot/default.nix
+++ b/pkgs/tools/graphics/gnuplot/default.nix
@@ -21,11 +21,11 @@ let
   withX = libX11 != null && !aquaterm && !stdenv.isDarwin;
 in
 stdenv.mkDerivation rec {
-  name = "gnuplot-5.2.0";
+  name = "gnuplot-5.2.1";
 
   src = fetchurl {
     url = "mirror://sourceforge/gnuplot/${name}.tar.gz";
-    sha256 = "0hqyajcnlk822fk7hyl07sqk6a75n93awbdl3ydk9fd6l4jn9zkx";
+    sha256 = "123yh0ysahn71nlibsz5qkq18rlf18qqfhrlkvl925ijdgxv1ikx";
   };
 
   buildInputs =
diff --git a/pkgs/tools/networking/htpdate/default.nix b/pkgs/tools/networking/htpdate/default.nix
index d937f3c2f0b..47163b94dc5 100644
--- a/pkgs/tools/networking/htpdate/default.nix
+++ b/pkgs/tools/networking/htpdate/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [
     "INSTALL=install"
-    "STRIP=strip"
+    "STRIP=${stdenv.cc.bintools.prefix}strip"
     "prefix=$(out)"
   ];
 
diff --git a/pkgs/tools/networking/mitmproxy/default.nix b/pkgs/tools/networking/mitmproxy/default.nix
index 7348cd7f116..f96987a1300 100644
--- a/pkgs/tools/networking/mitmproxy/default.nix
+++ b/pkgs/tools/networking/mitmproxy/default.nix
@@ -1,82 +1,32 @@
 { stdenv, fetchpatch, fetchFromGitHub, fetchurl, python3, glibcLocales }:
 
-let
-  p = python3.override {
-    packageOverrides = self: super: {
-      cryptography = super.cryptography.overridePythonAttrs (oldAttrs: rec {
-        version = "1.8.2";
-        name = "${oldAttrs.pname}-${version}";
-        src = oldAttrs.src.override {
-          inherit version;
-          sha256 = "8e88ebac371a388024dab3ccf393bf3c1790d21bc3c299d5a6f9f83fb823beda";
-        };
-      });
-      cryptography_vectors = super.cryptography_vectors.overridePythonAttrs (oldAttrs: rec {
-        version = self.cryptography.version;
-        name = "${oldAttrs.pname}-${version}";
-        src = oldAttrs.src.override {
-          inherit version;
-          sha256 = "00daa04c9870345f56605d91d7d4897bc1b16f6fff7c74cb602b08ef16c0fb43";
-        };
-      });
-      pyopenssl = super.pyopenssl.overridePythonAttrs (oldAttrs: rec {
-        version = "17.0.0";
-        name = "${oldAttrs.pname}-${version}";
-        src = oldAttrs.src.override {
-          inherit version;
-          sha256 = "1pdg1gpmkzj8yasg6cmkhcivxcdp4c12nif88y4qvsxq5ffzxas8";
-        };
-        patches = fetchpatch {
-          url = "https://github.com/pyca/pyopenssl/commit/"
-              + "a40898b5f1d472f9449a344f703fa7f90cddc21d.patch";
-          sha256 = "0bdfrhfvdfxhfknn46s4db23i3hww6ami2r1l5rfrri0pn8b8mh7";
-        };
-      });
-    };
-  };
-in p.pkgs.buildPythonPackage rec {
+python3.pkgs.buildPythonPackage rec {
   baseName = "mitmproxy";
-  name = "${baseName}-${version}";
-  version = "2.0.2";
+  name = "${baseName}-unstable-2017-10-31";
 
   src = fetchFromGitHub {
     owner = baseName;
     repo = baseName;
-    rev = "v${version}";
-    sha256 = "1x1a28al5clpfd69rjcpw26gjjnpsm1vfl4scrwpdd1jhkw044h9";
+    rev = "80a8eaa708ea31dd9c5e7e1ab6b02c69079039c0";
+    sha256 = "0rvwm11yryzlp3c1i42rk2iv1m38yn6r83k41jb51hwg6wzbwzvw";
   };
 
-  patches = [
-    # fix tests
-    (fetchpatch {
-      url = "https://github.com/mitmproxy/mitmproxy/commit/b3525570929ba47c10d9d08696876c39487f7000.patch";
-      sha256 = "111fld5gqdii7rs1jhqaqrxgbyhfn6qd0y7l15k4npamsnvdnv20";
-    })
-    # bump pyOpenSSL
-    (fetchpatch {
-      url = https://github.com/mitmproxy/mitmproxy/commit/6af72160bf98b58682b8f9fc5aabf51928d2b1d3.patch;
-      sha256 = "1q4ml81pq9c8j9iscq8janbxf4s37w3bqskbs6r30yqzy63v54f2";
-    })
-    # https://github.com/mitmproxy/mitmproxy/commit/3d7cde058b7e6242d93b9bc9d3e17520ffb578a5
-    ./tornado-4.6.patch
-  ];
-
   checkPhase = ''
     export HOME=$(mktemp -d)
     # test_echo resolves hostnames
-    LC_CTYPE=en_US.UTF-8 pytest -k 'not test_echo'
+    LC_CTYPE=en_US.UTF-8 pytest -k 'not test_echo and not test_find_unclaimed_URLs '
   '';
 
-  propagatedBuildInputs = with p.pkgs; [
-    blinker click certifi construct cryptography
-    cssutils editorconfig h2 html2text hyperframe
-    jsbeautifier kaitaistruct passlib pyasn1 pyopenssl
+  propagatedBuildInputs = with python3.pkgs; [
+    blinker click certifi cryptography
+    h2 hyperframe
+    kaitaistruct passlib pyasn1 pyopenssl
     pyparsing pyperclip requests ruamel_yaml tornado
-    urwid watchdog brotlipy sortedcontainers
+    urwid brotlipy sortedcontainers ldap3
   ];
 
-  buildInputs = with p.pkgs; [
-    beautifulsoup4 flask pytz pytest pytestrunner protobuf glibcLocales
+  buildInputs = with python3.pkgs; [
+    beautifulsoup4 flask pytest pytestrunner glibcLocales
   ];
 
   meta = with stdenv.lib; {
diff --git a/pkgs/tools/networking/p2p/gtk-gnutella/default.nix b/pkgs/tools/networking/p2p/gtk-gnutella/default.nix
index 901d84b4692..f63c1d474c0 100644
--- a/pkgs/tools/networking/p2p/gtk-gnutella/default.nix
+++ b/pkgs/tools/networking/p2p/gtk-gnutella/default.nix
@@ -13,8 +13,8 @@ stdenv.mkDerivation {
     sha256 = "1zvadgsskmpm82id9mbj24a2lyq38qv768ixv7nmfjl3d4wr2biv";
   };
 
-  nativeBuildInputs = [ bison binutils gettext pkgconfig ];
-  buildInputs = [ glib gnutls gtk2 libxml2 zlib ];
+  nativeBuildInputs = [ bison gettext pkgconfig ];
+  buildInputs = [ binutils glib gnutls gtk2 libxml2 zlib ];
 
   hardeningDisable = [ "bindnow" "fortify" "pic" "relro" ];
 
diff --git a/pkgs/tools/networking/reaver-wps-t6x/default.nix b/pkgs/tools/networking/reaver-wps-t6x/default.nix
index 2f0e19b231c..dd834771731 100644
--- a/pkgs/tools/networking/reaver-wps-t6x/default.nix
+++ b/pkgs/tools/networking/reaver-wps-t6x/default.nix
@@ -1,33 +1,24 @@
-{ stdenv, fetchFromGitHub, libpcap, sqlite, pixiewps, makeWrapper }:
+{ stdenv, fetchFromGitHub, libpcap, pixiewps, makeWrapper }:
 
 stdenv.mkDerivation rec {
-  version = "1.5.2";
+  version = "1.6.3";
   name = "reaver-wps-t6x-${version}";
-  confdir = "/var/db/${name}"; # the sqlite database is at "${confdir}/reaver/reaver.db"
 
   src = fetchFromGitHub {
     owner = "t6x";
     repo = "reaver-wps-fork-t6x";
     rev = "v${version}";
-    sha256 = "0zhlms89ncqz1f1hc22yw9x1s837yv76f1zcjizhgn5h7vp17j4b";
+    sha256 = "1bccwp67q1q0h5m38gqxn9imq5rb75jbmv7fjr2n38v10jcga2pb";
   };
 
   nativeBuildInputs = [ makeWrapper ];
-  buildInputs = [ libpcap sqlite pixiewps ];
+  buildInputs = [ libpcap pixiewps ];
 
-  setSourceRoot = ''
-    sourceRoot=$(echo */src)
-  '';
-
-  configureFlags = "--sysconfdir=${confdir}";
+  preConfigure = "cd src";
 
   installPhase = ''
-    mkdir -p $out/{bin,etc}
-    cp reaver.db $out/etc/
+    mkdir -p $out/bin
     cp reaver wash $out/bin/
-
-    wrapProgram $out/bin/reaver --run "[ -s ${confdir}/reaver/reaver.db ] || install -D $out/etc/reaver.db ${confdir}/reaver/reaver.db"
-    wrapProgram $out/bin/wash   --run "[ -s ${confdir}/reaver/reaver.db ] || install -D $out/etc/reaver.db ${confdir}/reaver/reaver.db"
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/tools/networking/strongswan/default.nix b/pkgs/tools/networking/strongswan/default.nix
index 7ef278e359c..89019986bca 100644
--- a/pkgs/tools/networking/strongswan/default.nix
+++ b/pkgs/tools/networking/strongswan/default.nix
@@ -35,6 +35,8 @@ stdenv.mkDerivation rec {
     # the configuration files. In the absence of that we patch swanctl to look
     # for configuration files in /etc/swanctl.
     substituteInPlace src/swanctl/swanctl.h --replace "SWANCTLDIR" "\"/etc/swanctl\""
+    # glibc-2.26 reorganized internal includes
+    sed '1i#include <stdint.h>' -i src/libstrongswan/utils/utils/memory.h
     '';
 
   preConfigure = ''
diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix
index efe239224ae..fe781869177 100644
--- a/pkgs/tools/package-management/nix/default.nix
+++ b/pkgs/tools/package-management/nix/default.nix
@@ -160,7 +160,7 @@ in rec {
   }) // { perl-bindings = nixStable; };
 
   nixUnstable = (lib.lowPrio (common rec {
-    name = "nix-1.12${suffix}";
+    name = "nix-unstable-1.12${suffix}";
     suffix = "pre5732_fd10f6f2";
     src = fetchFromGitHub {
       owner = "NixOS";
diff --git a/pkgs/tools/package-management/nixui/generate.sh b/pkgs/tools/package-management/nixui/generate.sh
index 915497208fa..e3a7d9f69e4 100755
--- a/pkgs/tools/package-management/nixui/generate.sh
+++ b/pkgs/tools/package-management/nixui/generate.sh
@@ -1,3 +1,3 @@
 #!/bin/sh -e
 
-node2nix -i pkg.json -c nixui.nix -e ../../../development/node-packages/node-env.nix
+node2nix -i pkg.json -c nixui.nix -e ../../../development/node-packages/node-env.nix --no-copy-node-env
diff --git a/pkgs/tools/security/mpw/default.nix b/pkgs/tools/security/mpw/default.nix
index e30866021da..3e1e3a88283 100644
--- a/pkgs/tools/security/mpw/default.nix
+++ b/pkgs/tools/security/mpw/default.nix
@@ -1,50 +1,39 @@
-{ stdenv, fetchzip, autoconf, automake, openssl, libxml2, fetchFromGitHub, ncurses }:
+{ stdenv, cmake, fetchFromGitHub, ncurses, libsodium, json_c }:
 
-let
-  scrypt_src = fetchzip {
-    url = "http://www.tarsnap.com/scrypt/scrypt-1.2.0.tgz";
-    sha256 = "0ahylib2pimlhjcm566kpim6n16jci5v749xwdkr9ivgfjrv3xn4";
-  };
-
-in stdenv.mkDerivation {
-  name = "mpw-2.1-6834f36";
+stdenv.mkDerivation rec {
+  name = "mpw-2.6-f8043ae";
 
   src = fetchFromGitHub {
     owner = "Lyndir";
     repo = "MasterPassword";
-    rev = "6834f3689f5dfd4e59ad6959961d349c224977ee";
-    sha256 = "0zlpx3hb1y2l60hg961h05lb9yf3xb5phnyycvazah2674gkwb2p";
+    rev = "f8043ae16d73ddfb205aadd25c35cd9c5e95b228";
+    sha256 = "0hy02ri7y3sca85z3ff5i68crwav5cjd7rrdqj7jrnpp1bw4yapi";
   };
 
   postUnpack = ''
-    sourceRoot+=/MasterPassword/C
+    sourceRoot+=/platform-independent/cli-c
   '';
 
-  prePatch = ''
-    patchShebangs .
-    mkdir lib/scrypt/src
-    cp -R --no-preserve=ownership ${scrypt_src}/* lib/scrypt/src
-    chmod +w -R lib/scrypt/src
-    substituteInPlace lib/scrypt/src/libcperciva/cpusupport/Build/cpusupport.sh \
-      --replace dirname "$(type -P dirname)"
-    substituteInPlace lib/scrypt/src/Makefile.in --replace "command -p mv" "mv"
+  preConfigure = ''
+    substituteInPlace CMakeLists.txt --replace curses ncurses
+    echo ${name} > VERSION
   '';
 
-  NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2";
+  dontUseCmakeBuildDir = true;
 
-  buildInputs = [ autoconf automake openssl libxml2 ncurses ];
+  nativeBuildInputs = [ cmake ];
 
-  buildPhase = ''
-    substituteInPlace build --replace '"curses"' '"ncurses"'
-    targets="mpw mpw-tests" ./build
-  '';
+  buildInputs = [ ncurses libsodium json_c ];
 
   installPhase = ''
     mkdir -p $out/bin
     mv mpw $out/bin/mpw
   '';
 
-  meta = {
-    platforms = stdenv.lib.platforms.unix;
+  meta = with stdenv.lib; {
+    homepage = http://masterpasswordapp.com/;
+    description = "A stateless password management solution";
+    license = licenses.gpl3;
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/tools/system/procodile/Gemfile b/pkgs/tools/system/procodile/Gemfile
new file mode 100644
index 00000000000..77e4bb430e9
--- /dev/null
+++ b/pkgs/tools/system/procodile/Gemfile
@@ -0,0 +1,2 @@
+source 'https://rubygems.org'
+gem 'procodile'
diff --git a/pkgs/tools/system/procodile/Gemfile.lock b/pkgs/tools/system/procodile/Gemfile.lock
new file mode 100644
index 00000000000..51ab44a762a
--- /dev/null
+++ b/pkgs/tools/system/procodile/Gemfile.lock
@@ -0,0 +1,15 @@
+GEM
+  remote: https://rubygems.org/
+  specs:
+    json (2.1.0)
+    procodile (1.0.17)
+      json
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  procodile
+
+BUNDLED WITH
+   1.14.6
diff --git a/pkgs/tools/system/procodile/default.nix b/pkgs/tools/system/procodile/default.nix
new file mode 100644
index 00000000000..3a5cb1b4965
--- /dev/null
+++ b/pkgs/tools/system/procodile/default.nix
@@ -0,0 +1,22 @@
+{ lib, bundlerEnv, ruby, stdenv }:
+
+bundlerEnv rec {
+  name = "procodile-${version}";
+
+  gemfile = ./Gemfile;
+  lockfile = ./Gemfile.lock;
+  gemset = ./gemset.nix;
+
+  version = (import gemset).procodile.version;
+  inherit ruby;
+
+  gemdir = ./.;
+
+  meta = with lib; {
+    description = "Run processes in the background (and foreground) on Mac & Linux from a Procfile (for production and/or development environments)";
+    homepage    = https://adam.ac/procodile;
+    license     = with licenses; mit;
+    maintainers = [ maintainers.ravloony ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/pkgs/tools/system/procodile/gemset.nix b/pkgs/tools/system/procodile/gemset.nix
new file mode 100644
index 00000000000..8216159ad94
--- /dev/null
+++ b/pkgs/tools/system/procodile/gemset.nix
@@ -0,0 +1,19 @@
+{
+  json = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "01v6jjpvh3gnq6sgllpfqahlgxzj50ailwhj9b3cd20hi2dx0vxp";
+      type = "gem";
+    };
+    version = "2.1.0";
+  };
+  procodile = {
+    dependencies = ["json"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1gfms2h4k9zqq7jn04nphibcsjykgxiqwdyyz2r4kq428a25kqsf";
+      type = "gem";
+    };
+    version = "1.0.17";
+  };
+}
\ No newline at end of file
diff --git a/pkgs/tools/text/gawk/default.nix b/pkgs/tools/text/gawk/default.nix
index 415a2ade28d..65d0a1e4c00 100644
--- a/pkgs/tools/text/gawk/default.nix
+++ b/pkgs/tools/text/gawk/default.nix
@@ -19,11 +19,11 @@ let
   inherit (stdenv.lib) optional;
 in
 stdenv.mkDerivation rec {
-  name = "gawk-4.1.4";
+  name = "gawk-4.2.0";
 
   src = fetchurl {
     url = "mirror://gnu/gawk/${name}.tar.xz";
-    sha256 = "0rn2mmjxm767zliqzd67j7h2ncjn4j0321c60y9fy3grs3i89qak";
+    sha256 = "1wm9lqj77y7xz07zi0n187aqm8zavzxzpm1j53ahxz81q0qwvwyl";
   };
 
   # When we do build separate interactive version, it makes sense to always include man.
diff --git a/pkgs/tools/typesetting/pygmentex/default.nix b/pkgs/tools/typesetting/pygmentex/default.nix
index c19447cc0c4..fef6c9087c5 100644
--- a/pkgs/tools/typesetting/pygmentex/default.nix
+++ b/pkgs/tools/typesetting/pygmentex/default.nix
@@ -1,12 +1,14 @@
-{ stdenv, fetchzip, python2Packages }:
+{ stdenv, fetchFromBitbucket, python2Packages }:
 
 python2Packages.buildPythonApplication rec {
   name = "pygmentex-${version}";
   version = "0.8";
 
-  src = fetchzip {
-      url = "http://mirrors.ctan.org/macros/latex/contrib/pygmentex.zip";
-      sha256 = "1nm19pvhlv51mv2sdankndhw64ys9r7ch6szzd6i4jz8zr86kn9v";
+  src = fetchFromBitbucket {
+    owner = "romildo";
+    repo = "pygmentex";
+    rev = version;
+    sha256 = "07dnv7hgppy15bda2kcbrlvfqzl6lhza80klc7133dwg8q92hm6m";
   };
 
   pythonPath = [ python2Packages.pygments python2Packages.chardet ];
@@ -38,7 +40,7 @@ python2Packages.buildPythonApplication rec {
       texlive.combine.
     '';
     license = licenses.lppl13c;
-    maintainers = with maintainers; [ romildo ];
     platforms = platforms.unix;
+    maintainers = with maintainers; [ romildo ];
   };
 }
diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix
index b6f36aa9de1..defac535532 100644
--- a/pkgs/top-level/aliases.nix
+++ b/pkgs/top-level/aliases.nix
@@ -83,6 +83,7 @@ mapAliases (rec {
   kdiff3-qt5 = kdiff3; # added 2017-02-18
   keepassx2-http = keepassx-reboot; # added 2016-10-17
   keepassx-reboot = keepassx-community; # added 2017-02-01
+  keepassx-community = keepassxc; # added 2017-11
   keybase-go = keybase;  # added 2016-08-24
   krename-qt5 = krename; # added 2017-02-18
   letsencrypt = certbot; # added 2016-05-16
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index a99e007f733..e37442940da 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1080,6 +1080,8 @@ with pkgs;
 
   go-dependency-manager = callPackage ../development/tools/gdm { };
 
+  geckodriver = callPackage ../development/tools/geckodriver { };
+
   geekbench = callPackage ../tools/misc/geekbench { };
 
   gencfsm = callPackage ../tools/security/gencfsm { };
@@ -1156,6 +1158,8 @@ with pkgs;
 
   mp3fs = callPackage ../tools/filesystems/mp3fs { };
 
+  mpdas = callPackage ../tools/audio/mpdas { };
+
   mpdcron = callPackage ../tools/audio/mpdcron { };
 
   mpdris2 = callPackage ../tools/audio/mpdris2 { };
@@ -5535,7 +5539,7 @@ with pkgs;
   # built with, and use, that cross-compiled libc.
   gccCrossStageStatic = assert targetPlatform != buildPlatform; let
     libcCross1 =
-      if targetPlatform.libc == "msvcrt" then __targetPackages.windows.mingw_w64_headers
+      if targetPlatform.libc == "msvcrt" then targetPackages.windows.mingw_w64_headers
       else if targetPlatform.libc == "libSystem" then darwin.xcode
       else null;
     in wrapCCWith {
@@ -6022,6 +6026,7 @@ with pkgs;
 
   julia_05 = callPackage ../development/compilers/julia/0.5.nix {
     gmp = gmp6;
+    libgit2 = libgit2_0_25;
     openblas = openblasCompat;
     inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices;
     llvm = llvm_38;
@@ -7483,6 +7488,8 @@ with pkgs;
 
   premake = premake4;
 
+  procodile = callPackage ../tools/system/procodile { };
+
   qtcreator = libsForQt5.callPackage ../development/qtcreator { };
 
   r10k = callPackage ../tools/system/r10k { };
@@ -8295,11 +8302,13 @@ with pkgs;
 
   icon-lang = callPackage ../development/interpreters/icon-lang { };
 
-  libgit2 = callPackage ../development/libraries/git2 (
-    stdenv.lib.optionalAttrs stdenv.isDarwin {
+  inherit (rec {
+    arg = stdenv.lib.optionalAttrs stdenv.isDarwin {
       inherit (darwin) libiconv;
-    }
-  );
+    };
+    libgit2 = callPackage ../development/libraries/git2 arg;
+    libgit2_0_25 = callPackage ../development/libraries/git2/0.25.nix arg;
+  }) libgit2 libgit2_0_25;
 
   gle = callPackage ../development/libraries/gle { };
 
@@ -8331,9 +8340,9 @@ with pkgs;
   libcCrossChooser = name:
     # libc is hackily often used from the previous stage. This `or`
     # hack fixes the hack, *sigh*.
-    /**/ if name == "glibc" then __targetPackages.glibcCross or glibcCross
+    /**/ if name == "glibc" then targetPackages.glibcCross or glibcCross
     else if name == "uclibc" then uclibcCross
-    else if name == "msvcrt" then __targetPackages.windows.mingw_w64 or windows.mingw_w64
+    else if name == "msvcrt" then targetPackages.windows.mingw_w64 or windows.mingw_w64
     else if name == "libSystem" then darwin.xcode
     else throw "Unknown libc";
 
@@ -9256,6 +9265,8 @@ with pkgs;
 
   libnice = callPackage ../development/libraries/libnice { };
 
+  libnsl = callPackage ../development/libraries/libnsl { };
+
   liboping = callPackage ../development/libraries/liboping { };
 
   libplist = callPackage ../development/libraries/libplist { };
@@ -10581,6 +10592,7 @@ with pkgs;
     openglSupport = mesaSupported;
     alsaSupport = stdenv.isLinux;
     x11Support = !stdenv.isCygwin;
+    waylandSupport = stdenv.isLinux;
     udevSupport = stdenv.isLinux;
     pulseaudioSupport = config.pulseaudio or stdenv.isLinux;
     inherit (darwin.apple_sdk.frameworks) AudioUnit Cocoa CoreAudio CoreServices ForceFeedback OpenGL;
@@ -14487,7 +14499,7 @@ with pkgs;
 
   keepassx = callPackage ../applications/misc/keepassx { };
   keepassx2 = callPackage ../applications/misc/keepassx/2.0.nix { };
-  keepassx-community = libsForQt5.callPackage ../applications/misc/keepassx/community.nix { };
+  keepassxc = libsForQt5.callPackage ../applications/misc/keepassx/community.nix { };
 
   inherit (gnome3) evince;
   evolution_data_server = gnome3.evolution_data_server;
@@ -15479,8 +15491,10 @@ with pkgs;
 
   llpp = ocaml-ng.ocamlPackages.callPackage ../applications/misc/llpp { };
 
-  lmms = callPackage ../applications/audio/lmms {
-    stdenv = overrideCC stdenv gcc5;
+  lmms = libsForQt5.callPackage ../applications/audio/lmms {
+    lame = null;
+    libsoundio = null;
+    portaudio = null;
   };
 
   loxodo = callPackage ../applications/misc/loxodo { };
@@ -16363,6 +16377,8 @@ with pkgs;
 
   recode = callPackage ../tools/text/recode { };
 
+  rednotebook = python3Packages.callPackage ../applications/editors/rednotebook { };
+
   remotebox = callPackage ../applications/virtualization/remotebox { };
 
   retroshare = libsForQt5.callPackage ../applications/networking/p2p/retroshare { };
diff --git a/pkgs/top-level/emacs-packages.nix b/pkgs/top-level/emacs-packages.nix
index 4ff8d23424c..baaedbeb521 100644
--- a/pkgs/top-level/emacs-packages.nix
+++ b/pkgs/top-level/emacs-packages.nix
@@ -226,6 +226,8 @@ let
     };
   };
 
+  font-lock-plus = callPackage ../applications/editors/emacs-modes/font-lock-plus { };
+
   ghc-mod = melpaBuild rec {
     pname = "ghc";
     version = external.ghc-mod.version;
diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix
index 0bdd0f2ccac..01d2fc8e046 100644
--- a/pkgs/top-level/perl-packages.nix
+++ b/pkgs/top-level/perl-packages.nix
@@ -12493,6 +12493,9 @@ let self = _self // overrides; _self = with self; {
     meta = {
       maintainers = with maintainers; [ ];
       platforms   = stdenv.lib.platforms.unix;
+
+      # http://cpansearch.perl.org/src/ROSCH/String-ShellQuote-1.04/README
+      license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
     };
   };
 
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 9941a80dd6b..c1578987570 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -11308,39 +11308,9 @@ in {
     };
   };
 
-  hyperframe = buildPythonPackage rec {
-    name = "hyperframe-${version}";
-    version = "4.0.1";
+  hyperframe = callPackage ../development/python-modules/hyperframe { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/h/hyperframe/${name}.tar.gz";
-      sha256 = "0hsfq0jigwa0i58z7vbnp62l7za49gmlg75vnygq2ijhkidkcmwa";
-    };
-
-    meta = {
-      description = "HTTP/2 framing layer for Python";
-      homepage = "http://hyper.rtfd.org/";
-      license = licenses.mit;
-    };
-  };
-
-  h2 = buildPythonPackage rec {
-    name = "h2-${version}";
-    version = "2.5.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/h/h2/${name}.tar.gz";
-      sha256 = "0xhzm5vcfhdq3mihynwh4ljwi0r06lvzk3ypr0gmmbcp1x43ffb7";
-    };
-
-    propagatedBuildInputs = with self; [ enum34 hpack hyperframe ];
-
-    meta = {
-      description = "HTTP/2 State-Machine based protocol implementation";
-      homepage = "http://hyper.rtfd.org/";
-      license = licenses.mit;
-    };
-  };
+  h2 = callPackage ../development/python-modules/h2 { };
 
   editorconfig = buildPythonPackage rec {
     name = "EditorConfig-${version}";
@@ -13529,21 +13499,7 @@ in {
 
   pecan = callPackage ../development/python-modules/pecan { };
 
-  kaitaistruct = buildPythonPackage rec {
-    name = "kaitaistruct-${version}";
-    version = "0.6";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/k/kaitaistruct/${name}.tar.gz";
-      sha256 = "0rwcrlz7f2bwmypqa38pag492bp71wp1bhz51hsaynjjyr9knr12";
-    };
-
-    meta = with stdenv.lib; {
-      description = "Kaitai Struct: runtime library for Python";
-      homepage = "https://github.com/kaitai-io/kaitai_struct_python_runtime";
-      license = licenses.mit;
-    };
-  };
+  kaitaistruct = callPackage ../development/python-modules/kaitaistruct { };
 
   Kajiki = buildPythonPackage rec {
     name = "Kajiki-${version}";
@@ -15231,41 +15187,9 @@ in {
   };
 
 
-  pyasn1 = buildPythonPackage rec {
-    name = "pyasn1-0.1.9";
+  pyasn1 = callPackage ../development/python-modules/pyasn1 { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pyasn1/${name}.tar.gz";
-      sha256 = "0zraxni14bqi20kr4bi6nwsh32aibz0fq0xaczfisw0zdpcsqg45";
-    };
-
-    meta = {
-      description = "ASN.1 tools for Python";
-      homepage = http://pyasn1.sourceforge.net/;
-      license = "mBSD";
-      platforms = platforms.unix;  # arbitrary choice
-    };
-  };
-
-  pyasn1-modules = buildPythonPackage rec {
-    name = "pyasn1-modules-${version}";
-    version = "0.0.8";
-    disabled = isPyPy;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pyasn1-modules/${name}.tar.gz";
-      sha256 = "0drqgw81xd3fxdlg89kgd79zzrabvfncvkbybi2wr6w2y4s1jmhh";
-    };
-
-    propagatedBuildInputs = with self; [ pyasn1 ];
-
-    meta = {
-      description = "A collection of ASN.1-based protocols modules";
-      homepage = https://pypi.python.org/pypi/pyasn1-modules;
-      license = licenses.bsd3;
-      platforms = platforms.unix;  # same as pyasn1
-    };
-  };
+  pyasn1-modules = callPackage ../development/python-modules/pyasn1-modules { };
 
   pyaudio = buildPythonPackage rec {
     name = "python-pyaudio-${version}";
@@ -15436,45 +15360,7 @@ in {
     };
   };
 
-  pygit2 = buildPythonPackage rec {
-    name = "pygit2-0.25.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pygit2/${name}.tar.gz";
-      sha256 = "0sja3g9mqwp5bnhdc313b2gc4z3p70nn6zzf2h8j581g0lrn0sg8";
-    };
-
-    # Fixes a bug which can cause test failed when cffi==1.10
-    prePatch = let
-      cffiVersionPatch = pkgs.fetchurl {
-        url = "https://github.com/libgit2/pygit2/commit/b88dc868423af2f760f649960112efd0e37e5335.patch";
-        sha256 = "14cfrz56y2dnwlxrrss9pjhxfnyyg5856gbabzjzyx674k0qcid4";
-      };
-    in ''
-      # we need to delete part of the patch because the missing .travis.yml causes problem
-      sed -e '1,36d' ${cffiVersionPatch} | patch -p1
-    '';
-
-    preConfigure = ( if stdenv.isDarwin then ''
-      export DYLD_LIBRARY_PATH="${pkgs.libgit2}/lib"
-    '' else "" );
-
-    propagatedBuildInputs = with self; [ pkgs.libgit2 six ] ++ optionals (!isPyPy) [ cffi ];
-
-    preCheck = ''
-      # disable tests that require networking
-      rm test/test_repository.py
-      rm test/test_credentials.py
-      rm test/test_submodule.py
-    '';
-
-    meta = {
-      homepage = https://pypi.python.org/pypi/pygit2;
-      description = "A set of Python bindings to the libgit2 shared library";
-      license = licenses.gpl2;
-      platforms = platforms.all;
-    };
-  };
+  pygit2 = callPackage ../development/python-modules/pygit2 { };
 
   Babel = buildPythonPackage (rec {
     name = "Babel-2.3.4";
@@ -16595,25 +16481,7 @@ in {
     inherit (pkgs) openldap cyrus_sasl openssl;
   };
 
-  ldap3 = buildPythonPackage rec {
-    version = "1.0.4";
-    name = "ldap3-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/l/ldap3/${name}.tar.gz";
-      sha256 = "0j4qqj9vq022hy7wfqn8s0j4vm2g6paabbzas1vbyspawvcfai98";
-    };
-
-    buildInputs = with self; [ gssapi ];
-
-    propagatedBuildInputs = with self; [ pyasn1 ];
-
-    meta = {
-      homepage = https://pypi.python.org/pypi/ldap3;
-      description = "A strictly RFC 4510 conforming LDAP V3 pure Python client library";
-      license = licenses.lgpl3;
-    };
-  };
+  ldap3 = callPackage ../development/python-modules/ldap3 {};
 
   ptest = buildPythonPackage rec {
     name = pname + "-" + version;
@@ -18169,36 +18037,7 @@ in {
 
   seaborn = callPackage ../development/python-modules/seaborn { };
 
-  selenium = buildPythonPackage rec {
-    name = "selenium-2.52.0";
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/s/selenium/${name}.tar.gz";
-      sha256 = "0971rd9b8kb97xp9fvrwzvxr8vqfdjc020cs75n787ya82km01c2";
-    };
-
-    buildInputs = with self; [pkgs.xorg.libX11];
-
-    # Recompiling x_ignore_nofocus.so as the original one dlopen's libX11.so.6 by some
-    # absolute paths. Replaced by relative path so it is found when used in nix.
-    x_ignore_nofocus =
-      pkgs.fetchFromGitHub {
-        owner = "SeleniumHQ";
-        repo = "selenium";
-        rev = "selenium-2.52.0";
-        sha256 = "1n58akim9np2jy22jfgichq1ckvm8gglqi2hn3syphh0jjqq6cfx";
-      };
-
-    patchPhase = ''
-      cp "${x_ignore_nofocus}/cpp/linux-specific/"* .
-      substituteInPlace x_ignore_nofocus.c --replace "/usr/lib/libX11.so.6" "${pkgs.xorg.libX11.out}/lib/libX11.so.6"
-      gcc -c -fPIC x_ignore_nofocus.c -o x_ignore_nofocus.o
-      gcc -shared \
-        -Wl,${if stdenv.isDarwin then "-install_name" else "-soname"},x_ignore_nofocus.so \
-        -o x_ignore_nofocus.so \
-        x_ignore_nofocus.o
-      cp -v x_ignore_nofocus.so py/selenium/webdriver/firefox/${if pkgs.stdenv.is64bit then "amd64" else "x86"}/
-    '';
-  };
+  selenium = callPackage ../development/python-modules/selenium { };
 
   serpy = callPackage ../development/python-modules/serpy { };
 
@@ -22657,6 +22496,8 @@ EOF
     };
   };
 
+  redNotebook = pkgs.rednotebook; # Backwards compatibility alias.
+
   uncertainties = callPackage ../development/python-modules/uncertainties { };
 
   funcy = buildPythonPackage rec {
diff --git a/pkgs/top-level/splice.nix b/pkgs/top-level/splice.nix
index 44a46b7b692..b13fa86a995 100644
--- a/pkgs/top-level/splice.nix
+++ b/pkgs/top-level/splice.nix
@@ -67,7 +67,7 @@ let
     if actuallySplice
     then splicer defaultBuildScope defaultRunScope // {
       # These should never be spliced under any circumstances
-      inherit (pkgs) pkgs buildPackages __targetPackages
+      inherit (pkgs) pkgs buildPackages targetPackages
         buildPlatform targetPlatform hostPlatform;
     }
     else pkgs // pkgs.xorg;
diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix
index 617fa0c30ce..7cddc664570 100644
--- a/pkgs/top-level/stage.nix
+++ b/pkgs/top-level/stage.nix
@@ -26,13 +26,13 @@
   # us to avoid expensive splicing.
   buildPackages
 
-, # The package set used in the next stage. If null, `__targetPackages` will be
+, # The package set used in the next stage. If null, `targetPackages` will be
   # defined internally as the final produced package set itself, just like with
   # `buildPackages` and for the same reasons.
   #
   # THIS IS A HACK for compilers that don't think critically about cross-
   # compilation. Please do *not* use unless you really know what you are doing.
-  __targetPackages
+  targetPackages
 
 , # The standard environment to use for building packages.
   stdenv
@@ -72,7 +72,7 @@ let
   stdenvBootstappingAndPlatforms = self: super: {
     buildPackages = (if buildPackages == null then self else buildPackages)
       // { recurseForDerivations = false; };
-    __targetPackages = (if __targetPackages == null then self else __targetPackages)
+    targetPackages = (if targetPackages == null then self else targetPackages)
       // { recurseForDerivations = false; };
     inherit stdenv;
   };