about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2014-01-21 12:54:58 +0100
committerVladimír Čunát <vcunat@gmail.com>2014-01-21 12:58:55 +0100
commit668310a2b578d57a59dad7481db651ab3a258256 (patch)
treedbe782a40c0146c04096c7009b357c9357f3a915
parent8088837dc8f35ef7853787f88bb1db7248900cc4 (diff)
parent28d51a31eeff92677132c84436c0a3536a34bea7 (diff)
downloadnixlib-668310a2b578d57a59dad7481db651ab3a258256.tar
nixlib-668310a2b578d57a59dad7481db651ab3a258256.tar.gz
nixlib-668310a2b578d57a59dad7481db651ab3a258256.tar.bz2
nixlib-668310a2b578d57a59dad7481db651ab3a258256.tar.lz
nixlib-668310a2b578d57a59dad7481db651ab3a258256.tar.xz
nixlib-668310a2b578d57a59dad7481db651ab3a258256.tar.zst
nixlib-668310a2b578d57a59dad7481db651ab3a258256.zip
Merge stdenv-updates into master
This is a re-merge, in fact. Now the first parent is master
as of right before the "first merge" (ac6761c9).
A few commits pushed in-between into master now look like coming
from stdenv-updates, but otherwise this seems to fix the situation.

Cf. https://github.com/NixOS/nixpkgs/commit/320209a618221728e022222a2aafee1af72037bb#commitcomment-5125991
-rw-r--r--pkgs/applications/audio/sonic-visualiser/default.nix5
-rw-r--r--pkgs/applications/editors/ed/default.nix4
-rw-r--r--pkgs/applications/editors/emacs-modes/emacs-clang-complete-async/default.nix4
-rw-r--r--pkgs/applications/graphics/inkscape/default.nix4
-rw-r--r--pkgs/applications/graphics/inkscape/libpng-1.5.patch47
-rw-r--r--pkgs/applications/graphics/inkscape/spuriouscomma.patch11
-rw-r--r--pkgs/applications/graphics/k3d/default.nix2
-rw-r--r--pkgs/applications/misc/goldendict/default.nix2
-rw-r--r--pkgs/applications/misc/goldendict/gcc47.patch40
-rw-r--r--pkgs/applications/misc/krusader/default.nix1
-rw-r--r--pkgs/applications/networking/esniper/default.nix15
-rw-r--r--pkgs/applications/science/astronomy/celestia/default.nix2
-rw-r--r--pkgs/applications/version-management/git-and-tools/git/default.nix3
-rw-r--r--pkgs/applications/version-management/gource/default.nix2
-rw-r--r--pkgs/build-support/gcc-wrapper/builder.sh21
-rw-r--r--pkgs/build-support/gcc-wrapper/default.nix1
-rw-r--r--pkgs/build-support/gcc-wrapper/ld-solaris-wrapper.sh40
-rw-r--r--pkgs/build-support/gcc-wrapper/setup-hook.sh2
-rw-r--r--pkgs/desktops/gnome-2/default.nix6
-rw-r--r--pkgs/development/compilers/gcc/4.2/default.nix6
-rw-r--r--pkgs/development/compilers/gcc/4.2/siginfo_t.patch15
-rw-r--r--pkgs/development/compilers/gcc/4.3/default.nix16
-rw-r--r--pkgs/development/compilers/gcc/4.4/default.nix2
-rw-r--r--pkgs/development/compilers/gcc/4.4/sources.nix14
-rwxr-xr-xpkgs/development/compilers/gcc/4.4/update-gcc.sh4
-rw-r--r--pkgs/development/compilers/gcc/4.5/default.nix2
-rw-r--r--pkgs/development/compilers/gcc/4.6/default.nix2
-rw-r--r--pkgs/development/compilers/gcc/4.7/build-race.patch11
-rw-r--r--pkgs/development/compilers/gcc/4.8/arm-eabi.patch (renamed from pkgs/development/compilers/gcc/4.7/arm-eabi.patch)0
-rw-r--r--pkgs/development/compilers/gcc/4.8/builder.sh (renamed from pkgs/development/compilers/gcc/4.7/builder.sh)15
-rw-r--r--pkgs/development/compilers/gcc/4.8/default.nix (renamed from pkgs/development/compilers/gcc/4.7/default.nix)124
-rw-r--r--pkgs/development/compilers/gcc/4.8/gfortran-driving.patch (renamed from pkgs/development/compilers/gcc/4.7/gfortran-driving.patch)0
-rw-r--r--pkgs/development/compilers/gcc/4.8/gnat-cflags.patch (renamed from pkgs/development/compilers/gcc/4.7/gnat-cflags.patch)0
-rw-r--r--pkgs/development/compilers/gcc/4.8/java-jvgenmain-link.patch (renamed from pkgs/development/compilers/gcc/4.7/java-jvgenmain-link.patch)0
-rw-r--r--pkgs/development/compilers/gcc/4.8/libstdc++-target.patch (renamed from pkgs/development/compilers/gcc/4.7/libstdc++-target.patch)0
-rw-r--r--pkgs/development/compilers/gcc/4.8/no-sys-dirs.patch (renamed from pkgs/development/compilers/gcc/4.7/no-sys-dirs.patch)0
-rw-r--r--pkgs/development/compilers/gcc/4.8/parallel-bconfig.patch32
-rw-r--r--pkgs/development/compilers/ghc/7.6.3.nix2
-rwxr-xr-xpkgs/development/compilers/ghc/ghc-get-packages.sh21
-rw-r--r--pkgs/development/compilers/llvm/3.3/llvm.nix41
-rw-r--r--pkgs/development/compilers/llvm/3.3/more-memory-for-bugpoint.patch (renamed from pkgs/development/compilers/llvm/more-memory-for-bugpoint.patch)0
-rw-r--r--pkgs/development/compilers/llvm/3.3/no-rule-aarch64.patch8
-rw-r--r--pkgs/development/compilers/llvm/3.4/clang-separate-build.patch8
-rw-r--r--pkgs/development/compilers/llvm/3.4/clang.nix41
-rw-r--r--pkgs/development/compilers/llvm/3.4/default.nix25
-rw-r--r--pkgs/development/compilers/llvm/3.4/dragonegg.nix (renamed from pkgs/development/compilers/llvm/dragonegg.nix)10
-rw-r--r--pkgs/development/compilers/llvm/3.4/lld.nix31
-rw-r--r--pkgs/development/compilers/llvm/3.4/lldb.nix44
-rw-r--r--pkgs/development/compilers/llvm/3.4/llvm-separate-build.patch12
-rw-r--r--pkgs/development/compilers/llvm/3.4/llvm.nix55
-rw-r--r--pkgs/development/compilers/llvm/3.4/polly-separate-build.patch12
-rw-r--r--pkgs/development/compilers/llvm/3.4/polly.nix27
-rw-r--r--pkgs/development/compilers/llvm/default.nix47
-rw-r--r--pkgs/development/compilers/llvm/full.nix89
-rw-r--r--pkgs/development/compilers/mlton/default.nix17
-rw-r--r--pkgs/development/compilers/openjdk/default.nix1
-rw-r--r--pkgs/development/interpreters/perl/5.14/default.nix3
-rw-r--r--pkgs/development/interpreters/perl/5.14/ld-shared.patch11
-rw-r--r--pkgs/development/interpreters/perl/5.16/default.nix35
-rw-r--r--pkgs/development/interpreters/perl/5.16/ld-shared.patch11
-rw-r--r--pkgs/development/interpreters/perl/5.16/no-sys-dirs.patch113
-rw-r--r--pkgs/development/interpreters/python/2.6/default.nix2
-rw-r--r--pkgs/development/interpreters/python/2.7/default.nix2
-rw-r--r--pkgs/development/libraries/acl/default.nix4
-rw-r--r--pkgs/development/libraries/attr/default.nix4
-rw-r--r--pkgs/development/libraries/cloog/default.nix4
-rw-r--r--pkgs/development/libraries/coin3d/default.nix9
-rw-r--r--pkgs/development/libraries/coin3d/gcc-4.8.patch38
-rw-r--r--pkgs/development/libraries/ctl/default.nix8
-rw-r--r--pkgs/development/libraries/ctl/gcc47.patch15
-rw-r--r--pkgs/development/libraries/dbus-cplusplus/default.nix6
-rw-r--r--pkgs/development/libraries/gettext/default.nix22
-rw-r--r--pkgs/development/libraries/gettext/no-gets.patch42
-rw-r--r--pkgs/development/libraries/glib/default.nix5
-rw-r--r--pkgs/development/libraries/glibc/2.18/common.nix12
-rw-r--r--pkgs/development/libraries/glibc/2.18/fix_path_attribute_in_getconf.patch6
-rw-r--r--pkgs/development/libraries/gmp/4.3.2.nix4
-rw-r--r--pkgs/development/libraries/gmp/5.1.x.nix (renamed from pkgs/development/libraries/gmp/5.1.3.nix)5
-rw-r--r--pkgs/development/libraries/gnu-efi/default.nix10
-rw-r--r--pkgs/development/libraries/gsl/default.nix4
-rw-r--r--pkgs/development/libraries/gsl/disable-fma.patch32
-rw-r--r--pkgs/development/libraries/icu/default.nix8
-rw-r--r--pkgs/development/libraries/isl/default.nix10
-rw-r--r--pkgs/development/libraries/isl/fix-gcc-build.diff12
-rw-r--r--pkgs/development/libraries/kerberos/krb5.nix8
-rw-r--r--pkgs/development/libraries/libarchive/default.nix8
-rw-r--r--pkgs/development/libraries/libc++/default.nix4
-rw-r--r--pkgs/development/libraries/libgcrypt/default.nix2
-rw-r--r--pkgs/development/libraries/libmsn/default.nix1
-rw-r--r--pkgs/development/libraries/libmsn/fix-ftbfs-gcc4.7.diff16
-rw-r--r--pkgs/development/libraries/libofa/curl-types.patch13
-rw-r--r--pkgs/development/libraries/libofa/default.nix17
-rw-r--r--pkgs/development/libraries/libofa/gcc-4.x.patch12
-rw-r--r--pkgs/development/libraries/libofa/libofa-0.9.3-gcc-4.3.patch36
-rw-r--r--pkgs/development/libraries/libofa/libofa-0.9.3-gcc-4.patch39
-rw-r--r--pkgs/development/libraries/libproxy/default.nix8
-rw-r--r--pkgs/development/libraries/libxml2/default.nix2
-rw-r--r--pkgs/development/libraries/libxslt/default.nix26
-rw-r--r--pkgs/development/libraries/libxslt/patch-ah.patch69
-rw-r--r--pkgs/development/libraries/mpc/default.nix4
-rw-r--r--pkgs/development/libraries/mpfr/3.1.2.nix51
-rw-r--r--pkgs/development/libraries/mpfr/default.nix28
-rw-r--r--pkgs/development/libraries/ncurses/default.nix21
-rw-r--r--pkgs/development/libraries/ncurses/patch-ac40
-rw-r--r--pkgs/development/libraries/ois/default.nix13
-rw-r--r--pkgs/development/libraries/openssl/default.nix8
-rw-r--r--pkgs/development/libraries/pcre/default.nix9
-rw-r--r--pkgs/development/libraries/ppl/default.nix8
-rw-r--r--pkgs/development/libraries/ppl/upstream-based.patch42
-rw-r--r--pkgs/development/libraries/qca2/default.nix2
-rw-r--r--pkgs/development/libraries/qca2/gcc47.patch12
-rw-r--r--pkgs/development/libraries/strigi/default.nix2
-rw-r--r--pkgs/development/libraries/strigi/export_bufferedstream.patch12
-rw-r--r--pkgs/development/libraries/sword/default.nix2
-rw-r--r--pkgs/development/libraries/sword/gcc47.patch35
-rw-r--r--pkgs/development/libraries/v8/default.nix5
-rw-r--r--pkgs/development/libraries/vigra/default.nix4
-rw-r--r--pkgs/development/libraries/xbase/default.nix8
-rw-r--r--pkgs/development/libraries/zlib/default.nix6
-rw-r--r--pkgs/development/lisp-modules/stumpwm/default.nix8
-rw-r--r--pkgs/development/tools/build-managers/cmake/762-13887.patch17
-rw-r--r--pkgs/development/tools/build-managers/cmake/default.nix14
-rw-r--r--pkgs/development/tools/build-managers/cmake/search-path.patch72
-rwxr-xr-xpkgs/development/tools/build-managers/cmake/setup-hook.sh17
-rw-r--r--pkgs/development/tools/misc/binutils/default.nix34
-rw-r--r--pkgs/development/tools/misc/elfutils/default.nix12
-rw-r--r--pkgs/development/tools/misc/gnum4/default.nix10
-rw-r--r--pkgs/development/tools/misc/gnum4/readlink-EINVAL.patch18
-rw-r--r--pkgs/development/tools/misc/patchelf/default.nix6
-rw-r--r--pkgs/development/tools/misc/patchelf/unstable.nix16
-rw-r--r--pkgs/development/tools/misc/texinfo/4.9.nix10
-rw-r--r--pkgs/development/tools/misc/texinfo/5.2.nix (renamed from pkgs/development/tools/misc/texinfo/5.1.nix)8
-rw-r--r--pkgs/development/tools/parsing/alex/2.3.1.nix1
-rw-r--r--pkgs/development/tools/parsing/alex/2.3.2.nix1
-rw-r--r--pkgs/development/tools/parsing/alex/2.3.3.nix1
-rw-r--r--pkgs/development/tools/parsing/alex/2.3.5.nix1
-rw-r--r--pkgs/development/tools/parsing/alex/adapt-crazy-perl-regex-for-cpp-4.8.0.patch12
-rw-r--r--pkgs/development/tools/parsing/bison/2.x.nix6
-rw-r--r--pkgs/development/tools/parsing/bison/3.x.nix6
-rw-r--r--pkgs/development/tools/parsing/flex/default.nix (renamed from pkgs/development/tools/parsing/flex/flex-2.5.35.nix)14
-rw-r--r--pkgs/development/tools/parsing/flex/flex-2.5.33.nix20
-rw-r--r--pkgs/development/tools/parsing/flex/flex-2.5.34.nix19
-rw-r--r--pkgs/development/tools/parsing/flex/flex-2.5.4a.nix12
-rw-r--r--pkgs/development/tools/parsing/happy/1.18.4.nix1
-rw-r--r--pkgs/development/tools/parsing/happy/1.18.5.nix1
-rw-r--r--pkgs/development/tools/parsing/happy/1.18.6.nix1
-rw-r--r--pkgs/development/tools/parsing/happy/1.18.8.nix1
-rw-r--r--pkgs/development/tools/parsing/happy/adapt-crazy-perl-regex-for-cpp-4.8.0.patch12
-rw-r--r--pkgs/games/asc/default.nix4
-rw-r--r--pkgs/misc/emulators/zsnes/default.nix29
-rw-r--r--pkgs/misc/emulators/zsnes/zsnes-1.51-libpng15.patch12
-rw-r--r--pkgs/misc/emulators/zsnes/zsnes.patch80
-rw-r--r--pkgs/os-specific/linux/ipsec-tools/default.nix3
-rw-r--r--pkgs/servers/monitoring/net-snmp/default.nix4
-rw-r--r--pkgs/servers/x11/xorg/overrides.nix13
-rw-r--r--pkgs/shells/bash/bash-4.2-patches.nix3
-rw-r--r--pkgs/stdenv/default.nix1
-rw-r--r--pkgs/stdenv/generic/default.nix6
-rw-r--r--pkgs/stdenv/generic/setup-repeatable.sh876
-rw-r--r--pkgs/stdenv/generic/setup.sh87
-rw-r--r--pkgs/stdenv/linux/bootstrap/armv5tel/default.nix69
-rw-r--r--pkgs/stdenv/linux/bootstrap/armv6l/default.nix10
-rw-r--r--pkgs/stdenv/linux/bootstrap/i686/default.nix70
-rw-r--r--pkgs/stdenv/linux/bootstrap/loongson2f/default.nix70
-rw-r--r--pkgs/stdenv/linux/bootstrap/powerpc/default.nix64
-rw-r--r--pkgs/stdenv/linux/default.nix50
-rw-r--r--pkgs/stdenv/linux/make-bootstrap-tools-crosspi.nix2
-rw-r--r--pkgs/stdenv/native/default.nix3
-rw-r--r--pkgs/stdenv/nix/default.nix1
-rw-r--r--pkgs/tools/archivers/cpio/default.nix17
-rw-r--r--pkgs/tools/archivers/cpio/no-gets.patch (renamed from pkgs/development/tools/misc/gnum4/no-gets.patch)10
-rw-r--r--pkgs/tools/archivers/gnutar/default.nix11
-rw-r--r--pkgs/tools/archivers/gnutar/gets-undeclared.patch26
-rw-r--r--pkgs/tools/compression/gzip/default.nix13
-rw-r--r--pkgs/tools/compression/xz/default.nix4
-rw-r--r--pkgs/tools/filesystems/e2fsprogs/default.nix2
-rw-r--r--pkgs/tools/graphics/asymptote/default.nix6
-rw-r--r--pkgs/tools/misc/coreutils/default.nix7
-rw-r--r--pkgs/tools/misc/coreutils/help2man.patch40
-rw-r--r--pkgs/tools/misc/file/default.nix4
-rw-r--r--pkgs/tools/misc/less/default.nix23
-rw-r--r--pkgs/tools/networking/curl/default.nix11
-rw-r--r--pkgs/tools/networking/p2p/amule/default.nix10
-rw-r--r--pkgs/tools/networking/p2p/amule/gcc47.patch21
-rw-r--r--pkgs/tools/package-management/nix/unstable.nix6
-rw-r--r--pkgs/tools/text/diffutils/default.nix10
-rw-r--r--pkgs/tools/text/diffutils/gets-undeclared.patch71
-rw-r--r--pkgs/tools/text/gawk/default.nix4
-rw-r--r--pkgs/tools/text/gnugrep/default.nix2
-rw-r--r--pkgs/tools/text/gnugrep/test-localeconv.patch18
-rw-r--r--pkgs/tools/text/gnupatch/bashishms.patch67
-rw-r--r--pkgs/tools/text/gnupatch/default.nix5
-rw-r--r--pkgs/tools/text/gnused/default.nix6
-rw-r--r--pkgs/tools/text/sgml/opensp/compat.nix4
-rw-r--r--pkgs/top-level/all-packages.nix372
-rw-r--r--pkgs/top-level/node-packages-generated.nix922
-rw-r--r--pkgs/top-level/node-packages.json2
-rw-r--r--pkgs/top-level/release-python.nix1
-rw-r--r--pkgs/top-level/release-small.nix25
-rw-r--r--pkgs/top-level/release.nix4
200 files changed, 2782 insertions, 2706 deletions
diff --git a/pkgs/applications/audio/sonic-visualiser/default.nix b/pkgs/applications/audio/sonic-visualiser/default.nix
index aeb90c09455b..6e15478ff630 100644
--- a/pkgs/applications/audio/sonic-visualiser/default.nix
+++ b/pkgs/applications/audio/sonic-visualiser/default.nix
@@ -14,6 +14,11 @@ stdenv.mkDerivation rec {
     url = "http://code.soundsoftware.ac.uk/attachments/download/194/${name}.tar.gz";
     sha256 = "00igf7j6s8xfyxnlkbqma0yby9pknxqzy8cmh0aw95ix80cw56fq";
   };
+  patches = [(fetchurl {
+    url = http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/media-sound/sonic-visualiser/files/sonic-visualiser-1.9-gcc47.patch;
+    sha256 = "0dhh111crvjvhcjqp7j9jqnvs8zmd6xrcirmzqrrnca1h0vbpkay";
+    name = "gcc47.patch";
+  })];
 
   buildInputs =
     [ libsndfile qt4 fftw /* should be fftw3f ??*/ bzip2 librdf rubberband
diff --git a/pkgs/applications/editors/ed/default.nix b/pkgs/applications/editors/ed/default.nix
index 3e22cfd0412d..88b539d29f5f 100644
--- a/pkgs/applications/editors/ed/default.nix
+++ b/pkgs/applications/editors/ed/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv }:
 
 stdenv.mkDerivation rec {
-  name = "ed-1.7";
+  name = "ed-1.9";
 
   src = fetchurl {
     url = "mirror://gnu/ed/${name}.tar.gz";
-    sha256 = "0c908wb5pm48rjrrfbm5dhrqzys8f1dbvi90dn0vgwjzk80l2hl9";
+    sha256 = "122syihsx2hwzj75mkf5a9ssiky2xby748kp4cc00wzhmp7p5cym";
   };
 
   /* FIXME: Tests currently fail on Darwin:
diff --git a/pkgs/applications/editors/emacs-modes/emacs-clang-complete-async/default.nix b/pkgs/applications/editors/emacs-modes/emacs-clang-complete-async/default.nix
index 6d10244a8795..b23c6da6123c 100644
--- a/pkgs/applications/editors/emacs-modes/emacs-clang-complete-async/default.nix
+++ b/pkgs/applications/editors/emacs-modes/emacs-clang-complete-async/default.nix
@@ -1,4 +1,4 @@
-{ clangStdenv, fetchgit, llvmFull }:
+{ clangStdenv, fetchgit, llvm, clang }:
 
 clangStdenv.mkDerivation {
   name = "emacs-clang-complete-async-20130218";
@@ -8,7 +8,7 @@ clangStdenv.mkDerivation {
     sha256 = "1c8zqi6axbsb951azz9iqx3j52j30nd9ypv396hvids3g02cirrf";
   };
 
-  buildInputs = [ llvmFull ];
+  buildInputs = [ llvm clang.clang ];
 
   installPhase = ''
     mkdir -p $out/bin
diff --git a/pkgs/applications/graphics/inkscape/default.nix b/pkgs/applications/graphics/inkscape/default.nix
index 37905f8a73f6..478a0ff7e50c 100644
--- a/pkgs/applications/graphics/inkscape/default.nix
+++ b/pkgs/applications/graphics/inkscape/default.nix
@@ -13,6 +13,10 @@ stdenv.mkDerivation rec {
 
   patches = [ ./configure-python-libs.patch ];
 
+  postPatch = ''
+    patch -p0 < ${./spuriouscomma.patch}
+  '';
+
   propagatedBuildInputs = [
     # Python is used at run-time to execute scripts, e.g., those from
     # the "Effects" menu.
diff --git a/pkgs/applications/graphics/inkscape/libpng-1.5.patch b/pkgs/applications/graphics/inkscape/libpng-1.5.patch
deleted file mode 100644
index 4c8a7ee5f9b6..000000000000
--- a/pkgs/applications/graphics/inkscape/libpng-1.5.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-Source: upstream revisions 10061 and 10707
-
---- a/src/sp-image.cpp	2011-02-21 07:59:34 +0000
-+++ b/src/sp-image.cpp	2011-02-21 08:57:28 +0000
-@@ -387,9 +387,13 @@
- 
- #if defined(PNG_iCCP_SUPPORTED)
-                 {
--                    char* name = 0;
-+                    png_charp name = 0;
-                     int compression_type = 0;
--                    char* profile = 0;
-+#if (PNG_LIBPNG_VER < 10500)
-+                    png_charp profile = 0;
-+#else
-+                    png_bytep profile = 0;
-+#endif
-                     png_uint_32 proflen = 0;
-                     if ( png_get_iCCP(pngPtr, infoPtr, &name, &compression_type, &profile, &proflen) ) {
- //                                         g_message("Found an iCCP chunk named [%s] with %d bytes and comp %d", name, proflen, compression_type);
-
---- a/src/extension/internal/pdfinput/svg-builder.cpp	2011-10-27 04:55:51 +0000
-+++ b/src/extension/internal/pdfinput/svg-builder.cpp	2011-10-29 20:34:00 +0000
-@@ -1481,7 +1481,7 @@
-         return NULL;
-     }
-     // Set error handler
--    if (setjmp(png_ptr->jmpbuf)) {
-+    if (setjmp(png_jmpbuf(png_ptr))) {
-         png_destroy_write_struct(&png_ptr, &info_ptr);
-         return NULL;
-     }
-
---- a/src/helper/png-write.cpp	2011-08-07 10:53:12 +0000
-+++ b/src/helper/png-write.cpp	2011-10-29 20:34:00 +0000
-@@ -166,8 +166,8 @@
-     /* Set error handling.  REQUIRED if you aren't supplying your own
-      * error hadnling functions in the png_create_write_struct() call.
-      */
--    if (setjmp(png_ptr->jmpbuf)) {
--        /* If we get here, we had a problem reading the file */
-+    if (setjmp(png_jmpbuf(png_ptr))) {
-+        // If we get here, we had a problem reading the file
-         fclose(fp);
-         png_destroy_write_struct(&png_ptr, &info_ptr);
-         return false;
-
diff --git a/pkgs/applications/graphics/inkscape/spuriouscomma.patch b/pkgs/applications/graphics/inkscape/spuriouscomma.patch
new file mode 100644
index 000000000000..bc538068f9e3
--- /dev/null
+++ b/pkgs/applications/graphics/inkscape/spuriouscomma.patch
@@ -0,0 +1,11 @@
+--- src/widgets/desktop-widget.h~	2011-07-08 13:25:09.000000000 -0500
++++ src/widgets/desktop-widget.h	2013-02-15 16:04:45.806910365 -0600
+@@ -239,7 +239,7 @@
+ private:
+     GtkWidget *tool_toolbox;
+     GtkWidget *aux_toolbox;
+-    GtkWidget *commands_toolbox,;
++    GtkWidget *commands_toolbox;
+     GtkWidget *snap_toolbox;
+ 
+     static void init(SPDesktopWidget *widget);
diff --git a/pkgs/applications/graphics/k3d/default.nix b/pkgs/applications/graphics/k3d/default.nix
index 8920d243dbf0..9f31d94ac7fb 100644
--- a/pkgs/applications/graphics/k3d/default.nix
+++ b/pkgs/applications/graphics/k3d/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   preConfigure = ''
     export LD_LIBRARY_PATH="$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/build/lib"
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$(echo ${gtkglext}/include/gtkglext-*) -I$(echo ${gtkglext}/lib/gtkglext-*/include)"
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fpermissive -I$(echo ${gtkglext}/include/gtkglext-*) -I$(echo ${gtkglext}/lib/gtkglext-*/include)"
   '';
 
   buildInputs = [
diff --git a/pkgs/applications/misc/goldendict/default.nix b/pkgs/applications/misc/goldendict/default.nix
index f7b8a511bc66..717d0a012a2c 100644
--- a/pkgs/applications/misc/goldendict/default.nix
+++ b/pkgs/applications/misc/goldendict/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     cd ${name}-src
     tar xf ${src}
   '';
-  patches = [ ./goldendict-paths.diff ];
+  patches = [ ./goldendict-paths.diff ./gcc47.patch ];
   patchFlags = "-p 0";
   configurePhase = ''
     qmake
diff --git a/pkgs/applications/misc/goldendict/gcc47.patch b/pkgs/applications/misc/goldendict/gcc47.patch
new file mode 100644
index 000000000000..311dad4f6487
--- /dev/null
+++ b/pkgs/applications/misc/goldendict/gcc47.patch
@@ -0,0 +1,40 @@
+From b00d081da20b9a6b257573c6b23a6bc640c4dab1 Mon Sep 17 00:00:00 2001
+From: Michael Palimaka <kensington@gentoo.org>
+Date: Fri, 20 Jul 2012 03:27:38 +1000
+Subject: [PATCH] Fix build with GCC 4.7 by adding missing includes.
+
+---
+ processwrapper.cc                       | 4 ++++
+ qtsingleapplication/src/qtlocalpeer.cpp | 1 +
+ 2 files changed, 5 insertions(+)
+
+diff --git processwrapper.cc processwrapper.cc
+index f7f3f19..86b985d 100644
+--- processwrapper.cc
++++ processwrapper.cc
+@@ -2,6 +2,10 @@
+ 

+ #include <QtCore>

+ 

++#if defined(Q_OS_UNIX)

++#include <unistd.h>

++#endif

++

+ #ifdef Q_OS_WIN32

+ 

+ #include <windows.h>

+diff --git qtsingleapplication/src/qtlocalpeer.cpp qtsingleapplication/src/qtlocalpeer.cpp
+index 382d182..506c142 100644
+--- qtsingleapplication/src/qtlocalpeer.cpp
++++ qtsingleapplication/src/qtlocalpeer.cpp
+@@ -50,6 +50,7 @@ static PProcessIdToSessionId pProcessIdToSessionId = 0;
+ #endif
+ #if defined(Q_OS_UNIX)
+ #include <time.h>
++#include <unistd.h>
+ #endif
+ 
+ namespace QtLP_Private {
+-- 
+1.7.11.1
+
diff --git a/pkgs/applications/misc/krusader/default.nix b/pkgs/applications/misc/krusader/default.nix
index bd86501c30e2..83c21da0e542 100644
--- a/pkgs/applications/misc/krusader/default.nix
+++ b/pkgs/applications/misc/krusader/default.nix
@@ -7,6 +7,7 @@ stdenv.mkDerivation rec {
     sha256 = "1q1m4cjzz2m41pdpxnwrsiczc7990785b700lv64midjjgjnr7j6";
   };
   buildInputs = [ gettext kdelibs kde_baseapps ];
+  NIX_CFLAGS_COMPILE = "-fpermissive"; # fix build with newer gcc versions
   meta = {
     description = "Norton/Total Commander clone for KDE";
     license = "GPL";
diff --git a/pkgs/applications/networking/esniper/default.nix b/pkgs/applications/networking/esniper/default.nix
index 8208da621af0..50a2764d375c 100644
--- a/pkgs/applications/networking/esniper/default.nix
+++ b/pkgs/applications/networking/esniper/default.nix
@@ -4,11 +4,11 @@ stdenv.mkDerivation {
   name = "esniper-2.28.0";
 
   src = fetchurl {
-    url = "mirror://sourceforge/esniper/esniper-2-28-0.tgz";
+    url    = "mirror://sourceforge/esniper/esniper-2-28-0.tgz";
     sha256 = "c2b0ccb757616b32f2d6cf54a4a5e367405fa7bcd6e6ed11835fe4f8a06a016b";
   };
 
-  buildInputs = [openssl curl];
+  buildInputs = [ openssl curl ];
 
   # Add support for CURL_CA_BUNDLE variable.
   patches = [ ./find-ca-bundle.patch ];
@@ -19,12 +19,11 @@ stdenv.mkDerivation {
     chmod 555 "$out/bin/snipe"
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Simple, lightweight tool for sniping eBay auctions";
-    homepage = "http://esnipe.rsourceforge.net";
-    license = "GPLv2";
-
-    platforms = stdenv.lib.platforms.all;
-    maintainers = [ stdenv.lib.maintainers.simons ];
+    homepage    = http://esnipe.rsourceforge.net;
+    license     = licenses.gpl2;
+    maintainers = with maintainers; [ lovek323 simons ];
+    platforms   = platforms.all;
   };
 }
diff --git a/pkgs/applications/science/astronomy/celestia/default.nix b/pkgs/applications/science/astronomy/celestia/default.nix
index d7814aa5b78f..6f9de9d981f6 100644
--- a/pkgs/applications/science/astronomy/celestia/default.nix
+++ b/pkgs/applications/science/astronomy/celestia/default.nix
@@ -65,6 +65,8 @@ stdenv.mkDerivation {
     )
   '';
 
+  installPhase = ''make DESTDIR="$out" MKDIR_P="mkdir -p" install'';
+
   enableParallelBuilding = true;
 
   meta = {
diff --git a/pkgs/applications/version-management/git-and-tools/git/default.nix b/pkgs/applications/version-management/git-and-tools/git/default.nix
index dd8821711de1..dad607c14623 100644
--- a/pkgs/applications/version-management/git-and-tools/git/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git/default.nix
@@ -35,7 +35,8 @@ stdenv.mkDerivation {
   NIX_LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s";
 
   makeFlags = "prefix=\${out} sysconfdir=/etc/ PERL_PATH=${perl}/bin/perl SHELL_PATH=${stdenv.shell} "
-      + (if pythonSupport then "PYTHON_PATH=${python}/bin/python" else "NO_PYTHON=1");
+      + (if pythonSupport then "PYTHON_PATH=${python}/bin/python" else "NO_PYTHON=1")
+      + (if stdenv.isSunOS then " INSTALL=install NO_INET_NTOP= NO_INET_PTON=" else "");
 
   # FIXME: "make check" requires Sparse; the Makefile must be tweaked
   # so that `SPARSE_FLAGS' corresponds to the current architecture...
diff --git a/pkgs/applications/version-management/gource/default.nix b/pkgs/applications/version-management/gource/default.nix
index 3b6d19e8fcf2..13c554767743 100644
--- a/pkgs/applications/version-management/gource/default.nix
+++ b/pkgs/applications/version-management/gource/default.nix
@@ -16,6 +16,8 @@ stdenv.mkDerivation rec {
 
   configureFlags = "--with-boost-libdir=${boost}/lib";
 
+  NIX_CFLAGS_COMPILE = "-fpermissive"; # fix build with newer gcc versions
+
   meta = {
     homepage = "http://code.google.com/p/gource/";
     description = "software version control visualization tool";
diff --git a/pkgs/build-support/gcc-wrapper/builder.sh b/pkgs/build-support/gcc-wrapper/builder.sh
index ed7ad0a50b73..e7c3400e9f7f 100644
--- a/pkgs/build-support/gcc-wrapper/builder.sh
+++ b/pkgs/build-support/gcc-wrapper/builder.sh
@@ -66,13 +66,23 @@ else
     echo "$gccCFlags" > $out/nix-support/gcc-cflags
     
     gccPath="$gcc/bin"
-    ldPath="$binutils/bin"
+    # On Illumos/Solaris we might prefer native ld
+    if test -n "$nativePrefix"; then
+      ldPath="$nativePrefix/bin"
+    else
+      ldPath="$binutils/bin"
+    fi;
 fi
 
 
 doSubstitute() {
     local src=$1
     local dst=$2
+    local ld="$ldPath/ld"
+    if $ld -V 2>&1 |grep Solaris; then
+      # Use Solaris specific linker wrapper
+      ld="$out/bin/ld-solaris"
+    fi
     # Can't use substitute() here, because replace may not have been
     # built yet (in the bootstrap).
     sed \
@@ -85,7 +95,7 @@ doSubstitute() {
         -e "s^@binutils@^$binutils^g" \
         -e "s^@coreutils@^$coreutils^g" \
         -e "s^@libc@^$libc^g" \
-        -e "s^@ld@^$ldPath/ld^g" \
+        -e "s^@ld@^$ld^g" \
         < "$src" > "$dst" 
 }
 
@@ -174,6 +184,13 @@ ln -s $ldPath/as $out/bin/as
 doSubstitute "$ldWrapper" "$out/bin/ld"
 chmod +x "$out/bin/ld"
 
+# Copy solaris ld wrapper if needed
+if $ldPath/ld -V 2>&1 |grep Solaris; then
+  # Use Solaris specific linker wrapper
+  sed -e "s^@ld@^$ldPath/ld^g" < "$ldSolarisWrapper" > "$out/bin/ld-solaris"
+  chmod +x "$out/bin/ld-solaris"
+fi
+
 
 # Emit a setup hook.  Also store the path to the original GCC and
 # Glibc.
diff --git a/pkgs/build-support/gcc-wrapper/default.nix b/pkgs/build-support/gcc-wrapper/default.nix
index 992c0f9af371..58dde3485ca0 100644
--- a/pkgs/build-support/gcc-wrapper/default.nix
+++ b/pkgs/build-support/gcc-wrapper/default.nix
@@ -36,6 +36,7 @@ stdenv.mkDerivation {
   gnatWrapper = ./gnat-wrapper.sh;
   gnatlinkWrapper = ./gnatlink-wrapper.sh;
   ldWrapper = ./ld-wrapper.sh;
+  ldSolarisWrapper = ./ld-solaris-wrapper.sh;
   utils = ./utils.sh;
   addFlags = ./add-flags;
   
diff --git a/pkgs/build-support/gcc-wrapper/ld-solaris-wrapper.sh b/pkgs/build-support/gcc-wrapper/ld-solaris-wrapper.sh
new file mode 100644
index 000000000000..5a7b92b5ad7d
--- /dev/null
+++ b/pkgs/build-support/gcc-wrapper/ld-solaris-wrapper.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+set -e
+set -u
+
+# I've also tried adding -z direct and -z lazyload, but it gave too many problems with C++ exceptions :'(
+# Also made sure libgcc would not be lazy-loaded, as suggested here: https://www.illumos.org/issues/2534#note-3
+#   but still no success.
+cmd="@ld@ -z ignore"
+
+args=("$@");
+
+# This loop makes sure all -L arguments are before -l arguments, or ld may complain it cannot find a library.
+# GNU binutils does not have this problem:
+#   http://stackoverflow.com/questions/5817269/does-the-order-of-l-and-l-options-in-the-gnu-linker-matter
+i=0;
+while [[ $i -lt $# ]]; do
+    case "${args[$i]}" in
+        -L)  cmd="$cmd ${args[$i]} ${args[($i+1)]}"; i=($i+1); ;;
+        -L*) cmd="$cmd ${args[$i]}" ;;
+        *)   ;;
+    esac
+    i=($i+1);
+done
+
+i=0;
+while [[ $i -lt $# ]]; do
+    case "${args[$i]}" in
+        -L)  i=($i+1); ;;
+        -L*) ;;
+        *)   cmd="$cmd ${args[$i]}" ;;
+    esac
+    i=($i+1);
+done
+
+# Trace:
+set -x
+exec $cmd
+
+exit 0
diff --git a/pkgs/build-support/gcc-wrapper/setup-hook.sh b/pkgs/build-support/gcc-wrapper/setup-hook.sh
index 513ab8053a7e..298ade21d1f5 100644
--- a/pkgs/build-support/gcc-wrapper/setup-hook.sh
+++ b/pkgs/build-support/gcc-wrapper/setup-hook.sh
@@ -1,6 +1,6 @@
 addCVars () {
     if test -d $1/include; then
-        export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$1/include"
+        export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem $1/include"
     fi
 
     if test -d $1/lib64; then
diff --git a/pkgs/desktops/gnome-2/default.nix b/pkgs/desktops/gnome-2/default.nix
index e839d793365d..6a8f9d157787 100644
--- a/pkgs/desktops/gnome-2/default.nix
+++ b/pkgs/desktops/gnome-2/default.nix
@@ -1,4 +1,4 @@
-{ callPackage, self, stdenv, gettext, gvfs, libunique, overrides ? {} }:
+{ callPackage, self, stdenv, gettext, gvfs, libunique, bison2, overrides ? {} }:
 let overridden = set // overrides; set = with overridden; {
   # Backward compatibility.
   gtkdoc = self.gtk_doc;
@@ -19,7 +19,9 @@ let overridden = set // overrides; set = with overridden; {
 
   libglade = callPackage ./platform/libglade { };
 
-  libgnomeprint = callPackage ./platform/libgnomeprint { };
+  libgnomeprint = callPackage ./platform/libgnomeprint {
+    bison = bison2;
+  };
 
   libgnomeprintui = callPackage ./platform/libgnomeprintui { };
 
diff --git a/pkgs/development/compilers/gcc/4.2/default.nix b/pkgs/development/compilers/gcc/4.2/default.nix
index 68a174cc5797..69cac159d4a5 100644
--- a/pkgs/development/compilers/gcc/4.2/default.nix
+++ b/pkgs/development/compilers/gcc/4.2/default.nix
@@ -30,11 +30,11 @@ stdenv.mkDerivation {
       url = "mirror://gnu/gcc/gcc-${version}/gcc-fortran-${version}.tar.bz2";
       sha256 = "013yqiqhdavgxzjryvylgf3lcnknmw89fx41jf2v4899srn0bhkg";
     });
-    
+
   patches =
-    [./pass-cxxcpp.patch]
+    [./pass-cxxcpp.patch ./siginfo_t.patch]
     ++ optional noSysDirs [./no-sys-dirs.patch];
-    
+
   inherit noSysDirs profiledCompiler staticCompiler;
 
   buildInputs = [gmp mpfr texinfo];
diff --git a/pkgs/development/compilers/gcc/4.2/siginfo_t.patch b/pkgs/development/compilers/gcc/4.2/siginfo_t.patch
new file mode 100644
index 000000000000..bfb9f9753728
--- /dev/null
+++ b/pkgs/development/compilers/gcc/4.2/siginfo_t.patch
@@ -0,0 +1,15 @@
+https://bbs.archlinux.org/viewtopic.php?id=144949
+--- a/gcc/config/i386/linux-unwind.h	2011-01-03 20:52:22.000000000 +0000
++++ b/gcc/config/i386/linux-unwind.h	2012-07-06 12:23:51.562859470 +0100
+@@ -133,9 +133,9 @@
+     {
+       struct rt_sigframe {
+ 	int sig;
+-	struct siginfo *pinfo;
++	siginfo_t *pinfo;
+ 	void *puc;
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
diff --git a/pkgs/development/compilers/gcc/4.3/default.nix b/pkgs/development/compilers/gcc/4.3/default.nix
index 7dd5be781859..4446876ab1f8 100644
--- a/pkgs/development/compilers/gcc/4.3/default.nix
+++ b/pkgs/development/compilers/gcc/4.3/default.nix
@@ -29,7 +29,7 @@ assert langVhdl -> gnat != null;
 with stdenv.lib;
 
 let
-  version = "4.3.4";
+  version = "4.3.6";
 
   crossConfigureFlags =
     "--target=${cross.config}" +
@@ -54,27 +54,27 @@ in
 
 stdenv.mkDerivation ({
   name = "${name}-${version}" + crossNameAddon;
-  
+
   builder = ./builder.sh;
-  
+
   src =
     optional /*langC*/ true (fetchurl {
       url = "mirror://gcc/releases/gcc-${version}/gcc-core-${version}.tar.bz2";
-      sha256 = "1yk80nwyw8vkpw8d3x7lkg3zrv3ngjqlvj0i8zslzgj7a27q729i";
+      sha256 = "0ygrfw3hgp48hkqipbl9lw38f27npigc2sm6f01g9iswpq1igbw6";
     }) ++
     optional langCC (fetchurl {
       url = "mirror://gcc/releases/gcc-${version}/gcc-g++-${version}.tar.bz2";
-      sha256 = "0d8pyk5c9zmph25f4fl63vd8vhljj6ildbxpz2hr594g5i6pplpq";
+      sha256 = "105xz3991b57zx3146xwlpchdb2sjmlknclvi1iac2gawm4mhxhf";
     }) ++
     optional langFortran (fetchurl {
       url = "mirror://gcc/releases/gcc-${version}/gcc-fortran-${version}.tar.bz2";
-      sha256 = "1xf2njykv1qcgxiqwj693dxjf77ss1rcxirylvnsp5hs89mdlj12";
+      sha256 = "12bqvf53hvhrwjnh101vn9frb5g8cr98cra4f11dzhzs4ppydpi1";
     }) ++
     optional langJava (fetchurl {
       url = "mirror://gcc/releases/gcc-${version}/gcc-java-${version}.tar.bz2";
-      sha256 = "1v3krhxi3zyaqfj0x8dbxvg67fjp29cr1psyf71r9zf757p3vqsw";
+      sha256 = "03w6jln9gmdv149s774rlw4rzi2zhbqna54r86cd6mql8flmy7fs";
     });
-    
+
   patches =
     [ ./pass-cxxcpp.patch ./libmudflap-cpp.patch ./siginfo_t_fix.patch ]
     ++ optional noSysDirs ./no-sys-dirs.patch
diff --git a/pkgs/development/compilers/gcc/4.4/default.nix b/pkgs/development/compilers/gcc/4.4/default.nix
index 3ecaf5cb5d29..e81ca3983196 100644
--- a/pkgs/development/compilers/gcc/4.4/default.nix
+++ b/pkgs/development/compilers/gcc/4.4/default.nix
@@ -31,7 +31,7 @@ assert langVhdl     -> gnat != null;
 
 with stdenv.lib;
 
-let version = "4.4.6";
+let version = "4.4.7";
     javaEcj = fetchurl {
       # The `$(top_srcdir)/ecj.jar' file is automatically picked up at
       # `configure' time.
diff --git a/pkgs/development/compilers/gcc/4.4/sources.nix b/pkgs/development/compilers/gcc/4.4/sources.nix
index 357cc2634edc..5517e7c3b922 100644
--- a/pkgs/development/compilers/gcc/4.4/sources.nix
+++ b/pkgs/development/compilers/gcc/4.4/sources.nix
@@ -1,26 +1,26 @@
 /* Automatically generated by `update-gcc.sh', do not edit.
-   For GCC 4.4.6.  */
+   For GCC 4.4.7.  */
 { fetchurl, optional, version, langC, langCC, langFortran, langJava, langAda }:
 
-assert version == "4.4.6";
+assert version == "4.4.7";
 optional /* langC */ true (fetchurl {
   url = "mirror://gcc/releases/gcc-${version}/gcc-core-${version}.tar.bz2";
-  sha256 = "c2959820de3e42eee6b1d381586992f26430f0083b9a51db31d706080fc9b44a";
+  sha256 = "c4663b7023909a4a075d3c2b2e17f6e082a9625aebfd0ce7f1d7817e44bf5542";
 }) ++
 optional langCC (fetchurl {
   url = "mirror://gcc/releases/gcc-${version}/gcc-g++-${version}.tar.bz2";
-  sha256 = "6d5d2dacab9569472e4caa291abe94017a9b19574b9b0d866de7b04702634ddf";
+  sha256 = "1882ff29be51eeb3fb349cbcda9df200a5c3cd20c97dd1d593101e0998b3c469";
 }) ++
 optional langFortran (fetchurl {
   url = "mirror://gcc/releases/gcc-${version}/gcc-fortran-${version}.tar.bz2";
-  sha256 = "2b9998716a16b80f4cf843ce81da1cf58ce116e0b85422e3004ce4454e8ff923";
+  sha256 = "545a1e8e97d9364de4408c6a91830f9051ce24b4fbfbfdc56e72c7b4be17ebdd";
 }) ++
 optional langJava (fetchurl {
   url = "mirror://gcc/releases/gcc-${version}/gcc-java-${version}.tar.bz2";
-  sha256 = "7c8c12eac21d2a5c605ea4d9b7aa52e482354205b801bc93d62603b6f0956b35";
+  sha256 = "3c31ddd80f945b797d8d4ed7761426c26343781c361ec1b33bcea9874cc4c6c0";
 }) ++
 optional langAda (fetchurl {
   url = "mirror://gcc/releases/gcc-${version}/gcc-ada-${version}.tar.bz2";
-  sha256 = "771ef0e90abf61208ce84689bed15391ad249287e36a28e816d6a044035af0c6";
+  sha256 = "fb9f30b85d48838390554b948d137487f0db09ad5f8ba73ca4d7ca35765c6ed8";
 }) ++
 []
diff --git a/pkgs/development/compilers/gcc/4.4/update-gcc.sh b/pkgs/development/compilers/gcc/4.4/update-gcc.sh
index 6b0bbb993309..03297fbadd64 100755
--- a/pkgs/development/compilers/gcc/4.4/update-gcc.sh
+++ b/pkgs/development/compilers/gcc/4.4/update-gcc.sh
@@ -21,7 +21,7 @@ options["g++"]="langCC"
 options["fortran"]="langFortran"
 options["java"]="langJava"
 options["ada"]="langAda"
-options["go"]="langGo"
+#options["go"]="langGo"
 
 cat > "$out"<<EOF
 /* Automatically generated by \`$(basename $0)', do not edit.
@@ -32,7 +32,7 @@ cat > "$out"<<EOF
 assert version == "${version}";
 EOF
 
-for component in core g++ fortran java ada go
+for component in core g++ fortran java ada #go
 do
     dir="ftp.gnu.org/gnu/gcc/gcc-${version}"
     file="gcc-${component}-${version}.tar.bz2"
diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix
index e63ff7947f66..9713164711f1 100644
--- a/pkgs/development/compilers/gcc/4.5/default.nix
+++ b/pkgs/development/compilers/gcc/4.5/default.nix
@@ -212,7 +212,7 @@ stdenv.mkDerivation ({
     ++ (optional (ppl != null) ppl)
     ++ (optional (cloogppl != null) cloogppl)
     ++ (optional (zlib != null) zlib)
-    ++ (optional (boehmgc != null) boehmgc)
+    ++ (optional langJava boehmgc)
     ++ (optionals langJava [zip unzip])
     ++ (optionals javaAwtGtk ([gtk pkgconfig libart_lgpl] ++ xlibs))
     ++ (optionals (cross != null) [binutilsCross])
diff --git a/pkgs/development/compilers/gcc/4.6/default.nix b/pkgs/development/compilers/gcc/4.6/default.nix
index 35255d0af5bd..796fc8fde530 100644
--- a/pkgs/development/compilers/gcc/4.6/default.nix
+++ b/pkgs/development/compilers/gcc/4.6/default.nix
@@ -434,7 +434,7 @@ stdenv.mkDerivation ({
   passthru = { inherit langC langCC langAda langFortran langVhdl
       langGo version; };
 
-  enableParallelBuilding = !langAda;
+  enableParallelBuilding = false;
 
   inherit (stdenv) is64bit;
 
diff --git a/pkgs/development/compilers/gcc/4.7/build-race.patch b/pkgs/development/compilers/gcc/4.7/build-race.patch
deleted file mode 100644
index 4d7607076d66..000000000000
--- a/pkgs/development/compilers/gcc/4.7/build-race.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- gcc-4.7.3/gcc/Makefile.in	2013-04-01 10:11:11.000000000 +0200
-+++ gcc-4.7.3/gcc/Makefile.in.new	2014-01-14 00:55:31.056406483 +0100
-@@ -3904,7 +3904,7 @@
-   $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
- build/gengenrtl.o : gengenrtl.c $(BCONFIG_H) $(SYSTEM_H) rtl.def
- gengtype-lex.o build/gengtype-lex.o : gengtype-lex.c gengtype.h $(SYSTEM_H)
--gengtype-lex.o: $(CONFIG_H)
-+gengtype-lex.o: $(CONFIG_H) $(BCONFIG_H)
- build/gengtype-lex.o: $(BCONFIG_H)
- gengtype-parse.o build/gengtype-parse.o : gengtype-parse.c gengtype.h \
-   $(SYSTEM_H)
diff --git a/pkgs/development/compilers/gcc/4.7/arm-eabi.patch b/pkgs/development/compilers/gcc/4.8/arm-eabi.patch
index 63b017062b5b..63b017062b5b 100644
--- a/pkgs/development/compilers/gcc/4.7/arm-eabi.patch
+++ b/pkgs/development/compilers/gcc/4.8/arm-eabi.patch
diff --git a/pkgs/development/compilers/gcc/4.7/builder.sh b/pkgs/development/compilers/gcc/4.8/builder.sh
index 37400fba5bf5..b781fa6c7ef6 100644
--- a/pkgs/development/compilers/gcc/4.7/builder.sh
+++ b/pkgs/development/compilers/gcc/4.8/builder.sh
@@ -33,7 +33,7 @@ if test "$noSysDirs" = "1"; then
 
         # The path to the Glibc binaries such as `crti.o'.
         glibc_libdir="$(cat $NIX_GCC/nix-support/orig-libc)/lib"
-        
+
     else
         # Hack: support impure environments.
         extraFlags="-isystem /usr/include"
@@ -50,10 +50,10 @@ if test "$noSysDirs" = "1"; then
     # bootstrap compiler are optimized and (optionally) contain
     # debugging information (info "(gccinstall) Building").
     if test -n "$dontStrip"; then
-	extraFlags="-O2 -g $extraFlags"
+        extraFlags="-O2 -g $extraFlags"
     else
-	# Don't pass `-g' at all; this saves space while building.
-	extraFlags="-O2 $extraFlags"
+        # Don't pass `-g' at all; this saves space while building.
+        extraFlags="-O2 $extraFlags"
     fi
 
     EXTRA_FLAGS="$extraFlags"
@@ -155,7 +155,7 @@ if test -n "$targetConfig"; then
     dontStrip=1
 fi
 
-
+providedPreConfigure="$preConfigure";
 preConfigure() {
     if test -n "$newlibSrc"; then
         tar xvf "$newlibSrc" -C ..
@@ -188,6 +188,9 @@ preConfigure() {
         configureFlags="$configureFlags --with-build-sysroot=`pwd`/.."
     fi
 
+    # Eval the preConfigure script from nix expression.
+    eval $providedPreConfigure;
+    env;
     # Perform the build in a different directory.
     mkdir ../build
     cd ../build
@@ -210,7 +213,7 @@ postInstall() {
     # previous gcc.
     rm -rf $out/libexec/gcc/*/*/install-tools
     rm -rf $out/lib/gcc/*/*/install-tools
-    
+
     # More dependencies with the previous gcc or some libs (gccbug stores the build command line)
     rm -rf $out/bin/gccbug
     # Take out the bootstrap-tools from the rpath, as it's not needed at all having $out
diff --git a/pkgs/development/compilers/gcc/4.7/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix
index da2d8c33161f..01c886739d8c 100644
--- a/pkgs/development/compilers/gcc/4.7/default.nix
+++ b/pkgs/development/compilers/gcc/4.8/default.nix
@@ -11,7 +11,7 @@
 , perl ? null # optional, for texi2pod (then pod2man); required for Java
 , gmp, mpfr, mpc, gettext, which
 , libelf                      # optional, for link-time optimizations (LTO)
-, ppl ? null, cloog ? null # optional, for the Graphite optimization framework.
+, ppl ? null, cloog ? null, isl ? null # optional, for the Graphite optimization framework.
 , zlib ? null, boehmgc ? null
 , zip ? null, unzip ? null, pkgconfig ? null, gtk ? null, libart_lgpl ? null
 , libX11 ? null, libXt ? null, libSM ? null, libICE ? null, libXtst ? null
@@ -37,6 +37,9 @@ assert langJava     -> zip != null && unzip != null
 assert langAda      -> gnatboot != null;
 assert langVhdl     -> gnat != null;
 
+# We enable the isl cloog backend.
+assert cloog != null -> isl != null;
+
 # LTO needs libelf and zlib.
 assert libelf != null -> zlib != null;
 
@@ -49,14 +52,19 @@ assert langGo -> langCC;
 with stdenv.lib;
 with builtins;
 
-let version = "4.7.3";
+let version = "4.8.2";
 
     # Whether building a cross-compiler for GNU/Hurd.
     crossGNU = cross != null && cross.config == "i586-pc-gnu";
 
-    patches = [
-      ./build-race.patch
-    ] ++ optional stdenv.isArm [ ./arm-eabi.patch ]
+  /* gccinstall.info says that "parallel make is currently not supported since
+     collisions in profile collecting may occur".
+  */
+    enableParallelBuilding = !profiledCompiler;
+
+    patches = []
+      ++ optional stdenv.isArm ./arm-eabi.patch
+      ++ optional enableParallelBuilding ./parallel-bconfig.patch
       ++ optional (cross != null) ./libstdc++-target.patch
       # ++ optional noSysDirs ./no-sys-dirs.patch
       # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
@@ -89,35 +97,35 @@ let version = "4.7.3";
 
     /* Platform flags */
     platformFlags = let
-        gccArch = stdenv.lib.attrByPath [ "platform" "gcc" "arch" ] null stdenv;
-        gccCpu = stdenv.lib.attrByPath [ "platform" "gcc" "cpu" ] null stdenv;
-        gccAbi = stdenv.lib.attrByPath [ "platform" "gcc" "abi" ] null stdenv;
-        gccFpu = stdenv.lib.attrByPath [ "platform" "gcc" "fpu" ] null stdenv;
-        gccFloat = stdenv.lib.attrByPath [ "platform" "gcc" "float" ] null stdenv;
-        gccMode = stdenv.lib.attrByPath [ "platform" "gcc" "mode" ] null stdenv;
+        gccArch = stdenv.platform.gcc.arch or null;
+        gccCpu = stdenv.platform.gcc.cpu or null;
+        gccAbi = stdenv.platform.gcc.abi or null;
+        gccFpu = stdenv.platform.gcc.fpu or null;
+        gccFloat = stdenv.platform.gcc.float or null;
+        gccMode = stdenv.platform.gcc.mode or null;
         withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
         withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
         withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
         withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
         withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
         withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
-      in 
-        (withArch +
+      in
+        withArch +
         withCpu +
         withAbi +
         withFpu +
         withFloat +
-        withMode);
+        withMode;
 
     /* Cross-gcc settings */
     crossMingw = (cross != null && cross.libc == "msvcrt");
     crossConfigureFlags = let
-        gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null cross;
-        gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null cross;
-        gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null cross;
-        gccFpu = stdenv.lib.attrByPath [ "gcc" "fpu" ] null cross;
-        gccFloat = stdenv.lib.attrByPath [ "gcc" "float" ] null cross;
-        gccMode = stdenv.lib.attrByPath [ "gcc" "mode" ] null cross;
+        gccArch = stdenv.cross.gcc.arch or null;
+        gccCpu = stdenv.cross.gcc.cpu or null;
+        gccAbi = stdenv.cross.gcc.abi or null;
+        gccFpu = stdenv.cross.gcc.fpu or null;
+        gccFloat = stdenv.cross.gcc.float or null;
+        gccMode = stdenv.cross.gcc.mode or null;
         withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
         withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
         withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
@@ -180,8 +188,7 @@ let version = "4.7.3";
             " --enable-nls" +
             " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
           );
-    stageNameAddon = if crossStageStatic then "-stage-static" else
-      "-stage-final";
+    stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
     crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
 
   bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips;
@@ -198,7 +205,7 @@ stdenv.mkDerivation ({
 
   src = fetchurl {
     url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2";
-    sha256 = "1hx9h64ivarlzi4hxvq42as5m9vlr5cyzaaq4gzj4i619zmkfz1g";
+    sha256 = "1j6dwgby4g3p3lz7zkss32ghr45zpdidrg8xvazvn91lqxv25p09";
   };
 
   inherit patches;
@@ -267,6 +274,7 @@ stdenv.mkDerivation ({
   buildInputs = [ gmp mpfr mpc libelf ]
     ++ (optional (ppl != null) ppl)
     ++ (optional (cloog != null) cloog)
+    ++ (optional (isl != null) isl)
     ++ (optional (zlib != null) zlib)
     ++ (optionals langJava [ boehmgc zip unzip ])
     ++ (optionals javaAwtGtk ([ gtk libart_lgpl ] ++ xlibs))
@@ -279,22 +287,42 @@ stdenv.mkDerivation ({
     ++ (optional stdenv.isDarwin gnused)
     ;
 
-  configureFlagsArray = stdenv.lib.optionals
-    (ppl != null && ppl ? dontDisableStatic && ppl.dontDisableStatic)
-        [ "--with-host-libstdcxx=-lstdc++ -lgcc_s" ];
+  NIX_LDFLAGS = stdenv.lib.optionalString  stdenv.isSunOS "-lm -ldl";
+
+  preConfigure = ''
+    configureFlagsArray=(
+      ${stdenv.lib.optionalString (ppl != null && ppl ? dontDisableStatic && ppl.dontDisableStatic)
+        "'--with-host-libstdcxx=-lstdc++ -lgcc_s'"}
+      ${stdenv.lib.optionalString (ppl != null && stdenv.isSunOS)
+        "\"--with-host-libstdcxx=-Wl,-rpath,\$prefix/lib/amd64 -lstdc++\"
+         \"--with-boot-ldflags=-L../prev-x86_64-pc-solaris2.11/libstdc++-v3/src/.libs\""}
+    );
+    ${stdenv.lib.optionalString (stdenv.isSunOS && stdenv.is64bit)
+      ''
+        export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
+        export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
+        export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
+        export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
+      ''}
+    '';
 
   # 'iant' at #go-nuts@freenode, gccgo maintainer, said that
   # they have a bug in 4.7.1 if adding "--disable-static"
-  dontDisableStatic = langGo;
+  dontDisableStatic = langGo || staticCompiler;
 
   configureFlags = "
+    ${if stdenv.isSunOS then
+      " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
+      # On Illumos/Solaris GNU as is preferred
+      " --with-gnu-as --without-gnu-ld "
+      else ""}
+    --enable-lto
     ${if enableMultilib then "" else "--disable-multilib"}
     ${if enableShared then "" else "--disable-shared"}
-    ${if enablePlugin then "--enable-plugin" else ""}
-    ${if ppl != null then "--with-ppl=${ppl}" else ""}
-    ${if cloog != null then
-      "--with-cloog=${cloog} --enable-cloog-backend=isl"
-      else ""}
+    ${if enablePlugin then "--enable-plugin" else "--disable-plugin"}
+    ${if ppl != null then "--with-ppl=${ppl} --disable-ppl-version-check" else ""}
+    ${optionalString (isl != null) "--with-isl=${isl}"}
+    ${optionalString (cloog != null) "--with-cloog=${cloog} --disable-cloog-version-check --enable-cloog-backend=isl"}
     ${if langJava then
       "--with-ecj-jar=${javaEcj} " +
 
@@ -345,11 +373,11 @@ stdenv.mkDerivation ({
     else "install";
 
   crossAttrs = let
-    xgccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null stdenv.cross;
-    xgccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null stdenv.cross;
-    xgccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null stdenv.cross;
-    xgccFpu = stdenv.lib.attrByPath [ "gcc" "fpu" ] null stdenv.cross;
-    xgccFloat = stdenv.lib.attrByPath [ "gcc" "float" ] null stdenv.cross;
+    xgccArch = stdenv.cross.gcc.arch or null;
+    xgccCpu = stdenv.cross.gcc.cpu or null;
+    xgccAbi = stdenv.cross.gcc.abi or null;
+    xgccFpu = stdenv.cross.gcc.fpu or null;
+    xgccFloat = stdenv.cross.gcc.float or null;
     xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else "";
     xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else "";
     xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else "";
@@ -408,7 +436,8 @@ stdenv.mkDerivation ({
   # Needed for the cross compilation to work
   AR = "ar";
   LD = "ld";
-  CC = "gcc";
+  # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
+  CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc";
 
   # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find
   # the library headers and binaries, regarless of the language being
@@ -432,8 +461,7 @@ stdenv.mkDerivation ({
 
                                    # On GNU/Hurd glibc refers to Mach & Hurd
                                    # headers.
-                                   ++ optionals (libcCross != null &&
-                                                 hasAttr "propagatedBuildInputs" libcCross)
+                                   ++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs" )
                                         libcCross.propagatedBuildInputs)));
 
   LIBRARY_PATH = concatStrings
@@ -456,14 +484,10 @@ stdenv.mkDerivation ({
            " -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}")
     else null;
 
-  passthru = { inherit langC langCC langAda langFortran langVhdl
-      langGo enableMultilib version; };
+  passthru =
+    { inherit langC langCC langAda langFortran langVhdl langGo enableMultilib version; };
 
-  /* From gccinstall.info:
-     "parallel make is currently not supported since collisions in profile
-     collecting may occur"
-  */
-  enableParallelBuilding = !profiledCompiler;
+  inherit enableParallelBuilding;
 
   meta = {
     homepage = http://gcc.gnu.org/;
@@ -480,11 +504,7 @@ stdenv.mkDerivation ({
       compiler used in the GNU system including the GNU/Linux variant.
     '';
 
-    maintainers = [
-      stdenv.lib.maintainers.ludo
-      stdenv.lib.maintainers.viric
-      stdenv.lib.maintainers.shlevy
-    ];
+    maintainers = with stdenv.lib.maintainers; [ ludo viric shlevy simons ];
 
     # Volunteers needed for the {Cyg,Dar}win ports of *PPL.
     # gnatboot is not available out of linux platforms, so we disable the darwin build
diff --git a/pkgs/development/compilers/gcc/4.7/gfortran-driving.patch b/pkgs/development/compilers/gcc/4.8/gfortran-driving.patch
index 70708886b405..70708886b405 100644
--- a/pkgs/development/compilers/gcc/4.7/gfortran-driving.patch
+++ b/pkgs/development/compilers/gcc/4.8/gfortran-driving.patch
diff --git a/pkgs/development/compilers/gcc/4.7/gnat-cflags.patch b/pkgs/development/compilers/gcc/4.8/gnat-cflags.patch
index bf2acf065e9b..bf2acf065e9b 100644
--- a/pkgs/development/compilers/gcc/4.7/gnat-cflags.patch
+++ b/pkgs/development/compilers/gcc/4.8/gnat-cflags.patch
diff --git a/pkgs/development/compilers/gcc/4.7/java-jvgenmain-link.patch b/pkgs/development/compilers/gcc/4.8/java-jvgenmain-link.patch
index 2612e8bfbbbc..2612e8bfbbbc 100644
--- a/pkgs/development/compilers/gcc/4.7/java-jvgenmain-link.patch
+++ b/pkgs/development/compilers/gcc/4.8/java-jvgenmain-link.patch
diff --git a/pkgs/development/compilers/gcc/4.7/libstdc++-target.patch b/pkgs/development/compilers/gcc/4.8/libstdc++-target.patch
index fb622b395806..fb622b395806 100644
--- a/pkgs/development/compilers/gcc/4.7/libstdc++-target.patch
+++ b/pkgs/development/compilers/gcc/4.8/libstdc++-target.patch
diff --git a/pkgs/development/compilers/gcc/4.7/no-sys-dirs.patch b/pkgs/development/compilers/gcc/4.8/no-sys-dirs.patch
index 79901703cb82..79901703cb82 100644
--- a/pkgs/development/compilers/gcc/4.7/no-sys-dirs.patch
+++ b/pkgs/development/compilers/gcc/4.8/no-sys-dirs.patch
diff --git a/pkgs/development/compilers/gcc/4.8/parallel-bconfig.patch b/pkgs/development/compilers/gcc/4.8/parallel-bconfig.patch
new file mode 100644
index 000000000000..bc56ac698f5a
--- /dev/null
+++ b/pkgs/development/compilers/gcc/4.8/parallel-bconfig.patch
@@ -0,0 +1,32 @@
+Hacky work-around for highly parallel builds.
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57125
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index aad927c..182f666 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -3908,21 +3908,21 @@ build/gengtype-lex.o: $(BCONFIG_H)
+ 
+ gengtype-parse.o build/gengtype-parse.o : gengtype-parse.c gengtype.h \
+   $(SYSTEM_H)
+-gengtype-parse.o: $(CONFIG_H)
++gengtype-parse.o: $(CONFIG_H) $(BCONFIG_H)
+ CFLAGS-gengtype-parse.o += -DGENERATOR_FILE
+ build/gengtype-parse.o: $(BCONFIG_H)
+ 
+ gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \
+   gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \
+   $(XREGEX_H)
+-gengtype-state.o: $(CONFIG_H)
++gengtype-state.o: $(CONFIG_H) $(BCONFIG_H)
+ CFLAGS-gengtype-state.o += -DGENERATOR_FILE
+ build/gengtype-state.o: $(BCONFIG_H)
+ 
+ gengtype.o build/gengtype.o : gengtype.c $(SYSTEM_H) gengtype.h 	\
+   rtl.def insn-notes.def errors.h double-int.h version.h $(HASHTAB_H) \
+   $(OBSTACK_H) $(XREGEX_H)
+-gengtype.o: $(CONFIG_H)
++gengtype.o: $(CONFIG_H) $(BCONFIG_H)
+ CFLAGS-gengtype.o += -DGENERATOR_FILE
+ build/gengtype.o: $(BCONFIG_H)
+ 
diff --git a/pkgs/development/compilers/ghc/7.6.3.nix b/pkgs/development/compilers/ghc/7.6.3.nix
index 427d21660b89..9135741e9f04 100644
--- a/pkgs/development/compilers/ghc/7.6.3.nix
+++ b/pkgs/development/compilers/ghc/7.6.3.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ ghc perl gmp ncurses ];
 
-  enableParallelBuilding = true;
+  enableParallelBuilding = false; # the same errors as 7.6.1
 
   buildMK = ''
     libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp}/lib"
diff --git a/pkgs/development/compilers/ghc/ghc-get-packages.sh b/pkgs/development/compilers/ghc/ghc-get-packages.sh
deleted file mode 100755
index 9ed1455d2321..000000000000
--- a/pkgs/development/compilers/ghc/ghc-get-packages.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#! /bin/sh
-# Usage:
-#  $1: version of GHC
-#  $2: invocation path of GHC
-#  $3: prefix
-version="$1"
-if test -z "$3"; then
-  prefix="-package-conf "
-else
-  prefix="$3"
-fi
-PATH="$2:$PATH"
-IFS=":"
-for p in $PATH; do
-  PkgDir="$p/../lib/ghc-pkgs/ghc-$version"
-  for i in $PkgDir/*.installedconf; do
-    # output takes place here
-    test -f $i && echo -n " $prefix$i"
-  done
-done
-test -f "$2/../lib/ghc-$version/package.conf" && echo -n " $prefix$2/../lib/ghc-$version/package.conf"
diff --git a/pkgs/development/compilers/llvm/3.3/llvm.nix b/pkgs/development/compilers/llvm/3.3/llvm.nix
new file mode 100644
index 000000000000..e40014a960c4
--- /dev/null
+++ b/pkgs/development/compilers/llvm/3.3/llvm.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl, perl, groff, cmake, python, libffi, binutils }:
+let
+  version = "3.3";
+in stdenv.mkDerivation rec {
+  name = "llvm-${version}";
+
+  src = fetchurl {
+    url = "http://llvm.org/releases/${version}/llvm-${version}.src.tar.gz";
+    sha256 = "0y3mfbb5qzcpw3v5qncn69x1hdrrrfirgs82ypi2annhf0g6nxk8";
+  };
+
+  patches = [
+    ./more-memory-for-bugpoint.patch # The default rlimits in 3.3 are too low for shared libraries.
+    ./no-rule-aarch64.patch          # http://llvm.org/bugs/show_bug.cgi?id=16625
+  ];
+
+  buildInputs = [ perl groff cmake python libffi ];
+
+  # hacky fix: created binaries need to be run before installation
+  preBuild = let LD = if stdenv.isDarwin then "DYLD" else "LD";
+    in "export ${LD}_LIBRARY_PATH='$$${LD}_LIBRARY_PATH:'`pwd`/lib";
+
+  cmakeFlags = with stdenv; [
+    "-DCMAKE_BUILD_TYPE=Release"
+    "-DLLVM_ENABLE_FFI=ON"
+    "-DLLVM_BINUTILS_INCDIR=${binutils}/include"
+    "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=R600" # for mesa
+  ] ++ stdenv.lib.optional (!isDarwin) "-DBUILD_SHARED_LIBS=ON";
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  meta = with stdenv.lib; {
+    description = "Collection of modular and reusable compiler and toolchain technologies";
+    homepage    = http://llvm.org/;
+    license     = licenses.bsd3;
+    maintainers = with maintainers; [ lovek323 raskin viric ];
+    platforms   = platforms.all;
+  };
+}
diff --git a/pkgs/development/compilers/llvm/more-memory-for-bugpoint.patch b/pkgs/development/compilers/llvm/3.3/more-memory-for-bugpoint.patch
index fa19ce4f5871..fa19ce4f5871 100644
--- a/pkgs/development/compilers/llvm/more-memory-for-bugpoint.patch
+++ b/pkgs/development/compilers/llvm/3.3/more-memory-for-bugpoint.patch
diff --git a/pkgs/development/compilers/llvm/3.3/no-rule-aarch64.patch b/pkgs/development/compilers/llvm/3.3/no-rule-aarch64.patch
new file mode 100644
index 000000000000..ea7214febe5a
--- /dev/null
+++ b/pkgs/development/compilers/llvm/3.3/no-rule-aarch64.patch
@@ -0,0 +1,8 @@
+--- llvm/lib/Target/AArch64/Utils/CMakeLists.txt	2013/05/18 04:32:15	182189
++++ llvm/lib/Target/AArch64/Utils/CMakeLists.txt	2013/05/18 08:17:47	182190
+@@ -3,3 +3,5 @@
+ add_llvm_library(LLVMAArch64Utils
+   AArch64BaseInfo.cpp
+   )
++
++add_dependencies(LLVMAArch64Utils AArch64CommonTableGen)
diff --git a/pkgs/development/compilers/llvm/3.4/clang-separate-build.patch b/pkgs/development/compilers/llvm/3.4/clang-separate-build.patch
new file mode 100644
index 000000000000..5fb67f169f45
--- /dev/null
+++ b/pkgs/development/compilers/llvm/3.4/clang-separate-build.patch
@@ -0,0 +1,8 @@
+diff -Naur clang-3.4-orig/tools/extra/CMakeLists.txt clang-3.4/tools/extra/CMakeLists.txt
+--- clang-3.4-orig/tools/extra/CMakeLists.txt	2013-11-07 19:08:23.000000000 -0500
++++ clang-3.4/tools/extra/CMakeLists.txt	2014-01-20 11:47:22.678435223 -0500
+@@ -1,3 +1,4 @@
++include(CheckLibraryExists)
+ check_library_exists(edit el_init "" HAVE_LIBEDIT)
+ 
+ add_subdirectory(clang-apply-replacements)
diff --git a/pkgs/development/compilers/llvm/3.4/clang.nix b/pkgs/development/compilers/llvm/3.4/clang.nix
new file mode 100644
index 000000000000..6f174a411cbe
--- /dev/null
+++ b/pkgs/development/compilers/llvm/3.4/clang.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetch, cmake, libxml2, libedit, llvm, version }:
+
+stdenv.mkDerivation {
+  name = "clang-${version}";
+
+  unpackPhase = ''
+    unpackFile ${fetch "clang" "06rb4j1ifbznl3gfhl98s7ilj0ns01p7y7zap4p7ynmqnc6pia92"}
+    mv clang-${version} clang
+    sourceRoot=$PWD/clang
+    unpackFile ${fetch "clang-tools-extra" "1d1822mwxxl9agmyacqjw800kzz5x8xr0sdmi8fgx5xfa5sii1ds"}
+    mv clang-tools-extra-${version} $sourceRoot/tools/extra
+    # !!! Hopefully won't be needed for 3.5
+    unpackFile ${llvm.src}
+    export cmakeFlags="$cmakeFlags -DCLANG_PATH_TO_LLVM_SOURCE=$PWD/llvm-${version}"
+    (cd llvm-${version} && patch -Np1 -i ${./llvm-separate-build.patch})
+  '';
+
+  patches = [ ./clang-separate-build.patch ];
+
+  buildInputs = [ cmake libedit libxml2 ];
+
+  cmakeFlags = [
+    "-DCMAKE_BUILD_TYPE=Release"
+    "-DCMAKE_CXX_FLAGS=-std=c++11"
+    "-DCLANG_PATH_TO_LLVM_BUILD=${llvm}"
+  ] ++
+  (stdenv.lib.optional (stdenv.gcc.libc != null) "-DC_INCLUDE_DIRS=${stdenv.gcc.libc}/include") ++
+  (stdenv.lib.optional (stdenv.gcc.gcc != null) "-DGCC_INSTALL_PREFIX=${stdenv.gcc.gcc}");
+
+  passthru.gcc = stdenv.gcc.gcc;
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
+    homepage    = http://llvm.org/;
+    license     = stdenv.lib.licenses.bsd3;
+    maintainers = [ stdenv.lib.maintainers.shlevy ];
+    platforms   = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/development/compilers/llvm/3.4/default.nix b/pkgs/development/compilers/llvm/3.4/default.nix
new file mode 100644
index 000000000000..0a8a72f59a96
--- /dev/null
+++ b/pkgs/development/compilers/llvm/3.4/default.nix
@@ -0,0 +1,25 @@
+{ newScope, stdenv, isl, fetchurl }:
+let
+  callPackage = newScope (self // { inherit stdenv isl version fetch; });
+
+  version = "3.4";
+
+  fetch = name: sha256: fetchurl {
+    url = "http://llvm.org/releases/${version}/${name}-${version}.src.tar.gz";
+    inherit sha256;
+  };
+
+  self = {
+    llvm = callPackage ./llvm.nix {};
+
+    clang = callPackage ./clang.nix {};
+
+    lld = callPackage ./lld.nix {};
+
+    lldb = callPackage ./lldb.nix {};
+
+    polly = callPackage ./polly.nix {};
+
+    dragonegg = callPackage ./dragonegg.nix {};
+  };
+in self
diff --git a/pkgs/development/compilers/llvm/dragonegg.nix b/pkgs/development/compilers/llvm/3.4/dragonegg.nix
index 38d3546d9819..f8ea44793de0 100644
--- a/pkgs/development/compilers/llvm/dragonegg.nix
+++ b/pkgs/development/compilers/llvm/3.4/dragonegg.nix
@@ -1,13 +1,9 @@
-{stdenv, fetchurl, llvm, gmp, mpfr, mpc, ncurses, zlib}:
+{stdenv, fetch, llvm, gmp, mpfr, mpc, ncurses, zlib, version}:
 
 stdenv.mkDerivation rec {
-  version = "3.4";
   name = "dragonegg-${version}";
 
-  src = fetchurl {
-    url = "http://llvm.org/releases/${version}/${name}.src.tar.gz";
-    sha256 = "1733czbvby1ww3xkwcwmm0km0bpwhfyxvf56wb0zv5gksp3kbgrl";
-  };
+  src = fetch "dragonegg" "1733czbvby1ww3xkwcwmm0km0bpwhfyxvf56wb0zv5gksp3kbgrl";
 
   # The gcc the plugin will be built for (the same used building dragonegg)
   GCC = "gcc";
@@ -24,7 +20,7 @@ stdenv.mkDerivation rec {
     homepage = http://dragonegg.llvm.org/;
     description = "gcc plugin that replaces gcc's optimizers and code generators by those in LLVM";
     license = "GPLv2+";
-    maintainers = with stdenv.lib.maintainers; [viric];
+    maintainers = with stdenv.lib.maintainers; [viric shlevy];
     platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/development/compilers/llvm/3.4/lld.nix b/pkgs/development/compilers/llvm/3.4/lld.nix
new file mode 100644
index 000000000000..22eb02a0e35b
--- /dev/null
+++ b/pkgs/development/compilers/llvm/3.4/lld.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetch, cmake, llvm, ncurses, zlib, python, version }:
+
+stdenv.mkDerivation {
+  name = "lld-${version}";
+
+  src = fetch "lld" "1sd4scqynryfrmcc4h0ljgwn2dgjmbbmf38z50ya6l0janpd2nxz";
+
+  preUnpack = ''
+    # !!! Hopefully won't be needed for 3.5
+    unpackFile ${llvm.src}
+    export cmakeFlags="$cmakeFlags -DLLD_PATH_TO_LLVM_SOURCE=$PWD/llvm-${version}"
+  '';
+
+  buildInputs = [ cmake ncurses zlib python ];
+
+  cmakeFlags = [
+    "-DCMAKE_BUILD_TYPE=Release"
+    "-DCMAKE_CXX_FLAGS=-std=c++11"
+    "-DLLD_PATH_TO_LLVM_BUILD=${llvm}"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "A set of modular code for creating linker tools";
+    homepage    = http://llvm.org/;
+    license     = stdenv.lib.licenses.bsd3;
+    maintainers = [ stdenv.lib.maintainers.shlevy ];
+    platforms   = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/development/compilers/llvm/3.4/lldb.nix b/pkgs/development/compilers/llvm/3.4/lldb.nix
new file mode 100644
index 000000000000..7b35119a93fb
--- /dev/null
+++ b/pkgs/development/compilers/llvm/3.4/lldb.nix
@@ -0,0 +1,44 @@
+{ stdenv
+, fetch
+, cmake
+, zlib
+, ncurses
+, swig
+, which
+, libedit
+, llvm
+, clang
+, python
+, version
+}:
+
+stdenv.mkDerivation {
+  name = "lldb-${version}";
+
+  src = fetch "lldb" "0h8cmjrhjhigk7k2qll1pcf6jfgmbdzkzfz2i048pkfg851s0x4g";
+
+  patchPhase = ''
+    sed -i 's|/usr/bin/env||' \
+      scripts/Python/finish-swig-Python-LLDB.sh \
+      scripts/Python/build-swig-Python.sh
+  '';
+
+  buildInputs = [ cmake python which swig ncurses zlib libedit ];
+
+  cmakeFlags = [
+    "-DCMAKE_BUILD_TYPE=Release"
+    "-DCMAKE_CXX_FLAGS=-std=c++11"
+    "-DLLDB_PATH_TO_LLVM_BUILD=${llvm}"
+    "-DLLDB_PATH_TO_CLANG_BUILD=${clang}"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "A next-generation high-performance debugger";
+    homepage    = http://llvm.org/;
+    license     = stdenv.lib.licenses.bsd3;
+    maintainers = [ stdenv.lib.maintainers.shlevy ];
+    platforms   = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/development/compilers/llvm/3.4/llvm-separate-build.patch b/pkgs/development/compilers/llvm/3.4/llvm-separate-build.patch
new file mode 100644
index 000000000000..abfc11513cdc
--- /dev/null
+++ b/pkgs/development/compilers/llvm/3.4/llvm-separate-build.patch
@@ -0,0 +1,12 @@
+diff -Naur llvm-3.4-orig/cmake/modules/TableGen.cmake llvm-3.4/cmake/modules/TableGen.cmake
+--- llvm-3.4-orig/cmake/modules/TableGen.cmake	2013-10-06 21:00:07.000000000 -0400
++++ llvm-3.4/cmake/modules/TableGen.cmake	2014-01-20 13:06:55.273022149 -0500
+@@ -78,8 +78,6 @@
+ endif()
+ 
+ macro(add_tablegen target project)
+-  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR})
+-
+   set(${target}_OLD_LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS})
+   set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} TableGen)
+   add_llvm_utility(${target} ${ARGN})
diff --git a/pkgs/development/compilers/llvm/3.4/llvm.nix b/pkgs/development/compilers/llvm/3.4/llvm.nix
new file mode 100644
index 000000000000..4947bdca2a96
--- /dev/null
+++ b/pkgs/development/compilers/llvm/3.4/llvm.nix
@@ -0,0 +1,55 @@
+{ stdenv
+, fetch
+, perl
+, groff
+, cmake
+, python
+, libffi
+, binutils
+, libxml2
+, valgrind
+, ncurses
+, version
+}:
+
+let
+  src = fetch "llvm" "0a169ba045r4apb9cv6ncrwl83l7yiajnzirkcdlhj1cd4nn3995";
+in stdenv.mkDerivation rec {
+  name = "llvm-${version}";
+
+  unpackPhase = ''
+    unpackFile ${src}
+    mv llvm-${version} llvm
+    sourceRoot=$PWD/llvm
+    unpackFile ${fetch "compiler-rt" "0p5b6varxdqn7q3n77xym63hhq4qqxd2981pfpa65r1w72qqjz7k"}
+    mv compiler-rt-${version} $sourceRoot/projects/compiler-rt
+  '';
+
+  buildInputs = [ perl groff cmake libxml2 python libffi valgrind ncurses ];
+
+  # hacky fix: created binaries need to be run before installation
+  preBuild = ''
+    mkdir -p $out/
+    ln -sv $PWD/lib $out
+  '';
+  postBuild = "rm -fR $out";
+
+  cmakeFlags = with stdenv; [
+    "-DCMAKE_BUILD_TYPE=Release"
+    "-DLLVM_ENABLE_FFI=ON"
+    "-DLLVM_BINUTILS_INCDIR=${binutils}/include"
+    "-DCMAKE_CXX_FLAGS=-std=c++11"
+  ] ++ stdenv.lib.optional (!isDarwin) "-DBUILD_SHARED_LIBS=ON";
+
+  enableParallelBuilding = true;
+
+  passthru.src = src;
+
+  meta = {
+    description = "Collection of modular and reusable compiler and toolchain technologies";
+    homepage    = http://llvm.org/;
+    license     = stdenv.lib.licenses.bsd3;
+    maintainers = with stdenv.lib.maintainers; [ shlevy lovek323 raskin viric ];
+    platforms   = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/development/compilers/llvm/3.4/polly-separate-build.patch b/pkgs/development/compilers/llvm/3.4/polly-separate-build.patch
new file mode 100644
index 000000000000..618dd4dc3b12
--- /dev/null
+++ b/pkgs/development/compilers/llvm/3.4/polly-separate-build.patch
@@ -0,0 +1,12 @@
+diff -Naur polly-3.4-orig/CMakeLists.txt polly-3.4/CMakeLists.txt
+--- polly-3.4-orig/CMakeLists.txt	2013-11-21 06:51:46.000000000 -0500
++++ polly-3.4/CMakeLists.txt	2014-01-20 18:49:34.907919933 -0500
+@@ -53,7 +53,7 @@
+   execute_process(COMMAND "${LLVM_INSTALL_ROOT}/bin/llvm-config" --cxxflags
+                   OUTPUT_VARIABLE LLVM_CXX_FLAGS
+                   OUTPUT_STRIP_TRAILING_WHITESPACE)
+-  set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${LLVM_CXX_FLAGS})
++  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LLVM_CXX_FLAGS}")
+ endif(NOT DEFINED LLVM_MAIN_SRC_DIR)
+ 
+ set(POLLY_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
diff --git a/pkgs/development/compilers/llvm/3.4/polly.nix b/pkgs/development/compilers/llvm/3.4/polly.nix
new file mode 100644
index 000000000000..61721ffad67d
--- /dev/null
+++ b/pkgs/development/compilers/llvm/3.4/polly.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetch, cmake, isl, python, gmp, llvm, version }:
+
+stdenv.mkDerivation {
+  name = "polly-${version}";
+
+  src =  fetch "polly" "1rqflmgzg1vzjm0r32c5ck8x3q0qm3g0hh8ggbjazh6x7nvmy6lz";
+
+  patches = [ ./polly-separate-build.patch ];
+
+  buildInputs = [ cmake isl python gmp ];
+
+  cmakeFlags = [
+    "-DCMAKE_BUILD_TYPE=Release"
+    "-DCMAKE_CXX_FLAGS=-std=c++11"
+    "-DLLVM_INSTALL_ROOT=${llvm}"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "A polyhedral optimizer for llvm";
+    homepage    = http://llvm.org/;
+    license     = stdenv.lib.licenses.bsd3;
+    maintainers = [ stdenv.lib.maintainers.shlevy ];
+    platforms   = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/development/compilers/llvm/default.nix b/pkgs/development/compilers/llvm/default.nix
deleted file mode 100644
index 1a8fa3097499..000000000000
--- a/pkgs/development/compilers/llvm/default.nix
+++ /dev/null
@@ -1,47 +0,0 @@
-{ stdenv, fetchurl, perl, groff, cmake, python, libffi, binutils_gold, version }:
-
-with { inherit (stdenv.lib) optional; };
-
-assert version == "3.4" || version == "3.3";
-
-stdenv.mkDerivation rec {
-  name = "llvm-${version}";
-
-  src = fetchurl {
-    url    = "http://llvm.org/releases/${version}/llvm-${version}.src.tar.gz";
-    sha256 =
-      if version == "3.4" then "0a169ba045r4apb9cv6ncrwl83l7yiajnzirkcdlhj1cd4nn3995"
-        else       /*3.3*/     "0y3mfbb5qzcpw3v5qncn69x1hdrrrfirgs82ypi2annhf0g6nxk8";
-  };
-
-  # The default rlimits are too low for shared libraries.
-  patches = optional (version == "3.3") [ ./more-memory-for-bugpoint.patch ];
-
-  # libffi was propagated before, but it wasn't even being used, so
-  # unless something needs it just an input is fine.
-  buildInputs = [ perl groff cmake python libffi ]; # ToDo: polly, libc++; enable cxx11?
-
-  # hacky fix: created binaries need to be run before installation
-  preBuild = let LD = if stdenv.isDarwin then "DYLD" else "LD";
-    in "export ${LD}_LIBRARY_PATH='$$${LD}_LIBRARY_PATH:'`pwd`/lib";
-
-  cmakeFlags = with stdenv; [
-    "-DCMAKE_BUILD_TYPE=Release"
-    "-DLLVM_ENABLE_FFI=ON"
-    "-DLLVM_BINUTILS_INCDIR=${binutils_gold}/include"
-  ]
-    ++ optional (version == "3.3") "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=R600" # for mesa
-    ++ optional (!isDarwin) "-DBUILD_SHARED_LIBS=ON";
-
-  enableParallelBuilding = true;
-
-  doCheck = true;
-
-  meta = with stdenv.lib; {
-    description = "Collection of modular and reusable compiler and toolchain technologies";
-    homepage    = http://llvm.org/;
-    license     = licenses.bsd3;
-    maintainers = with maintainers; [ lovek323 raskin viric ];
-    platforms   = platforms.all;
-  };
-}
diff --git a/pkgs/development/compilers/llvm/full.nix b/pkgs/development/compilers/llvm/full.nix
deleted file mode 100644
index c3ca879c5527..000000000000
--- a/pkgs/development/compilers/llvm/full.nix
+++ /dev/null
@@ -1,89 +0,0 @@
-{ stdenv
-, fetchurl
-, perl, groff
-, cmake
-, libxml2
-, python
-, libffi
-, zlib
-, ncurses
-, isl
-, gmp
-, doxygen
-, binutils_gold
-, swig
-, which
-, libedit
-, valgrind
-}:
-
-let
-  version = "3.4";
-
-  fetch = name: sha256: fetchurl {
-    url = "http://llvm.org/releases/${version}/${name}-${version}.src.tar.gz";
-    inherit sha256;
-  };
-
-  inherit (stdenv.lib) concatStrings mapAttrsToList;
-in stdenv.mkDerivation {
-  name = "llvm-full-${version}";
-
-  unpackPhase = ''
-    unpackFile ${fetch "llvm" "0a169ba045r4apb9cv6ncrwl83l7yiajnzirkcdlhj1cd4nn3995"}
-    mv llvm-${version} llvm
-    sourceRoot=$PWD/llvm
-    ${concatStrings (mapAttrsToList (name: { location, sha256 }: ''
-      unpackFile ${fetch name sha256}
-      mv ${name}-${version} $sourceRoot/${location}
-    '') {
-      clang = { location = "tools/clang"; sha256 = "06rb4j1ifbznl3gfhl98s7ilj0ns01p7y7zap4p7ynmqnc6pia92"; };
-      clang-tools-extra = { location = "tools/clang/tools/extra"; sha256 = "1d1822mwxxl9agmyacqjw800kzz5x8xr0sdmi8fgx5xfa5sii1ds"; };
-      compiler-rt = { location = "projects/compiler-rt"; sha256 = "0p5b6varxdqn7q3n77xym63hhq4qqxd2981pfpa65r1w72qqjz7k"; };
-      lld = { location = "tools/lld"; sha256 = "1sd4scqynryfrmcc4h0ljgwn2dgjmbbmf38z50ya6l0janpd2nxz"; };
-      lldb = { location = "tools/lldb"; sha256 = "0h8cmjrhjhigk7k2qll1pcf6jfgmbdzkzfz2i048pkfg851s0x4g"; };
-      polly = { location = "tools/polly"; sha256 = "1rqflmgzg1vzjm0r32c5ck8x3q0qm3g0hh8ggbjazh6x7nvmy6lz"; };
-    })}
-    sed -i 's|/usr/bin/env||' \
-      $sourceRoot/tools/lldb/scripts/Python/finish-swig-Python-LLDB.sh \
-      $sourceRoot/tools/lldb/scripts/Python/build-swig-Python.sh
-  '';
-
-  buildInputs = [ perl
-                  groff
-                  cmake
-                  libxml2
-                  python
-                  libffi
-                  zlib
-                  ncurses
-                  isl
-                  gmp
-                  doxygen
-                  swig
-                  which
-                  libedit
-                  valgrind
-                ];
-
-  cmakeFlags = [
-    "-DCMAKE_BUILD_TYPE=Release"
-    "-DLLVM_ENABLE_FFI=ON"
-    "-DGCC_INSTALL_PREFIX=${stdenv.gcc.gcc}"
-    "-DC_INCLUDE_DIRS=${stdenv.gcc.libc}/include/"
-    "-DLLVM_BINUTILS_INCDIR=${binutils_gold}/include"
-    "-DCMAKE_CXX_FLAGS=-std=c++11"
-  ];
-
-  passthru.gcc = stdenv.gcc.gcc;
-
-  enableParallelBuilding = true;
-
-  meta = {
-    description = "Collection of modular and reusable compiler and toolchain technologies";
-    homepage    = http://llvm.org/;
-    license     = stdenv.lib.licenses.bsd3;
-    maintainers = [ stdenv.lib.maintainers.shlevy ];
-    platforms   = stdenv.lib.platforms.all;
-  };
-}
diff --git a/pkgs/development/compilers/mlton/default.nix b/pkgs/development/compilers/mlton/default.nix
index a5ff613a9b45..47c4404a818e 100644
--- a/pkgs/development/compilers/mlton/default.nix
+++ b/pkgs/development/compilers/mlton/default.nix
@@ -1,23 +1,26 @@
 { stdenv, fetchurl, gmp }:
 
+let
+  version = "20130715";
+in
 stdenv.mkDerivation rec {
-  name = "mlton-20100608";
+  name = "mlton-${version}";
 
   binSrc =
     if stdenv.system == "i686-linux" then (fetchurl {
-      url = "http://sourceforge.net/projects/mlton/files/mlton/20100608/${name}-1.x86-linux.static.tgz";
-      sha256 = "16qg8df9hg2pmnsblkgxp6bgm7334rsqkxqzskv5fl21wivmnwfw";
+      url = "http://sourceforge.net/projects/mlton/files/mlton/${version}/${name}-1.x86-linux.tgz";
+      sha256 = "1kxjjmnw4xk2d9hpvz43w9dvyhb3025k4zvjx785c33nrwkrdn4j";
     })
     else if stdenv.system == "x86_64-linux" then (fetchurl {
-        url = "http://sourceforge.net/projects/mlton/files/mlton/20100608/${name}-1.amd64-linux.static.tgz";
-        sha256 = "0i6ic8f6prl0cigrmf6bj9kqz3plzappxn17lz1rg2v832nfbw9r";
+        url = "http://sourceforge.net/projects/mlton/files/mlton/${version}/${name}-1.amd64-linux.tgz";
+        sha256 = "0fyhwxb4nmpirjbjcvk9f6w67gmn2gkz7xcgz0xbfih9kc015ygn";
     })
     else throw "Architecture not supported";
 
   codeSrc =
     fetchurl {
-      url = "http://sourceforge.net/projects/mlton/files/mlton/20100608/${name}.src.tgz";
-      sha256 = "0cqb3k6ld9965hyyfyayi510f205vqzd5qqm3crh13nasvq2rjzj";
+      url = "http://sourceforge.net/projects/mlton/files/mlton/${version}/${name}.src.tgz";
+      sha256 = "0v1x2hrh9hiqkvnbq11kf34v4i5a2x0ffxbzqaa8skyl26nmfn11";
     };
 
   srcs = [ binSrc codeSrc ];
diff --git a/pkgs/development/compilers/openjdk/default.nix b/pkgs/development/compilers/openjdk/default.nix
index f29ab9399643..306337fac9c6 100644
--- a/pkgs/development/compilers/openjdk/default.nix
+++ b/pkgs/development/compilers/openjdk/default.nix
@@ -65,6 +65,7 @@ stdenv.mkDerivation rec {
     "DEVTOOLS_PATH="
     "UNIXCOMMAND_PATH="
     "BOOTDIR=${jdk}"
+    "STATIC_CXX=false"
     "UNLIMITED_CRYPTO=1"
   ];
 
diff --git a/pkgs/development/interpreters/perl/5.14/default.nix b/pkgs/development/interpreters/perl/5.14/default.nix
index 08690e9507fa..dd4e7acf71f3 100644
--- a/pkgs/development/interpreters/perl/5.14/default.nix
+++ b/pkgs/development/interpreters/perl/5.14/default.nix
@@ -17,7 +17,8 @@ stdenv.mkDerivation rec {
   patches = 
     [ # Do not look in /usr etc. for dependencies.
       ./no-sys-dirs.patch
-    ] 
+    ]
+    ++ stdenv.lib.optional stdenv.isSunOS  ./ld-shared.patch
     ++ stdenv.lib.optional stdenv.isDarwin ./no-libutil.patch;
 
   # Build a thread-safe Perl with a dynamic libperls.o.  We need the
diff --git a/pkgs/development/interpreters/perl/5.14/ld-shared.patch b/pkgs/development/interpreters/perl/5.14/ld-shared.patch
new file mode 100644
index 000000000000..b1834ff7a1f2
--- /dev/null
+++ b/pkgs/development/interpreters/perl/5.14/ld-shared.patch
@@ -0,0 +1,11 @@
+--- perl-5.14.2/hints/solaris_2.sh.orig	2013-02-14 19:29:49.453988140 +0000
++++ perl-5.14.2/hints/solaris_2.sh	2013-02-14 19:30:31.681631019 +0000
+@@ -568,7 +568,7 @@
+ #		    ccflags="$ccflags -Wa,`getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`"
+ #		fi
+ 		ldflags="$ldflags -m64"
+-		lddlflags="$lddlflags -G -m64"
++		lddlflags="$lddlflags -shared -m64"
+ 		;;
+ 	    *)
+ 		getconfccflags="`getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`"
diff --git a/pkgs/development/interpreters/perl/5.16/default.nix b/pkgs/development/interpreters/perl/5.16/default.nix
index a3ab0ef4b96f..a8c175453037 100644
--- a/pkgs/development/interpreters/perl/5.16/default.nix
+++ b/pkgs/development/interpreters/perl/5.16/default.nix
@@ -6,6 +6,10 @@ let
 
 in
 
+with {
+  inherit (stdenv.lib) optional optionalString;
+};
+
 stdenv.mkDerivation rec {
   name = "perl-5.16.3";
 
@@ -18,7 +22,8 @@ stdenv.mkDerivation rec {
     [ # Do not look in /usr etc. for dependencies.
       ./no-sys-dirs.patch
     ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ ./cpp-precomp.patch ./no-libutil.patch ] ;
+    ++ optional stdenv.isSunOS  ./ld-shared.patch
+    ++ stdenv.lib.optional stdenv.isDarwin [ ./cpp-precomp.patch ./no-libutil.patch ] ;
 
   # Build a thread-safe Perl with a dynamic libperls.o.  We need the
   # "installstyle" option to ensure that modules are put under
@@ -34,7 +39,7 @@ stdenv.mkDerivation rec {
       "-Dlocincpth=${libc}/include"
       "-Dloclibpth=${libc}/lib"
     ]
-    ++ stdenv.lib.optional (stdenv ? glibc) "-Dusethreads";
+    ++ optional (stdenv ? glibc) "-Dusethreads";
 
   configureScript = "${stdenv.shell} ./Configure";
 
@@ -46,12 +51,12 @@ stdenv.mkDerivation rec {
     ''
       configureFlags="$configureFlags -Dprefix=$out -Dman1dir=$out/share/man/man1 -Dman3dir=$out/share/man/man3"
 
-      ${stdenv.lib.optionalString stdenv.isArm ''
+      ${optionalString stdenv.isArm ''
         configureFlagsArray=(-Dldflags="-lm -lrt")
       ''}
     '';
 
-  preBuild = stdenv.lib.optionalString (!(stdenv ? gcc && stdenv.gcc.nativeTools))
+  preBuild = optionalString (!(stdenv ? gcc && stdenv.gcc.nativeTools))
     ''
       # Make Cwd work on NixOS (where we don't have a /bin/pwd).
       substituteInPlace dist/Cwd/Cwd.pm --replace "'/bin/pwd'" "'$(type -tP pwd)'"
@@ -59,5 +64,27 @@ stdenv.mkDerivation rec {
 
   setupHook = ./setup-hook.sh;
 
+  doCheck = !stdenv.isDarwin;
+
+  # some network-related tests don't work, mostly probably due to our sandboxing
+  testsToSkip = ''
+    lib/Net/hostent.t \
+    dist/IO/t/{io_multihomed.t,io_sock.t} \
+    t/porting/{maintainers.t,regen.t} \
+    cpan/Socket/t/get{name,addr}info.t \
+  '' + optionalString stdenv.isFreeBSD ''
+    cpan/CPANPLUS/t/04_CPANPLUS-Module.t \
+    cpan/CPANPLUS/t/20_CPANPLUS-Dist-MM.t \
+  '' + " ";
+
+  postPatch = optionalString (!stdenv.isDarwin) /* this failed on Darwin, no idea why */ ''
+    for test in ${testsToSkip}; do
+      echo "Removing test" $test
+      rm "$test"
+      pat=`echo "$test" | sed 's,/,\\\\/,g'` # just escape slashes
+      sed "/^$pat/d" -i MANIFEST
+    done
+  '';
+
   passthru.libPrefix = "lib/perl5/site_perl";
 }
diff --git a/pkgs/development/interpreters/perl/5.16/ld-shared.patch b/pkgs/development/interpreters/perl/5.16/ld-shared.patch
new file mode 100644
index 000000000000..be45230c8a73
--- /dev/null
+++ b/pkgs/development/interpreters/perl/5.16/ld-shared.patch
@@ -0,0 +1,11 @@
+--- perl-5.16.2/hints/solaris_2.sh.orig	2013-02-14 19:29:49.453988140 +0000
++++ perl-5.16.2/hints/solaris_2.sh	2013-02-14 19:30:31.681631019 +0000
+@@ -568,7 +568,7 @@
+ #		    ccflags="$ccflags -Wa,`getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`"
+ #		fi
+ 		ldflags="$ldflags -m64"
+-		lddlflags="$lddlflags -G -m64"
++		lddlflags="$lddlflags -shared -m64"
+ 		;;
+ 	    *)
+ 		getconfccflags="`getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`"
diff --git a/pkgs/development/interpreters/perl/5.16/no-sys-dirs.patch b/pkgs/development/interpreters/perl/5.16/no-sys-dirs.patch
index 54ffb28e2065..883b24889c37 100644
--- a/pkgs/development/interpreters/perl/5.16/no-sys-dirs.patch
+++ b/pkgs/development/interpreters/perl/5.16/no-sys-dirs.patch
@@ -1,7 +1,8 @@
-diff -ru -x '*~' perl-5.14.2-orig/Configure perl-5.14.2/Configure
---- perl-5.14.2-orig/Configure	2011-09-26 11:44:34.000000000 +0200
-+++ perl-5.14.2/Configure	2012-01-20 17:05:23.089223129 +0100
-@@ -106,15 +106,7 @@
+diff --git a/Configure b/Configure
+index fdbbf20..ba1fd07 100755
+--- a/Configure
++++ b/Configure
+@@ -106,15 +106,7 @@ if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
  fi
  
  : Proper PATH setting
@@ -18,7 +19,7 @@ diff -ru -x '*~' perl-5.14.2-orig/Configure perl-5.14.2/Configure
  
  for p in $paths
  do
-@@ -1311,8 +1303,7 @@
+@@ -1323,8 +1315,7 @@ archobjs=''
  archname=''
  : Possible local include directories to search.
  : Set locincpth to "" in a hint file to defeat local include searches.
@@ -28,8 +29,8 @@ diff -ru -x '*~' perl-5.14.2-orig/Configure perl-5.14.2/Configure
  :
  : no include file wanted by default
  inclwanted=''
-@@ -1328,17 +1319,12 @@
- archobjs=''
+@@ -1335,17 +1326,12 @@ DEBUGGING=''
+ 
  libnames=''
  : change the next line if compiling for Xenix/286 on Xenix/386
 -xlibpth='/usr/lib/386 /lib/386'
@@ -49,7 +50,7 @@ diff -ru -x '*~' perl-5.14.2-orig/Configure perl-5.14.2/Configure
  
  : Private path used by Configure to find libraries.  Its value
  : is prepended to libpth. This variable takes care of special
-@@ -1371,8 +1357,6 @@
+@@ -1380,8 +1366,6 @@ libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
  libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
  : We probably want to search /usr/shlib before most other libraries.
  : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
@@ -58,7 +59,7 @@ diff -ru -x '*~' perl-5.14.2-orig/Configure perl-5.14.2/Configure
  : Do not use vfork unless overridden by a hint file.
  usevfork=false
  
-@@ -2380,7 +2364,6 @@
+@@ -2389,7 +2373,6 @@ uname
  zip
  "
  pth=`echo $PATH | sed -e "s/$p_/ /g"`
@@ -66,7 +67,7 @@ diff -ru -x '*~' perl-5.14.2-orig/Configure perl-5.14.2/Configure
  for file in $loclist; do
  	eval xxx=\$$file
  	case "$xxx" in
-@@ -4785,7 +4768,7 @@
+@@ -4708,7 +4691,7 @@ $rm -f testcpp.c testcpp.out
  : Set private lib path
  case "$plibpth" in
  '') if ./mips; then
@@ -75,7 +76,7 @@ diff -ru -x '*~' perl-5.14.2-orig/Configure perl-5.14.2/Configure
  	fi;;
  esac
  case "$libpth" in
-@@ -8390,13 +8373,8 @@
+@@ -8354,13 +8337,8 @@ esac
  echo " "
  case "$sysman" in
  '') 
@@ -91,7 +92,7 @@ diff -ru -x '*~' perl-5.14.2-orig/Configure perl-5.14.2/Configure
  	;;
  esac
  if $test -d "$sysman"; then
-@@ -19721,9 +19699,10 @@
+@@ -19742,9 +19720,10 @@ $rm_try tryp
  case "$full_ar" in
  '') full_ar=$ar ;;
  esac
@@ -103,10 +104,11 @@ diff -ru -x '*~' perl-5.14.2-orig/Configure perl-5.14.2/Configure
  
  : see what type gids are declared as in the kernel
  echo " "
-diff -ru -x '*~' perl-5.14.2-orig/ext/Errno/Errno_pm.PL perl-5.14.2/ext/Errno/Errno_pm.PL
---- perl-5.14.2-orig/ext/Errno/Errno_pm.PL	2011-09-26 11:44:34.000000000 +0200
-+++ perl-5.14.2/ext/Errno/Errno_pm.PL	2012-01-20 17:02:07.938138311 +0100
-@@ -137,11 +137,7 @@
+diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
+index 439f254..2cdfdb0 100644
+--- a/ext/Errno/Errno_pm.PL
++++ b/ext/Errno/Errno_pm.PL
+@@ -137,11 +137,7 @@ sub get_files {
  	if ($dep =~ /(\S+errno\.h)/) {
  	     $file{$1} = 1;
  	}
@@ -119,10 +121,11 @@ diff -ru -x '*~' perl-5.14.2-orig/ext/Errno/Errno_pm.PL perl-5.14.2/ext/Errno/Er
  	# Some Linuxes have weird errno.hs which generate
  	# no #file or #line directives
  	my $linux_errno_h = -e '/usr/include/errno.h' ?
-diff -ru -x '*~' perl-5.14.2-orig/hints/freebsd.sh perl-5.14.2/hints/freebsd.sh
---- perl-5.14.2-orig/hints/freebsd.sh	2011-09-19 15:18:22.000000000 +0200
-+++ perl-5.14.2/hints/freebsd.sh	2012-01-20 17:10:37.267924044 +0100
-@@ -118,21 +118,21 @@
+diff --git a/hints/freebsd.sh b/hints/freebsd.sh
+index a67c0bb..0f07ca5 100644
+--- a/hints/freebsd.sh
++++ b/hints/freebsd.sh
+@@ -119,21 +119,21 @@ case "$osvers" in
          objformat=`/usr/bin/objformat`
          if [ x$objformat = xaout ]; then
              if [ -e /usr/lib/aout ]; then
@@ -150,3 +153,73 @@ diff -ru -x '*~' perl-5.14.2-orig/hints/freebsd.sh perl-5.14.2/hints/freebsd.sh
         ldflags="-Wl,-E "
          lddlflags="-shared "
          cccdlflags='-DPIC -fPIC'
+diff --git a/hints/linux.sh b/hints/linux.sh
+index 688c68d..c12f5f5 100644
+--- a/hints/linux.sh
++++ b/hints/linux.sh
+@@ -60,17 +60,6 @@ libswanted="$*"
+ # Debian 4.0 puts ndbm in the -lgdbm_compat library.
+ libswanted="$libswanted gdbm_compat"
+ 
+-# If you have glibc, then report the version for ./myconfig bug reporting.
+-# (Configure doesn't need to know the specific version since it just uses
+-# gcc to load the library for all tests.)
+-# We don't use __GLIBC__ and  __GLIBC_MINOR__ because they
+-# are insufficiently precise to distinguish things like
+-# libc-2.0.6 and libc-2.0.7.
+-if test -L /lib/libc.so.6; then
+-    libc=`ls -l /lib/libc.so.6 | awk '{print $NF}'`
+-    libc=/lib/$libc
+-fi
+-
+ # Configure may fail to find lstat() since it's a static/inline
+ # function in <sys/stat.h>.
+ d_lstat=define
+@@ -154,24 +143,6 @@ case "$optimize" in
+     ;;
+ esac
+ 
+-# Ubuntu 11.04 (and later, presumably) doesn't keep most libraries
+-# (such as -lm) in /lib or /usr/lib.  So we have to ask gcc to tell us
+-# where to look.  We don't want gcc's own libraries, however, so we
+-# filter those out.
+-# This could be conditional on Unbuntu, but other distributions may
+-# follow suit, and this scheme seems to work even on rather old gcc's.
+-# This unconditionally uses gcc because even if the user is using another
+-# compiler, we still need to find the math library and friends, and I don't
+-# know how other compilers will cope with that situation.
+-# Morever, if the user has their own gcc earlier in $PATH than the system gcc,
+-# we don't want its libraries. So we try to prefer the system gcc
+-# Still, as an escape hatch, allow Configure command line overrides to
+-# plibpth to bypass this check.
+-if [ -x /usr/bin/gcc ] ; then
+-    gcc=/usr/bin/gcc
+-else
+-    gcc=gcc
+-fi
+ 
+ case "$plibpth" in
+ '') plibpth=`LANG=C LC_ALL=C $gcc -print-search-dirs | grep libraries |
+@@ -345,22 +316,6 @@ sparc*)
+ 	;;
+ esac
+ 
+-# SuSE8.2 has /usr/lib/libndbm* which are ld scripts rather than
+-# true libraries. The scripts cause binding against static
+-# version of -lgdbm which is a bad idea. So if we have 'nm'
+-# make sure it can read the file
+-# NI-S 2003/08/07
+-if [ -r /usr/lib/libndbm.so  -a  -x /usr/bin/nm ] ; then
+-   if /usr/bin/nm /usr/lib/libndbm.so >/dev/null 2>&1 ; then
+-    echo 'Your shared -lndbm seems to be a real library.'
+-   else
+-    echo 'Your shared -lndbm is not a real library.'
+-    set `echo X "$libswanted "| sed -e 's/ ndbm / /'`
+-    shift
+-    libswanted="$*"
+-   fi
+-fi
+-
+ 
+ # This script UU/usethreads.cbu will get 'called-back' by Configure
+ # after it has prompted the user for whether to use threads.
diff --git a/pkgs/development/interpreters/python/2.6/default.nix b/pkgs/development/interpreters/python/2.6/default.nix
index 7fba70377d74..7c6516fe668c 100644
--- a/pkgs/development/interpreters/python/2.6/default.nix
+++ b/pkgs/development/interpreters/python/2.6/default.nix
@@ -45,7 +45,7 @@ let
     C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs);
     LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs);
 
-    configureFlags = "--enable-shared --with-threads --enable-unicode --with-wctype-functions";
+    configureFlags = "--enable-shared --with-threads --enable-unicode";
 
     preConfigure =
       ''
diff --git a/pkgs/development/interpreters/python/2.7/default.nix b/pkgs/development/interpreters/python/2.7/default.nix
index 617be4f29f13..043094c03036 100644
--- a/pkgs/development/interpreters/python/2.7/default.nix
+++ b/pkgs/development/interpreters/python/2.7/default.nix
@@ -59,7 +59,7 @@ let
     C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs);
     LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs);
 
-    configureFlags = "--enable-shared --with-threads --enable-unicode --with-wctype-functions";
+    configureFlags = "--enable-shared --with-threads --enable-unicode";
 
     preConfigure = "${ensurePurity}" + optionalString stdenv.isCygwin
       ''
diff --git a/pkgs/development/libraries/acl/default.nix b/pkgs/development/libraries/acl/default.nix
index bc0821f39fdd..d37d8926fbdc 100644
--- a/pkgs/development/libraries/acl/default.nix
+++ b/pkgs/development/libraries/acl/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, gettext, attr }:
 
 stdenv.mkDerivation rec {
-  name = "acl-2.2.51";
+  name = "acl-2.2.52";
 
   src = fetchurl {
     url = "mirror://savannah/acl/${name}.src.tar.gz";
-    sha256 = "09aj30m49ivycl3irram8c3givc0crivjm3ymw0nhfaxrwhlb186";
+    sha256 = "08qd9s3wfhv0ajswsylnfwr5h0d7j9d4rgip855nrh400nxp940p";
   };
 
   nativeBuildInputs = [ gettext ];
diff --git a/pkgs/development/libraries/attr/default.nix b/pkgs/development/libraries/attr/default.nix
index 3c5855ea284f..8d87e2ee50dd 100644
--- a/pkgs/development/libraries/attr/default.nix
+++ b/pkgs/development/libraries/attr/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, gettext }:
 
 stdenv.mkDerivation rec {
-  name = "attr-2.4.46";
+  name = "attr-2.4.47";
 
   src = fetchurl {
     url = "mirror://savannah/attr/${name}.src.tar.gz";
-    sha256 = "07qf6kb2zk512az481bbnsk9jycn477xpva1a726n5pzlzf9pmnw";
+    sha256 = "0nd8y0m6awc9ahv0ciiwf8gy54c8d3j51pw9xg7f7cn579jjyxr5";
   };
 
   nativeBuildInputs = [ gettext ];
diff --git a/pkgs/development/libraries/cloog/default.nix b/pkgs/development/libraries/cloog/default.nix
index ab5737b20ede..c3878ef4b789 100644
--- a/pkgs/development/libraries/cloog/default.nix
+++ b/pkgs/development/libraries/cloog/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, gmp, isl }:
 
 stdenv.mkDerivation rec {
-  name = "cloog-0.16.3";
+  name = "cloog-0.18.0";
 
   src = fetchurl {
     url = "http://www.bastoul.net/cloog/pages/download/count.php3?url=./${name}.tar.gz";
-    sha256 = "0lzbsszfzsr0jfwkccfbsvx913d2yc45dqwa472plmxkhbwykmc9";
+    sha256 = "1c4aa8dde7886be9cbe0f9069c334843b21028f61d344a2d685f88cb1dcf2228";
   };
 
   buildInputs = [ gmp ];
diff --git a/pkgs/development/libraries/coin3d/default.nix b/pkgs/development/libraries/coin3d/default.nix
index 2ada02441492..f866b2299c1f 100644
--- a/pkgs/development/libraries/coin3d/default.nix
+++ b/pkgs/development/libraries/coin3d/default.nix
@@ -9,6 +9,15 @@ stdenv.mkDerivation rec {
     sha256 = "05ylhrcglm81dajbk132l1w892634z2i97x10fm64y1ih72phd2q";
   };
 
+  patches = [
+    (fetchurl {
+      url = http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/media-libs/coin/files/coin-3.1.3-gcc-4.7.patch;
+      name = "gcc-4.7.patch";
+      sha256 = "076dyc52swk8qc7ylps53fg6iqmd52x8s7m18i80x49dd109yw20";
+    })
+    ./gcc-4.8.patch # taken from FC-17 source rpm
+  ];
+
   buildInputs = [ mesa ];
 
   meta = {
diff --git a/pkgs/development/libraries/coin3d/gcc-4.8.patch b/pkgs/development/libraries/coin3d/gcc-4.8.patch
new file mode 100644
index 000000000000..be5b8b03b638
--- /dev/null
+++ b/pkgs/development/libraries/coin3d/gcc-4.8.patch
@@ -0,0 +1,38 @@
+From 9f5d96a2b9a71ab539237d2dab4c54fc46fc5c5b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ralf=20Cors=C3=A9pius?= <corsepiu@corsepiu.home>
+Date: Thu, 18 Apr 2013 19:17:06 +0200
+Subject: [PATCH 10/10] GCC-4.8.0 fixes
+
+---
+ src/fonts/freetype.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/fonts/freetype.cpp b/src/fonts/freetype.cpp
+index 760b88b..e705d3a 100644
+--- a/src/fonts/freetype.cpp
++++ b/src/fonts/freetype.cpp
+@@ -32,18 +32,18 @@
+ 
+    20050613 mortene. */
+ 
+-#include "fonts/freetype.h"
+-
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif /* HAVE_CONFIG_H */
+ 
+-#include <stdlib.h>
++#include <cstdlib>
+ #include <assert.h>
+ 
+ #include "glue/freetype.h"
+ #include "glue/GLUWrapper.h"
+ 
++#include "fonts/freetype.h"
++
+ /* ************************************************************************* */
+ 
+ #ifdef __cplusplus
+-- 
+1.8.1.4
+
diff --git a/pkgs/development/libraries/ctl/default.nix b/pkgs/development/libraries/ctl/default.nix
index a802f5716746..65489ee8c88d 100644
--- a/pkgs/development/libraries/ctl/default.nix
+++ b/pkgs/development/libraries/ctl/default.nix
@@ -8,12 +8,12 @@ stdenv.mkDerivation {
     sha256 = "16lzgbpxdyhykdwndj1i9vx3h4bfkxqqcrvasvgg70gb5raxj0mj";
   };
 
-  patches = [ ./patch.patch ];
-  
+  patches = [ ./patch.patch ./gcc47.patch ];
+
   propagatedBuildInputs = [ ilmbase ];
-  
+
   configureFlags = "--with-ilmbase-prefix=${ilmbase}";
-  
+
   #configurePhase = "
     #export CXXFLAGS=\"-I${ilmbase}/include -L${ilmbase}/lib\"
     #echo $CXXFLAGS
diff --git a/pkgs/development/libraries/ctl/gcc47.patch b/pkgs/development/libraries/ctl/gcc47.patch
new file mode 100644
index 000000000000..1aa4be4fe6d0
--- /dev/null
+++ b/pkgs/development/libraries/ctl/gcc47.patch
@@ -0,0 +1,15 @@
+ https://bugs.gentoo.org/426368
+ 
+ IlmCtl/CtlInterpreter.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/IlmCtl/CtlInterpreter.cpp
++++ b/IlmCtl/CtlInterpreter.cpp
+@@ -64,6 +64,7 @@
+ #include <fstream>
+ #include <algorithm>
+ #include <cassert>
++#include <unistd.h>
+ 
+ #ifdef WIN32
+     #include <io.h>
diff --git a/pkgs/development/libraries/dbus-cplusplus/default.nix b/pkgs/development/libraries/dbus-cplusplus/default.nix
index 0a4b80d3f3ea..2bd4f8149853 100644
--- a/pkgs/development/libraries/dbus-cplusplus/default.nix
+++ b/pkgs/development/libraries/dbus-cplusplus/default.nix
@@ -10,6 +10,12 @@ stdenv.mkDerivation rec {
     sha256 = "0qafmy2i6dzx4n1dqp6pygyy6gjljnb7hwjcj2z11c1wgclsq4dw";
   };
 
+  patches = [( fetchurl {
+    url = http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/dbus-c%2B%2B/files/dbus-c%2B%2B-0.9.0-gcc-4.7.patch;
+    name = "gcc-4.7.patch";
+    sha256 = "0rwcz9pvc13b3yfr0lkifnfz0vb5q6dg240bzgf37ni4s8rpc72g";
+  })];
+
   buildInputs = [ dbus glib gtkmm pkgconfig expat ];
 
   configureFlags = "--disable-ecore";
diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix
index 4908662591cb..4d400a6ea7da 100644
--- a/pkgs/development/libraries/gettext/default.nix
+++ b/pkgs/development/libraries/gettext/default.nix
@@ -1,19 +1,17 @@
-{ stdenv, fetchurl, libiconvOrEmpty }:
-
-with { inherit (stdenv.lib) optionals optionalAttrs; };
+{ stdenv, fetchurl, libiconv, xz }:
 
 stdenv.mkDerivation (rec {
-  name = "gettext-0.18.1.1";
+  name = "gettext-0.18.2";
 
   src = fetchurl {
     url = "mirror://gnu/gettext/${name}.tar.gz";
-    sha256 = "1sa3ch12qxa4h3ya6hkz119yclcccmincl9j20dhrdx5mykp3b4k";
+    sha256 = "516a6370b3b3f46e2fc5a5e222ff5ecd76f3089bc956a7587a6e4f89de17714c";
   };
 
-  patches = [ ./no-gets.patch ];
+  LDFLAGS = if stdenv.isSunOS then "-lm -lmd -lmp -luutil -lnvpair -lnsl -lidmap -lavl -lsec" else "";
 
-  configureFlags = [ "--disable-csharp" ]
-     ++ (optionals stdenv.isCygwin
+  configureFlags = [ "--disable-csharp" "--with-xz" ]
+     ++ (stdenv.lib.optionals stdenv.isCygwin
           [ # We have a static libiconv, so we can only build the static lib.
             "--disable-shared" "--enable-static"
 
@@ -32,12 +30,12 @@ stdenv.mkDerivation (rec {
     fi
   '';
 
-  buildInputs = libiconvOrEmpty;
+  buildInputs = [ xz ] ++ stdenv.lib.optional (!stdenv.isLinux) libiconv;
 
   enableParallelBuilding = true;
 
   crossAttrs = {
-    buildInputs = optional (stdenv.gccCross.libc ? libiconv)
+    buildInputs = stdenv.lib.optional (stdenv.gccCross.libc ? libiconv)
       stdenv.gccCross.libc.libiconv.crossDrv;
     # Gettext fails to guess the cross compiler
     configureFlags = "CXX=${stdenv.cross.config}-g++";
@@ -72,11 +70,11 @@ stdenv.mkDerivation (rec {
   };
 }
 
-// optionalAttrs stdenv.isDarwin {
+// stdenv.lib.optionalAttrs stdenv.isDarwin {
   makeFlags = "CFLAGS=-D_FORTIFY_SOURCE=0";
 }
 
-// optionalAttrs stdenv.isCygwin {
+// stdenv.lib.optionalAttrs stdenv.isCygwin {
   patchPhase =
    # Make sure `error.c' gets compiled and is part of `libgettextlib.la'.
    # This fixes:
diff --git a/pkgs/development/libraries/gettext/no-gets.patch b/pkgs/development/libraries/gettext/no-gets.patch
deleted file mode 100644
index 9daa48eae649..000000000000
--- a/pkgs/development/libraries/gettext/no-gets.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-hack until gzip pulls a newer gnulib version
-
-From 66712c23388e93e5c518ebc8515140fa0c807348 Mon Sep 17 00:00:00 2001
-From: Eric Blake <eblake@redhat.com>
-Date: Thu, 29 Mar 2012 13:30:41 -0600
-Subject: [PATCH] stdio: don't assume gets any more
-
-Gnulib intentionally does not have a gets module, and now that C11
-and glibc have dropped it, we should be more proactive about warning
-any user on a platform that still has a declaration of this dangerous
-interface.
-
---- a/gettext-tools/libgettextpo/stdio.in.h
-+++ b/gettext-tools/libgettextpo/stdio.in.h
-@@ -125,7 +125,6 @@
-    so any use of gets warrants an unconditional warning.  Assume it is
-    always declared, since it is required by C89.  */
- #undef gets
--_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
- 
- #if @GNULIB_FOPEN@
- # if @REPLACE_FOPEN@
---- a/gettext-tools/gnulib-lib/stdio.in.h
-+++ b/gettext-tools/gnulib-lib/stdio.in.h
-@@ -125,7 +125,6 @@
-    so any use of gets warrants an unconditional warning.  Assume it is
-    always declared, since it is required by C89.  */
- #undef gets
--_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
- 
- #if @GNULIB_FOPEN@
- # if @REPLACE_FOPEN@
---- a/gettext-runtime/gnulib-lib/stdio.in.h
-+++ b/gettext-runtime/gnulib-lib/stdio.in.h
-@@ -125,7 +125,6 @@
-    so any use of gets warrants an unconditional warning.  Assume it is
-    always declared, since it is required by C89.  */
- #undef gets
--_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
- 
- #if @GNULIB_FOPEN@
- # if @REPLACE_FOPEN@
diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix
index e7bae0100a4f..812148c7adc6 100644
--- a/pkgs/development/libraries/glib/default.nix
+++ b/pkgs/development/libraries/glib/default.nix
@@ -54,7 +54,10 @@ stdenv.mkDerivation rec {
   propagatedBuildInputs = [ pcre zlib libffi ] ++ libiconvOrEmpty ++ libintlOrEmpty;
 
   preConfigure = "autoreconf -fi";
-  configureFlags = "--with-pcre=system --disable-fam";
+
+  configureFlags = stdenv.lib.optional stdenv.isSunOS "--disable-modular-tests";
+
+  CPPFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-DBSD_COMP";
 
   NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin "-lintl";
 
diff --git a/pkgs/development/libraries/glibc/2.18/common.nix b/pkgs/development/libraries/glibc/2.18/common.nix
index 9271e33cf07b..518615b1739a 100644
--- a/pkgs/development/libraries/glibc/2.18/common.nix
+++ b/pkgs/development/libraries/glibc/2.18/common.nix
@@ -56,14 +56,20 @@ stdenv.mkDerivation ({
 
       ./scanf.patch
 
+      /* The command "getconf CS_PATH" returns the default search path
+         "/bin:/usr/bin", which is inappropriate on NixOS machines. This
+         patch extends the search path by "/run/current-system/sw/bin". */
+      ./fix_path_attribute_in_getconf.patch
+
+
       ./cve-2012-4412+4424.patch
       ./cve-2013-4237.patch
       ./cve-2013-4332.patch
       ./cve-2013-4458.patch
       ./cve-2013-4788.patch
-    ]
-      # the problem only seems to affect i686, so avoid re-hash x86_64 ATM
-      ++ stdenv.lib.optional stdenv.isi686 ./strstr-sse42-hack.patch;
+
+      ./strstr-sse42-hack.patch
+    ];
 
   postPatch = ''
     # Needed for glibc to build with the gnumake 3.82
diff --git a/pkgs/development/libraries/glibc/2.18/fix_path_attribute_in_getconf.patch b/pkgs/development/libraries/glibc/2.18/fix_path_attribute_in_getconf.patch
new file mode 100644
index 000000000000..714e49db5607
--- /dev/null
+++ b/pkgs/development/libraries/glibc/2.18/fix_path_attribute_in_getconf.patch
@@ -0,0 +1,6 @@
+diff -ubr glibc-2.17-orig/sysdeps/unix/confstr.h glibc-2.17/sysdeps/unix/confstr.h
+--- glibc-2.17-orig/sysdeps/unix/confstr.h	2013-06-03 22:01:44.829726968 +0200
++++ glibc-2.17/sysdeps/unix/confstr.h	2013-06-03 22:04:39.469376740 +0200
+@@ -1 +1 @@
+-#define	CS_PATH	"/bin:/usr/bin"
++#define	CS_PATH	"/run/current-system/sw/bin:/bin:/usr/bin"
diff --git a/pkgs/development/libraries/gmp/4.3.2.nix b/pkgs/development/libraries/gmp/4.3.2.nix
index df7bd0ea3b96..f003979c701c 100644
--- a/pkgs/development/libraries/gmp/4.3.2.nix
+++ b/pkgs/development/libraries/gmp/4.3.2.nix
@@ -23,7 +23,9 @@ stdenv.mkDerivation rec {
 
   configureFlags = if cxx then "--enable-cxx" else "--disable-cxx";
 
-  doCheck = true;
+  # The test t-lucnum_ui fails (on Linux/x86_64) when built with GCC 4.8.
+  # Newer versions of GMP don't have that issue anymore.
+  doCheck = false;
 
   meta = {
     description = "GMP, the GNU multiple precision arithmetic library";
diff --git a/pkgs/development/libraries/gmp/5.1.3.nix b/pkgs/development/libraries/gmp/5.1.x.nix
index ec6580942e6e..a25eabbee86e 100644
--- a/pkgs/development/libraries/gmp/5.1.3.nix
+++ b/pkgs/development/libraries/gmp/5.1.x.nix
@@ -3,7 +3,7 @@
 stdenv.mkDerivation rec {
   name = "gmp-5.1.3";
 
-  src = fetchurl {
+  src = fetchurl { # we need to use bz2, others aren't in bootstrapping stdenv
     urls = [ "mirror://gnu/gmp/${name}.tar.bz2" "ftp://ftp.gmplib.org/pub/${name}/${name}.tar.bz2" ];
     sha256 = "0q5i39pxrasgn9qdxzpfbwhh11ph80p57x6hf48m74261d97j83m";
   };
@@ -15,7 +15,8 @@ stdenv.mkDerivation rec {
     # (x86), except on Solaris where some tests crash with "Memory fault".
     # See <http://hydra.nixos.org/build/2760931>, for instance.
     (stdenv.lib.optional (!stdenv.isSunOS) "--enable-fat")
-    ++ (if cxx then [ "--enable-cxx" ] else [ "--disable-cxx" ]);
+    ++ (if cxx then [ "--enable-cxx" ] else [ "--disable-cxx" ])
+    ++ (if stdenv.is64bit then [ "--with-pic" ] else []);
 
   doCheck = true;
 
diff --git a/pkgs/development/libraries/gnu-efi/default.nix b/pkgs/development/libraries/gnu-efi/default.nix
index f741a0b4f34d..07c3c668793c 100644
--- a/pkgs/development/libraries/gnu-efi/default.nix
+++ b/pkgs/development/libraries/gnu-efi/default.nix
@@ -19,8 +19,8 @@ let version = "3.0u"; in stdenv.mkDerivation {
     platforms = ["x86_64-linux" "i686-linux"];
   };
 
-  buildFlags = [
-    "CC=cc"
+  makeFlags = [
+    "CC=gcc"
     "AS=as"
     "LD=ld"
     "AR=ar"
@@ -29,12 +29,12 @@ let version = "3.0u"; in stdenv.mkDerivation {
   ];
 
   buildPhase = ''
-    make $buildFlags
-    make $buildFlags -C apps clean all
+    make $makeFlags
+    make $makeFlags -C apps clean all
   '';
 
   installPhase = ''
-    make PREFIX="$out" install
+    make PREFIX="$out" $makeFlags install
     mkdir -pv $out/share/gnu-efi
     install -D -m644 apps/*.efi $out/share/gnu-efi
   '';
diff --git a/pkgs/development/libraries/gsl/default.nix b/pkgs/development/libraries/gsl/default.nix
index 49364f882429..eee977e97037 100644
--- a/pkgs/development/libraries/gsl/default.nix
+++ b/pkgs/development/libraries/gsl/default.nix
@@ -8,6 +8,10 @@ stdenv.mkDerivation rec {
     sha256 = "18qf6jzz1r3mzb5qynywv4xx3z9g61hgkbpkdrhbgqh2g7jhgfc5";
   };
 
+  # ToDo: there might be more impurities than FMA support check
+  patches = [ ./disable-fma.patch ]; # http://lists.gnu.org/archive/html/bug-gsl/2011-11/msg00019.html
+  patchFlags = "-p0";
+
   doCheck = true;
 
   meta = {
diff --git a/pkgs/development/libraries/gsl/disable-fma.patch b/pkgs/development/libraries/gsl/disable-fma.patch
new file mode 100644
index 000000000000..d5c0d620863e
--- /dev/null
+++ b/pkgs/development/libraries/gsl/disable-fma.patch
@@ -0,0 +1,32 @@
+--- configure.ac        2011-09-22 16:13:22 +0000
++++ configure.ac        2011-11-26 23:55:24 +0000
+@@ -381,6 +381,28 @@
+ AC_SUBST(HAVE_DARWIN_IEEE_INTERFACE)
+ AC_SUBST(HAVE_DARWIN86_IEEE_INTERFACE)
+ 
++dnl check for compiler flags to disable use of FMA
++save_cflags="$CFLAGS"
++AC_CACHE_CHECK([for compiler flags to disable use of FMA], ac_cv_c_fma_flags,
++[
++if test X"$GCC" = Xyes; then
++    fma_flags='-ffp-contract=off'
++else
++    fma_flags=
++fi
++if test X"$fma_flags" != X; then
++  CFLAGS="$fma_flags $CFLAGS"
++  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int foo;]])],[ac_cv_c_fma_flags="$fma_flags"],[ac_cv_c_fma_flags="none"])
++else
++  ac_cv_c_fma_flags="none"
++fi])
++
++if test "$ac_cv_c_fma_flags" != "none" ; then
++   CFLAGS="$ac_cv_c_fma_flags $save_cflags"
++else
++   CFLAGS="$save_cflags"
++fi
++
+ dnl Check for IEEE control flags
+ 
+ save_cflags="$CFLAGS"
+
diff --git a/pkgs/development/libraries/icu/default.nix b/pkgs/development/libraries/icu/default.nix
index 3ca8382c2da6..fa486ba0b395 100644
--- a/pkgs/development/libraries/icu/default.nix
+++ b/pkgs/development/libraries/icu/default.nix
@@ -3,16 +3,14 @@
 let
 
   pname = "icu4c";
-  ver_maj = "52";
-  ver_min = "1";
-  version = "${ver_maj}.${ver_min}";
+  version = "52.1";
 in
-
 stdenv.mkDerivation {
   name = pname + "-" + version;
 
   src = fetchurl {
-    url = "http://download.icu-project.org/files/icu4c/${version}/icu4c-${ver_maj}_${ver_min}-src.tgz";
+    url = "http://download.icu-project.org/files/${pname}/${version}/${pname}-"
+      + (stdenv.lib.replaceChars ["."] ["_"] version) + "-src.tgz";
     sha256 = "14l0kl17nirc34frcybzg0snknaks23abhdxkmsqg3k9sil5wk9g";
   };
 
diff --git a/pkgs/development/libraries/isl/default.nix b/pkgs/development/libraries/isl/default.nix
index aaec37eae8f2..7711d4f170f9 100644
--- a/pkgs/development/libraries/isl/default.nix
+++ b/pkgs/development/libraries/isl/default.nix
@@ -1,17 +1,15 @@
 { stdenv, fetchurl, gmp }:
 
 stdenv.mkDerivation rec {
-  name = "isl-0.07"; # CLooG 0.16.3 fails to build with ISL 0.08.
+  name = "isl-0.11.1"; # CLooG 0.16.3 fails to build with ISL 0.08.
 
   src = fetchurl {
-    urls = [
-        "http://www.kotnet.org/~skimo/isl/${name}.tar.bz2"
-        "ftp://ftp.linux.student.kuleuven.be/pub/people/skimo/isl/${name}.tar.bz2"
-      ];
-    sha256 = "0kpxmvhrwwdygqqafqzjf9xiksq7paac2x24g9jhr3f9ajj3zkyx";
+    url = "http://pkgs.fedoraproject.org/repo/pkgs/gcc/isl-0.11.1.tar.bz2/bce1586384d8635a76d2f017fb067cd2/isl-0.11.1.tar.bz2";
+    sha256 = "13d9cqa5rzhbjq0xf0b2dyxag7pqa72xj9dhsa03m8ccr1a4npq9";
   };
 
   buildInputs = [ gmp ];
+  patches = [ ./fix-gcc-build.diff ];
 
   meta = {
     homepage = http://www.kotnet.org/~skimo/isl/;
diff --git a/pkgs/development/libraries/isl/fix-gcc-build.diff b/pkgs/development/libraries/isl/fix-gcc-build.diff
new file mode 100644
index 000000000000..6fbd1f9d478b
--- /dev/null
+++ b/pkgs/development/libraries/isl/fix-gcc-build.diff
@@ -0,0 +1,12 @@
+diff -ru isl-0.11.1/include/isl/int.h isl-0.11.1.new/include/isl/int.h
+--- isl-0.11.1/include/isl/int.h        2012-11-29 09:47:32.000000000 +0100
++++ isl-0.11.1.new/include/isl/int.h    2013-10-27 15:35:31.348553812 +0100
+@@ -14,7 +14,7 @@
+ #include <string.h>
+ #include <gmp.h>
+ #if defined(__cplusplus)
+-#include <iostream>
++#include <ostream>
+ #endif
+ 
+ #if defined(__cplusplus)
diff --git a/pkgs/development/libraries/kerberos/krb5.nix b/pkgs/development/libraries/kerberos/krb5.nix
index 5c408e9a76c5..647a6b031138 100644
--- a/pkgs/development/libraries/kerberos/krb5.nix
+++ b/pkgs/development/libraries/kerberos/krb5.nix
@@ -23,11 +23,13 @@ stdenv.mkDerivation (rec {
     cd ${name}/src
   '';
 
+  #doCheck = true; # report: No suitable file for testing purposes
+
   enableParallelBuilding = true;
 
   meta = {
-      description = "MIT Kerberos 5";
-      homepage = webpage;
-      license = "MPL";
+    description = "MIT Kerberos 5";
+    homepage = webpage;
+    license = "MPL";
   };
 })
diff --git a/pkgs/development/libraries/libarchive/default.nix b/pkgs/development/libraries/libarchive/default.nix
index 851601fe9639..e0f2ba77de2d 100644
--- a/pkgs/development/libraries/libarchive/default.nix
+++ b/pkgs/development/libraries/libarchive/default.nix
@@ -2,11 +2,11 @@
 , sharutils }:
 
 stdenv.mkDerivation rec {
-  name = "libarchive-3.0.4";
+  name = "libarchive-3.1.2";
 
   src = fetchurl {
-    url = "https://github.com/downloads/libarchive/libarchive/${name}.tar.gz";
-    sha256 = "76e8d7c7b100ec4071e48c1b7d3f3ea1d22b39db3e45b7189f75b5ff4df90fac";
+    url = "${meta.homepage}/downloads/${name}.tar.gz";
+    sha256 = "0pixqnrcf35dnqgv0lp7qlcw7k13620qkhgxr288v7p4iz6ym1zb";
   };
 
   buildInputs = [ sharutils libxml2 zlib bzip2 openssl xz ] ++
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
       compressions formats including (but not limited to) tar, shar, cpio, zip, and
       compressed with gzip, bzip2, lzma, xz, .. 
     '';
-    homepage = http://libarchive.github.com/;
+    homepage = http://libarchive.org;
     license = stdenv.lib.licenses.bsd3;
     platforms = with stdenv.lib.platforms; all;
     maintainers = with stdenv.lib.maintainers; [ jcumming ];
diff --git a/pkgs/development/libraries/libc++/default.nix b/pkgs/development/libraries/libc++/default.nix
index 964d3727f8f2..70da4462486d 100644
--- a/pkgs/development/libraries/libc++/default.nix
+++ b/pkgs/development/libraries/libc++/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchsvn, cmake, libcxxabi }:
+{ stdenv, fetchurl, fetchsvn, cmake, libcxxabi, python }:
 
 let
   version = "3.4";
@@ -11,7 +11,7 @@ in stdenv.mkDerivation rec {
     sha256 = "1sqd5qhqj7qnn9zjxx9bv7ky4f7xgmh9sbgd53y1kszhg41217xx";
   };
 
-  buildInputs = [ cmake libcxxabi ];
+  buildInputs = [ cmake libcxxabi python ];
 
   cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release"
                  "-DLIBCXX_LIBCXXABI_INCLUDE_PATHS=${libcxxabi}/include"
diff --git a/pkgs/development/libraries/libgcrypt/default.nix b/pkgs/development/libraries/libgcrypt/default.nix
index 997e9cfc5b88..c53b5479b7b2 100644
--- a/pkgs/development/libraries/libgcrypt/default.nix
+++ b/pkgs/development/libraries/libgcrypt/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation (rec {
 
   propagatedBuildInputs = [ libgpgerror ];
 
-  doCheck = true;
+  doCheck = stdenv.system != "i686-linux"; # "basic" test fails after stdenv+glibc-2.18
 
   # For some reason the tests don't find `libgpg-error.so'.
   checkPhase = ''
diff --git a/pkgs/development/libraries/libmsn/default.nix b/pkgs/development/libraries/libmsn/default.nix
index 4ec5e62ea04d..77fe3403de77 100644
--- a/pkgs/development/libraries/libmsn/default.nix
+++ b/pkgs/development/libraries/libmsn/default.nix
@@ -6,5 +6,6 @@ stdenv.mkDerivation rec {
     url = "mirror://sourceforge/libmsn/${name}.tar.bz2";
     sha256 = "338369c7455b123e84b9a7a858ac0ed2b1dc32e6529f460fdc01d28869a20fde";
   };
+  patches = [ ./fix-ftbfs-gcc4.7.diff ];
   buildInputs = [ cmake openssl ];
 }
diff --git a/pkgs/development/libraries/libmsn/fix-ftbfs-gcc4.7.diff b/pkgs/development/libraries/libmsn/fix-ftbfs-gcc4.7.diff
new file mode 100644
index 000000000000..46aeab31c842
--- /dev/null
+++ b/pkgs/development/libraries/libmsn/fix-ftbfs-gcc4.7.diff
@@ -0,0 +1,16 @@
+Fix g++ 4.7 build failure
+
+Kudos to Matthias Klose for the patch
+
+Index: libmsn-4.2/msn/util.cpp
+===================================================================
+--- libmsn-4.2.orig/msn/util.cpp	2009-07-22 19:57:10.000000000 +0000
++++ libmsn-4.2/msn/util.cpp	2012-04-16 20:52:18.068767213 +0000
+@@ -25,6 +25,7 @@
+ #include <msn/util.h>
+ #include <sstream>
+ #include <errno.h>
++#include <unistd.h>
+ #include <cctype>
+ #include <fstream>
+ #include <openssl/rand.h>
diff --git a/pkgs/development/libraries/libofa/curl-types.patch b/pkgs/development/libraries/libofa/curl-types.patch
deleted file mode 100644
index acd8d9aeabb8..000000000000
--- a/pkgs/development/libraries/libofa/curl-types.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -rc libofa-0.9.3/examples/protocol.cpp libofa-0.9.3-new/examples/protocol.cpp
-*** libofa-0.9.3/examples/protocol.cpp	2006-05-10 14:05:42.000000000 -0400
---- libofa-0.9.3-new/examples/protocol.cpp	2011-11-06 09:24:05.653283203 -0500
-***************
-*** 12,18 ****
-  #include <map>
-  #include <expat.h>
-  #include <curl/curl.h>
-- #include <curl/types.h>
-  #include <curl/easy.h>
-  
-  using namespace std;
---- 12,17 ----
diff --git a/pkgs/development/libraries/libofa/default.nix b/pkgs/development/libraries/libofa/default.nix
index 6b1ceee40f1c..2e2640e86362 100644
--- a/pkgs/development/libraries/libofa/default.nix
+++ b/pkgs/development/libraries/libofa/default.nix
@@ -1,17 +1,24 @@
 { stdenv, fetchurl, expat, curl, fftw }:
 
+let
+  version = "0.9.3";
+  deb_patch = "5";
+in
 stdenv.mkDerivation rec {
-  name = "libofa-0.9.3";
-
-  propagatedBuildInputs = [ expat curl fftw ];
-
-  patches = [ ./libofa-0.9.3-gcc-4.patch ./libofa-0.9.3-gcc-4.3.patch ./gcc-4.x.patch ./curl-types.patch ];
+  name = "libofa-${version}";
 
   src = fetchurl {
     url = "http://musicip-libofa.googlecode.com/files/${name}.tar.gz";
     sha256 = "184ham039l7lwhfgg0xr2vch2xnw1lwh7sid432mh879adhlc5h2";
   };
 
+  patches = fetchurl {
+    url = "mirror://debian/pool/main/libo/libofa/libofa_${version}-${deb_patch}.debian.tar.gz";
+    sha256 = "1rfkyz13cm8izm90c1xflp4rvsa24aqs6qpbbbqqcbmvzsj6j9yn";
+  };
+
+  propagatedBuildInputs = [ expat curl fftw ];
+
   meta = {
     homepage = http://code.google.com/musicip-libofa/;
     description = "LibOFA - Library Open Fingerprint Architecture";
diff --git a/pkgs/development/libraries/libofa/gcc-4.x.patch b/pkgs/development/libraries/libofa/gcc-4.x.patch
deleted file mode 100644
index 50f72bb428c6..000000000000
--- a/pkgs/development/libraries/libofa/gcc-4.x.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/examples/example.cpp b/examples/example.cpp
-index ef978d5..7d58a0f 100644
---- a/examples/example.cpp
-+++ b/examples/example.cpp
-@@ -10,6 +10,7 @@
- #include "protocol.h"
- 
- #include <string.h>
-+#include <stdio.h>
-  
- AudioData* loadWaveFile(char *file);
- AudioData* loadDataUsingLAME(char *file);
diff --git a/pkgs/development/libraries/libofa/libofa-0.9.3-gcc-4.3.patch b/pkgs/development/libraries/libofa/libofa-0.9.3-gcc-4.3.patch
deleted file mode 100644
index 7682e3710514..000000000000
--- a/pkgs/development/libraries/libofa/libofa-0.9.3-gcc-4.3.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-Fix build with gcc >=4.3
-diff -ur libofa-0.9.3.orig/examples/example.cpp libofa-0.9.3/examples/example.cpp
---- libofa-0.9.3.orig/examples/example.cpp	2006-05-10 21:05:37.000000000 +0300
-+++ libofa-0.9.3/examples/example.cpp	2008-04-16 15:51:49.000000000 +0300
-@@ -9,6 +9,8 @@
- 
- #include "protocol.h"
- 
-+#include <string.h>
-+ 
- AudioData* loadWaveFile(char *file);
- AudioData* loadDataUsingLAME(char *file);
- 
-Vain hakemistossa libofa-0.9.3/examples: example.cpp.orig
-diff -ur libofa-0.9.3.orig/examples/protocol.cpp libofa-0.9.3/examples/protocol.cpp
---- libofa-0.9.3.orig/examples/protocol.cpp	2006-05-10 21:05:42.000000000 +0300
-+++ libofa-0.9.3/examples/protocol.cpp	2008-04-16 15:51:49.000000000 +0300
-@@ -8,6 +8,7 @@
- -------------------------------------------------------------------*/
- #include <stdio.h>
- #include <stdlib.h>
-+#include <cstring>
- #include <string>
- #include <map>
- #include <expat.h>
-diff -ur libofa-0.9.3.orig/lib/signal_op.cpp libofa-0.9.3/lib/signal_op.cpp
---- libofa-0.9.3.orig/lib/signal_op.cpp	2006-05-10 21:01:12.000000000 +0300
-+++ libofa-0.9.3/lib/signal_op.cpp	2008-04-16 15:51:49.000000000 +0300
-@@ -12,6 +12,7 @@
- // DATE CREATED: 1/12/06
- 
- 
-+#include <cstdlib>
- #include <math.h>
- #include "signal_op.h"
- #include "AFLIB/aflibConverter.h"
diff --git a/pkgs/development/libraries/libofa/libofa-0.9.3-gcc-4.patch b/pkgs/development/libraries/libofa/libofa-0.9.3-gcc-4.patch
deleted file mode 100644
index 920c383c657b..000000000000
--- a/pkgs/development/libraries/libofa/libofa-0.9.3-gcc-4.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- a/lib/JAMA/tnt_math_utils.h	2006-06-17 01:46:22.000000000 +0300
-+++ b/lib/JAMA/tnt_math_utils.h	2006-06-17 01:47:02.000000000 +0300
-@@ -20,11 +20,20 @@
- namespace TNT

- {

- /**

-+	@returns the absolute value of a real (no-complex) scalar.

-+*/

-+template <class Real>

-+Real abs(const Real &a)

-+{

-+	return  (a > 0 ? a : -a);

-+}

-+/**

- 	@returns hypotenuse of real (non-complex) scalars a and b by 

- 	avoiding underflow/overflow

- 	using (a * sqrt( 1 + (b/a) * (b/a))), rather than

- 	sqrt(a*a + b*b).

- */

-+

- template <class Real>

- Real hypot(const Real &a, const Real &b)

- {

-@@ -56,15 +65,6 @@
- }

- */

- 

--/**

--	@returns the absolute value of a real (no-complex) scalar.

--*/

--template <class Real>

--Real abs(const Real &a)

--{

--	return  (a > 0 ? a : -a);

--}

--

- }

- #endif

- /* MATH_UTILS_H */

diff --git a/pkgs/development/libraries/libproxy/default.nix b/pkgs/development/libraries/libproxy/default.nix
index 68c3ac5130df..7085236feb52 100644
--- a/pkgs/development/libraries/libproxy/default.nix
+++ b/pkgs/development/libraries/libproxy/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, cmake, zlib}:
+{ stdenv, fetchurl, pkgconfig, cmake, zlib, glib }:
 
 stdenv.mkDerivation rec {
   name = "libproxy-0.4.11";
@@ -6,5 +6,9 @@ stdenv.mkDerivation rec {
     url = "http://libproxy.googlecode.com/files/${name}.tar.gz";
     sha256 = "0jw6454gxjykmbnbh544axi8hzz9gmm4jz1y5gw1hdqnakg36gyw";
   };
-  buildInputs = [cmake zlib];
+
+  nativeBuildInputs = [ pkgconfig cmake ];
+  propagatedBuildInputs = [ zlib ]
+    # now some optional deps, but many more are possible
+    ++ [ glib ];
 }
diff --git a/pkgs/development/libraries/libxml2/default.nix b/pkgs/development/libraries/libxml2/default.nix
index b86df4969c29..b235c746e1a0 100644
--- a/pkgs/development/libraries/libxml2/default.nix
+++ b/pkgs/development/libraries/libxml2/default.nix
@@ -41,7 +41,7 @@ stdenv.mkDerivation (rec {
   preInstall = ''substituteInPlace python/libxml2mod.la --replace "${python}" "$out"'';
   installFlags = ''pythondir="$(out)/lib/${python.libPrefix}/site-packages"'';
 
-} // stdenv.lib.optionalAttrs (!pythonSupport && stdenv.isFreeBSD) {
+} // stdenv.lib.optionalAttrs (!pythonSupport) {
   configureFlags = "--with-python=no"; # otherwise build impurity bites us
 })
 
diff --git a/pkgs/development/libraries/libxslt/default.nix b/pkgs/development/libraries/libxslt/default.nix
index d8794142b7dc..fd84c53c88fd 100644
--- a/pkgs/development/libraries/libxslt/default.nix
+++ b/pkgs/development/libraries/libxslt/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, libxml2 }:
 
-stdenv.mkDerivation (rec {
+stdenv.mkDerivation rec {
   name = "libxslt-1.1.28";
 
   src = fetchurl {
@@ -10,6 +10,17 @@ stdenv.mkDerivation (rec {
 
   buildInputs = [ libxml2 ];
 
+  patches = stdenv.lib.optionals stdenv.isSunOS [ ./patch-ah.patch ];
+
+  configureFlags = [
+    "--with-libxml-prefix=${libxml2}"
+    "--without-python"
+    "--without-crypto"
+    "--without-debug"
+    "--without-mem-debug"
+    "--without-debugger"
+  ];
+
   postInstall = ''
     mkdir -p $out/nix-support
     ln -s ${libxml2}/nix-support/setup-hook $out/nix-support/
@@ -22,15 +33,4 @@ stdenv.mkDerivation (rec {
     platforms = stdenv.lib.platforms.unix;
     maintainers = [ stdenv.lib.maintainers.eelco ];
   };
-} // (if !stdenv.isFreeBSD then {} else {
-  buildInputs = [];
-
-  configureFlags = [
-    "--with-libxml-prefix=${libxml2}"
-    "--without-python"
-    "--without-crypto"
-    "--without-debug"
-    "--without-mem-debug"
-    "--without-debugger"
-  ];
-}))
+}
diff --git a/pkgs/development/libraries/libxslt/patch-ah.patch b/pkgs/development/libraries/libxslt/patch-ah.patch
new file mode 100644
index 000000000000..ea75b01178e3
--- /dev/null
+++ b/pkgs/development/libraries/libxslt/patch-ah.patch
@@ -0,0 +1,69 @@
+$NetBSD: patch-ah,v 1.3 2012/11/27 12:17:51 adam Exp $
+
+Fix syms file for stricter solaris ld
+
+--- libxslt-1.1.28/libxslt/libxslt.syms.orig	2012-11-27 12:04:43.000000000 +0000
++++ libxslt-1.1.28/libxslt/libxslt.syms
+@@ -107,7 +107,7 @@ LIBXML2_1.0.11 {
+   xsltFreeCompMatchList;
+   xsltFreeTemplateHashes;
+   xsltGetTemplate;
+-  xsltMatchPattern;
++# xsltMatchPattern;
+   xsltTestCompMatchList;
+ 
+ # preproc
+@@ -407,7 +407,7 @@ LIBXML2_1.1.18 {
+     global:
+ 
+ # xsltInternals
+-  xsltConstNamespaceNameXSLT; # variable
++# xsltConstNamespaceNameXSLT; # variable
+   xsltExtensionInstructionResultFinalize;
+   xsltExtensionInstructionResultRegister;
+   xsltInitCtxtKey;
+@@ -416,24 +416,24 @@ LIBXML2_1.1.18 {
+   xsltInit;
+ 
+ # xsltInternals
+-  xsltParseAnyXSLTElem;
+-  xsltParseSequenceConstructor;
+-  xsltPointerListAddSize;
+-  xsltPointerListClear;
+-  xsltPointerListCreate;
+-  xsltPointerListFree;
++# xsltParseAnyXSLTElem;
++# xsltParseSequenceConstructor;
++# xsltPointerListAddSize;
++# xsltPointerListClear;
++# xsltPointerListCreate;
++# xsltPointerListFree;
+   xsltRegisterLocalRVT;
+   xsltReleaseRVT;
+-  xsltRestoreDocumentNamespaces;
++# xsltRestoreDocumentNamespaces;
+ 
+ # extensions
+-  xsltStyleStylesheetLevelGetExtData;
++# xsltStyleStylesheetLevelGetExtData;
+ 
+ # xsltInternals
+ # xsltTransStorageAdd; removed in 1.1.28
+ # xsltTransStorageRemove; removed in 1.1.28
+   xsltUninit;
+-  xsltXSLTAttrMarker; # variable
++# xsltXSLTAttrMarker; # variable
+ } LIBXML2_1.1.9;
+ 
+ LIBXML2_1.1.20 {
+@@ -476,6 +476,10 @@ LIBXML2_1.1.26 {
+ 
+ # transform
+   xsltProcessOneNode;
++
++# Solaris ld needs explicit auto-reduction (or, alternatively, "-B local")
++    local:
++  *;
+ } LIBXML2_1.1.25;
+ 
+ LIBXML2_1.1.27 {
diff --git a/pkgs/development/libraries/mpc/default.nix b/pkgs/development/libraries/mpc/default.nix
index 3824e3d3755b..e5d212dc2690 100644
--- a/pkgs/development/libraries/mpc/default.nix
+++ b/pkgs/development/libraries/mpc/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, gmp, mpfr }:
 
 stdenv.mkDerivation rec {
-  name = "mpc-0.9";
+  name = "mpc-1.0.1";
 
   src = fetchurl {
     url = "http://www.multiprecision.org/mpc/download/${name}.tar.gz";
-    sha1 = "229722d553030734d49731844abfef7617b64f1a";
+    sha1 = "vxg0rkyn4cs40wr2cp6bbcyr1nnijzlc";
   };
 
   buildInputs = [ gmp mpfr ];
diff --git a/pkgs/development/libraries/mpfr/3.1.2.nix b/pkgs/development/libraries/mpfr/3.1.2.nix
deleted file mode 100644
index fd164cf91052..000000000000
--- a/pkgs/development/libraries/mpfr/3.1.2.nix
+++ /dev/null
@@ -1,51 +0,0 @@
-
-{stdenv, fetchurl, gmp}:
-
-stdenv.mkDerivation (rec {
-  name = "mpfr-3.1.2";
-
-  src = fetchurl {
-    url = "mirror://gnu/mpfr/${name}.tar.bz2";
-    sha256 = "0sqvpfkzamxdr87anzakf9dhkfh15lfmm5bsqajk02h1mxh3zivr";
-  };
-
-  buildInputs = [ gmp ];
-
-  doCheck = true;
-
-  enableParallelBuilding = true;
-
-  meta = {
-    homepage = http://www.mpfr.org/;
-    description = "GNU MPFR, a library for multiple-precision floating-point arithmetic";
-
-    longDescription = ''
-      The GNU MPFR library is a C library for multiple-precision
-      floating-point computations with correct rounding.  MPFR is
-      based on the GMP multiple-precision library.
-
-      The main goal of MPFR is to provide a library for
-      multiple-precision floating-point computation which is both
-      efficient and has a well-defined semantics.  It copies the good
-      ideas from the ANSI/IEEE-754 standard for double-precision
-      floating-point arithmetic (53-bit mantissa).
-    '';
-
-    license = "LGPLv2+";
-
-    maintainers = [ stdenv.lib.maintainers.ludo ];
-    platforms = stdenv.lib.platforms.all;
-  };
-}
-
-//
-
-(stdenv.lib.optionalAttrs stdenv.isFreeBSD {
-   /* Work around a FreeBSD bug that otherwise leads to segfaults in
-      the test suite:
-        http://hydra.bordeaux.inria.fr/build/34862
-        http://websympa.loria.fr/wwsympa/arc/mpfr/2011-10/msg00015.html
-        http://www.freebsd.org/cgi/query-pr.cgi?pr=161344
-    */
-   configureFlags = [ "--disable-thread-safe" ];
- }))
diff --git a/pkgs/development/libraries/mpfr/default.nix b/pkgs/development/libraries/mpfr/default.nix
index faa2e1b1a71e..8e3281c862ae 100644
--- a/pkgs/development/libraries/mpfr/default.nix
+++ b/pkgs/development/libraries/mpfr/default.nix
@@ -1,15 +1,24 @@
-{stdenv, fetchurl, gmp}:
+{ stdenv, fetchurl, gmp }:
 
-stdenv.mkDerivation (rec {
-  name = "mpfr-3.1.0";
+stdenv.mkDerivation rec {
+  name = "mpfr-3.1.2";
 
   src = fetchurl {
     url = "mirror://gnu/mpfr/${name}.tar.bz2";
-    sha256 = "105nx8qqx5x8f4rlplr2wk4cyv61iw5j3jgi2k21rpb8s6xbp9vl";
+    sha256 = "0sqvpfkzamxdr87anzakf9dhkfh15lfmm5bsqajk02h1mxh3zivr";
   };
 
   buildInputs = [ gmp ];
 
+  configureFlags =
+    /* Work around a FreeBSD bug that otherwise leads to segfaults in the test suite:
+          http://hydra.bordeaux.inria.fr/build/34862
+          http://websympa.loria.fr/wwsympa/arc/mpfr/2011-10/msg00015.html
+          http://www.freebsd.org/cgi/query-pr.cgi?pr=161344
+      */
+    stdenv.lib.optional (stdenv.isSunOS or stdenv.isFreeBSD) "--disable-thread-safe" ++
+    stdenv.lib.optional stdenv.is64bit "--with-pic";
+
   doCheck = true;
 
   enableParallelBuilding = true;
@@ -37,14 +46,3 @@ stdenv.mkDerivation (rec {
   };
 }
 
-//
-
-(stdenv.lib.optionalAttrs stdenv.isFreeBSD {
-   /* Work around a FreeBSD bug that otherwise leads to segfaults in
-      the test suite:
-        http://hydra.bordeaux.inria.fr/build/34862
-        http://websympa.loria.fr/wwsympa/arc/mpfr/2011-10/msg00015.html
-        http://www.freebsd.org/cgi/query-pr.cgi?pr=161344
-    */
-   configureFlags = [ "--disable-thread-safe" ];
- }))
diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix
index 569d7fe2a328..2e5db48b7df3 100644
--- a/pkgs/development/libraries/ncurses/default.nix
+++ b/pkgs/development/libraries/ncurses/default.nix
@@ -8,7 +8,7 @@ let
      <http://mail.python.org/pipermail/python-bugs-list/2006-September/035362.html>,
      but this is left as an exercise to the reader.
      So disable them for now.  */
-  cxx = stdenv.system != "i686-solaris";
+  cxx = !stdenv.isSunOS;
 in
 stdenv.mkDerivation (rec {
   name = "ncurses-5.9";
@@ -18,11 +18,25 @@ stdenv.mkDerivation (rec {
     sha256 = "0fsn7xis81za62afan0vvm38bvgzg5wfmv1m86flqcj0nj7jjilh";
   };
 
+  patches = [ ./patch-ac ];
+
   configureFlags = ''
-    --with-shared --includedir=''${out}/include --without-debug
+    --with-shared --without-debug --enable-pc-files
     ${if unicode then "--enable-widec" else ""}${if cxx then "" else "--without-cxx-binding"}
   '';
 
+  # PKG_CONFIG_LIBDIR is where the *.pc files will be installed. If this
+  # directory doesn't exist, the configure script will disable installation of
+  # *.pc files. The configure script usually (on LSB distros) pick $(path of
+  # pkg-config)/../lib/pkgconfig. On NixOS that path doesn't exist and is not
+  # the place we want to put *.pc files from other packages anyway. So we must
+  # tell it explicitly where to install with PKG_CONFIG_LIBDIR.
+  preConfigure = ''
+    export configureFlags="$configureFlags --includedir=$out/include"
+    export PKG_CONFIG_LIBDIR="$out/lib/pkgconfig"
+    mkdir -p "$PKG_CONFIG_LIBDIR"
+  '';
+
   selfNativeBuildInput = true;
 
   enableParallelBuilding = true;
@@ -44,8 +58,11 @@ stdenv.mkDerivation (rec {
         echo "INPUT(-l''${lib}w)" > $out/lib/lib$lib.so
         ln -svf lib''${lib}w.a $out/lib/lib$lib.a
         ln -svf lib''${lib}w.so.5 $out/lib/lib$lib.so.5
+        ln -svf ''${lib}w.pc $out/lib/pkgconfig/$lib.pc
       fi
     done;
+    ln -svf . $out/include/ncursesw
+    ln -svf ncursesw5-config $out/bin/ncurses5-config
   '' else "";
 
   meta = {
diff --git a/pkgs/development/libraries/ncurses/patch-ac b/pkgs/development/libraries/ncurses/patch-ac
new file mode 100644
index 000000000000..73578f8a3675
--- /dev/null
+++ b/pkgs/development/libraries/ncurses/patch-ac
@@ -0,0 +1,40 @@
+$NetBSD: patch-ac,v 1.18 2011/11/01 14:47:46 hans Exp $
+
+--- ncurses-5.9/configure.orig	2011-02-21 01:40:36.000000000 +0000
++++ ncurses-5.9/configure
+@@ -7096,6 +7096,13 @@ sco*) #(vi
+ 	# setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
+ 	;;
+ solaris2.1[0-9]) #(vi
++	case "$GCC_VERSION" in 
++		4.[67].*)
++			cf_XOPEN_SOURCE=600
++			cf_add_cflags=-std=c99
++			CPPFLAGS="$CPPFLAGS -std=c99"
++			;;
++	esac
+ 	cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+ 	;;
+ solaris2.[1-9]) #(vi
+@@ -9640,12 +9647,7 @@ case ".$MANPAGE_RENAMES" in #(vi
+ .no) #(vi
+   ;;
+ .|.yes)
+-  # Debian 'man' program?
+-  if test -f /etc/debian_version ; then
+-    MANPAGE_RENAMES=`cd $srcdir && pwd`/man/man_db.renames
+-  else
+     MANPAGE_RENAMES=no
+-  fi
+   ;;
+ esac
+ 
+@@ -18449,7 +18444,7 @@ echo "${ECHO_T}$LIB_SUBSETS" >&6
+ 
+ ### Construct the list of include-directories to be generated
+ 
+-CPPFLAGS="$CPPFLAGS -I. -I../include"
++CPPFLAGS="-I. -I../include $CPPFLAGS"
+ if test "$srcdir" != "."; then
+ 	CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include"
+ fi
diff --git a/pkgs/development/libraries/ois/default.nix b/pkgs/development/libraries/ois/default.nix
index abf6c7112a5c..67df3645eb90 100644
--- a/pkgs/development/libraries/ois/default.nix
+++ b/pkgs/development/libraries/ois/default.nix
@@ -1,4 +1,4 @@
-x@{builderDefsPackage
+x@{builderDefsPackage, fetchurl
   , autoconf, automake, libtool, m4
   , libX11, xproto, libXi, inputproto
   , libXaw, libXmu, libXt
@@ -30,10 +30,17 @@ rec {
   inherit (sourceInfo) name version;
   inherit buildInputs;
 
-  phaseNames = ["doConfigure" "doMakeInstall"];
+  phaseNames = ["doPatch" "doConfigure" "doMakeInstall"];
+
+  patches = [(fetchurl {
+    url = http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-games/ois/files/ois-1.3-gcc47.patch;
+    sha256 = "026jw06n42bcrmg0sbdhzc4cqxsnf7fw30a2z9cigd9x282zhii8";
+    name = "gcc47.patch";
+  })];
+  patchFlags = "-p0";
 
   configureCommand = ''sh bootstrap; sh configure'';
-      
+
   meta = {
     description = "Object-oriented C++ input system";
     maintainers = with a.lib.maintainers;
diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix
index 640b99df5473..7d7ccacd14ad 100644
--- a/pkgs/development/libraries/openssl/default.nix
+++ b/pkgs/development/libraries/openssl/default.nix
@@ -2,7 +2,7 @@
 , withCryptodev ? false, cryptodevHeaders }:
 
 let
-  name = "openssl-1.0.1e";
+  name = "openssl-1.0.1f";
 
   opensslCrossSystem = stdenv.lib.attrByPath [ "openssl" "system" ]
     (throw "openssl needs its platform name cross building" null)
@@ -41,7 +41,7 @@ stdenv.mkDerivation {
       "http://www.openssl.org/source/${name}.tar.gz"
       "http://openssl.linux-mirror.org/source/${name}.tar.gz"
     ];
-    sha256 = "1qqskk39jh85fvdn3ycmdqjdf67c0b97dwmmbcysl4gzr3l1akzp";
+    sha256 = "0nnbr70dg67raqsqvlypzxa1v5xsv9gp91f9pavyckfn2w5sihkc";
   };
 
   patches = patchesCross false;
@@ -53,7 +53,9 @@ stdenv.mkDerivation {
   # On x86_64-darwin, "./config" misdetects the system as
   # "darwin-i386-cc".  So specify the system type explicitly.
   configureScript =
-    if stdenv.system == "x86_64-darwin" then "./Configure darwin64-x86_64-cc" else "./config";
+    if stdenv.system == "x86_64-darwin" then "./Configure darwin64-x86_64-cc"
+    else if stdenv.system == "x86_64-solaris" then "./Configure solaris64-x86_64-gcc"
+    else "./config";
 
   configureFlags = "shared --libdir=lib --openssldir=etc/ssl" +
     stdenv.lib.optionalString withCryptodev " -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS";
diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix
index e59c249348a8..51279701d4a5 100644
--- a/pkgs/development/libraries/pcre/default.nix
+++ b/pkgs/development/libraries/pcre/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, unicodeSupport ? true, cplusplusSupport ? true }:
 
 stdenv.mkDerivation rec {
-  name = "pcre-8.31";
+  name = "pcre-8.34";
 
   src = fetchurl {
     url = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${name}.tar.bz2";
-    sha256 = "5778a02535473c7ee7838ea598c19f451e63cf5eec0bf0307a688301c9078c3c";
+    sha256 = "0gsqmsp0q0n3q0ba32gkjvgcsdy6nwidqa7sbxkbw817zzhkl15n";
   };
 
   # The compiler on Darwin crashes with an internal error while building the
@@ -13,11 +13,14 @@ stdenv.mkDerivation rec {
   # problem. In case we ever update the Darwin GCC version, the exception for
   # that platform ought to be removed.
   configureFlags = ''
+    --enable-jit
     ${if unicodeSupport then "--enable-unicode-properties" else ""}
     ${if !cplusplusSupport then "--disable-cpp" else ""}
   '' + stdenv.lib.optionalString stdenv.isDarwin "CXXFLAGS=-O0";
 
-  doCheck = !stdenv.isCygwin;                   # XXX: test failure on Cygwin
+  doCheck = with stdenv; !(isCygwin || isFreeBSD);
+    # XXX: test failure on Cygwin
+    # we are running out of stack on both freeBSDs on Hydra
 
   meta = {
     homepage = "http://www.pcre.org/";
diff --git a/pkgs/development/libraries/ppl/default.nix b/pkgs/development/libraries/ppl/default.nix
index 2ba6b5cb9078..cbdb7b128b45 100644
--- a/pkgs/development/libraries/ppl/default.nix
+++ b/pkgs/development/libraries/ppl/default.nix
@@ -1,13 +1,13 @@
 { fetchurl, stdenv, gmpxx, perl, gnum4 }:
 
-let version = "0.11.2"; in
+let version = "1.0"; in
 
 stdenv.mkDerivation rec {
   name = "ppl-${version}";
 
   src = fetchurl {
     url = "http://bugseng.com/products/ppl/download/ftp/releases/${version}/ppl-${version}.tar.bz2";
-    sha256 = "1sxviip4yk6gp453pid5scy1ba66dzdpr02i1416yk7lkv0x3yz3";
+    sha256 = "0m0b6dzablci8mlavpsmn5w1v3r46li0wpjwvsybgxx0p1ifjsf1";
   };
 
   nativeBuildInputs = [ perl gnum4 ];
@@ -15,6 +15,8 @@ stdenv.mkDerivation rec {
 
   configureFlags = "--disable-watchdog";
 
+  patches = [ ./upstream-based.patch ];
+
   # Beware!  It took ~6 hours to compile PPL and run its tests on a 1.2 GHz
   # x86_64 box.  Nevertheless, being a dependency of GCC, it probably ought
   # to be tested.
@@ -40,7 +42,7 @@ stdenv.mkDerivation rec {
       version of the simplex algorithm.
     '';
 
-    homepage = http://www.cs.unipr.it/ppl/;
+    homepage = http://bugseng.com/products/ppl/;
 
     license = "GPLv3+";
 
diff --git a/pkgs/development/libraries/ppl/upstream-based.patch b/pkgs/development/libraries/ppl/upstream-based.patch
new file mode 100644
index 000000000000..551050f67bf9
--- /dev/null
+++ b/pkgs/development/libraries/ppl/upstream-based.patch
@@ -0,0 +1,42 @@
+https://bugs.gentoo.org/show_bug.cgi?id=447928
+--- ppl-1.0/src/p_std_bits.cc.org	2012-12-30 00:37:03.033948083 +0100
++++ ppl-1.0/src/mp_std_bits.cc	2012-12-30 00:44:12.893019313 +0100
+@@ -25,6 +25,9 @@
+ #include "ppl-config.h"
+ #include "mp_std_bits.defs.hh"
+ 
++#if __GNU_MP_VERSION < 5 \
++  || (__GNU_MP_VERSION == 5 && __GNU_MP_VERSION_MINOR < 1)
++
+ const bool std::numeric_limits<mpz_class>::is_specialized;
+ const int std::numeric_limits<mpz_class>::digits;
+ const int std::numeric_limits<mpz_class>::digits10;
+@@ -70,3 +73,6 @@
+ const bool std::numeric_limits<mpq_class>::traps;
+ const bool std::numeric_limits<mpq_class>::tininess_before;
+ const std::float_round_style std::numeric_limits<mpq_class>::round_style;
++
++#endif // __GNU_MP_VERSION < 5
++       // || (__GNU_MP_VERSION == 5 && __GNU_MP_VERSION_MINOR < 1)
+--- ppl-1.0/src/mp_std_bits.defs.hh.org	2012-12-30 00:37:03.037948187 +0100
++++ ppl-1.0/src/mp_std_bits.defs.hh	2012-12-30 00:42:32.002424189 +0100
+@@ -38,6 +38,9 @@
+ #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
+ void swap(mpq_class& x, mpq_class& y);
+ 
++#if __GNU_MP_VERSION < 5 \
++  || (__GNU_MP_VERSION == 5 && __GNU_MP_VERSION_MINOR < 1)
++
+ namespace std {
+ 
+ #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
+@@ -164,6 +167,9 @@
+ 
+ } // namespace std
+ 
++#endif // __GNU_MP_VERSION < 5
++       // || (__GNU_MP_VERSION == 5 && __GNU_MP_VERSION_MINOR < 1)
++
+ #include "mp_std_bits.inlines.hh"
+ 
+ #endif // !defined(PPL_mp_std_bits_defs_hh)
diff --git a/pkgs/development/libraries/qca2/default.nix b/pkgs/development/libraries/qca2/default.nix
index 1da9ef193b5f..952bdfa29cee 100644
--- a/pkgs/development/libraries/qca2/default.nix
+++ b/pkgs/development/libraries/qca2/default.nix
@@ -21,6 +21,8 @@ stdenv.mkDerivation rec {
               EMSA3_SHA512      ///< SHA512, with EMSA3 (ie PKCS#1 Version 1.5) encoding'
     '';
 
+  patches = [ ./gcc47.patch ];
+
   configureFlags = "--no-separate-debug-info";
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/qca2/gcc47.patch b/pkgs/development/libraries/qca2/gcc47.patch
new file mode 100644
index 000000000000..08711884a570
--- /dev/null
+++ b/pkgs/development/libraries/qca2/gcc47.patch
@@ -0,0 +1,12 @@
+# Thanks to http://lists.pld-linux.org/mailman/pipermail/pld-cvs-commit/Week-of-Mon-20120917/347917.html
+--- qca-2.0.3/src/botantools/botan/botan/secmem.h.orig 2007-04-19 23:26:13.000000000 +0200
++++ qca-2.0.3/src/botantools/botan/botan/secmem.h  2012-09-16 23:28:43.767480490 +0200
+@@ -214,7 +214,7 @@
+ 
+       SecureVector(u32bit n = 0) { MemoryRegion<T>::init(true, n); }
+       SecureVector(const T in[], u32bit n)
+-         { MemoryRegion<T>::init(true); set(in, n); }
++         { MemoryRegion<T>::init(true); this->set(in, n); }
+       SecureVector(const MemoryRegion<T>& in)
+          { MemoryRegion<T>::init(true); set(in); }
+       SecureVector(const MemoryRegion<T>& in1, const MemoryRegion<T>& in2)
diff --git a/pkgs/development/libraries/strigi/default.nix b/pkgs/development/libraries/strigi/default.nix
index fc8dc123032a..6b8b611d3f7a 100644
--- a/pkgs/development/libraries/strigi/default.nix
+++ b/pkgs/development/libraries/strigi/default.nix
@@ -20,6 +20,8 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake pkgconfig perl ];
 
+  patches = [ ./export_bufferedstream.patch ];
+
   enableParallelBuilding = true;
 
   meta = {
diff --git a/pkgs/development/libraries/strigi/export_bufferedstream.patch b/pkgs/development/libraries/strigi/export_bufferedstream.patch
new file mode 100644
index 000000000000..4c6b34fe1bec
--- /dev/null
+++ b/pkgs/development/libraries/strigi/export_bufferedstream.patch
@@ -0,0 +1,12 @@
+diff -u -r strigi-0.7.8/libstreams/include/strigi/bufferedstream.h strigi-0.7.8_new/libstreams/include/strigi/bufferedstream.h
+--- strigi-0.7.8/libstreams/include/strigi/bufferedstream.h	2013-02-05 13:34:57.000000000 -0800
++++ strigi-0.7.8_new/libstreams/include/strigi/bufferedstream.h	2013-07-14 17:01:54.000000000 -0700
+@@ -34,7 +34,7 @@
+  * BufferedStream will do the rest.
+  */
+ template <class T>
+-class BufferedStream : public StreamBase<T> {
++class STRIGI_EXPORT BufferedStream : public StreamBase<T> {
+ private:
+     StreamBuffer<T> buffer;
+     bool finishedWritingToBuffer;
diff --git a/pkgs/development/libraries/sword/default.nix b/pkgs/development/libraries/sword/default.nix
index bd177ffc6600..f8c5a213ee3b 100644
--- a/pkgs/development/libraries/sword/default.nix
+++ b/pkgs/development/libraries/sword/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ pkgconfig icu clucene_core curl ];
 
   # because curl/types.h disappeared since at least curl 7.21.7
-  patches = [ ./dont_include_curl_types_h.patch ];
+  patches = [ ./dont_include_curl_types_h.patch ./gcc47.patch ];
 
   prePatch = ''
     patchShebangs .;
diff --git a/pkgs/development/libraries/sword/gcc47.patch b/pkgs/development/libraries/sword/gcc47.patch
new file mode 100644
index 000000000000..7b55de75b646
--- /dev/null
+++ b/pkgs/development/libraries/sword/gcc47.patch
@@ -0,0 +1,35 @@
+https://bugs.gentoo.org/419505
+
+
+--- a/include/multimapwdef.h
++++ b/include/multimapwdef.h
+@@ -12,21 +12,21 @@ class multimapwithdefault : public std::multimap<Key, T, Compare> {
+ public:
+ 	typedef std::pair<const Key, T> value_type;
+ 	T& getWithDefault(const Key& k, const T& defaultValue) {
+-		if (find(k) == this->end()) {
+-			insert(value_type(k, defaultValue));
++		if (this->find(k) == this->end()) {
++			this->insert(value_type(k, defaultValue));
+ 		}
+-		return (*(find(k))).second;
++		return (*(this->find(k))).second;
+ 	}
+ 
+ 	T& operator[](const Key& k) {
+-		if (find(k) == this->end()) {
+-			insert(value_type(k, T()));
++		if (this->find(k) == this->end()) {
++			this->insert(value_type(k, T()));
+ 		}
+-		return (*(find(k))).second;
++		return (*(this->find(k))).second;
+ 	}
+ 	bool has(const Key& k, const T &val) const {
+-		typename std::multimap<Key, T, Compare>::const_iterator start = lower_bound(k);
+-		typename std::multimap<Key, T, Compare>::const_iterator end = upper_bound(k);
++		typename std::multimap<Key, T, Compare>::const_iterator start = this->lower_bound(k);
++		typename std::multimap<Key, T, Compare>::const_iterator end = this->upper_bound(k);
+ 		for (; start!=end; start++) {
+ 			if (start->second == val)
+ 				return true;
diff --git a/pkgs/development/libraries/v8/default.nix b/pkgs/development/libraries/v8/default.nix
index 5ac2487c9edc..0564e6887957 100644
--- a/pkgs/development/libraries/v8/default.nix
+++ b/pkgs/development/libraries/v8/default.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation {
       ln -sv ${gyp}/bin/gyp build/gyp/gyp
     '';
 
-    nativeBuildInputs = stdenv.lib.optional (system == "i686-linux") which;
+    nativeBuildInputs = [ which ];
     buildInputs = [ readline python ];
 
     buildFlags = [
@@ -35,6 +35,9 @@ stdenv.mkDerivation {
       "${arch}.release"
     ];
 
+    # http://code.google.com/p/v8/issues/detail?id=2149
+    NIX_CFLAGS_COMPILE = "-Wno-unused-local-typedefs -Wno-aggressive-loop-optimizations";
+
     enableParallelBuilding = true;
 
     installPhase = ''
diff --git a/pkgs/development/libraries/vigra/default.nix b/pkgs/development/libraries/vigra/default.nix
index 83b921dd49b9..5130abc9a963 100644
--- a/pkgs/development/libraries/vigra/default.nix
+++ b/pkgs/development/libraries/vigra/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, cmake, libtiff, libpng, libjpeg, doxygen, python,
   fftw, fftwSinglePrec, hdf5, boost, numpy }:
 stdenv.mkDerivation rec {
-  name = "vigra-1.8.0";
+  name = "vigra-1.9.0";
 
   src = fetchurl {
     url = "${meta.homepage}/${name}-src.tar.gz";
-    sha256 = "0542qy1bqaq73l7i8aqdhwdbhd6m1wldsn1w2sfyf8yf4398ffpw";
+    sha256 = "00fg64da6dj9k42d90dz6y7x91xw1xqppcla14im74m4afswrgcg";
   };
 
   buildInputs = [ cmake fftw fftwSinglePrec libtiff libpng libjpeg python boost
diff --git a/pkgs/development/libraries/xbase/default.nix b/pkgs/development/libraries/xbase/default.nix
index 847ca6510e5a..81447276db79 100644
--- a/pkgs/development/libraries/xbase/default.nix
+++ b/pkgs/development/libraries/xbase/default.nix
@@ -9,7 +9,13 @@ stdenv.mkDerivation {
   };
 
   prePatch = "find . -type f -not -name configure -print0 | xargs -0 chmod -x";
-  patches = [ ./xbase-fixes.patch ];
+  patches = [
+    ./xbase-fixes.patch
+    (fetchurl {
+      url = "http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-db/xbase/files/xbase-3.1.2-gcc47.patch?revision=1.1";
+      sha256 = "1kpcrkkcqdwl609yd0qxlvp743icz3vni13993sz6fkgn5lah8yl";
+    })
+  ];
 
   meta = {
     homepage = http://linux.techass.com/projects/xdb/;
diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix
index ec47c35c1530..0d4abaf25e0a 100644
--- a/pkgs/development/libraries/zlib/default.nix
+++ b/pkgs/development/libraries/zlib/default.nix
@@ -1,16 +1,16 @@
 { stdenv, fetchurl, static ? false }:
 
-let version = "1.2.7"; in
+let version = "1.2.8"; in
 
 stdenv.mkDerivation rec {
   name = "zlib-${version}";
-  
+
   src = fetchurl {
     urls =
       [ "http://www.zlib.net/${name}.tar.gz"  # old versions vanish from here
         "mirror://sourceforge/libpng/zlib/${version}/${name}.tar.gz"
       ];
-    sha256 = "1i96gsdvxqb6skp9a58bacf1wxamwi9m9pg4yn7cpf7g7239r77s";
+    sha256 = "039agw5rqvqny92cpkrfn243x2gd4xn13hs3xi6isk55d2vqqr9n";
   };
 
   configureFlags = if static then "" else "--shared";
diff --git a/pkgs/development/lisp-modules/stumpwm/default.nix b/pkgs/development/lisp-modules/stumpwm/default.nix
index 57939526f565..ae0dab1ec9d4 100644
--- a/pkgs/development/lisp-modules/stumpwm/default.nix
+++ b/pkgs/development/lisp-modules/stumpwm/default.nix
@@ -1,4 +1,4 @@
-{pkgs, nixLib, clwrapper, cl-ppcre, clx, buildLispPackage}: 
+{pkgs, nixLib, clwrapper, cl-ppcre, clx, buildLispPackage}:
 buildLispPackage rec {
   baseName = "stumpwm";
   version = "2013-09";
@@ -9,7 +9,7 @@ buildLispPackage rec {
   };
   description = "Tiling window manager for X11";
   deps = [cl-ppcre clx];
-  buildInputs = with pkgs; [texinfo autoconf which makeWrapper];
+  buildInputs = with pkgs; [texinfo4 autoconf which makeWrapper];
   meta = {
     maintainers = [nixLib.maintainers.raskin];
     platforms = nixLib.platforms.linux;
@@ -18,11 +18,11 @@ buildLispPackage rec {
     preConfigure = ''
       ${x.deployConfigScript}
       export CL_SOURCE_REGISTRY="$CL_SOURCE_REGISTRY:$PWD/"
-      ./autogen.sh 
+      ./autogen.sh
       configureFlags=" --with-lisp=$NIX_LISP --with-$NIX_LISP=$(which common-lisp.sh) --with-contrib-dir=$out/lib/common-lisp/stumpwm/contrib/"
     '';
     installPhase = with pkgs; x.installPhase + ''
-      make install 
+      make install
 
       if [ "$NIX_LISP" = "sbcl" ]; then
         wrapProgram "$out"/bin/stumpwm --set SBCL_HOME "${clwrapper.lisp}/lib/sbcl"
diff --git a/pkgs/development/tools/build-managers/cmake/762-13887.patch b/pkgs/development/tools/build-managers/cmake/762-13887.patch
new file mode 100644
index 000000000000..3ef27a09b5c2
--- /dev/null
+++ b/pkgs/development/tools/build-managers/cmake/762-13887.patch
@@ -0,0 +1,17 @@
+diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
+index e7491bb..57b4348 100644
+--- a/Source/CTest/cmCTestTestHandler.cxx
++++ b/Source/CTest/cmCTestTestHandler.cxx
+@@ -1303,10 +1303,9 @@ int cmCTestTestHandler::ExecuteCommands(std::vector<cmStdString>& vec)
+   for ( it = vec.begin(); it != vec.end(); ++it )
+     {
+     int retVal = 0;
+-    std::string cmd = cmSystemTools::ConvertToOutputPath(it->c_str());
+-    cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command: " << cmd
++    cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command: " << *it
+       << std::endl);
+-    if ( !cmSystemTools::RunSingleCommand(cmd.c_str(), 0, &retVal, 0,
++    if ( !cmSystemTools::RunSingleCommand((*it).c_str(), 0, &retVal, 0,
+                                           cmSystemTools::OUTPUT_MERGE
+         /*this->Verbose*/) || retVal != 0 )
+       {
diff --git a/pkgs/development/tools/build-managers/cmake/default.nix b/pkgs/development/tools/build-managers/cmake/default.nix
index d66149a95096..35ae214266dc 100644
--- a/pkgs/development/tools/build-managers/cmake/default.nix
+++ b/pkgs/development/tools/build-managers/cmake/default.nix
@@ -7,7 +7,7 @@ with stdenv.lib;
 let
   os = stdenv.lib.optionalString;
   majorVersion = "2.8";
-  minorVersion = "9";
+  minorVersion = "11.2";
   version = "${majorVersion}.${minorVersion}";
 in
 
@@ -18,13 +18,19 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "${meta.homepage}files/v${majorVersion}/cmake-${version}.tar.gz";
-    sha256 = "1yg68ng732cfm5c0h91chqwhg06zdh45bybm353kd1myk5rwqgfw";
+    sha256 = "0qh5dhd7ff08n2h569j7g9m92gb3bz14wvhwjhwl7lgx794cnamk";
   };
 
+  enableParallelBuilding = true;
+
   patches =
+    # See https://github.com/NixOS/nixpkgs/issues/762
+    # and http://public.kitware.com/Bug/view.php?id=13887
+    # Remove this patch when a CMake release contains the corresponding fix
+    [ ./762-13887.patch ]
     # Don't search in non-Nix locations such as /usr, but do search in
-    # Nixpkgs' Glibc.
-    optional (stdenv ? glibc) ./search-path.patch;
+    # Nixpkgs' Glibc. 
+    ++ optional (stdenv ? glibc) ./search-path.patch;
 
   buildInputs = [ curl expat zlib bzip2 libarchive ]
     ++ optional useNcurses ncurses
diff --git a/pkgs/development/tools/build-managers/cmake/search-path.patch b/pkgs/development/tools/build-managers/cmake/search-path.patch
index ef8a9eef7c18..31c85d6f5220 100644
--- a/pkgs/development/tools/build-managers/cmake/search-path.patch
+++ b/pkgs/development/tools/build-managers/cmake/search-path.patch
@@ -1,41 +1,43 @@
-diff -ru -x '*~' cmake-2.8.5-orig/Modules/Platform/Linux.cmake cmake-2.8.5/Modules/Platform/Linux.cmake
---- cmake-2.8.5-orig/Modules/Platform/Linux.cmake	2011-07-08 14:21:44.000000000 +0200
-+++ cmake-2.8.5/Modules/Platform/Linux.cmake	2011-07-21 19:45:00.000000000 +0200
-@@ -36,13 +36,13 @@
+diff --git a/Modules/Platform/Linux.cmake b/Modules/Platform/Linux.cmake
+index fe8e003..378512c 100644
+--- a/Modules/Platform/Linux.cmake
++++ b/Modules/Platform/Linux.cmake
+@@ -36,13 +36,13 @@ else()
    # checking the platform every time.  This option is advanced enough
    # that only package maintainers should need to adjust it.  They are
    # capable of providing a setting on the command line.
--  IF(EXISTS "/etc/debian_version")
--    SET(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL
+-  if(EXISTS "/etc/debian_version")
+-    set(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL
 -      "Install .so files without execute permission.")
--  ELSE(EXISTS "/etc/debian_version")
-+  #IF(EXISTS "/etc/debian_version")
-+  #  SET(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL
-+  #    "Install .so files without execute permission.")
-+  #ELSE(EXISTS "/etc/debian_version")
-     SET(CMAKE_INSTALL_SO_NO_EXE 0 CACHE INTERNAL
+-  else()
++  # if(EXISTS "/etc/debian_version")
++  #   set(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL
++  #     "Install .so files without execute permission.")
++  # else()
+     set(CMAKE_INSTALL_SO_NO_EXE 0 CACHE INTERNAL
        "Install .so files without execute permission.")
--  ENDIF(EXISTS "/etc/debian_version")
-+  #ENDIF(EXISTS "/etc/debian_version")
- ENDIF(DEFINED CMAKE_INSTALL_SO_NO_EXE)
+-  endif()
++  # endif()
+ endif()
  
  # Match multiarch library directory names.
-@@ -52,6 +52,6 @@
+@@ -52,6 +52,6 @@ include(Platform/UnixPaths)
  
  # Debian has lib64 paths only for compatibility so they should not be
  # searched.
--IF(EXISTS "/etc/debian_version")
--  SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
--ENDIF(EXISTS "/etc/debian_version")
-+#IF(EXISTS "/etc/debian_version")
-+#  SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
-+#ENDIF(EXISTS "/etc/debian_version")
-diff -ru -x '*~' cmake-2.8.5-orig/Modules/Platform/UnixPaths.cmake cmake-2.8.5/Modules/Platform/UnixPaths.cmake
---- cmake-2.8.5-orig/Modules/Platform/UnixPaths.cmake	2011-07-08 14:21:44.000000000 +0200
-+++ cmake-2.8.5/Modules/Platform/UnixPaths.cmake	2011-07-21 19:50:52.000000000 +0200
-@@ -33,55 +33,18 @@
+-if(EXISTS "/etc/debian_version")
+-  set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
+-endif()
++# if(EXISTS "/etc/debian_version")
++#  set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
++#endif()
+diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake
+index ccb2663..39834e6 100644
+--- a/Modules/Platform/UnixPaths.cmake
++++ b/Modules/Platform/UnixPaths.cmake
+@@ -33,55 +33,18 @@ get_filename_component(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH)
  # search types.
- LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
+ list(APPEND CMAKE_SYSTEM_PREFIX_PATH
    # Standard
 -  /usr/local /usr /
 -
@@ -47,7 +49,7 @@ diff -ru -x '*~' cmake-2.8.5-orig/Modules/Platform/UnixPaths.cmake cmake-2.8.5/M
 -  )
 -
 -# List common include file locations not under the common prefixes.
--LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH
+-list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
 -  # Windows API on Cygwin
 -  /usr/include/w32api
 -
@@ -56,11 +58,11 @@ diff -ru -x '*~' cmake-2.8.5-orig/Modules/Platform/UnixPaths.cmake cmake-2.8.5/M
 -
 -  # Other
 -  /usr/pkg/include
--  /opt/csw/include /opt/include  
+-  /opt/csw/include /opt/include
 -  /usr/openwin/include
 -  )
 -
--LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH
+-list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
 -  # Windows API on Cygwin
 -  /usr/lib/w32api
 -
@@ -69,25 +71,25 @@ diff -ru -x '*~' cmake-2.8.5-orig/Modules/Platform/UnixPaths.cmake cmake-2.8.5/M
 -
 -  # Other
 -  /usr/pkg/lib
--  /opt/csw/lib /opt/lib 
+-  /opt/csw/lib /opt/lib
 -  /usr/openwin/lib
 -  )
 -
--LIST(APPEND CMAKE_SYSTEM_PROGRAM_PATH
+-list(APPEND CMAKE_SYSTEM_PROGRAM_PATH
 -  /usr/pkg/bin
 +  "@glibc@"
    )
  
- LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
+ list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
 -  /lib /usr/lib /usr/lib32 /usr/lib64
 +  "@glibc@/lib"
    )
  
- LIST(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
+ list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
 -  /usr/include
 +  "@glibc@/include"
    )
- LIST(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
+ list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
 -  /usr/include
 +  "@glibc@/include"
    )
diff --git a/pkgs/development/tools/build-managers/cmake/setup-hook.sh b/pkgs/development/tools/build-managers/cmake/setup-hook.sh
index 175e538e5193..abc0b070a764 100755
--- a/pkgs/development/tools/build-managers/cmake/setup-hook.sh
+++ b/pkgs/development/tools/build-managers/cmake/setup-hook.sh
@@ -56,3 +56,20 @@ if [ -n "$crossConfig" ]; then
 else
     envHooks+=(addCMakeParams)
 fi
+
+makeCmakeFindLibs(){
+  for flag in $NIX_CFLAGS_COMPILE $NIX_LDFLAGS; do
+    case $flag in
+      -I*)
+        export CMAKE_INCLUDE_PATH="$CMAKE_INCLUDE_PATH${CMAKE_INCLUDE_PATH:+:}${flag:2}"
+        ;;
+      -L*)
+        export CMAKE_LIBRARY_PATH="$CMAKE_LIBRARY_PATH${CMAKE_LIBRARY_PATH:+:}${flag:2}"
+        ;;
+    esac
+  done
+}
+
+# not using setupHook, because it could be a setupHook adding additional
+# include flags to NIX_CFLAGS_COMPILE
+postHooks+=(makeCmakeFindLibs)
diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix
index 6b93240ba057..6db4abbf446b 100644
--- a/pkgs/development/tools/misc/binutils/default.nix
+++ b/pkgs/development/tools/misc/binutils/default.nix
@@ -1,10 +1,13 @@
 { stdenv, fetchurl, noSysDirs, zlib
-, cross ? null, gold ? false, bison ? null, flex2535 ? null, bc ? null, dejagnu ? null
-, deterministic ? false }:
+, cross ? null, gold ? true, bison ? null
+}:
 
 let basename = "binutils-2.23.1"; in
+
+with { inherit (stdenv.lib) optional optionals optionalString; };
+
 stdenv.mkDerivation rec {
-  name = basename + stdenv.lib.optionalString (cross != null) "-${cross.config}";
+  name = basename + optionalString (cross != null) "-${cross.config}";
 
   src = fetchurl {
     url = "mirror://gnu/binutils/${basename}.tar.bz2";
@@ -21,23 +24,26 @@ stdenv.mkDerivation rec {
     # That requires upstream changes for things to work. So we can patch it to
     # get the old behaviour by now.
     ./dtneeded.patch
-  ] ++ (stdenv.lib.optional deterministic ./deterministic.patch);
+
+    # Make binutils output deterministic by default.
+    ./deterministic.patch
+  ];
 
   buildInputs =
     [ zlib ]
-    ++ stdenv.lib.optional gold bison;
+    ++ optional gold bison;
 
   inherit noSysDirs;
 
   preConfigure = ''
     # Clear the default library search path.
     if test "$noSysDirs" = "1"; then
-	echo 'NATIVE_LIB_DIRS=' >> ld/configure.tgt
+        echo 'NATIVE_LIB_DIRS=' >> ld/configure.tgt
     fi
 
     # Use symlinks instead of hard links to save space ("strip" in the
     # fixup phase strips each hard link separately).
-    for i in binutils/Makefile.in gas/Makefile.in ld/Makefile.in; do
+    for i in binutils/Makefile.in gas/Makefile.in ld/Makefile.in gold/Makefile.in; do
         sed -i "$i" -e 's|ln |ln -s |'
     done
   '';
@@ -46,15 +52,15 @@ stdenv.mkDerivation rec {
   # to the bootstrap-tools libgcc (as uses to happen on arm/mips)
   NIX_CFLAGS_COMPILE = "-static-libgcc";
 
-  configureFlags = "--disable-werror" # needed for dietlibc build
-      + stdenv.lib.optionalString (stdenv.system == "mips64el-linux")
-        " --enable-fix-loongson2f-nop"
-      + stdenv.lib.optionalString (cross != null) " --target=${cross.config}"
-      + stdenv.lib.optionalString gold " --enable-gold --enable-plugins"
-      + stdenv.lib.optionalString deterministic " --enable-deterministic-archives";
+  configureFlags =
+    [ "--enable-shared" "--enable-deterministic-archives" ]
+    ++ optional (stdenv.system == "mips64el-linux") "--enable-fix-loongson2f-nop"
+    ++ optional (cross != null) "--target=${cross.config}"
+    ++ optionals gold [ "--enable-gold" "--enable-plugins" ]
+    ++ optional (stdenv.system == "i686-linux") "--enable-targets=x86_64-linux-gnu";
 
   enableParallelBuilding = true;
-      
+
   meta = {
     description = "GNU Binutils, tools for manipulating binaries (linker, assembler, etc.)";
 
diff --git a/pkgs/development/tools/misc/elfutils/default.nix b/pkgs/development/tools/misc/elfutils/default.nix
index 526a66e02804..e2f6c6932987 100644
--- a/pkgs/development/tools/misc/elfutils/default.nix
+++ b/pkgs/development/tools/misc/elfutils/default.nix
@@ -3,20 +3,20 @@
 # TODO: Look at the hardcoded paths to kernel, modules etc.
 stdenv.mkDerivation rec {
   name = "elfutils-${version}";
-  version = "0.152";
-  
+  version = "0.155";
+
   src = fetchurl {
     urls = [
-      "https://fedorahosted.org/releases/e/l/elfutils/${version}/${name}.tar.bz2"
+      "http://fedorahosted.org/releases/e/l/elfutils/${version}/${name}.tar.bz2"
       "mirror://gentoo/distfiles/${name}.tar.bz2"
       ];
-    sha256 = "19mlgxyzcwiv64ynj2cibgkiw4qkm3n37kizvy6555dsmlaqfybq";
+    sha256 = "1n0fsg2q961i0lj355w2ad3cmp7d1jjcdhrfhmlgsvs14r2lli38";
   };
 
   patches = [
     (fetchurl {
-      url = https://fedorahosted.org/releases/e/l/elfutils/0.152/elfutils-portability.patch;
-      sha256 = "0q318w4cvvqv9ps4xcwphapj1gl31isgjyya4y9sm72qj68n61p0";
+      url = "http://fedorahosted.org/releases/e/l/elfutils/${version}/elfutils-portability.patch";
+      sha256 = "0w8i94x9hqirgs2lwcd1g36s77r5svh4j1fgcrd6lx5w18vch0di";
     }) ];
 
   # We need bzip2 in NativeInputs because otherwise we can't unpack the src,
diff --git a/pkgs/development/tools/misc/gnum4/default.nix b/pkgs/development/tools/misc/gnum4/default.nix
index d1b0d0e376ed..75e8e2dfe4fd 100644
--- a/pkgs/development/tools/misc/gnum4/default.nix
+++ b/pkgs/development/tools/misc/gnum4/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl}:
 
-stdenv.mkDerivation {
-  name = "gnum4-1.4.16";
+stdenv.mkDerivation rec {
+  name = "gnum4-1.4.17";
 
   src = fetchurl {
-    url = mirror://gnu/m4/m4-1.4.16.tar.bz2;
-    sha256 = "035r7ma272j2cwni2961jp22k6bn3n9xwn3b3qbcn2yrvlghql22";
+    url = "mirror://gnu/m4/m4-1.4.17.tar.bz2";
+    sha256 = "0w0da1chh12mczxa5lnwzjk9czi3dq6gnnndbpa6w4rj76b1yklf";
   };
 
   doCheck = !stdenv.isDarwin
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
     && !stdenv.isSunOS;                    # XXX: `test-setlocale2.sh' fails
 
   # Upstream is aware of it; it may be in the next release.
-  patches = [ ./s_isdir.patch ./readlink-EINVAL.patch ./no-gets.patch ];
+  patches = [ ./s_isdir.patch ];
 
   meta = {
     homepage = http://www.gnu.org/software/m4/;
diff --git a/pkgs/development/tools/misc/gnum4/readlink-EINVAL.patch b/pkgs/development/tools/misc/gnum4/readlink-EINVAL.patch
deleted file mode 100644
index dd371584a798..000000000000
--- a/pkgs/development/tools/misc/gnum4/readlink-EINVAL.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Newer Linux kernels would return EINVAL instead of ENOENT.
-The patch below, taken from Gnulib, allows the test to pass when
-these Linux versions are in use:
-https://lists.gnu.org/archive/html/bug-gnulib/2011-03/msg00308.html .
-
-diff --git a/tests/test-readlink.h b/tests/test-readlink.h
-index 08d5662..7247fc4 100644
---- a/tests/test-readlink.h
-+++ b/tests/test-readlink.h
-@@ -38,7 +38,7 @@ test_readlink (ssize_t (*func) (char const *, char *, size_t), bool print)
-   ASSERT (errno == ENOENT);
-   errno = 0;
-   ASSERT (func ("", buf, sizeof buf) == -1);
--  ASSERT (errno == ENOENT);
-+  ASSERT (errno == ENOENT || errno == EINVAL);
-   errno = 0;
-   ASSERT (func (".", buf, sizeof buf) == -1);
-   ASSERT (errno == EINVAL);
diff --git a/pkgs/development/tools/misc/patchelf/default.nix b/pkgs/development/tools/misc/patchelf/default.nix
index 857aa1cabcf9..06b5c2ef516d 100644
--- a/pkgs/development/tools/misc/patchelf/default.nix
+++ b/pkgs/development/tools/misc/patchelf/default.nix
@@ -1,16 +1,18 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "patchelf-0.6";
+  name = "patchelf-0.8";
 
   src = fetchurl {
     url = "http://nixos.org/releases/patchelf/${name}/${name}.tar.bz2";
-    sha256 = "fc7e7fa95f282fc37a591a802629e0e1ed07bc2a8bf162228d9a69dd76127c01";
+    sha256 = "c99f84d124347340c36707089ec8f70530abd56e7827c54d506eb4cc097a17e7";
   };
 
   meta = {
     homepage = http://nixos.org/patchelf.html;
     license = "GPL";
     description = "A small utility to modify the dynamic linker and RPATH of ELF executables";
+    maintainers = [ stdenv.lib.maintainers.eelco ];
+    platforms = stdenv.lib.platforms.all;
   };
 }
diff --git a/pkgs/development/tools/misc/patchelf/unstable.nix b/pkgs/development/tools/misc/patchelf/unstable.nix
deleted file mode 100644
index aa8418496eaa..000000000000
--- a/pkgs/development/tools/misc/patchelf/unstable.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-{ stdenv, fetchurl }:
-
-stdenv.mkDerivation rec {
-  name = "patchelf-0.7pre160_1c057cd";
-
-  src = fetchurl {
-    url = http://hydra.nixos.org/build/2961500/download/2/patchelf-0.7pre160_1c057cd.tar.bz2;
-    sha256 = "bbc46169f6b6803410e0072cf57e631481e3d5f1dde234f4eacbccb6562c5f4f";
-  };
-
-  meta = {
-    homepage = http://nixos.org/patchelf.html;
-    license = "GPL";
-    description = "A small utility to modify the dynamic linker and RPATH of ELF executables";
-  };
-}
diff --git a/pkgs/development/tools/misc/texinfo/4.9.nix b/pkgs/development/tools/misc/texinfo/4.9.nix
deleted file mode 100644
index fd42093e561d..000000000000
--- a/pkgs/development/tools/misc/texinfo/4.9.nix
+++ /dev/null
@@ -1,10 +0,0 @@
-{stdenv, fetchurl, ncurses}:
-
-stdenv.mkDerivation {
-  name = "texinfo-4.9";
-  src = fetchurl {
-    url = mirror://gnu/texinfo/texinfo-4.9.tar.bz2;
-    sha256 = "0h7q9h405m88fjj067brzniiv8306ryl087pgjpmbpd2jci9h6g7";
-  };
-  buildInputs = [ncurses];
-}
diff --git a/pkgs/development/tools/misc/texinfo/5.1.nix b/pkgs/development/tools/misc/texinfo/5.2.nix
index 2f318f18d542..1bb8fca0ecff 100644
--- a/pkgs/development/tools/misc/texinfo/5.1.nix
+++ b/pkgs/development/tools/misc/texinfo/5.2.nix
@@ -1,14 +1,14 @@
-{ stdenv, fetchurl, ncurses, perl }:
+{ stdenv, fetchurl, ncurses, perl, xz }:
 
 stdenv.mkDerivation rec {
-  name = "texinfo-5.1";
+  name = "texinfo-5.2";
 
   src = fetchurl {
     url = "mirror://gnu/texinfo/${name}.tar.xz";
-    sha256 = "0864v5i488x3mb3v5p6nhy2kw0mqkzpa3b0453iibj81zlpq078q";
+    sha256 = "1njfwh2z34r2c4r0iqa7v24wmjzvsfyz4vplzry8ln3479lfywal";
   };
 
-  buildInputs = [ ncurses perl ];
+  buildInputs = [ ncurses perl xz ];
 
   preInstall = ''
     installFlags="TEXMF=$out/texmf-dist";
diff --git a/pkgs/development/tools/parsing/alex/2.3.1.nix b/pkgs/development/tools/parsing/alex/2.3.1.nix
index 7dc17cd4153a..b38979256c66 100644
--- a/pkgs/development/tools/parsing/alex/2.3.1.nix
+++ b/pkgs/development/tools/parsing/alex/2.3.1.nix
@@ -8,6 +8,7 @@ cabal.mkDerivation (self: {
   isExecutable = true;
   buildTools = [ perl ];
   doCheck = false;
+  patches = [ ./adapt-crazy-perl-regex-for-cpp-4.8.0.patch ];
   meta = {
     homepage = "http://www.haskell.org/alex/";
     description = "Alex is a tool for generating lexical analysers in Haskell";
diff --git a/pkgs/development/tools/parsing/alex/2.3.2.nix b/pkgs/development/tools/parsing/alex/2.3.2.nix
index 5d10dbd69951..dc4a0261c4a9 100644
--- a/pkgs/development/tools/parsing/alex/2.3.2.nix
+++ b/pkgs/development/tools/parsing/alex/2.3.2.nix
@@ -8,6 +8,7 @@ cabal.mkDerivation (self: {
   isExecutable = true;
   buildTools = [ perl ];
   doCheck = false;
+  patches = [ ./adapt-crazy-perl-regex-for-cpp-4.8.0.patch ];
   meta = {
     homepage = "http://www.haskell.org/alex/";
     description = "Alex is a tool for generating lexical analysers in Haskell";
diff --git a/pkgs/development/tools/parsing/alex/2.3.3.nix b/pkgs/development/tools/parsing/alex/2.3.3.nix
index bbe413d478ff..146f784463e4 100644
--- a/pkgs/development/tools/parsing/alex/2.3.3.nix
+++ b/pkgs/development/tools/parsing/alex/2.3.3.nix
@@ -8,6 +8,7 @@ cabal.mkDerivation (self: {
   isExecutable = true;
   buildTools = [ perl ];
   doCheck = false;
+  patches = [ ./adapt-crazy-perl-regex-for-cpp-4.8.0.patch ];
   meta = {
     homepage = "http://www.haskell.org/alex/";
     description = "Alex is a tool for generating lexical analysers in Haskell";
diff --git a/pkgs/development/tools/parsing/alex/2.3.5.nix b/pkgs/development/tools/parsing/alex/2.3.5.nix
index 3fb843e69557..65faf84aa2cb 100644
--- a/pkgs/development/tools/parsing/alex/2.3.5.nix
+++ b/pkgs/development/tools/parsing/alex/2.3.5.nix
@@ -8,6 +8,7 @@ cabal.mkDerivation (self: {
   isExecutable = true;
   buildTools = [ perl ];
   doCheck = false;
+  patches = [ ./adapt-crazy-perl-regex-for-cpp-4.8.0.patch ];
   meta = {
     homepage = "http://www.haskell.org/alex/";
     description = "Alex is a tool for generating lexical analysers in Haskell";
diff --git a/pkgs/development/tools/parsing/alex/adapt-crazy-perl-regex-for-cpp-4.8.0.patch b/pkgs/development/tools/parsing/alex/adapt-crazy-perl-regex-for-cpp-4.8.0.patch
new file mode 100644
index 000000000000..1e5942bfbefb
--- /dev/null
+++ b/pkgs/development/tools/parsing/alex/adapt-crazy-perl-regex-for-cpp-4.8.0.patch
@@ -0,0 +1,12 @@
+diff -ubr alex-2.3.5-orig/Setup.lhs alex-2.3.5/Setup.lhs
+--- alex-2.3.5-orig/Setup.lhs	2013-04-19 12:00:15.812606335 +0000
++++ alex-2.3.5/Setup.lhs	2013-04-19 12:05:41.635450321 +0000
+@@ -25,7 +25,7 @@
+ -- hack to turn cpp-style '# 27 "GenericTemplate.hs"' into 
+ -- '{-# LINE 27 "GenericTemplate.hs" #-}'.
+ crazy_perl_regexp =
+- "s/^#\\s+(\\d+)\\s+(\"[^\"]*\")/{-# LINE \\1 \\2 #-}/g;s/\\$(Id:.*)\\$/\\1/g"
++ "s/^#\\s+(\\d+)\\s+(\"[^\"]*\").*/{-# LINE \\1 \\2 #-}/g;s/\\$(Id:.*)\\$/\\1/g"
+ 
+ myPostBuild _ flags _ lbi = do
+   let runProgram p = rawSystemProgramConf (buildVerbose flags) p (withPrograms lbi)
diff --git a/pkgs/development/tools/parsing/bison/2.x.nix b/pkgs/development/tools/parsing/bison/2.x.nix
index 77ba164f07ae..5660d51f0606 100644
--- a/pkgs/development/tools/parsing/bison/2.x.nix
+++ b/pkgs/development/tools/parsing/bison/2.x.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, m4, perl }:
 
 stdenv.mkDerivation rec {
-  name = "bison-2.6.5";
+  name = "bison-2.7";
 
   src = fetchurl {
-    url = "mirror://gnu/bison/${name}.tar.xz";
-    sha256 = "8640d5b51aad462db6863711f333a9159836853e0b1e79fdef708c6efb5cd52b";
+    url = "mirror://gnu/bison/${name}.tar.gz";
+    sha256 = "0cd8s2g7zjshya7kwjc9rh3drsssl4hiq4sccnkgf0nn9wvygfqr";
   };
 
   nativeBuildInputs = [ m4 ] ++ stdenv.lib.optional doCheck perl;
diff --git a/pkgs/development/tools/parsing/bison/3.x.nix b/pkgs/development/tools/parsing/bison/3.x.nix
index e3bd4ac7a5a9..284223905f64 100644
--- a/pkgs/development/tools/parsing/bison/3.x.nix
+++ b/pkgs/development/tools/parsing/bison/3.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, m4, perl, flex }:
+{ stdenv, fetchurl, m4, perl }:
 
 stdenv.mkDerivation rec {
   name = "bison-3.0.2";
@@ -8,11 +8,9 @@ stdenv.mkDerivation rec {
     sha256 = "1vc17y6242jlwp0gdj7wsim3nvc1ws7q3j0v3065nz8g9hd9vwnd";
   };
 
-  nativeBuildInputs = [ m4 ] ++ stdenv.lib.optionals doCheck [perl flex];
+  nativeBuildInputs = [ m4 perl ];
   propagatedBuildInputs = [ m4 ];
 
-  doCheck = true;
-
   meta = {
     homepage = "http://www.gnu.org/software/bison/";
     description = "GNU Bison, a Yacc-compatible parser generator";
diff --git a/pkgs/development/tools/parsing/flex/flex-2.5.35.nix b/pkgs/development/tools/parsing/flex/default.nix
index 21180e7d185e..8047080a125d 100644
--- a/pkgs/development/tools/parsing/flex/flex-2.5.35.nix
+++ b/pkgs/development/tools/parsing/flex/default.nix
@@ -1,17 +1,16 @@
-# This should be moved to default.nix eventually (?)
-
-{stdenv, fetchurl, yacc, m4}:
-
-assert yacc != null && m4 != null;
+{ stdenv, fetchurl, bison, m4 }:
 
 stdenv.mkDerivation {
   name = "flex-2.5.35";
+
   src = fetchurl {
     url = mirror://sourceforge/flex/flex-2.5.35.tar.bz2;
     sha256 = "0ysff249mwhq0053bw3hxh58djc0gy7vjan2z1krrf9n5d5vvv0b";
   };
-  buildInputs = [yacc];
-  propagatedNativeBuildInputs = [m4];
+
+  buildInputs = [ bison ];
+
+  propagatedNativeBuildInputs = [ m4 ];
 
   crossAttrs = {
     preConfigure = ''
@@ -21,6 +20,7 @@ stdenv.mkDerivation {
   };
 
   meta = {
+    homepage = http://flex.sourceforge.net/;
     description = "A fast lexical analyser generator";
   };
 }
diff --git a/pkgs/development/tools/parsing/flex/flex-2.5.33.nix b/pkgs/development/tools/parsing/flex/flex-2.5.33.nix
deleted file mode 100644
index 9be98689aeaa..000000000000
--- a/pkgs/development/tools/parsing/flex/flex-2.5.33.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-# !!! this should be moved to default.nix eventually (but I delay
-# doing that since it would cause a rebuild of lots of stuff).
-
-{stdenv, fetchurl, yacc, m4}:
-
-assert yacc != null && m4 != null;
-
-stdenv.mkDerivation {
-  name = "flex-2.5.33";
-  src = fetchurl {
-    url = mirror://sourceforge/flex/flex-2.5.33.tar.bz2;
-    md5 = "343374a00b38d9e39d1158b71af37150";
-  };
-  buildInputs = [yacc];
-  propagatedBuildInputs = [m4];
-
-  meta = {
-    description = "A fast lexical analyser generator";
-  };
-}
diff --git a/pkgs/development/tools/parsing/flex/flex-2.5.34.nix b/pkgs/development/tools/parsing/flex/flex-2.5.34.nix
deleted file mode 100644
index d56cf0c88a2e..000000000000
--- a/pkgs/development/tools/parsing/flex/flex-2.5.34.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-# This should be moved to default.nix eventually (?)
-
-{stdenv, fetchurl, yacc, m4}:
-
-assert yacc != null && m4 != null;
-
-stdenv.mkDerivation {
-  name = "flex-2.5.34";
-  src = fetchurl {
-    url = mirror://sourceforge/flex/flex-2.5.34.tar.bz2;
-    sha256 = "1c8e64f32508841b0441ddfb139c4cfd25fee3728cadb63f5f351c6eb9b224a6";
-  };
-  buildInputs = [yacc];
-  propagatedBuildInputs = [m4];
-
-  meta = {
-    description = "A fast lexical analyser generator";
-  };
-}
diff --git a/pkgs/development/tools/parsing/flex/flex-2.5.4a.nix b/pkgs/development/tools/parsing/flex/flex-2.5.4a.nix
deleted file mode 100644
index 13bb68349790..000000000000
--- a/pkgs/development/tools/parsing/flex/flex-2.5.4a.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-{stdenv, fetchurl, yacc}:
-
-assert yacc != null;
-
-stdenv.mkDerivation {
-  name = "flex-2.5.4a";
-  src = fetchurl {
-    url = mirror://sourceforge/flex/flex-2.5.4a.tar.gz;
-    md5 = "bd8753d0b22e1f4ec87a553a73021adf";
-  };
-  buildInputs = [yacc];
-}
diff --git a/pkgs/development/tools/parsing/happy/1.18.4.nix b/pkgs/development/tools/parsing/happy/1.18.4.nix
index 401c4d1475ce..5ebac4303e75 100644
--- a/pkgs/development/tools/parsing/happy/1.18.4.nix
+++ b/pkgs/development/tools/parsing/happy/1.18.4.nix
@@ -8,6 +8,7 @@ cabal.mkDerivation (self: {
   isExecutable = true;
   buildDepends = [ mtl ];
   buildTools = [ perl ];
+  patches = [ ./adapt-crazy-perl-regex-for-cpp-4.8.0.patch ];
   meta = {
     homepage = "http://www.haskell.org/happy/";
     description = "Happy is a parser generator for Haskell";
diff --git a/pkgs/development/tools/parsing/happy/1.18.5.nix b/pkgs/development/tools/parsing/happy/1.18.5.nix
index d64d8983e9cb..7463a9f94a0a 100644
--- a/pkgs/development/tools/parsing/happy/1.18.5.nix
+++ b/pkgs/development/tools/parsing/happy/1.18.5.nix
@@ -8,6 +8,7 @@ cabal.mkDerivation (self: {
   isExecutable = true;
   buildDepends = [ mtl ];
   buildTools = [ perl ];
+  patches = [ ./adapt-crazy-perl-regex-for-cpp-4.8.0.patch ];
   meta = {
     homepage = "http://www.haskell.org/happy/";
     description = "Happy is a parser generator for Haskell";
diff --git a/pkgs/development/tools/parsing/happy/1.18.6.nix b/pkgs/development/tools/parsing/happy/1.18.6.nix
index fdc483fe5714..3a3795c90db6 100644
--- a/pkgs/development/tools/parsing/happy/1.18.6.nix
+++ b/pkgs/development/tools/parsing/happy/1.18.6.nix
@@ -8,6 +8,7 @@ cabal.mkDerivation (self: {
   isExecutable = true;
   buildDepends = [ mtl ];
   buildTools = [ perl ];
+  patches = [ ./adapt-crazy-perl-regex-for-cpp-4.8.0.patch ];
   meta = {
     homepage = "http://www.haskell.org/happy/";
     description = "Happy is a parser generator for Haskell";
diff --git a/pkgs/development/tools/parsing/happy/1.18.8.nix b/pkgs/development/tools/parsing/happy/1.18.8.nix
index decc992809a2..141205d19402 100644
--- a/pkgs/development/tools/parsing/happy/1.18.8.nix
+++ b/pkgs/development/tools/parsing/happy/1.18.8.nix
@@ -8,6 +8,7 @@ cabal.mkDerivation (self: {
   isExecutable = true;
   buildDepends = [ mtl ];
   buildTools = [ perl ];
+  patches = [ ./adapt-crazy-perl-regex-for-cpp-4.8.0.patch ];
   meta = {
     homepage = "http://www.haskell.org/happy/";
     description = "Happy is a parser generator for Haskell";
diff --git a/pkgs/development/tools/parsing/happy/adapt-crazy-perl-regex-for-cpp-4.8.0.patch b/pkgs/development/tools/parsing/happy/adapt-crazy-perl-regex-for-cpp-4.8.0.patch
new file mode 100644
index 000000000000..8bc4db0f405e
--- /dev/null
+++ b/pkgs/development/tools/parsing/happy/adapt-crazy-perl-regex-for-cpp-4.8.0.patch
@@ -0,0 +1,12 @@
+diff -ubr happy-1.18.6-orig/Setup.lhs happy-1.18.6/Setup.lhs
+--- happy-1.18.6-orig/Setup.lhs	2013-04-19 14:17:10.865999210 +0200
++++ happy-1.18.6/Setup.lhs	2013-04-19 14:17:15.285214809 +0200
+@@ -25,7 +25,7 @@
+ -- hack to turn cpp-style '# 27 "GenericTemplate.hs"' into 
+ -- '{-# LINE 27 "GenericTemplate.hs" #-}'.
+ crazy_perl_regexp =
+- "s/^#\\s+(\\d+)\\s+(\"[^\"]*\")/{-# LINE \\1 \\2 #-}/g;s/\\$(Id:.*)\\$/\\1/g"
++ "s/^#\\s+(\\d+)\\s+(\"[^\"]*\").*/{-# LINE \\1 \\2 #-}/g;s/\\$(Id:.*)\\$/\\1/g"
+ 
+ myPostBuild _ flags _ lbi = do
+   let runProgram p = rawSystemProgramConf (buildVerbose flags) p (withPrograms lbi)
diff --git a/pkgs/games/asc/default.nix b/pkgs/games/asc/default.nix
index 86cf929aede7..bf2fb1e89c21 100644
--- a/pkgs/games/asc/default.nix
+++ b/pkgs/games/asc/default.nix
@@ -10,6 +10,10 @@ stdenv.mkDerivation rec {
     sha256 = "1r011l4gsliky6szjvda8xzyhkkc50ahrr7p14911v5ydar0w3hh";
   };
 
+  configureFlags = [ "--disable-paragui" "--disable-paraguitest" ];
+
+  NIX_CFLAGS_COMPILE = "-fpermissive"; # I'm too lazy to catch all gcc47-related problems
+
   buildInputs = [
     SDL SDL_image SDL_mixer SDL_sound libsigcxx physfs boost expat freetype
     libjpeg wxGTK lua perl pkgconfig zlib zip bzip2 libpng
diff --git a/pkgs/misc/emulators/zsnes/default.nix b/pkgs/misc/emulators/zsnes/default.nix
index eaab4276c1a3..c3bced292005 100644
--- a/pkgs/misc/emulators/zsnes/default.nix
+++ b/pkgs/misc/emulators/zsnes/default.nix
@@ -2,35 +2,28 @@
 
 stdenv.mkDerivation {
   name = "zsnes-1.51";
-  
+
   src = fetchurl {
     url = mirror://sourceforge/zsnes/zsnes151src.tar.bz2;
     sha256 = "08s64qsxziv538vmfv38fg1rfrz5k95dss5zdkbfxsbjlbdxwmi8";
   };
 
+  # copied from arch linux, fixes gcc-4.8 compatibility
+  patches = [ ./zsnes.patch ];
+
+  postPatch = ''
+    patch -p0 < ${./zsnes-1.51-libpng15.patch}
+  '';
+
   buildInputs = [ nasm SDL zlib libpng ncurses mesa ];
 
   preConfigure = ''
     cd src
-
     sed -i "/^STRIP/d" configure
-    
-    # Fix for undefined strncasecmp()
-    echo '#include <strings.h>' > tmp.cpp 
-    cat tmp.cpp tools/strutil.h > tools/strutil.h.new
-    mv tools/strutil.h.new tools/strutil.h
-    
-    # Fix for undefined system()
-    echo '#include <stdlib.h>' > tmp.cpp
-    cat tmp.cpp tools/depbuild.cpp > tools/depbuild.cpp.new
-    mv tools/depbuild.cpp.new tools/depbuild.cpp
-    
-    # Fix for lots of undefined strcmp, strncmp etc.
-    echo '#include <string.h>' > tmp.cpp 
-    cat tmp.cpp parsegen.cpp > parsegen.cpp.new
-    mv parsegen.cpp.new parsegen.cpp
   '';
-  
+
+  configureFlags = "--enable-release";
+
   meta = {
     description = "A Super Nintendo Entertainment System Emulator";
     license = "GPLv2+";
diff --git a/pkgs/misc/emulators/zsnes/zsnes-1.51-libpng15.patch b/pkgs/misc/emulators/zsnes/zsnes-1.51-libpng15.patch
new file mode 100644
index 000000000000..b32c30967547
--- /dev/null
+++ b/pkgs/misc/emulators/zsnes/zsnes-1.51-libpng15.patch
@@ -0,0 +1,12 @@
+Use existing png_set_IHDR() and stop accessing PNG structure members directly
+
+--- src/zip/zpng.c
++++ src/zip/zpng.c
+@@ -129,7 +129,6 @@
+         png_set_IHDR(png_ptr, info_ptr, width, height, 8,
+                      PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,
+                      PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
+-        info_ptr->color_type = PNG_COLOR_TYPE_RGB;
+ 
+         //Allocate an array of scanline pointers
+         row_pointers = (png_bytep*)malloc(height*sizeof(png_bytep));
diff --git a/pkgs/misc/emulators/zsnes/zsnes.patch b/pkgs/misc/emulators/zsnes/zsnes.patch
new file mode 100644
index 000000000000..d5d681ae67a8
--- /dev/null
+++ b/pkgs/misc/emulators/zsnes/zsnes.patch
@@ -0,0 +1,80 @@
+diff -aur zsnes_1_51//src/Makefile.in zsnes_1_51_new//src/Makefile.in
+--- zsnes_1_51//src/Makefile.in	2007-01-24 21:54:12.000000000 +0100
++++ zsnes_1_51_new//src/Makefile.in	2010-09-06 00:03:04.715810431 +0200
+@@ -95,7 +95,7 @@
+ %.o: %.cpp
+ 	@CXX@ @CXXFLAGS@ -o $@ -c $<
+ %.o %.h: %.psr $(PSR)
+-	./$(PSR) @PSRFLAGS@ -gcc @CC@ -compile -flags "@CFLAGS@ -O1" -cheader $*.h -fname $* $*.o $<
++	./$(PSR) @PSRFLAGS@ -gcc "@CC@" -compile -flags "@CFLAGS@ -O1 -D_FORTIFY_SOURCE=0" -cheader $*.h -fname $* $*.o $<
+ 
+ default: main
+ all: main tools
+@@ -133,7 +133,7 @@
+ 
+ include makefile.dep
+ makefile.dep: $(TOOL_D)/depbuild Makefile
+-	$(TOOL_D)/depbuild @CC@ "@CFLAGS@" @NASMPATH@ "@NFLAGS@" $(Z_OBJS) > makefile.dep
++	$(TOOL_D)/depbuild "@CC@" "@CFLAGS@" "@NASMPATH@" "@NFLAGS@" $(Z_OBJS) > makefile.dep
+ 
+ Makefile: Makefile.in config.status
+ 	./config.status
+diff -aur zsnes_1_51//src/parsegen.cpp zsnes_1_51_new//src/parsegen.cpp
+--- zsnes_1_51//src/parsegen.cpp	2007-10-31 05:30:26.000000000 +0100
++++ zsnes_1_51_new//src/parsegen.cpp	2010-09-05 15:48:36.903333444 +0200
+@@ -19,6 +19,9 @@
+ Config file handler creator by Nach (C) 2005-2007
+ */
+ 
++#include <cstring>
++#include <cstdlib>
++
+ #if !defined(__GNUC__) && !defined(_MSC_VER)
+ #error You are using an unsupported compiler
+ #endif
+@@ -1822,7 +1825,7 @@
+   }
+ }
+ 
+-int main(size_t argc, const char *const *const argv)
++int main(int argc, const char *const *const argv)
+ {
+   const char *cheader_file = 0;
+   bool compile = false;
+diff -aur zsnes_1_51//src/tools/depbuild.cpp zsnes_1_51_new//src/tools/depbuild.cpp
+--- zsnes_1_51//src/tools/depbuild.cpp	2006-12-27 12:04:05.000000000 +0100
++++ zsnes_1_51_new//src/tools/depbuild.cpp	2010-09-05 15:48:36.903333444 +0200
+@@ -183,7 +183,7 @@
+   }
+ }
+ 
+-int main(size_t argc, const char *const *const argv)
++int main(int argc, const char *const *const argv)
+ {
+   if (argc < 5)
+   {
+diff -aur zsnes_1_51//src/tools/strutil.h zsnes_1_51_new//src/tools/strutil.h
+--- zsnes_1_51//src/tools/strutil.h	2006-12-27 12:04:05.000000000 +0100
++++ zsnes_1_51_new//src/tools/strutil.h	2010-09-05 15:48:36.903333444 +0200
+@@ -15,6 +15,9 @@
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+ 
++#include <cstring>
++#include <cstdlib>
++
+ /*
+ This is part of a toolkit used to assist in ZSNES development
+ */
+diff -u -r zsnes_1_51/src/tools/depbuild.cpp zsnes_1_51-fix/src/tools/depbuild.cpp
+--- zsnes_1_51/src/tools/depbuild.cpp	2006-12-27 12:04:05.000000000 +0100
++++ zsnes_1_51-fix/src/tools/depbuild.cpp	2012-07-14 16:20:17.759886250 +0200
+@@ -26,6 +26,8 @@
+ #include <cstdio>
+ using namespace std;
+ 
++#include <unistd.h>
++
+ #include "fileutil.h"
+ #include "strutil.h"
+ 
diff --git a/pkgs/os-specific/linux/ipsec-tools/default.nix b/pkgs/os-specific/linux/ipsec-tools/default.nix
index b28320c06252..f1faa5c4884d 100644
--- a/pkgs/os-specific/linux/ipsec-tools/default.nix
+++ b/pkgs/os-specific/linux/ipsec-tools/default.nix
@@ -18,6 +18,9 @@ stdenv.mkDerivation rec {
 
   patches = [ ./dont-create-localstatedir-during-install.patch ];
 
+  # fix build with newer gcc versions
+  preConfigure = ''substituteInPlace configure --replace "-Werror" "" '';
+
   configureFlags = ''
     --sysconfdir=/etc --localstatedir=/var
     --with-kernel-headers=${linuxHeaders}/include
diff --git a/pkgs/servers/monitoring/net-snmp/default.nix b/pkgs/servers/monitoring/net-snmp/default.nix
index a9d1578495ab..ad44860e7bd8 100644
--- a/pkgs/servers/monitoring/net-snmp/default.nix
+++ b/pkgs/servers/monitoring/net-snmp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, file, openssl, perl }:
+{ stdenv, fetchurl, autoreconfHook, file, openssl, perl }:
 
 stdenv.mkDerivation rec {
   name = "net-snmp-5.7.2";
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
       "--with-persistent-directory=/var/lib/net-snmp"
     ];
 
-  buildInputs = [ file openssl perl ];
+  buildInputs = [ autoreconfHook file openssl perl ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix
index 08dc5a92b7d0..3e27b8743434 100644
--- a/pkgs/servers/x11/xorg/overrides.nix
+++ b/pkgs/servers/x11/xorg/overrides.nix
@@ -86,6 +86,12 @@ in
     propagatedBuildInputs = [ xorg.libSM ];
   };
 
+  # See https://bugs.freedesktop.org/show_bug.cgi?id=47792
+  # Once the bug is fixed upstream, this can be removed.
+  luit = attrs: attrs // {
+    configureFlags = "--disable-selective-werror";
+  };
+
   compositeproto = attrs: attrs // {
     propagatedBuildInputs = [ xorg.fixesproto ];
   };
@@ -186,6 +192,13 @@ in
     buildInputs = attrs.buildInputs ++ [args.intltool];
   };
 
+  xmodmap = attrs: attrs // {
+    patches = [(args.fetchurl {
+      url = http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/x11-apps/xmodmap/files/xmodmap-1.0.7-_GNU_SOURCE.patch;
+      sha256 = "0q3zhy0wy1kkbpagzav8869fais4lw5q5vybgjj7wkmak06c5648";
+      name = "new-gcc.patch";
+    })];
+  };
   xorgserver = with xorg; attrs: attrs // {
     configureFlags = [
       "--enable-xcsecurity" # enable SECURITY extension
diff --git a/pkgs/shells/bash/bash-4.2-patches.nix b/pkgs/shells/bash/bash-4.2-patches.nix
index 52392f4b32c6..ac6e9e97f180 100644
--- a/pkgs/shells/bash/bash-4.2-patches.nix
+++ b/pkgs/shells/bash/bash-4.2-patches.nix
@@ -43,4 +43,7 @@ patch: [
 (patch "040" "0v5a98ybibwsd4iyh18gy0kc51mx8qn9w2wfpjaiycn7yg5gjrdj")
 (patch "041" "1szmm8xv41hvbzgxfwrj6dg85wa7zy3781nnil428rlzpm8ikk05")
 (patch "042" "017kpdqy6v9sgi2a931wyzpix86n9mkalpm6n9cb45v58lgmraps")
+(patch "043" "0mswgjk3z80qm1mb93jmbql27nbczxk86cw5byf0m29y1y2869nw")
+(patch "044" "1rk6jywzfvg1crvhib1zk37rsps73minhr7l4vcb3vfdkin2vlqh")
+(patch "045" "0vcqn9rb26bahhrarbwhpa0ny0nrf4vyrzh97d44lfcxypqfzdyx")
 ]
diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix
index ca90b46192e3..a2723f5575c0 100644
--- a/pkgs/stdenv/default.nix
+++ b/pkgs/stdenv/default.nix
@@ -62,5 +62,6 @@ rec {
     if stdenvType == "powerpc-linux" then /* stdenvLinux */ stdenvNative else
     if stdenvType == "i686-mingw" then stdenvMinGW else
     if stdenvType == "x86_64-darwin" then stdenvNix else
+    if stdenvType == "x86_64-solaris" then stdenvNix else
     stdenvNative;
 }
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix
index a139d47a8ccd..4a36327810b0 100644
--- a/pkgs/stdenv/generic/default.nix
+++ b/pkgs/stdenv/generic/default.nix
@@ -143,11 +143,13 @@ let
         isx86_64 = result.system == "x86_64-linux"
                || result.system == "x86_64-darwin"
                || result.system == "x86_64-freebsd"
-               || result.system == "x86_64-openbsd";
+               || result.system == "x86_64-openbsd"
+               || result.system == "x86_64-solaris";
         is64bit = result.system == "x86_64-linux"
                 || result.system == "x86_64-darwin"
                 || result.system == "x86_64-freebsd"
-                || result.system == "x86_64-openbsd";
+                || result.system == "x86_64-openbsd"
+                || result.system == "x86_64-solaris";
         isMips = result.system == "mips-linux"
                 || result.system == "mips64el-linux";
         isArm = result.system == "armv5tel-linux"
diff --git a/pkgs/stdenv/generic/setup-repeatable.sh b/pkgs/stdenv/generic/setup-repeatable.sh
deleted file mode 100644
index 3b2e01519320..000000000000
--- a/pkgs/stdenv/generic/setup-repeatable.sh
+++ /dev/null
@@ -1,876 +0,0 @@
-# Run the named hook, either by calling the function with that name or
-# by evaluating the variable with that name.  This allows convenient
-# setting of hooks both from Nix expressions (as attributes /
-# environment variables) and from shell scripts (as functions).
-runHook() {
-    local hookName="$1"
-    case "$(type -t $hookName)" in
-        (function|alias|builtin) $hookName;;
-        (file) source $hookName;;
-        (keyword) :;;
-        (*) eval "${!hookName}";;
-    esac
-}
-
-
-exitHandler() {
-    exitCode=$?
-    set +e
-
-    closeNest
-
-    if [ -n "$showBuildStats" ]; then
-        times > "$NIX_BUILD_TOP/.times"
-        local -a times=($(cat "$NIX_BUILD_TOP/.times"))
-        # Print the following statistics:
-        # - user time for the shell
-        # - system time for the shell
-        # - user time for all child processes
-        # - system time for all child processes
-        echo "build time elapsed: " ${times[*]}
-    fi
-
-    if [ $exitCode != 0 ]; then
-        runHook failureHook
-
-        # If the builder had a non-zero exit code and
-        # $succeedOnFailure is set, create the file
-        # `$out/nix-support/failed' to signal failure, and exit
-        # normally.  Otherwise, return the original exit code.
-        if [ -n "$succeedOnFailure" ]; then
-            echo "build failed with exit code $exitCode (ignored)"
-            mkdir -p "$out/nix-support"
-            echo -n $exitCode > "$out/nix-support/failed"
-            exit 0
-        fi
-
-    else
-        runHook exitHook
-    fi
-
-    exit $exitCode
-}
-
-trap "exitHandler" EXIT
-
-
-######################################################################
-# Helper functions that might be useful in setup hooks.
-
-
-addToSearchPathWithCustomDelimiter() {
-    local delimiter=$1
-    local varName=$2
-    local dir=$3
-    if [ -d "$dir" ]; then
-        eval export ${varName}=${!varName}${!varName:+$delimiter}${dir}
-    fi
-}
-
-PATH_DELIMITER=':'
-
-addToSearchPath() {
-    addToSearchPathWithCustomDelimiter "${PATH_DELIMITER}" "$@"
-}
-
-
-######################################################################
-# Initialisation.
-
-set -e
-
-[ -z $NIX_GCC ] && NIX_GCC=@gcc@
-
-
-# Wildcard expansions that don't match should expand to an empty list.
-# This ensures that, for instance, "for i in *; do ...; done" does the
-# right thing.
-shopt -s nullglob
-
-
-# Set up the initial path.
-PATH=
-for i in $NIX_GCC @initialPath@; do
-    if [ "$i" = / ]; then i=; fi
-    addToSearchPath PATH $i/bin
-done
-
-if [ "$NIX_DEBUG" = 1 ]; then
-    echo "initial path: $PATH"
-fi
-
-
-# Execute the pre-hook.
-export SHELL=@shell@
-if [ -z "$shell" ]; then export shell=@shell@; fi
-runHook preHook
-
-
-# Check that the pre-hook initialised SHELL.
-if [ -z "$SHELL" ]; then echo "SHELL not set"; exit 1; fi
-
-
-# Hack: run gcc's setup hook.
-envHooks=()
-crossEnvHooks=()
-if [ -f $NIX_GCC/nix-support/setup-hook ]; then
-    source $NIX_GCC/nix-support/setup-hook
-fi
-
-
-# Ensure that the given directories exists.
-ensureDir() {
-    local dir
-    for dir in "$@"; do
-        if ! [ -x "$dir" ]; then mkdir -p "$dir"; fi
-    done
-}
-
-installBin() {
-    mkdir -p $out/bin
-    cp "$@" $out/bin
-}
-
-
-# Allow the caller to augment buildInputs (it's not always possible to
-# do this before the call to setup.sh, since the PATH is empty at that
-# point; here we have a basic Unix environment).
-runHook addInputsHook
-
-
-# Recursively find all build inputs.
-findInputs() {
-    local pkg=$1
-    local var=$2
-    local propagatedBuildInputsFile=$3
-
-    case ${!var} in
-        *\ $pkg\ *)
-            return 0
-            ;;
-    esac
-
-    eval $var="'${!var} $pkg '"
-
-    if [ -f $pkg/nix-support/setup-hook ]; then
-        source $pkg/nix-support/setup-hook
-    fi
-
-    if [ -f $pkg/nix-support/$propagatedBuildInputsFile ]; then
-        for i in $(cat $pkg/nix-support/$propagatedBuildInputsFile); do
-            findInputs $i $var $propagatedBuildInputsFile
-        done
-    fi
-}
-
-crossPkgs=""
-for i in $buildInputs $propagatedBuildInputs; do
-    findInputs $i crossPkgs propagated-build-inputs
-done
-
-nativePkgs=""
-for i in $nativeBuildInputs $propagatedNativeBuildInputs; do
-    findInputs $i nativePkgs propagated-native-build-inputs
-done
-
-
-# Set the relevant environment variables to point to the build inputs
-# found above.
-addToNativeEnv() {
-    local pkg=$1
-
-    if [ -d $1/bin ]; then
-        addToSearchPath _PATH $1/bin
-    fi
-
-    # Run the package-specific hooks set by the setup-hook scripts.
-    for i in "${envHooks[@]}"; do
-        $i $pkg
-    done
-}
-
-for i in $nativePkgs; do
-    addToNativeEnv $i
-done
-
-addToCrossEnv() {
-    local pkg=$1
-
-    # Some programs put important build scripts (freetype-config and similar)
-    # into their crossDrv bin path. Intentionally these should go after
-    # the nativePkgs in PATH.
-    if [ -d $1/bin ]; then
-        addToSearchPath _PATH $1/bin
-    fi
-
-    # Run the package-specific hooks set by the setup-hook scripts.
-    for i in "${crossEnvHooks[@]}"; do
-        $i $pkg
-    done
-}
-
-for i in $crossPkgs; do
-    addToCrossEnv $i
-done
-
-
-# Add the output as an rpath.
-if [ "$NIX_NO_SELF_RPATH" != 1 ]; then
-    export NIX_LDFLAGS="-rpath $out/lib $NIX_LDFLAGS"
-    if [ -n "$NIX_LIB64_IN_SELF_RPATH" ]; then
-        export NIX_LDFLAGS="-rpath $out/lib64 $NIX_LDFLAGS"
-    fi
-    if [ -n "$NIX_LIB32_IN_SELF_RPATH" ]; then
-        export NIX_LDFLAGS="-rpath $out/lib32 $NIX_LDFLAGS"
-    fi
-fi
-
-
-# Set the TZ (timezone) environment variable, otherwise commands like
-# `date' will complain (e.g., `Tue Mar 9 10:01:47 Local time zone must
-# be set--see zic manual page 2004').
-export TZ=UTC
-
-
-# Set the prefix.  This is generally $out, but it can be overriden,
-# for instance if we just want to perform a test build/install to a
-# temporary location and write a build report to $out.
-if [ -z "$prefix" ]; then
-    prefix="$out";
-fi
-
-if [ "$useTempPrefix" = 1 ]; then
-    prefix="$NIX_BUILD_TOP/tmp_prefix";
-fi
-
-
-PATH=$_PATH${_PATH:+:}$PATH
-if [ "$NIX_DEBUG" = 1 ]; then
-    echo "final path: $PATH"
-fi
-
-
-# Make GNU Make produce nested output.
-export NIX_INDENT_MAKE=1
-
-
-# Normalize the NIX_BUILD_CORES variable. The value might be 0, which
-# means that we're supposed to try and auto-detect the number of
-# available CPU cores at run-time.
-
-if [ -z "${NIX_BUILD_CORES:-}" ]; then
-  NIX_BUILD_CORES="1"
-elif [ "$NIX_BUILD_CORES" -le 0 ]; then
-  NIX_BUILD_CORES=$(nproc 2>/dev/null || true)
-  if expr >/dev/null 2>&1 "$NIX_BUILD_CORES" : "^[0-9][0-9]*$"; then
-    :
-  else
-    NIX_BUILD_CORES="1"
-  fi
-fi
-export NIX_BUILD_CORES
-
-
-######################################################################
-# Misc. helper functions.
-
-
-stripDirs() {
-    local dirs="$1"
-    local stripFlags="$2"
-    local dirsNew=
-
-    for d in ${dirs}; do
-        if [ -d "$prefix/$d" ]; then
-            dirsNew="${dirsNew} $prefix/$d "
-        fi
-    done
-    dirs=${dirsNew}
-
-    if [ -n "${dirs}" ]; then
-        header "stripping (with flags $stripFlags) in $dirs"
-        find $dirs -type f -print0 | xargs -0 ${xargsFlags:--r} strip $stripFlags || true
-        stopNest
-    fi
-}
-
-
-######################################################################
-# Textual substitution functions.
-
-
-substitute() {
-    local input="$1"
-    local output="$2"
-
-    local -a params=("$@")
-
-    local n p pattern replacement varName
-
-    local content="$(cat $input)"
-
-    for ((n = 2; n < ${#params[*]}; n += 1)); do
-        p=${params[$n]}
-
-        if [ "$p" = --replace ]; then
-            pattern="${params[$((n + 1))]}"
-            replacement="${params[$((n + 2))]}"
-            n=$((n + 2))
-        fi
-
-        if [ "$p" = --subst-var ]; then
-            varName="${params[$((n + 1))]}"
-            pattern="@$varName@"
-            replacement="${!varName}"
-            n=$((n + 1))
-        fi
-
-        if [ "$p" = --subst-var-by ]; then
-            pattern="@${params[$((n + 1))]}@"
-            replacement="${params[$((n + 2))]}"
-            n=$((n + 2))
-        fi
-
-        content="${content//"$pattern"/$replacement}"
-    done
-
-    # !!! This doesn't work properly if $content is "-n".
-    echo -n "$content" > "$output".tmp
-    if [ -x "$output" ]; then chmod +x "$output".tmp; fi
-    mv -f "$output".tmp "$output"
-}
-
-
-substituteInPlace() {
-    local fileName="$1"
-    shift
-    substitute "$fileName" "$fileName" "$@"
-}
-
-
-substituteAll() {
-    local input="$1"
-    local output="$2"
-
-    # Select all environment variables that start with a lowercase character.
-    for envVar in $(env | sed "s/^[^a-z].*//" | sed "s/^\([^=]*\)=.*/\1/"); do
-        if [ "$NIX_DEBUG" = "1" ]; then
-            echo "$envVar -> ${!envVar}"
-        fi
-        args="$args --subst-var $envVar"
-    done
-
-    substitute "$input" "$output" $args
-}
-
-
-substituteAllInPlace() {
-    local fileName="$1"
-    shift
-    substituteAll "$fileName" "$fileName" "$@"
-}
-
-
-######################################################################
-# What follows is the generic builder.
-
-
-nestingLevel=0
-
-startNest() {
-    nestingLevel=$(($nestingLevel + 1))
-    echo -en "\033[$1p"
-}
-
-stopNest() {
-    nestingLevel=$(($nestingLevel - 1))
-    echo -en "\033[q"
-}
-
-header() {
-    startNest "$2"
-    echo "$1"
-}
-
-# Make sure that even when we exit abnormally, the original nesting
-# level is properly restored.
-closeNest() {
-    while [ $nestingLevel -gt 0 ]; do
-        stopNest
-    done
-}
-
-
-# This function is useful for debugging broken Nix builds.  It dumps
-# all environment variables to a file `env-vars' in the build
-# directory.  If the build fails and the `-K' option is used, you can
-# then go to the build directory and source in `env-vars' to reproduce
-# the environment used for building.
-dumpVars() {
-    if [ "$noDumpEnvVars" != 1 ]; then
-        export > "$NIX_BUILD_TOP/env-vars"
-    fi
-}
-
-
-# Utility function: return the base name of the given path, with the
-# prefix `HASH-' removed, if present.
-stripHash() {
-    strippedName=$(basename $1);
-    if echo "$strippedName" | grep -q '^[a-z0-9]\{32\}-'; then
-        strippedName=$(echo "$strippedName" | cut -c34-)
-    fi
-}
-
-
-unpackFile() {
-    curSrc="$1"
-    local cmd
-
-    header "unpacking source archive $curSrc" 3
-
-    case "$curSrc" in
-        *.tar.xz | *.tar.lzma)
-            # Don't rely on tar knowing about .xz.
-            xz -d < $curSrc | tar xf -
-            ;;
-        *.tar | *.tar.* | *.tgz | *.tbz2)
-            # GNU tar can automatically select the decompression method
-            # (info "(tar) gzip").
-            tar xf $curSrc
-            ;;
-        *.zip)
-            unzip -qq $curSrc
-            ;;
-        *)
-            if [ -d "$curSrc" ]; then
-                stripHash $curSrc
-                cp -prd --no-preserve=timestamps $curSrc $strippedName
-            else
-                if [ -z "$unpackCmd" ]; then
-                    echo "source archive $curSrc has unknown type"
-                    exit 1
-                fi
-                runHook unpackCmd
-            fi
-            ;;
-    esac
-
-    stopNest
-}
-
-
-unpackPhase() {
-    runHook preUnpack
-
-    if [ -z "$srcs" ]; then
-        if [ -z "$src" ]; then
-            echo 'variable $src or $srcs should point to the source'
-            exit 1
-        fi
-        srcs="$src"
-    fi
-
-    # To determine the source directory created by unpacking the
-    # source archives, we record the contents of the current
-    # directory, then look below which directory got added.  Yeah,
-    # it's rather hacky.
-    local dirsBefore=""
-    for i in *; do
-        if [ -d "$i" ]; then
-            dirsBefore="$dirsBefore $i "
-        fi
-    done
-
-    # Unpack all source archives.
-    for i in $srcs; do
-        unpackFile $i
-    done
-
-    # Find the source directory.
-    if [ -n "$setSourceRoot" ]; then
-        runHook setSourceRoot
-    elif [ -z "$sourceRoot" ]; then
-        sourceRoot=
-        for i in *; do
-            if [ -d "$i" ]; then
-                case $dirsBefore in
-                    *\ $i\ *)
-                        ;;
-                    *)
-                        if [ -n "$sourceRoot" ]; then
-                            echo "unpacker produced multiple directories"
-                            exit 1
-                        fi
-                        sourceRoot="$i"
-                        ;;
-                esac
-            fi
-        done
-    fi
-
-    if [ -z "$sourceRoot" ]; then
-        echo "unpacker appears to have produced no directories"
-        exit 1
-    fi
-
-    echo "source root is $sourceRoot"
-
-    # By default, add write permission to the sources.  This is often
-    # necessary when sources have been copied from other store
-    # locations.
-    if [ "$dontMakeSourcesWritable" != 1 ]; then
-        chmod -R u+w "$sourceRoot"
-    fi
-
-    runHook postUnpack
-}
-
-
-patchPhase() {
-    runHook prePatch
-
-    for i in $patches; do
-        header "applying patch $i" 3
-        local uncompress=cat
-        case $i in
-            *.gz)
-                uncompress="gzip -d"
-                ;;
-            *.bz2)
-                uncompress="bzip2 -d"
-                ;;
-            *.lzma)
-                uncompress="lzma -d"
-                ;;
-        esac
-        $uncompress < $i | patch ${patchFlags:--p1}
-        stopNest
-    done
-
-    runHook postPatch
-}
-
-
-fixLibtool() {
-    sed -i -e 's^eval sys_lib_.*search_path=.*^^' "$1"
-}
-
-
-configurePhase() {
-    runHook preConfigure
-
-    if [ -z "$configureScript" ]; then
-        configureScript=./configure
-        if ! [ -x $configureScript ]; then
-            echo "no configure script, doing nothing"
-            return
-        fi
-    fi
-
-    if [ -z "$dontFixLibtool" ]; then
-        for i in $(find . -name "ltmain.sh"); do
-            echo "fixing libtool script $i"
-            fixLibtool $i
-        done
-    fi
-
-    if [ -z "$dontAddPrefix" ]; then
-        configureFlags="${prefixKey:---prefix=}$prefix $configureFlags"
-    fi
-
-    # Add --disable-dependency-tracking to speed up some builds.
-    if [ -z "$dontAddDisableDepTrack" ]; then
-        if grep -q dependency-tracking $configureScript; then
-            configureFlags="--disable-dependency-tracking $configureFlags"
-        fi
-    fi
-
-    # By default, disable static builds.
-    if [ -z "$dontDisableStatic" ]; then
-        if grep -q enable-static $configureScript; then
-            configureFlags="--disable-static $configureFlags"
-        fi
-    fi
-
-    echo "configure flags: $configureFlags ${configureFlagsArray[@]}"
-    $configureScript $configureFlags "${configureFlagsArray[@]}"
-
-    runHook postConfigure
-}
-
-
-buildPhase() {
-    runHook preBuild
-
-    if [ -z "$makeFlags" ] && ! [ -n "$makefile" -o -e "Makefile" -o -e "makefile" -o -e "GNUmakefile" ]; then
-        echo "no Makefile, doing nothing"
-        return
-    fi
-
-    echo "make flags: $makeFlags ${makeFlagsArray[@]} $buildFlags ${buildFlagsArray[@]}"
-    make ${makefile:+-f $makefile} \
-        ${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} \
-        $makeFlags "${makeFlagsArray[@]}" \
-        $buildFlags "${buildFlagsArray[@]}"
-
-    runHook postBuild
-}
-
-
-checkPhase() {
-    runHook preCheck
-
-    echo "check flags: $makeFlags ${makeFlagsArray[@]} $checkFlags ${checkFlagsArray[@]}"
-    make ${makefile:+-f $makefile} \
-        ${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} \
-        $makeFlags "${makeFlagsArray[@]}" \
-        ${checkFlags:-VERBOSE=y} "${checkFlagsArray[@]}" ${checkTarget:-check}
-
-    runHook postCheck
-}
-
-
-patchELF() {
-    # Patch all ELF executables and shared libraries.
-    header "patching ELF executables and libraries"
-    if [ -e "$prefix" ]; then
-        find "$prefix" \( \
-            \( -type f -a -name "*.so*" \) -o \
-            \( -type f -a -perm +0100 \) \
-            \) -print -exec patchelf --shrink-rpath {} \;
-    fi
-    stopNest
-}
-
-
-patchShebangs() {
-    # Rewrite all script interpreter file names (`#! /path') under the
-    # specified  directory tree to paths found in $PATH.  E.g.,
-    # /bin/sh will be rewritten to /nix/store/<hash>-some-bash/bin/sh.
-    # Interpreters that are already in the store are left untouched.
-    header "patching script interpreter paths"
-    local dir="$1"
-    local f
-    for f in $(find "$dir" -type f -perm +0100); do
-        local oldPath=$(sed -ne '1 s,^#![ ]*\([^ ]*\).*$,\1,p' "$f")
-        if [ -n "$oldPath" -a "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ]; then
-            local newPath=$(type -P $(basename $oldPath) || true)
-            if [ -n "$newPath" -a "$newPath" != "$oldPath" ]; then
-                echo "$f: interpreter changed from $oldPath to $newPath"
-                sed -i -e "1 s,$oldPath,$newPath," "$f"
-            fi
-        fi
-    done
-    stopNest
-}
-
-
-installPhase() {
-    runHook preInstall
-
-    mkdir -p "$prefix"
-
-    installTargets=${installTargets:-install}
-    echo "install flags: $installTargets $makeFlags ${makeFlagsArray[@]} $installFlags ${installFlagsArray[@]}"
-    make ${makefile:+-f $makefile} $installTargets \
-        $makeFlags "${makeFlagsArray[@]}" \
-        $installFlags "${installFlagsArray[@]}"
-
-    runHook postInstall
-}
-
-
-# The fixup phase performs generic, package-independent, Nix-related
-# stuff, like running patchelf and setting the
-# propagated-build-inputs.  It should rarely be overriden.
-fixupPhase() {
-    runHook preFixup
-
-    # Put man/doc/info under $out/share.
-    forceShare=${forceShare:=man doc info}
-    if [ -n "$forceShare" ]; then
-        for d in $forceShare; do
-            if [ -d "$prefix/$d" ]; then
-                if [ -d "$prefix/share/$d" ]; then
-                    echo "both $d/ and share/$d/ exists!"
-                else
-                    echo "fixing location of $d/ subdirectory"
-                    mkdir -p $prefix/share
-                    if [ -w $prefix/share ]; then
-                        mv -v $prefix/$d $prefix/share
-                        ln -sv share/$d $prefix
-                    fi
-                fi
-            fi
-        done;
-    fi
-
-    if [ -z "$dontGzipMan" ]; then
-        GLOBIGNORE=.:..:*.gz:*.bz2
-        for f in $out/share/man/*/* $out/share/man/*/*/*; do
-            if [ -f $f ]; then
-                if gzip -c -n $f > $f.gz; then
-                    rm $f
-                else
-                    rm $f.gz
-                fi
-            fi
-        done
-        unset GLOBIGNORE
-    fi
-
-    # TODO: strip _only_ ELF executables, and return || fail here...
-    if [ -z "$dontStrip" ]; then
-        stripDebugList=${stripDebugList:-lib lib32 lib64 libexec bin sbin}
-        if [ -n "$stripDebugList" ]; then
-            stripDirs "$stripDebugList" "${stripDebugFlags:--S --enable-deterministic-archives}"
-        fi
-
-        stripAllList=${stripAllList:-}
-        if [ -n "$stripAllList" ]; then
-            stripDirs "$stripAllList" "${stripAllFlags:--s --enable-deterministic-archives}"
-        fi
-    fi
-
-    if [ "$havePatchELF" = 1 -a -z "$dontPatchELF" ]; then
-        patchELF "$prefix"
-    fi
-
-    if [ -z "$dontPatchShebangs" ]; then
-        patchShebangs "$prefix"
-    fi
-
-    if [ -n "$propagatedBuildInputs" ]; then
-        mkdir -p "$out/nix-support"
-        echo "$propagatedBuildInputs" > "$out/nix-support/propagated-build-inputs"
-    fi
-
-    if [ -n "$propagatedNativeBuildInputs" ]; then
-        mkdir -p "$out/nix-support"
-        echo "$propagatedNativeBuildInputs" > "$out/nix-support/propagated-native-build-inputs"
-    fi
-
-    if [ -n "$propagatedUserEnvPkgs" ]; then
-        mkdir -p "$out/nix-support"
-        echo "$propagatedUserEnvPkgs" > "$out/nix-support/propagated-user-env-packages"
-    fi
-
-    if [ -n "$setupHook" ]; then
-        mkdir -p "$out/nix-support"
-        substituteAll "$setupHook" "$out/nix-support/setup-hook"
-    fi
-
-    runHook postFixup
-}
-
-
-installCheckPhase() {
-    runHook preInstallCheck
-
-    echo "installcheck flags: $makeFlags ${makeFlagsArray[@]} $installCheckFlags ${installCheckFlagsArray[@]}"
-    make ${makefile:+-f $makefile} \
-        ${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} \
-        $makeFlags "${makeFlagsArray[@]}" \
-        $installCheckFlags "${installCheckFlagsArray[@]}" ${installCheckTarget:-installcheck}
-
-    runHook postInstallCheck
-}
-
-
-distPhase() {
-    runHook preDist
-
-    echo "dist flags: $distFlags ${distFlagsArray[@]}"
-    make ${makefile:+-f $makefile} $distFlags "${distFlagsArray[@]}" ${distTarget:-dist}
-
-    if [ "$dontCopyDist" != 1 ]; then
-        mkdir -p "$out/tarballs"
-
-        # Note: don't quote $tarballs, since we explicitly permit
-        # wildcards in there.
-        cp -pvd ${tarballs:-*.tar.gz} $out/tarballs
-    fi
-
-    runHook postDist
-}
-
-
-showPhaseHeader() {
-    local phase="$1"
-    case $phase in
-        unpackPhase) header "unpacking sources";;
-        patchPhase) header "patching sources";;
-        configurePhase) header "configuring";;
-        buildPhase) header "building";;
-        checkPhase) header "running tests";;
-        installPhase) header "installing";;
-        fixupPhase) header "post-installation fixup";;
-        installCheckPhase) header "running install tests";;
-        *) header "$phase";;
-    esac
-}
-
-
-genericBuild() {
-    header "building $out"
-
-    if [ -n "$buildCommand" ]; then
-        eval "$buildCommand"
-        return
-    fi
-
-    if [ -z "$phases" ]; then
-        phases="$prePhases unpackPhase patchPhase $preConfigurePhases \
-            configurePhase $preBuildPhases buildPhase checkPhase \
-            $preInstallPhases installPhase fixupPhase installCheckPhase \
-            $preDistPhases distPhase $postPhases";
-    fi
-
-    for curPhase in $phases; do
-        if [ "$curPhase" = buildPhase -a -n "$dontBuild" ]; then continue; fi
-        if [ "$curPhase" = checkPhase -a -z "$doCheck" ]; then continue; fi
-        if [ "$curPhase" = installPhase -a -n "$dontInstall" ]; then continue; fi
-        if [ "$curPhase" = fixupPhase -a -n "$dontFixup" ]; then continue; fi
-        if [ "$curPhase" = installCheckPhase -a -z "$doInstallCheck" ]; then continue; fi
-        if [ "$curPhase" = distPhase -a -z "$doDist" ]; then continue; fi
-
-        if [ -n "$tracePhases" ]; then
-            echo
-            echo "@ phase-started $out $curPhase"
-        fi
-
-        showPhaseHeader "$curPhase"
-        dumpVars
-
-        # Evaluate the variable named $curPhase if it exists, otherwise the
-        # function named $curPhase.
-        eval "${!curPhase:-$curPhase}"
-
-        if [ "$curPhase" = unpackPhase ]; then
-            cd "${sourceRoot:-.}"
-        fi
-
-        if [ -n "$tracePhases" ]; then
-            echo
-            echo "@ phase-succeeded $out $curPhase"
-        fi
-
-        stopNest
-    done
-
-    stopNest
-}
-
-
-# Execute the post-hook.
-runHook postHook
-
-
-# Execute the global user hook (defined through the Nixpkgs
-# configuration option ‘stdenv.userHook’).  This can be used to set
-# global compiler optimisation flags, for instance.
-runHook userHook
-
-
-dumpVars
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh
index a474b6a8eaf1..4740c6386339 100644
--- a/pkgs/stdenv/generic/setup.sh
+++ b/pkgs/stdenv/generic/setup.sh
@@ -109,7 +109,6 @@ runHook preHook
 # Check that the pre-hook initialised SHELL.
 if [ -z "$SHELL" ]; then echo "SHELL not set"; exit 1; fi
 
-
 # Hack: run gcc's setup hook.
 envHooks=()
 crossEnvHooks=()
@@ -289,7 +288,7 @@ stripDirs() {
 
     if [ -n "${dirs}" ]; then
         header "stripping (with flags $stripFlags) in $dirs"
-        find $dirs -type f -print0 | xargs -0 ${xargsFlags:--r} strip $stripFlags || true
+        find $dirs -type f -print0 | xargs -0 ${xargsFlags:--r} strip $commonStripFlags $stripFlags || true
         stopNest
     fi
 }
@@ -540,11 +539,15 @@ patchPhase() {
             *.bz2)
                 uncompress="bzip2 -d"
                 ;;
+            *.xz)
+                uncompress="xz -d"
+                ;;
             *.lzma)
                 uncompress="lzma -d"
                 ;;
         esac
-        $uncompress < $i | patch ${patchFlags:--p1}
+        # "2>&1" is a hack to make patch fail if the decompressor fails (nonexistent patch, etc.)
+        $uncompress < $i 2>&1 | patch ${patchFlags:--p1}
         stopNest
     done
 
@@ -569,7 +572,7 @@ configurePhase() {
     fi
 
     if [ -z "$dontFixLibtool" ]; then
-        for i in $(find . -name "ltmain.sh"); do
+        find . -iname "ltmain.sh" | while read i; do
             echo "fixing libtool script $i"
             fixLibtool $i
         done
@@ -608,6 +611,9 @@ buildPhase() {
         return
     fi
 
+    # See https://github.com/NixOS/nixpkgs/pull/1354#issuecomment-31260409
+    makeFlags="SHELL=$SHELL $makeFlags"
+
     echo "make flags: $makeFlags ${makeFlagsArray[@]} $buildFlags ${buildFlagsArray[@]}"
     make ${makefile:+-f $makefile} \
         ${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} \
@@ -638,7 +644,7 @@ patchELF() {
         find "$prefix" \( \
             \( -type f -a -name "*.so*" \) -o \
             \( -type f -a -perm +0100 \) \
-            \) -print -exec patchelf --shrink-rpath {} \;
+            \) -print -exec patchelf --shrink-rpath '{}' \;
     fi
     stopNest
 }
@@ -648,20 +654,59 @@ patchShebangs() {
     # Rewrite all script interpreter file names (`#! /path') under the
     # specified  directory tree to paths found in $PATH.  E.g.,
     # /bin/sh will be rewritten to /nix/store/<hash>-some-bash/bin/sh.
+    # /usr/bin/env gets special treatment so that ".../bin/env python" is
+    # rewritten to /nix/store/<hash>/bin/python.
     # Interpreters that are already in the store are left untouched.
     header "patching script interpreter paths"
     local dir="$1"
     local f
-    for f in $(find "$dir" -type f -perm +0100); do
-        local oldPath=$(sed -ne '1 s,^#![ ]*\([^ ]*\).*$,\1,p' "$f")
+    local oldPath
+    local newPath
+    local arg0
+    local args
+    local oldInterpreterLine
+    local newInterpreterLine
+
+    find "$dir" -type f -perm +0100 | while read f; do
+        if [ "$(head -1 "$f" | head -c +2)" != '#!' ]; then
+            # missing shebang => not a script
+            continue
+        fi
+
+        oldInterpreterLine=$(head -1 "$f" | tail -c +3)
+        read -r oldPath arg0 args <<< "$oldInterpreterLine"
+
+        if $(echo "$oldPath" | grep -q "/bin/env$"); then
+            # Check for unsupported 'env' functionality:
+            # - options: something starting with a '-'
+            # - environment variables: foo=bar
+            if $(echo "$arg0" | grep -q -- "^-.*\|.*=.*"); then
+                echo "unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)"
+                exit 1
+            fi
+            newPath="$(command -v "$arg0" || true)"
+        else
+            if [ "$oldPath" = "" ]; then
+                # If no interpreter is specified linux will use /bin/sh. Set
+                # oldpath="/bin/sh" so that we get /nix/store/.../sh.
+                oldPath="/bin/sh"
+            fi
+            newPath="$(command -v "$(basename "$oldPath")" || true)"
+            args="$arg0 $args"
+        fi
+
+        newInterpreterLine="$newPath $args"
+
         if [ -n "$oldPath" -a "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ]; then
-            local newPath=$(type -P $(basename $oldPath) || true)
             if [ -n "$newPath" -a "$newPath" != "$oldPath" ]; then
-                echo "$f: interpreter changed from $oldPath to $newPath"
-                sed -i -e "1 s,$oldPath,$newPath," "$f"
+                echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\""
+                # escape the escape chars so that sed doesn't interpret them
+                escapedInterpreterLine=$(echo "$newInterpreterLine" | sed 's|\\|\\\\|g')
+                sed -i -e "1 s|.*|#\!$escapedInterpreterLine|" "$f"
             fi
         fi
     done
+
     stopNest
 }
 
@@ -687,6 +732,9 @@ installPhase() {
 fixupPhase() {
     runHook preFixup
 
+    # Make sure everything is writable so "strip" et al. work.
+    if [ -e "$prefix" ]; then chmod -R u+w "$prefix"; fi
+
     # Put man/doc/info under $out/share.
     forceShare=${forceShare:=man doc info}
     if [ -n "$forceShare" ]; then
@@ -707,16 +755,22 @@ fixupPhase() {
     fi
 
     if [ -z "$dontGzipMan" ]; then
+        echo "gzipping man pages"
         GLOBIGNORE=.:..:*.gz:*.bz2
-        for f in $out/share/man/*/* $out/share/man/*/*/*; do
-            if [ -f $f ]; then
-                if gzip -c $f > $f.gz; then
-                    rm $f
+        for f in "$out"/share/man/*/* "$out"/share/man/*/*/*; do
+            if [ -f "$f" -a ! -L "$f" ]; then
+                if gzip -c -n "$f" > "$f".gz; then
+                    rm "$f"
                 else
-                    rm $f.gz
+                    rm "$f".gz
                 fi
             fi
         done
+        for f in "$out"/share/man/*/* "$out"/share/man/*/*/*; do
+            if [ -L "$f" -a -f `readlink -f "$f"`.gz ]; then
+                ln -sf `readlink "$f"`.gz "$f".gz && rm "$f"
+            fi
+        done
         unset GLOBIGNORE
     fi
 
@@ -863,7 +917,8 @@ genericBuild() {
 }
 
 
-# Execute the post-hook.
+# Execute the post-hooks.
+for i in "${postHooks[@]}"; do $i; done
 runHook postHook
 
 
diff --git a/pkgs/stdenv/linux/bootstrap/armv5tel/default.nix b/pkgs/stdenv/linux/bootstrap/armv5tel/default.nix
index 1d4d53a38ee6..e8f04497bd91 100644
--- a/pkgs/stdenv/linux/bootstrap/armv5tel/default.nix
+++ b/pkgs/stdenv/linux/bootstrap/armv5tel/default.nix
@@ -1,10 +1,65 @@
-{
-  sh = ./sh;
-  bzip2 = ./bzip2;
-  mkdir = ./mkdir;
-  cpio = ./cpio;
-  ln = ./ln;
-  curl = ./curl.bz2;
+let fetch = { file, sha256 }:
+    let
+      nixFetchurl = import <nix/fetchurl.nix>;
+      args = {
+        url = "file://${builtins.toString ./.}/${file}";
+        inherit sha256;
+        executable = true;
+      };
+    in if (builtins.functionArgs nixFetchurl) ? executable
+      then nixFetchurl args
+      else derivation {
+        name = file;
+        builder = "/bin/sh";
+
+        system = builtins.currentSystem;
+
+        args = [ "-c" "echo $message; exit 1" ];
+
+        message = ''
+          Sorry, this version of nix cannot download all of the bootstrap tools.
+          Please download ${args.url}, make it executable, add it to the store
+          with `nix-store --add', and try again.
+        '';
+
+        outputHashAlgo = "sha256";
+
+        outputHash = args.sha256;
+
+        outputHashMode = "recursive";
+
+        preferLocalBuild = true;
+      };
+in {
+  sh = fetch {
+    file = "sh";
+    sha256 = "1kv3gc8h209rjc5i0rzzc4pjxq23kzq25iff89in05c9vl20mn4n";
+  };
+
+  bzip2 = fetch {
+    file = "bzip2";
+    sha256 = "090jrj099wl33q0iq092iljilam39pv8acli59m2af0fa9z0d9f0";
+  };
+
+  mkdir = fetch {
+    file = "mkdir";
+    sha256 = "01s8myfvi559dsxvbanxw71vxzjv49k4gi1qh0ak6l0qx0xq602b";
+  };
+
+  cpio = fetch {
+    file = "cpio";
+    sha256 = "07snc8l0mn84w2xrvdmc5yfpmlbrvl2bar8wipbpvm43nzz2qbzs";
+  };
+
+  ln = fetch {
+    file = "ln";
+    sha256 = "0m9fz02bashpfgwfkxmrp4wa8a5r3il52bclvf6z36vsam0vx56d";
+  };
+
+  curl = fetch {
+    file = "curl.bz2";
+    sha256 = "19yqdjqi31zlnqn8ss2ml60iq2a1vrwfw6dmvjqp6qbxmh7yb8n8";
+  };
 
   bootstrapTools = {
     url = "http://tarballs.nixos.org/stdenv-linux/armv5tel/r18744/bootstrap-tools.cpio.bz2";
diff --git a/pkgs/stdenv/linux/bootstrap/armv6l/default.nix b/pkgs/stdenv/linux/bootstrap/armv6l/default.nix
index ecda6be8bd32..542f74de49fe 100644
--- a/pkgs/stdenv/linux/bootstrap/armv6l/default.nix
+++ b/pkgs/stdenv/linux/bootstrap/armv6l/default.nix
@@ -1,11 +1,7 @@
-{
-  sh = ../armv5tel/sh;
-  bzip2 = ../armv5tel/bzip2;
-  mkdir = ../armv5tel/mkdir;
-  cpio = ../armv5tel/cpio;
-  ln = ../armv5tel/ln;
-  curl = ../armv5tel/curl.bz2;
+# Use the static tools for armv5tel-linux.
+(import ../armv5tel) //
 
+{
   bootstrapTools = {
     # Built from make-bootstrap-tools-crosspi.nix
     # nixpkgs rev eb0422e4c1263a65a9b2b954fe10a1e03d67db3e
diff --git a/pkgs/stdenv/linux/bootstrap/i686/default.nix b/pkgs/stdenv/linux/bootstrap/i686/default.nix
index dc4fee1beccb..9c78dcc7b2fa 100644
--- a/pkgs/stdenv/linux/bootstrap/i686/default.nix
+++ b/pkgs/stdenv/linux/bootstrap/i686/default.nix
@@ -1,10 +1,66 @@
-{
-  sh = ./sh;
-  bzip2 = ./bzip2;
-  mkdir = ./mkdir;
-  cpio = ./cpio;
-  ln = ./ln;
-  curl = ./curl.bz2;
+let
+  fetch = { file, sha256 }:
+    let
+      nixFetchurl = import <nix/fetchurl.nix>;
+      args = {
+        url = "file://${builtins.toString ./.}/${file}";
+        inherit sha256;
+        executable = true;
+      };
+    in if (builtins.functionArgs nixFetchurl) ? executable
+      then nixFetchurl args
+      else derivation {
+        name = file;
+        builder = "/bin/sh";
+
+        system = builtins.currentSystem;
+
+        args = [ "-c" "echo $message; exit 1" ];
+
+        message = ''
+          Sorry, this version of nix cannot download all of the bootstrap tools.
+          Please download ${args.url}, make it executable, add it to the store
+          with `nix-store --add', and try again.
+        '';
+
+        outputHashAlgo = "sha256";
+
+        outputHash = args.sha256;
+
+        outputHashMode = "recursive";
+
+        preferLocalBuild = true;
+      };
+in {
+  sh = fetch {
+    file = "sh";
+    sha256 = "1l6sdhyqjlh4m5gj3pfpi8aisp1m012lpwxfcc4v1x8g429mflmy";
+  };
+
+  bzip2 = fetch {
+    file = "bzip2";
+    sha256 = "1p5nkrdn52jm6rsx8x3wwjpsh83f2qsjl1qckkgnkplwhj23zjp7";
+  };
+
+  mkdir = fetch {
+    file = "mkdir";
+    sha256 = "02ff7i9ph9ahiapsg2v9c3pwr7sl73sk4n7ic112ljkrgwkail33";
+  };
+
+  cpio = fetch {
+    file = "cpio";
+    sha256 = "046if3aqqramyhrn2yxrjf4bfkl8x1bcqxhvi7ml9nrv9smx8irg";
+  };
+
+  ln = fetch {
+    file = "ln";
+    sha256 = "06vr474i3x55p0rnqa87yx7dzf4qdfpfg201mks39id43cjm9f8j";
+  };
+
+  curl = fetch {
+    file = "curl.bz2";
+    sha256 = "1v0yfb4gcdyqpl2fxlxjh337r28c23iqm7vwck4p4643xd55di7q";
+  };
 
   bootstrapTools = {
     url = http://tarballs.nixos.org/stdenv-linux/i686/r24519/bootstrap-tools.cpio.bz2;
diff --git a/pkgs/stdenv/linux/bootstrap/loongson2f/default.nix b/pkgs/stdenv/linux/bootstrap/loongson2f/default.nix
index b9a294e13325..e49b09eb23cb 100644
--- a/pkgs/stdenv/linux/bootstrap/loongson2f/default.nix
+++ b/pkgs/stdenv/linux/bootstrap/loongson2f/default.nix
@@ -1,10 +1,66 @@
-{
-  sh = ./sh;
-  bzip2 = ./bzip2;
-  mkdir = ./mkdir;
-  cpio = ./cpio;
-  ln = ./ln;
-  curl = ./curl.bz2;
+let
+  fetch = { file, sha256 }:
+    let
+      nixFetchurl = import <nix/fetchurl.nix>;
+      args = {
+        url = "file://${builtins.toString ./.}/${file}";
+        inherit sha256;
+        executable = true;
+      };
+    in if (builtins.functionArgs nixFetchurl) ? executable
+      then nixFetchurl args
+      else derivation {
+        name = file;
+        builder = "/bin/sh";
+
+        system = builtins.currentSystem;
+
+        args = [ "-c" "echo $message; exit 1" ];
+
+        message = ''
+          Sorry, this version of nix cannot download all of the bootstrap tools.
+          Please download ${args.url}, make it executable, add it to the store
+          with `nix-store --add', and try again.
+        '';
+
+        outputHashAlgo = "sha256";
+
+        outputHash = args.sha256;
+
+        outputHashMode = "recursive";
+
+        preferLocalBuild = true;
+      };
+in {
+  sh = fetch {
+    file = "sh";
+    sha256 = "02jjl49wdq85pgh61aqf78yaknn9mi3rcspbpk7hs9c4mida2rhf";
+  };
+
+  bzip2 = fetch {
+    file = "bzip2";
+    sha256 = "1qn27y3amj9c6mnjk2kyb59y0d2w4yv16z9apaxx91hyq19gf29z";
+  };
+
+  mkdir = fetch {
+    file = "mkdir";
+    sha256 = "1vbp2bv9hkyb2fwl8hjrffpywn1wrl1kc4yrwi2lirawlnc6kymh";
+  };
+
+  cpio = fetch {
+    file = "cpio";
+    sha256 = "0mqxwdx0sl7skxx6049mk35l7d0fnibqsv174284kdp4p7iixwa0";
+  };
+
+  ln = fetch {
+    file = "ln";
+    sha256 = "05lwx8qvga3yv8xhs8bjgsfygsfrcxsfck0lxw6gsdckx25fgi7s";
+  };
+
+  curl = fetch {
+    file = "curl.bz2";
+    sha256 = "0iblnz4my54gryac04i64fn3ksi9g3dx96yjq93fj39z6kx6151c";
+  };
 
   bootstrapTools = {
     url = "http://tarballs.nixos.org/stdenv-linux/loongson2f/r22849/cross-bootstrap-tools.cpio.bz2";
diff --git a/pkgs/stdenv/linux/bootstrap/powerpc/default.nix b/pkgs/stdenv/linux/bootstrap/powerpc/default.nix
index d3569362b6c5..4ad8bc93e442 100644
--- a/pkgs/stdenv/linux/bootstrap/powerpc/default.nix
+++ b/pkgs/stdenv/linux/bootstrap/powerpc/default.nix
@@ -1,9 +1,61 @@
-{
-  bash = ./bash;
-  bzip2 = ./bzip2;
-  cp = ./cp;
-  curl = ./curl.bz2;
-  tar = ./tar.bz2;
+let
+  fetch = { file, sha256 }:
+    let
+      nixFetchurl = import <nix/fetchurl.nix>;
+      args = {
+        url = "file://${builtins.toString ./.}/${file}";
+        inherit sha256;
+        executable = true;
+      };
+    in if (builtins.functionArgs nixFetchurl) ? executable
+      then nixFetchurl args
+      else derivation {
+        name = file;
+        builder = "/bin/sh";
+
+        system = builtins.currentSystem;
+
+        args = [ "-c" "echo $message; exit 1" ];
+
+        message = ''
+          Sorry, this version of nix cannot download all of the bootstrap tools.
+          Please download ${args.url}, make it executable, add it to the store
+          with `nix-store --add', and try again.
+        '';
+
+        outputHashAlgo = "sha256";
+
+        outputHash = args.sha256;
+
+        outputHashMode = "recursive";
+
+        preferLocalBuild = true;
+      };
+in {
+  bash = fetch {
+    file = "bash";
+    sha256 = "0zss8im6hbx6z2i2wxn1554kd7ggdqdli4xk39cy5fchlnz9bqpp";
+  };
+
+  bzip2 = fetch {
+    file = "bzip2";
+    sha256 = "01ylj8x7albv6k9sqx2h1prsazh4d8y22nga0pwai2bnns0q9qdg";
+  };
+
+  cp = fetch {
+    file = "cp";
+    sha256 = "0d7xbzrv22bxgw7w9b03rakirna5zfvr9gzwm7ichd2fh634hvgl";
+  };
+
+  curl = fetch {
+    file = "curl.bz2";
+    sha256 = "17c25dfslw3qkjlcmihpbhn3x4kj9pgkslizv89ggnki7iiy4jgh";
+  };
+
+  tar = fetch {
+    file = "tar.bz2";
+    sha256 = "132ylqwz02hw5njqx7wvj4sxpcrllx8b8b3a00rlv6iad671ayyr";
+  };
 
   staticToolsURL = {
     url = http://tarballs.nixos.org/stdenv-linux/powerpc/r9828/static-tools.tar.bz2;
diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix
index 84af23a263cd..bedeea0915d3 100644
--- a/pkgs/stdenv/linux/default.nix
+++ b/pkgs/stdenv/linux/default.nix
@@ -7,7 +7,7 @@
 # The function defaults are for easy testing.
 { system ? builtins.currentSystem
 , allPackages ? import ../../top-level/all-packages.nix
-, platform ? null, config }:
+, platform ? null, config ? {} }:
 
 rec {
 
@@ -17,7 +17,7 @@ rec {
     else if system == "powerpc-linux" then import ./bootstrap/powerpc
     else if system == "armv5tel-linux" then import ./bootstrap/armv5tel
     else if system == "armv6l-linux" then import ./bootstrap/armv6l
-    else if system == "armv7l-linux" then import ./bootstrap/armv5tel
+    else if system == "armv7l-linux" then import ./bootstrap/armv6l
     else if system == "mips64el-linux" then import ./bootstrap/loongson2f
     else abort "unsupported platform for the pure Linux stdenv";
 
@@ -58,7 +58,8 @@ rec {
     builder = bootstrapFiles.sh;
 
     args =
-      if (system == "armv5tel-linux" || system == "armv6l-linux")
+      if system == "armv5tel-linux" || system == "armv6l-linux" 
+        || system == "armv7l-linux"
       then [ ./scripts/unpack-bootstrap-tools-arm.sh ]
       else [ ./scripts/unpack-bootstrap-tools.sh ];
 
@@ -165,12 +166,14 @@ rec {
     bootStdenv = stdenvLinuxBoot1;
   };
 
+  binutils1 = stdenvLinuxBoot1Pkgs.binutils.override { gold = false; };
 
-  # 3) 2nd stdenv that we will use to build only the glibc.
+
+  # 3) 2nd stdenv that we will use to build only Glibc.
   stdenvLinuxBoot2 = stdenvBootFun {
     gcc = wrapGCC {
       libc = bootstrapGlibc;
-      binutils = stdenvLinuxBoot1Pkgs.binutils;
+      binutils = binutils1;
       coreutils = bootstrapTools;
     };
     overrides = pkgs: {
@@ -181,7 +184,7 @@ rec {
 
 
   # 4) These are the packages that we can build with the 2nd
-  #    stdenv.  We only need Glibc (in step 5).
+  #    stdenv.
   stdenvLinuxBoot2Pkgs = allPackages {
     inherit system platform;
     bootStdenv = stdenvLinuxBoot2;
@@ -193,12 +196,12 @@ rec {
   stdenvLinuxGlibc = stdenvLinuxBoot2Pkgs.glibc;
 
 
-  # 6) Construct a third stdenv identical to the 2nd, except that
-  #    this one uses the Glibc built in step 3.  It still uses
-  #    the recent binutils and rest of the bootstrap tools, including GCC.
+  # 6) Construct a third stdenv identical to the 2nd, except that this
+  #    one uses the Glibc built in step 5.  It still uses the recent
+  #    binutils and rest of the bootstrap tools, including GCC.
   stdenvLinuxBoot3 = stdenvBootFun {
     gcc = wrapGCC {
-      binutils = stdenvLinuxBoot1Pkgs.binutils;
+      binutils = binutils1;
       coreutils = bootstrapTools;
       libc = stdenvLinuxGlibc;
     };
@@ -215,6 +218,9 @@ rec {
       cloog = pkgs.cloog.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
       ppl = pkgs.ppl.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
     };
+    extraAttrs = {
+      glibc = stdenvLinuxGlibc;   # Required by gcc47 build
+    };
     inherit fetchurl;
   };
 
@@ -227,12 +233,11 @@ rec {
 
 
   # 8) Construct a fourth stdenv identical to the second, except that
-  #    this one uses the dynamically linked GCC and Binutils from step
-  #    5.  The other tools (e.g. coreutils) are still from the
-  #    bootstrap tools.
+  #    this one uses the new GCC from step 7.  The other tools
+  #    (e.g. coreutils) are still from the bootstrap tools.
   stdenvLinuxBoot4 = stdenvBootFun {
     gcc = wrapGCC rec {
-      inherit (stdenvLinuxBoot3Pkgs) binutils;
+      binutils = binutils1;
       coreutils = bootstrapTools;
       libc = stdenvLinuxGlibc;
       gcc = stdenvLinuxBoot3Pkgs.gcc.gcc;
@@ -254,9 +259,9 @@ rec {
   };
 
 
-  # 10) Construct the final stdenv.  It uses the Glibc, GCC and
-  #     Binutils built above, and adds in dynamically linked versions
-  #     of all other tools.
+  # 10) Construct the final stdenv.  It uses the Glibc and GCC, and
+  #     adds in a new binutils that doesn't depend on bootstrap-tools,
+  #     as well as dynamically linked versions of all other tools.
   #
   #     When updating stdenvLinux, make sure that the result has no
   #     dependency (`nix-store -qR') on bootstrapTools or the
@@ -264,15 +269,20 @@ rec {
   stdenvLinux = import ../generic rec {
     inherit system config;
 
-    preHook = commonPreHook;
+    preHook =
+      ''
+        # Make "strip" produce deterministic output, by setting
+        # timestamps etc. to a fixed value.
+        commonStripFlags="--enable-deterministic-archives"
+        ${commonPreHook}
+      '';
 
     initialPath =
       ((import ../common-path.nix) {pkgs = stdenvLinuxBoot4Pkgs;})
       ++ [stdenvLinuxBoot4Pkgs.patchelf];
 
     gcc = wrapGCC rec {
-      inherit (stdenvLinuxBoot3Pkgs) binutils;
-      inherit (stdenvLinuxBoot4Pkgs) coreutils;
+      inherit (stdenvLinuxBoot4Pkgs) binutils coreutils;
       libc = stdenvLinuxGlibc;
       gcc = stdenvLinuxBoot4.gcc.gcc;
       shell = stdenvLinuxBoot4Pkgs.bash + "/bin/bash";
diff --git a/pkgs/stdenv/linux/make-bootstrap-tools-crosspi.nix b/pkgs/stdenv/linux/make-bootstrap-tools-crosspi.nix
index aeea4b53c15c..9ea63a46be3e 100644
--- a/pkgs/stdenv/linux/make-bootstrap-tools-crosspi.nix
+++ b/pkgs/stdenv/linux/make-bootstrap-tools-crosspi.nix
@@ -73,7 +73,7 @@ let
   patch = pkgs.patch.crossDrv;
   patchelf = pkgs.patchelf.crossDrv;
   replace = pkgs.replace.crossDrv;
-  gcc = pkgs.gcc47;
+  gcc = pkgs.gcc;
   gmp = pkgs.gmp.crossDrv;
   mpfr = pkgs.mpfr.crossDrv;
   ppl = pkgs.ppl.crossDrv;
diff --git a/pkgs/stdenv/native/default.nix b/pkgs/stdenv/native/default.nix
index 524b2a53337b..715bc02758bc 100644
--- a/pkgs/stdenv/native/default.nix
+++ b/pkgs/stdenv/native/default.nix
@@ -9,6 +9,7 @@ rec {
   path =
     (if system == "i686-solaris" then [ "/usr/gnu" ] else []) ++
     (if system == "i686-netbsd" then [ "/usr/pkg" ] else []) ++
+    (if system == "x86_64-solaris" then [ "/opt/local/gnu" ] else []) ++
     ["/" "/usr" "/usr/local"];
 
   prehookBase = ''
@@ -112,7 +113,7 @@ rec {
     name = "gcc-native";
     nativeTools = true;
     nativeLibc = true;
-    nativePrefix = if system == "i686-solaris" then "/usr/gnu" else "/usr";
+    nativePrefix = if system == "i686-solaris" then "/usr/gnu" else if system == "x86_64-solaris" then "/opt/local/gcc47" else "/usr";
     stdenv = stdenvBoot0;
   };
 
diff --git a/pkgs/stdenv/nix/default.nix b/pkgs/stdenv/nix/default.nix
index d0f7d60f101c..b16c51f7580b 100644
--- a/pkgs/stdenv/nix/default.nix
+++ b/pkgs/stdenv/nix/default.nix
@@ -23,6 +23,7 @@ import ../generic rec {
 
   gcc = import ../../build-support/gcc-wrapper {
     nativeTools = false;
+    nativePrefix = stdenv.lib.optionalString stdenv.isSunOS "/usr";
     nativeLibc = true;
     inherit stdenv;
     binutils =
diff --git a/pkgs/tools/archivers/cpio/default.nix b/pkgs/tools/archivers/cpio/default.nix
index 1700f03d7bd8..ec873507c85e 100644
--- a/pkgs/tools/archivers/cpio/default.nix
+++ b/pkgs/tools/archivers/cpio/default.nix
@@ -1,21 +1,14 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation {
-  name = "cpio-2.9";
-  
+  name = "cpio-2.11";
+
   src = fetchurl {
-    url = mirror://gnu/cpio/cpio-2.9.tar.bz2;
-    sha256 = "01s7f9hg8kgpis96j99hgkiqgdy53pm7qi7bhm3fzx58jfk5z6mv";
+    url = mirror://gnu/cpio/cpio-2.11.tar.bz2;
+    sha256 = "bb820bfd96e74fc6ce43104f06fe733178517e7f5d1cdee553773e8eff7d5bbd";
   };
 
-  patches = [
-    # Make it compile on GCC 4.3.
-    (fetchurl {
-      name = "cpio-2.9-gnu-inline.patch";
-      url = "http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/app-arch/cpio/files/cpio-2.9-gnu-inline.patch?rev=1.1";
-      sha256 = "1167hrq64h9lh3qhgasm2rivfzkkgx6fik92b017qfa0q61ff8c3";
-    })
-  ];
+  patches = [ ./no-gets.patch ];
 
   meta = {
     homepage = http://www.gnu.org/software/cpio/;
diff --git a/pkgs/development/tools/misc/gnum4/no-gets.patch b/pkgs/tools/archivers/cpio/no-gets.patch
index 456c08b56c34..f7a9be324df4 100644
--- a/pkgs/development/tools/misc/gnum4/no-gets.patch
+++ b/pkgs/tools/archivers/cpio/no-gets.patch
@@ -1,8 +1,6 @@
-http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-devel/m4/files/m4-1.4.16-no-gets.patch?revision=1.1
+https://bugs.gentoo.org/424974
 
-https://bugs.gentoo.org/424978
-
-hack until m4 pulls a newer gnulib version
+hack until gzip pulls a newer gnulib version
 
 From 66712c23388e93e5c518ebc8515140fa0c807348 Mon Sep 17 00:00:00 2001
 From: Eric Blake <eblake@redhat.com>
@@ -14,8 +12,8 @@ and glibc have dropped it, we should be more proactive about warning
 any user on a platform that still has a declaration of this dangerous
 interface.
 
---- a/lib/stdio.in.h
-+++ b/lib/stdio.in.h
+--- a/gnu/stdio.in.h
++++ b/gnu/stdio.in.h
 @@ -125,7 +125,6 @@
     so any use of gets warrants an unconditional warning.  Assume it is
     always declared, since it is required by C89.  */
diff --git a/pkgs/tools/archivers/gnutar/default.nix b/pkgs/tools/archivers/gnutar/default.nix
index 24249e383951..6428fbaa9dc4 100644
--- a/pkgs/tools/archivers/gnutar/default.nix
+++ b/pkgs/tools/archivers/gnutar/default.nix
@@ -1,18 +1,17 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "gnutar-1.26";
+  name = "gnutar-${version}";
+  version = "1.27.1";
 
   src = fetchurl {
-    url = "mirror://gnu/tar/tar-1.26.tar.bz2";
-    sha256 = "0hbdkzmchq9ycr2x1pxqdcgdbaxksh8c6ac0jf75jajhcks6jlss";
+    url = "mirror://gnu/tar/tar-${version}.tar.bz2";
+    sha256 = "1iip0fk0wqhxb0jcwphz43r4fxkx1y7mznnhmlvr618jhp7b63wv";
   };
 
-  patches = [ ./gets-undeclared.patch ];
-
   # May have some issues with root compilation because the bootstrap tool
   # cannot be used as a login shell for now.
-  FORCE_UNSAFE_CONFIGURE = stdenv.lib.optionalString (stdenv.system == "armv7l-linux") "1";
+  FORCE_UNSAFE_CONFIGURE = stdenv.lib.optionalString (stdenv.system == "armv7l-linux" || stdenv.isSunOS) "1";
 
   meta = {
     homepage = http://www.gnu.org/software/tar/;
diff --git a/pkgs/tools/archivers/gnutar/gets-undeclared.patch b/pkgs/tools/archivers/gnutar/gets-undeclared.patch
deleted file mode 100644
index 301a09dde128..000000000000
--- a/pkgs/tools/archivers/gnutar/gets-undeclared.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-This patch is needed to allow builds with newer versions of
-the GNU libc (2.16+).
-
-This is a backport of this patch:
-
-commit 66712c23388e93e5c518ebc8515140fa0c807348
-Author: Eric Blake <eblake@redhat.com>
-Date:   Thu Mar 29 13:30:41 2012 -0600
-
-    stdio: don't assume gets any more
-    
---- tar-1.26/gnu/stdio.in.h	2012-07-02 14:28:45.000000000 +0200
-+++ tar-1.26/gnu/stdio.in.h	2012-07-02 14:28:50.000000000 +0200
-@@ -160,12 +160,6 @@ _GL_WARN_ON_USE (fflush, "fflush is not
-                  "use gnulib module fflush for portable POSIX compliance");
- #endif
- 
--/* It is very rare that the developer ever has full control of stdin,
--   so any use of gets warrants an unconditional warning.  Assume it is
--   always declared, since it is required by C89.  */
--#undef gets
--_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
--
- #if @GNULIB_FOPEN@
- # if @REPLACE_FOPEN@
- #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
diff --git a/pkgs/tools/compression/gzip/default.nix b/pkgs/tools/compression/gzip/default.nix
index 0e6742253441..b1d127635f61 100644
--- a/pkgs/tools/compression/gzip/default.nix
+++ b/pkgs/tools/compression/gzip/default.nix
@@ -1,13 +1,18 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchurl, less }:
 
 stdenv.mkDerivation rec {
-  name = "gzip-1.5";
+  name = "gzip-1.6";
 
   src = fetchurl {
     url = "mirror://gnu/gzip/${name}.tar.xz";
-    sha256 = "0wx1nqk709kx75cwp2axachnbxryp4gyl06qxn5nl95184w0mhls";
+    sha256 = "0ivqnbhiwd12q8hp3qw6rpsrpw2jg5y2mymk8cn22lsx90dfvprp";
   };
 
+  enableParallelBuilding = true;
+
+  # In stdenv-linux, prevent a dependency on bootstrap-tools.
+  makeFlags = "SHELL=/bin/sh GREP=grep";
+
   meta = {
     homepage = http://www.gnu.org/software/gzip/;
     description = "Gzip, the GNU zip compression program";
@@ -25,7 +30,5 @@ stdenv.mkDerivation rec {
       '';
 
     license = "GPLv3+";
-
-    maintainers = [ ];
   };
 }
diff --git a/pkgs/tools/compression/xz/default.nix b/pkgs/tools/compression/xz/default.nix
index 26c1597f2aa8..6d59bd927cff 100644
--- a/pkgs/tools/compression/xz/default.nix
+++ b/pkgs/tools/compression/xz/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "xz-5.0.4";
+  name = "xz-5.0.5";
 
   src = fetchurl {
     url = "http://tukaani.org/xz/${name}.tar.bz2";
-    sha256 = "14nf55b47335aakswqk0kqv1qsh4269rnb757dmkkbd1sdhb1naw";
+    sha256 = "1404i59bp6rzxya0br1q9njdv32z4sggyfrkjr7vq695hk94hv0n";
   };
 
   doCheck = true;
diff --git a/pkgs/tools/filesystems/e2fsprogs/default.nix b/pkgs/tools/filesystems/e2fsprogs/default.nix
index 9e1fa728e175..16e836e2ddc2 100644
--- a/pkgs/tools/filesystems/e2fsprogs/default.nix
+++ b/pkgs/tools/filesystems/e2fsprogs/default.nix
@@ -25,8 +25,6 @@ stdenv.mkDerivation rec {
 
   postInstall = "make install-libs";
 
-  dontGzipMan = true; # See issue #523
-
   meta = {
     homepage = http://e2fsprogs.sourceforge.net/;
     description = "Tools for creating and checking ext2/ext3/ext4 filesystems";
diff --git a/pkgs/tools/graphics/asymptote/default.nix b/pkgs/tools/graphics/asymptote/default.nix
index e9f61228bedb..b4bb49758a42 100644
--- a/pkgs/tools/graphics/asymptote/default.nix
+++ b/pkgs/tools/graphics/asymptote/default.nix
@@ -1,7 +1,7 @@
 a @ {
   freeglut,ghostscriptX,imagemagick,fftw,
   boehmgc,mesa,ncurses,readline,gsl,libsigsegv,
-  python,zlib, perl, texLive, texinfo, lzma,
+  python,zlib, perl, texLive, texinfo, xz,
 
   noDepEntry, fullDepEntry, fetchUrlFromSrcInfo,
   lib,
@@ -20,7 +20,7 @@ let
   buildInputs = with a; [
     freeglut ghostscriptX imagemagick fftw boehmgc
     mesa ncurses readline gsl libsigsegv python zlib
-    perl texLive texinfo lzma
+    perl texLive texinfo xz
   ];
 in
 rec {
@@ -54,7 +54,7 @@ rec {
   '';
 
   extractTexinfoTex = a.fullDepEntry ''
-    lzma -d < ${a.texinfo.src} | tar --wildcards -x texinfo-'*'/doc/texinfo.tex
+    xz -d < ${a.texinfo.src} | tar --wildcards -x texinfo-'*'/doc/texinfo.tex
     cp texinfo-*/doc/texinfo.tex doc/
   '' ["minInit" "addInputs" "doUnpack"];
 
diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix
index 65a3bec555ef..e5f9eb1be2c0 100644
--- a/pkgs/tools/misc/coreutils/default.nix
+++ b/pkgs/tools/misc/coreutils/default.nix
@@ -18,6 +18,8 @@ let
       sha256 = "064f512185iysqqcvhnhaf3bfmzrvcgs7n405qsyp99zmfyl9amd";
     };
 
+    patches = [ ./help2man.patch ];
+
     nativeBuildInputs = [ perl ];
     buildInputs = [ gmp ]
       ++ optional aclSupport acl
@@ -36,7 +38,7 @@ let
           for a in *.x; do
             touch `basename $a .x`.1
           done
-          popd; make ) 
+          popd; make )
       '';
 
       postInstall = ''
@@ -80,3 +82,6 @@ let
   });
 in
   self
+  // stdenv.lib.optionalAttrs (stdenv.system == "armv7l-linux" || stdenv.isSunOS) {
+    FORCE_UNSAFE_CONFIGURE = 1;
+  }
diff --git a/pkgs/tools/misc/coreutils/help2man.patch b/pkgs/tools/misc/coreutils/help2man.patch
new file mode 100644
index 000000000000..9f3cbaa40ff1
--- /dev/null
+++ b/pkgs/tools/misc/coreutils/help2man.patch
@@ -0,0 +1,40 @@
+Although the above man pages depend on src/md5sum.c as a shared
+source, the build of the man pages directly requires their own
+executables to exist.
+
+* man/local.mk (man/sha1sum.1): Change the dependency from
+'src/md5sum' to 'src/sha1sum'.
+(man/sha224sum.1): s/md5sum/sha224sum/
+(man/sha256sum.1): s/md5sum/sha256sum/
+(man/sha384sum.1): s/md5sum/sha384sum/
+(man/sha512sum.1): s/md5sum/sha512sum/
+
+Reported by Pádraig Brady in
+http://lists.gnu.org/archive/html/coreutils/2013-11/msg00006.html
+---
+ man/local.mk | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/man/local.mk b/man/local.mk
+index 266b780..45dbcb9 100644
+--- a/man/local.mk
++++ b/man/local.mk
+@@ -131,11 +131,11 @@ man/rm.1:        src/rm
+ man/rmdir.1:     src/rmdir
+ man/runcon.1:    src/runcon
+ man/seq.1:       src/seq
+-man/sha1sum.1:   src/md5sum
+-man/sha224sum.1: src/md5sum
+-man/sha256sum.1: src/md5sum
+-man/sha384sum.1: src/md5sum
+-man/sha512sum.1: src/md5sum
++man/sha1sum.1:   src/sha1sum
++man/sha224sum.1: src/sha224sum
++man/sha256sum.1: src/sha256sum
++man/sha384sum.1: src/sha384sum
++man/sha512sum.1: src/sha512sum
+ man/shred.1:     src/shred
+ man/shuf.1:      src/shuf
+ man/sleep.1:     src/sleep
+-- 
+1.8.3.1
diff --git a/pkgs/tools/misc/file/default.nix b/pkgs/tools/misc/file/default.nix
index 8b141fea8262..cbcbbb2bb4aa 100644
--- a/pkgs/tools/misc/file/default.nix
+++ b/pkgs/tools/misc/file/default.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, zlib }:
 
 stdenv.mkDerivation rec {
-  name = "file-5.12";
+  name = "file-5.14";
 
   buildInputs = [ zlib ];
 
   src = fetchurl {
     url = "ftp://ftp.astron.com/pub/file/${name}.tar.gz";
-    sha256 = "08ix4xrvan0k80n0l5lqfmc4azjv5lyhvhwdxny4r09j5smhv78r";
+    sha256 = "1r3zqxr7al5yy2595hd9hxwc14iij021p46d5my3n2lhs0fs06s6";
   };
 
   meta = {
diff --git a/pkgs/tools/misc/less/default.nix b/pkgs/tools/misc/less/default.nix
index fa391880a101..5acb0e0fb700 100644
--- a/pkgs/tools/misc/less/default.nix
+++ b/pkgs/tools/misc/less/default.nix
@@ -1,13 +1,22 @@
-{stdenv, fetchurl, ncurses}:
- 
-stdenv.mkDerivation {
+{ stdenv, fetchurl, ncurses }:
+
+stdenv.mkDerivation rec {
   name = "less-462";
- 
+
   src = fetchurl {
     url = http://www.greenwoodsoftware.com/less/less-462.tar.gz;
     sha256 = "1kv5izyrkds8lkkzd46c9gxsnjgxbr7w4ficzma95dprcn92m97a";
   };
- 
-  buildInputs = [ncurses];
- 
+
+  # Look for ‘sysless’ in /etc.
+  configureFlags = "--sysconfdir=/etc";
+
+  buildInputs = [ ncurses ];
+
+  meta = {
+    homepage = http://www.greenwoodsoftware.com/less/;
+    description = "A more advanced file pager than ‘more’";
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.eelco ];
+  };
 }
diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix
index 3fee2507b864..86f27d7460c1 100644
--- a/pkgs/tools/networking/curl/default.nix
+++ b/pkgs/tools/networking/curl/default.nix
@@ -27,11 +27,13 @@ stdenv.mkDerivation rec {
     optional zlibSupport zlib ++
     optional gssSupport gss ++
     optional c-aresSupport c-ares ++
-    optional sslSupport openssl;
+    optional sslSupport openssl ++
+    optional scpSupport libssh2;
 
   preConfigure = ''
     sed -e 's|/usr/bin|/no-such-path|g' -i.bak configure
   '';
+
   configureFlags = [
       ( if sslSupport then "--with-ssl=${openssl}" else "--without-ssl" )
       ( if scpSupport then "--with-libssh2=${libssh2}" else "--without-libssh2" )
@@ -67,9 +69,10 @@ stdenv.mkDerivation rec {
     inherit sslSupport openssl;
   };
 
-  meta = {
-    homepage = "http://curl.haxx.se/";
+  meta = with stdenv.lib; {
     description = "A command line tool for transferring files with URL syntax";
-    platforms = stdenv.lib.platforms.all;
+    homepage    = http://curl.haxx.se/;
+    maintainers = with maintainers; [ lovek323 ];
+    platforms   = platforms.all;
   };
 }
diff --git a/pkgs/tools/networking/p2p/amule/default.nix b/pkgs/tools/networking/p2p/amule/default.nix
index 039fca35ab3a..ac848b5d72e2 100644
--- a/pkgs/tools/networking/p2p/amule/default.nix
+++ b/pkgs/tools/networking/p2p/amule/default.nix
@@ -1,7 +1,7 @@
 { monolithic ? true # build monolithic amule
 , daemon ? false # build amule daemon
 , httpServer ? false # build web interface for the daemon
-, client ? false # build amule remote gui 
+, client ? false # build amule remote gui
 , fetchurl, stdenv, zlib, wxGTK, perl, cryptopp, libupnp, gettext, libpng ? null
 , pkgconfig, makeWrapper }:
 
@@ -10,19 +10,21 @@ with stdenv;
 let
   # Enable/Disable Feature
   edf = enabled: flag: if enabled then "--enable-" + flag else "--disable-" + flag;
-in 
+in
 mkDerivation rec {
   name = "aMule-2.3.1";
 
   src = fetchurl {
-    url = "mirror://sourceforge/amule/${name}.tar.bz2";
-    sha256 = "17g6xh6k7rqy2sjp9l4m7h4in96cqwk5gfgg4fhlymzc6jfa3vfj";
+    url = "mirror://sourceforge/amule/${name}.tar.xz";
+    sha256 = "0hvpx3c005nvxsfand5bwfxxiq3mv0mpykajfm2lkygjh1rw2383";
   };
 
   buildInputs =
     [ zlib wxGTK perl cryptopp libupnp gettext pkgconfig makeWrapper ]
     ++ lib.optional httpServer libpng;
 
+  patches = [ ./gcc47.patch ]; # from Gentoo
+
   configureFlags = ''
     --with-crypto-prefix=${cryptopp}
     --disable-debug
diff --git a/pkgs/tools/networking/p2p/amule/gcc47.patch b/pkgs/tools/networking/p2p/amule/gcc47.patch
new file mode 100644
index 000000000000..e776dda3240e
--- /dev/null
+++ b/pkgs/tools/networking/p2p/amule/gcc47.patch
@@ -0,0 +1,21 @@
+# http://code.google.com/p/amule/source/detail?r=10772
+diff -ur aMule-2.3.1.orig//src/ObservableQueue.h aMule-2.3.1/src/ObservableQueue.h
+--- aMule-2.3.1.orig//src/ObservableQueue.h	2012-04-22 19:40:05.560084120 +0200
++++ aMule-2.3.1/src/ObservableQueue.h	2012-04-22 19:40:32.479085322 +0200
+@@ -331,14 +331,14 @@
+ template <typename ValueType>
+ void CObservableQueue<ValueType>::ObserverAdded( ObserverType* o )
+ {
+-	NotifyObservers( EventType( EventType::STARTING ), o );
++	this->NotifyObservers( EventType( EventType::STARTING ), o );
+ }
+ 
+ 
+ template <typename ValueType>
+ void CObservableQueue<ValueType>::ObserverRemoved( ObserverType* o )
+ {
+-	NotifyObservers( EventType( EventType::STOPPING ), o );
++	this->NotifyObservers( EventType( EventType::STOPPING ), o );
+ }
+ 
+ 
\ No newline at end of file
diff --git a/pkgs/tools/package-management/nix/unstable.nix b/pkgs/tools/package-management/nix/unstable.nix
index aad734cd6196..a340d51fd7d9 100644
--- a/pkgs/tools/package-management/nix/unstable.nix
+++ b/pkgs/tools/package-management/nix/unstable.nix
@@ -5,11 +5,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "nix-1.7pre3319_f4013b6";
+  name = "nix-1.7pre3327_0e2ca26";
 
   src = fetchurl {
-    url = "http://hydra.nixos.org/build/7848540/download/5/${name}.tar.xz";
-    sha256 = "0f9095aabe3399436a75162c046fdc1e4d0c1e9a98f7d8ffcd3d910b19c8c265";
+    url = "http://hydra.nixos.org/build/8316406/download/5/${name}.tar.xz";
+    sha256 = "52cc082f4ce8ec3c316f032c0201cc76980df2845b15714e71acb2ef7715f1de";
   };
 
   nativeBuildInputs = [ perl pkgconfig ];
diff --git a/pkgs/tools/text/diffutils/default.nix b/pkgs/tools/text/diffutils/default.nix
index fc4293ad7cff..f8413b9a0d0f 100644
--- a/pkgs/tools/text/diffutils/default.nix
+++ b/pkgs/tools/text/diffutils/default.nix
@@ -1,15 +1,13 @@
 { stdenv, fetchurl, coreutils ? null }:
 
-stdenv.mkDerivation {
-  name = "diffutils-3.2";
+stdenv.mkDerivation rec {
+  name = "diffutils-3.3";
 
   src = fetchurl {
-    url = mirror://gnu/diffutils/diffutils-3.2.tar.gz;
-    sha256 = "1lsf0ln0h3mnm2y0mwgrfk0lyfi7bnm4r886acvdrrsvc7pypaia";
+    url = "mirror://gnu/diffutils/${name}.tar.xz";
+    sha256 = "1761vymxbp4wb5rzjvabhdkskk95pghnn67464byvzb5mfl8jpm2";
   };
 
-  patches = [ ./gets-undeclared.patch ];
-
   /* If no explicit coreutils is given, use the one from stdenv. */
   nativeBuildInputs = [ coreutils ];
 
diff --git a/pkgs/tools/text/diffutils/gets-undeclared.patch b/pkgs/tools/text/diffutils/gets-undeclared.patch
deleted file mode 100644
index b6cdc77caa84..000000000000
--- a/pkgs/tools/text/diffutils/gets-undeclared.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-This patch is needed to allow builds with newer versions of
-the GNU libc (2.16+).
-
-
-commit 66712c23388e93e5c518ebc8515140fa0c807348
-Author: Eric Blake <eblake@redhat.com>
-Date:   Thu Mar 29 13:30:41 2012 -0600
-
-    stdio: don't assume gets any more
-    
-    Gnulib intentionally does not have a gets module, and now that C11
-    and glibc have dropped it, we should be more proactive about warning
-    any user on a platform that still has a declaration of this dangerous
-    interface.
-    
-    * m4/stdio_h.m4 (gl_STDIO_H, gl_STDIO_H_DEFAULTS): Drop gets
-    support.
-    * modules/stdio (Makefile.am): Likewise.
-    * lib/stdio-read.c (gets): Likewise.
-    * tests/test-stdio-c++.cc: Likewise.
-    * m4/warn-on-use.m4 (gl_WARN_ON_USE_PREPARE): Fix comment.
-    * lib/stdio.in.h (gets): Make warning occur in more places.
-    * doc/posix-functions/gets.texi (gets): Update documentation.
-    Reported by Christer Solskogen.
-    
-    Signed-off-by: Eric Blake <eblake@redhat.com>
-
-diff --git a/lib/stdio.in.h b/lib/stdio.in.h
-index aa7b599..c377b6e 100644
---- a/lib/stdio.in.h
-+++ b/lib/stdio.in.h
-@@ -698,22 +698,11 @@ _GL_WARN_ON_USE (getline, "getline is unportable - "
- # endif
- #endif
- 
--#if @GNULIB_GETS@
--# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
--#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
--#   undef gets
--#   define gets rpl_gets
--#  endif
--_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1)));
--_GL_CXXALIAS_RPL (gets, char *, (char *s));
--# else
--_GL_CXXALIAS_SYS (gets, char *, (char *s));
--#  undef gets
--# endif
--_GL_CXXALIASWARN (gets);
- /* It is very rare that the developer ever has full control of stdin,
--   so any use of gets warrants an unconditional warning.  Assume it is
--   always declared, since it is required by C89.  */
-+   so any use of gets warrants an unconditional warning; besides, C11
-+   removed it.  */
-+#undef gets
-+#if HAVE_RAW_DECL_GETS
- _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
- #endif
- 
-@@ -1053,9 +1042,9 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
- # endif
- #endif
- 
--/* Some people would argue that sprintf should be handled like gets
--   (for example, OpenBSD issues a link warning for both functions),
--   since both can cause security holes due to buffer overruns.
-+/* Some people would argue that all sprintf uses should be warned about
-+   (for example, OpenBSD issues a link warning for it),
-+   since it can cause security holes due to buffer overruns.
-    However, we believe that sprintf can be used safely, and is more
-    efficient than snprintf in those safe cases; and as proof of our
-    belief, we use sprintf in several gnulib modules.  So this header
diff --git a/pkgs/tools/text/gawk/default.nix b/pkgs/tools/text/gawk/default.nix
index eba1dc2ac7fd..901f53c5e5cc 100644
--- a/pkgs/tools/text/gawk/default.nix
+++ b/pkgs/tools/text/gawk/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, libsigsegv }:
 
 stdenv.mkDerivation rec {
-  name = "gawk-4.0.2";
+  name = "gawk-4.1.0";
 
   src = fetchurl {
     url = "mirror://gnu/gawk/${name}.tar.xz";
-    sha256 = "04vd0axif762mf781pj3days6ilv2333b9zi9c50y5mma66g5q91";
+    sha256 = "0hin2hswbbd6kd6i4zzvgciwpl5fba8d2s524z8y5qagyz3x010q";
   };
 
   patches = [];
diff --git a/pkgs/tools/text/gnugrep/default.nix b/pkgs/tools/text/gnugrep/default.nix
index 5a31d0096107..bdf19161e431 100644
--- a/pkgs/tools/text/gnugrep/default.nix
+++ b/pkgs/tools/text/gnugrep/default.nix
@@ -13,6 +13,8 @@ stdenv.mkDerivation {
   buildInputs = [ pcre ]
     ++ stdenv.lib.optional (libiconv != null) libiconv;
 
+  patches = [ ./test-localeconv.patch ];
+
   NIX_LDFLAGS = stdenv.lib.optionalString (libiconv != null) "-L${libiconv}/lib -liconv";
 
   doCheck = !stdenv.isDarwin;
diff --git a/pkgs/tools/text/gnugrep/test-localeconv.patch b/pkgs/tools/text/gnugrep/test-localeconv.patch
new file mode 100644
index 000000000000..f5efaf222217
--- /dev/null
+++ b/pkgs/tools/text/gnugrep/test-localeconv.patch
@@ -0,0 +1,18 @@
+--- grep-2.14/gnulib-tests/test-localeconv.c.orig	2013-02-15 18:41:50.213433059 +0000
++++ grep-2.14/gnulib-tests/test-localeconv.c	2013-02-15 18:50:33.964751303 +0000
+@@ -37,13 +37,13 @@
+ 
+     ASSERT (STREQ (l->decimal_point, "."));
+     ASSERT (STREQ (l->thousands_sep, ""));
+-#if !defined __FreeBSD__
++#if !(defined __FreeBSD__ || defined __sun)
+     ASSERT (STREQ (l->grouping, ""));
+ #endif
+ 
+     ASSERT (STREQ (l->mon_decimal_point, ""));
+     ASSERT (STREQ (l->mon_thousands_sep, ""));
+-#if !defined __FreeBSD__
++#if !(defined __FreeBSD__ || defined __sun)
+     ASSERT (STREQ (l->mon_grouping, ""));
+ #endif
+     ASSERT (STREQ (l->positive_sign, ""));
diff --git a/pkgs/tools/text/gnupatch/bashishms.patch b/pkgs/tools/text/gnupatch/bashishms.patch
new file mode 100644
index 000000000000..1a2cfbd8e4a2
--- /dev/null
+++ b/pkgs/tools/text/gnupatch/bashishms.patch
@@ -0,0 +1,67 @@
+http://lists.gnu.org/archive/html/bug-patch/2012-11/msg00001.html
+Tested on Illumos, where ksh is /bin/sh.
+
+--- patch-2.7.1/tests/test-lib.sh
++++ patch-2.7.1/tests/test-lib.sh
+@@ -118,7 +118,7 @@
+ }
+ 
+ if test -z "`echo -n`"; then
+-    if eval 'test -n "${BASH_LINENO[0]}" 2>/dev/null'; then
++    if (eval 'test -n "${BASH_LINENO[0]}"') 2>/dev/null; then
+ 	eval '
+ 	    _start_test() {
+ 		echo -n "[${BASH_LINENO[2]}] $* -- "
+
+--- patch-2.7.1/tests/crlf-handling
++++ patch-2.7.1/tests/crlf-handling
+@@ -14,7 +14,7 @@
+ use_tmpdir
+ 
+ lf2crlf() {
+-    while read l; do echo -e "$l\r"; done
++    while read l; do printf "%s\r\n" "$l"; done
+ }
+ 
+ echo 1 > a
+
+--- patch-2.7.1/tests/merge
++++ patch-2.7.1/tests/merge
+@@ -32,18 +32,20 @@
+     shift
+     done > a.sed
+     echo "$body" | sed -f a.sed > b
+-    shift
+-    while test $# -gt 0 ; do
+-	echo "$1"
++    if test $# -gt 0 ; then
+ 	shift
+-    done > b.sed
++    while test $# -gt 0 ; do
++	echo "$1"
++	shift
++    done
++    fi > b.sed
+     echo "$body" | sed -f b.sed > c
+     rm -f a.sed b.sed
+     output=`diff -u a b | patch $ARGS -f c`
+     status=$?
+     echo "$output" | sed -e '/^$/d' -e '/^patching file c$/d'
+     cat c
+-    test $status == 0 || echo "Status: $status"
++    test $status = 0 || echo "Status: $status"
+ }
+ 
+ x() {
+
+--- patch-2.7.1/tests/read-only-files
++++ patch-2.7.1/tests/read-only-files
+@@ -16,7 +16,7 @@
+
+ : > read-only
+ chmod a-w read-only
+-if : 2> /dev/null > read-only; then
++if (: > read-only) 2> /dev/null; then
+     echo "Files with read-only permissions are writable" \
+         "(probably running as superuser)" >&2
+     exit 77
diff --git a/pkgs/tools/text/gnupatch/default.nix b/pkgs/tools/text/gnupatch/default.nix
index e494eba13ce3..1ad40a4a5fa0 100644
--- a/pkgs/tools/text/gnupatch/default.nix
+++ b/pkgs/tools/text/gnupatch/default.nix
@@ -14,8 +14,9 @@ stdenv.mkDerivation rec {
     configureFlags = [ "ac_cv_func_strnlen_working=yes" ];
   };
 
-  # Tests fail on FreeBSD due to a Bashism in the tests.
-  doCheck = !stdenv.isFreeBSD;
+  patches = [ ./bashishms.patch ];
+
+  doCheck = true;
 
   meta = {
     description = "GNU Patch, a program to apply differences to files";
diff --git a/pkgs/tools/text/gnused/default.nix b/pkgs/tools/text/gnused/default.nix
index d34ed00d436a..cf30169acef1 100644
--- a/pkgs/tools/text/gnused/default.nix
+++ b/pkgs/tools/text/gnused/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation {
-  name = "gnused-4.2.1";
+  name = "gnused-4.2.2";
 
   src = fetchurl {
-    url = mirror://gnu/sed/sed-4.2.1.tar.gz;
-    sha256 = "0q1hzjvr6pzhaagidg7pj76k1fzz5nl15np7p72w9zcpw0f58ww7";
+    url = mirror://gnu/sed/sed-4.2.2.tar.bz2;
+    sha256 = "f048d1838da284c8bc9753e4506b85a1e0cc1ea8999d36f6995bcb9460cddbd7";
   };
 
   meta = {
diff --git a/pkgs/tools/text/sgml/opensp/compat.nix b/pkgs/tools/text/sgml/opensp/compat.nix
index 3e9d9152d36a..164982811811 100644
--- a/pkgs/tools/text/sgml/opensp/compat.nix
+++ b/pkgs/tools/text/sgml/opensp/compat.nix
@@ -1,9 +1,9 @@
 { stdenv, opensp }:
 
 stdenv.mkDerivation {
-  name = "sp-compat-${builtins.substring 7 100 opensp.name}";
+  name = "sp-compat-${stdenv.lib.getVersion opensp}";
 
-  phases = [ "fixupPhase" "installPhase" ];
+  phases = [ "installPhase" "fixupPhase" ];
 
   installPhase = ''
     mkdir -pv $out/bin
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 0fcfe95a07d4..1313ad12ba1b 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -440,9 +440,9 @@ let
   asymptote = builderDefsPackage ../tools/graphics/asymptote {
     inherit freeglut ghostscriptX imagemagick fftw boehmgc
       mesa ncurses readline gsl libsigsegv python zlib perl
-      texinfo lzma;
+      texinfo xz;
     texLive = texLiveAggregationFun {
-      paths = [ texLive texLiveExtra ];
+      paths = [ texLive texLiveExtra texLiveCMSuper ];
     };
   };
 
@@ -542,9 +542,7 @@ let
 
   bochs = callPackage ../applications/virtualization/bochs { };
 
-  boomerang = callPackage ../development/tools/boomerang {
-    stdenv = overrideGCC stdenv gcc47;
-  };
+  boomerang = callPackage ../development/tools/boomerang { };
 
   bootchart = callPackage ../tools/system/bootchart { };
 
@@ -1033,6 +1031,7 @@ let
   gnuplot = callPackage ../tools/graphics/gnuplot {
     texLive = null;
     lua = null;
+    texinfo = texinfo4; # build errors with gnuplot-4.6.3
 
     # use gccApple to compile on darwin, seems to resolve a malloc error
     stdenv = if stdenv.isDarwin
@@ -1095,7 +1094,7 @@ let
 
   gtmess = callPackage ../applications/networking/instant-messengers/gtmess { };
 
-  gummiboot = callPackage ../tools/misc/gummiboot { stdenv = overrideGCC stdenv gcc47; };
+  gummiboot = callPackage ../tools/misc/gummiboot { };
 
   gupnp = callPackage ../development/libraries/gupnp {
     inherit (gnome) libsoup;
@@ -2299,26 +2298,24 @@ let
 
   ccl = builderDefsPackage ../development/compilers/ccl {};
 
-  clang = wrapClang llvmFull;
+  clang = wrapClang llvmPackages.clang;
 
-  llvmFullSelf = clangWrapSelf (llvmFull.override {
-     stdenv = libcxxStdenv;
-  });
+  clangSelf = clangWrapSelf llvmPackagesSelf.clang;
 
   clangWrapSelf = build: (import ../build-support/clang-wrapper) {
-      clang = build;
-      stdenv = clangStdenv;
-      libc = glibc;
-      binutils = binutils_gold;
-      shell = bash;
-      inherit libcxx coreutils zlib;
-      nativeTools = false;
-      nativeLibc = false;
+    clang = build;
+    stdenv = clangStdenv;
+    libc = glibc;
+    binutils = binutils;
+    shell = bash;
+    inherit libcxx coreutils zlib;
+    nativeTools = false;
+    nativeLibc = false;
   };
 
   #Use this instead of stdenv to build with clang
   clangStdenv = lowPrio (stdenvAdapters.overrideGCC stdenv clang);
-  libcxxStdenv = stdenvAdapters.overrideGCC stdenv (clangWrapSelf llvmFull);
+  libcxxStdenv = stdenvAdapters.overrideGCC stdenv (clangWrapSelf llvmPackages.clang);
 
   clean = callPackage ../development/compilers/clean { };
 
@@ -2343,7 +2340,7 @@ let
 
   gambit = callPackage ../development/compilers/gambit { };
 
-  gcc = gcc46;
+  gcc = gcc48;
 
   gcc33 = wrapGCC (import ../development/compilers/gcc/3.3 {
     inherit fetchurl stdenv noSysDirs;
@@ -2364,97 +2361,14 @@ let
   });
 
   gcc43 = lowPrio (wrapGCC (makeOverridable (import ../development/compilers/gcc/4.3) {
-    inherit stdenv fetchurl texinfo gmp mpfr noSysDirs;
+    inherit stdenv fetchurl gmp mpfr noSysDirs;
+    texinfo = texinfo4;
     profiledCompiler = true;
   }));
 
-  gcc43_realCross = makeOverridable (import ../development/compilers/gcc/4.3) {
-    inherit stdenv fetchurl texinfo gmp mpfr noSysDirs;
-    binutilsCross = binutilsCross;
-    libcCross = libcCross;
-    profiledCompiler = false;
-    enableMultilib = true;
-    crossStageStatic = false;
-    cross = assert crossSystem != null; crossSystem;
-  };
-
-  gcc44_realCross = lib.addMetaAttrs { hydraPlatforms = []; }
-    (makeOverridable (import ../development/compilers/gcc/4.4) {
-      inherit stdenv fetchurl texinfo gmp mpfr /* ppl cloogppl */ noSysDirs
-          gettext which;
-      binutilsCross = binutilsCross;
-      libcCross = libcCross;
-      profiledCompiler = false;
-      enableMultilib = false;
-      crossStageStatic = false;
-      cross = assert crossSystem != null; crossSystem;
-    });
-
-  gcc45 = gcc45_real;
-
-  wrapDeterministicGCCWith = gccWrapper: glibc: baseGCC: gccWrapper {
-    nativeTools = stdenv ? gcc && stdenv.gcc.nativeTools;
-    nativeLibc = stdenv ? gcc && stdenv.gcc.nativeLibc;
-    nativePrefix = if stdenv ? gcc then stdenv.gcc.nativePrefix else "";
-    gcc = baseGCC;
-    libc = glibc;
-    shell = bash;
-    binutils = binutils_deterministic;
-    inherit stdenv coreutils zlib;
-  };
-
-  wrapDeterministicGCC = wrapDeterministicGCCWith (import ../build-support/gcc-wrapper) glibc;
-
-  gcc46_deterministic = lowPrio (wrapDeterministicGCC (callPackage ../development/compilers/gcc/4.6 {
-    inherit noSysDirs;
-
-    # bootstrapping a profiled compiler does not work in the sheevaplug:
-    # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43944
-    profiledCompiler = false;
-
-    # When building `gcc.crossDrv' (a "Canadian cross", with host == target
-    # and host != build), `cross' must be null but the cross-libc must still
-    # be passed.
-    cross = null;
-    libcCross = if crossSystem != null then libcCross else null;
-    libpthreadCross =
-      if crossSystem != null && crossSystem.config == "i586-pc-gnu"
-      then gnu.libpthreadCross
-      else null;
-  }));
-
-  gcc46 = gcc46_real;
-
-  gcc47 = gcc47_real;
-
-  gcc45_realCross = lib.addMetaAttrs { hydraPlatforms = []; }
-    (makeOverridable (import ../development/compilers/gcc/4.5) {
-      inherit fetchurl stdenv texinfo gmp mpfr mpc libelf zlib
-        ppl cloogppl gettext which noSysDirs;
-      binutilsCross = binutilsCross;
-      libcCross = libcCross;
-      profiledCompiler = false;
-      enableMultilib = false;
-      crossStageStatic = false;
-      cross = assert crossSystem != null; crossSystem;
-    });
-
-  gcc46_realCross = lib.addMetaAttrs { hydraPlatforms = []; }
-    (makeOverridable (import ../development/compilers/gcc/4.6) {
-      inherit fetchurl stdenv texinfo gmp mpfr mpc libelf zlib
-        cloog ppl gettext which noSysDirs;
-      binutilsCross = binutilsCross;
-      libcCross = libcCross;
-      profiledCompiler = false;
-      enableMultilib = false;
-      crossStageStatic = false;
-      cross = assert crossSystem != null; crossSystem;
-    });
-
-  gcc47_realCross = lib.addMetaAttrs { hydraPlatforms = []; }
-    (makeOverridable (import ../development/compilers/gcc/4.7) {
-      inherit fetchurl stdenv texinfo gmp mpfr mpc libelf zlib
-        cloog ppl gettext which noSysDirs;
+  gcc48_realCross = lib.addMetaAttrs { hydraPlatforms = []; }
+    (callPackage ../development/compilers/gcc/4.8 {
+      inherit noSysDirs;
       binutilsCross = binutilsCross;
       libcCross = libcCross;
       profiledCompiler = false;
@@ -2463,7 +2377,7 @@ let
       cross = assert crossSystem != null; crossSystem;
     });
 
-  gcc_realCross = gcc47_realCross;
+  gcc_realCross = gcc48_realCross;
 
   gccCrossStageStatic = let
       isMingw = (stdenv.cross.libc == "msvcrt");
@@ -2511,15 +2425,20 @@ let
   };
 
   gcc44 = lowPrio (wrapGCC (makeOverridable (import ../development/compilers/gcc/4.4) {
-    inherit fetchurl stdenv texinfo gmp mpfr /* ppl cloogppl */
+    inherit fetchurl stdenv gmp mpfr /* ppl cloogppl */
       gettext which noSysDirs;
+    texinfo = texinfo4;
     profiledCompiler = true;
   }));
 
-  gcc45_real = lowPrio (wrapGCC (makeOverridable (import ../development/compilers/gcc/4.5) {
-    inherit fetchurl stdenv texinfo gmp mpfr mpc libelf zlib perl
-      ppl cloogppl
+  gcc45 = lowPrio (wrapGCC (callPackage ../development/compilers/gcc/4.5 {
+    inherit fetchurl stdenv gmp mpfr mpc libelf zlib perl
       gettext which noSysDirs;
+    texinfo = texinfo4;
+
+    ppl = null;
+    cloogppl = null;
+
     # bootstrapping a profiled compiler does not work in the sheevaplug:
     # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43944
     profiledCompiler = !stdenv.isArm;
@@ -2535,9 +2454,12 @@ let
       else null;
   }));
 
-  gcc46_real = lowPrio (wrapGCC (callPackage ../development/compilers/gcc/4.6 {
+  gcc46 = lowPrio (wrapGCC (callPackage ../development/compilers/gcc/4.6 {
     inherit noSysDirs;
 
+    ppl = null;
+    cloog = null;
+
     # bootstrapping a profiled compiler does not work in the sheevaplug:
     # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43944
     profiledCompiler = false;
@@ -2554,16 +2476,6 @@ let
     texinfo = texinfo413;
   }));
 
-  # A non-stripped version of GCC.
-  gcc46_debug = lowPrio (wrapGCC (callPackage ../development/compilers/gcc/4.6 {
-    stripped = false;
-
-    inherit noSysDirs;
-    cross = null;
-    libcCross = null;
-    binutilsCross = null;
-  }));
-
   gcc46_multi =
     if system == "x86_64-linux" then lowPrio (
       wrapGCCWith (import ../build-support/gcc-wrapper) glibc_multi (gcc46.gcc.override {
@@ -2573,11 +2485,11 @@ let
       }))
     else throw "Multilib gcc not supported on ‘${system}’";
 
-  gcc47_real = lowPrio (wrapGCC (callPackage ../development/compilers/gcc/4.7 {
+  gcc48 = lowPrio (wrapGCC (callPackage ../development/compilers/gcc/4.8 {
     inherit noSysDirs;
-    # I'm not sure if profiling with enableParallelBuilding helps a lot.
-    # We can enable it back some day. This makes the *gcc* builds faster now.
-    profiledCompiler = false;
+
+    # PGO seems to speed up compilation by gcc by ~10%, see #445 discussion
+    profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64));
 
     # When building `gcc.crossDrv' (a "Canadian cross", with host == target
     # and host != build), `cross' must be null but the cross-libc must still
@@ -2590,7 +2502,7 @@ let
       else null;
   }));
 
-  gcc47_debug = lowPrio (wrapGCC (callPackage ../development/compilers/gcc/4.7 {
+  gcc48_debug = lowPrio (wrapGCC (callPackage ../development/compilers/gcc/4.8 {
     stripped = false;
 
     inherit noSysDirs;
@@ -2609,41 +2521,9 @@ let
       stdenv = allStdenvs.stdenvNative;
     });
 
-  gfortran = gfortran46;
-
-  gfortran42 = wrapGCC (gcc42.gcc.override {
-    name = "gfortran";
-    langFortran = true;
-    langCC = false;
-    langC = false;
-    inherit gmp mpfr;
-  });
-
-  gfortran43 = wrapGCC (gcc43.gcc.override {
-    name = "gfortran";
-    langFortran = true;
-    langCC = false;
-    langC = false;
-    profiledCompiler = false;
-  });
-
-  gfortran44 = wrapGCC (gcc44.gcc.override {
-    name = "gfortran";
-    langFortran = true;
-    langCC = false;
-    langC = false;
-    profiledCompiler = false;
-  });
-
-  gfortran45 = wrapGCC (gcc45_real.gcc.override {
-    name = "gfortran";
-    langFortran = true;
-    langCC = false;
-    langC = false;
-    profiledCompiler = false;
-  });
+  gfortran = gfortran48;
 
-  gfortran46 = wrapGCC (gcc46_real.gcc.override {
+  gfortran48 = wrapGCC (gcc48.gcc.override {
     name = "gfortran";
     langFortran = true;
     langCC = false;
@@ -2651,27 +2531,13 @@ let
     profiledCompiler = false;
   });
 
-  gcj = gcj45;
-
-  gcj45 = wrapGCC (gcc45.gcc.override {
-    name = "gcj";
-    langJava = true;
-    langFortran = false;
-    langCC = true;
-    langC = false;
-    profiledCompiler = false;
-    inherit zip unzip zlib boehmgc gettext pkgconfig perl;
-    inherit gtk;
-    inherit (gnome) libart_lgpl;
-    inherit (xlibs) libX11 libXt libSM libICE libXtst libXi libXrender
-      libXrandr xproto renderproto xextproto inputproto randrproto;
-  });
+  gcj = gcj48;
 
-  gcj46 = wrapGCC (gcc46.gcc.override {
+  gcj48 = wrapGCC (gcc48.gcc.override {
     name = "gcj";
     langJava = true;
     langFortran = false;
-    langCC = true;
+    langCC = false;
     langC = false;
     profiledCompiler = false;
     inherit zip unzip zlib boehmgc gettext pkgconfig perl;
@@ -2683,20 +2549,7 @@ let
 
   gnat = gnat45;
 
-  gnat44 = wrapGCC (gcc44.gcc.override {
-    name = "gnat";
-    langCC = false;
-    langC = true;
-    langAda = true;
-    profiledCompiler = false;
-    inherit gnatboot;
-    # We can't use the ppl stuff, because we would have
-    # libstdc++ problems.
-    cloogppl = null;
-    ppl = null;
-  });
-
-  gnat45 = wrapGCC (gcc45_real.gcc.override {
+  gnat45 = wrapGCC (gcc45.gcc.override {
     name = "gnat";
     langCC = false;
     langC = true;
@@ -2709,7 +2562,7 @@ let
     ppl = null;
   });
 
-  gnat46 = wrapGCC (gcc46_real.gcc.override {
+  gnat46 = wrapGCC (gcc46.gcc.override {
     name = "gnat";
     langCC = false;
     langC = true;
@@ -2726,10 +2579,9 @@ let
     inherit fetchurl stdenv;
   });
 
-  # gccgo46 does not work. I set 4.7 then.
-  gccgo = gccgo47;
+  gccgo = gccgo48;
 
-  gccgo47 = wrapGCC (gcc47_real.gcc.override {
+  gccgo48 = wrapGCC (gcc48.gcc.override {
     name = "gccgo";
     langCC = true; #required for go.
     langC = true;
@@ -2737,7 +2589,8 @@ let
   });
 
   ghdl = wrapGCC (import ../development/compilers/gcc/4.3 {
-    inherit stdenv fetchurl texinfo gmp mpfr noSysDirs gnat;
+    inherit stdenv fetchurl gmp mpfr noSysDirs gnat;
+    texinfo = texinfo4;
     name = "ghdl";
     langVhdl = true;
     langCC = false;
@@ -2762,7 +2615,7 @@ let
 
   jhc = callPackage ../development/compilers/jhc {
     inherit (haskellPackages_ghc6123) ghc binary zlib utf8String readline fgl
-    regexCompat HsSyck random;
+      regexCompat HsSyck random;
   };
 
   # Haskell and GHC
@@ -2895,7 +2748,7 @@ let
 
   julia = callPackage ../development/compilers/julia {
     liblapack = liblapack.override {shared = true;};
-    mpfr = mpfr_3_1_2;
+    llvm = llvm_33;
   };
 
   lazarus = builderDefsPackage (import ../development/compilers/fpc/lazarus.nix) {
@@ -2906,18 +2759,14 @@ let
 
   lessc = callPackage ../development/compilers/lessc { };
 
-  llvm = llvm_33;
-  llvm_34 = callPackage ../development/compilers/llvm {
-    version = "3.4";
+  llvm = llvmPackages.llvm;
+  llvm_33 = callPackage ../development/compilers/llvm/3.3/llvm.nix {
     stdenv = if stdenv.isDarwin
       then stdenvAdapters.overrideGCC stdenv gccApple
       else stdenv;
   };
-  llvm_33 = llvm_34.override { version = "3.3"; };
-  llvmFull = callPackage ../development/compilers/llvm/full.nix {
-    stdenv = stdenvAdapters.overrideGCC stdenv gcc47;
-    isl = isl_0_12;
-  };
+  llvmPackages = recurseIntoAttrs (import ../development/compilers/llvm/3.4 { inherit newScope stdenv fetchurl; isl = isl_0_12; });
+  llvmPackagesSelf = import ../development/compilers/llvm/3.4 { inherit newScope fetchurl; isl = isl_0_12; stdenv = libcxxStdenv; };
 
   mentorToolchains = recurseIntoAttrs (
     callPackage_i686 ../development/compilers/mentor {}
@@ -3095,15 +2944,6 @@ let
     ocaml = ocaml_3_08_0;
   };
 
-  deterministicStdenv = lowPrio (
-    overrideInStdenv (
-      stdenvAdapters.overrideGCC
-        (stdenvAdapters.overrideSetup stdenv ../stdenv/generic/setup-repeatable.sh )
-      gcc46_deterministic
-    )
-    [ binutils_deterministic ]
-  );
-
   roadsend = callPackage ../development/compilers/roadsend { };
 
   rust = callPackage ../development/compilers/rust {};
@@ -3527,14 +3367,9 @@ let
     inherit noSysDirs;
   };
 
-  binutils_deterministic = lowPrio (callPackage ../development/tools/misc/binutils {
-    inherit noSysDirs;
-    deterministic = true;
-  });
-
-  binutils_gold = lowPrio (callPackage ../development/tools/misc/binutils {
+  binutils_nogold = lowPrio (callPackage ../development/tools/misc/binutils {
     inherit noSysDirs;
-    gold = true;
+    gold = false;
   });
 
   binutilsCross = lowPrio (forceNativeDrv (import ../development/tools/misc/binutils {
@@ -3544,8 +3379,8 @@ let
   }));
 
   bison2 = callPackage ../development/tools/parsing/bison/2.x.nix { };
-  bison3 = lowPrio (callPackage ../development/tools/parsing/bison/3.x.nix { });
-  bison = bison2;
+  bison3 = callPackage ../development/tools/parsing/bison/3.x.nix { };
+  bison = bison3;
 
   buildbot = callPackage ../development/tools/build-managers/buildbot {
     inherit (pythonPackages) twisted jinja2 sqlalchemy sqlalchemy_migrate;
@@ -3688,19 +3523,7 @@ let
 
   checkstyle = callPackage ../development/tools/analysis/checkstyle { };
 
-  flex = flex2535;
-
-  flex2535 = callPackage ../development/tools/parsing/flex/flex-2.5.35.nix { };
-
-  flex2534 = callPackage ../development/tools/parsing/flex/flex-2.5.34.nix { };
-
-  flex2533 = callPackage ../development/tools/parsing/flex/flex-2.5.33.nix { };
-
-  # Note: 2.5.4a is much older than 2.5.35 but happens first when sorting
-  # alphabetically, hence the low priority.
-  flex254a = lowPrio (import ../development/tools/parsing/flex/flex-2.5.4a.nix {
-    inherit fetchurl stdenv yacc;
-  });
+  flex = callPackage ../development/tools/parsing/flex { };
 
   m4 = gnum4;
 
@@ -3795,8 +3618,6 @@ let
 
   patchelf = callPackage ../development/tools/misc/patchelf { };
 
-  patchelfUnstable = callPackage ../development/tools/misc/patchelf/unstable.nix { };
-
   peg = callPackage ../development/tools/parsing/peg { };
 
   phantomjs = callPackage ../development/tools/phantomjs { };
@@ -3882,9 +3703,9 @@ let
   tcptrack = callPackage ../development/tools/misc/tcptrack { };
 
   texinfo413 = callPackage ../development/tools/misc/texinfo/4.13a.nix { };
-  texinfo49 = callPackage ../development/tools/misc/texinfo/4.9.nix { };
-  texinfo5 = callPackage ../development/tools/misc/texinfo/5.1.nix { };
-  texinfo = texinfo413;
+  texinfo5 = callPackage ../development/tools/misc/texinfo/5.2.nix { };
+  texinfo4 = texinfo413;
+  texinfo = texinfo5;
 
   texi2html = callPackage ../development/tools/misc/texi2html { };
 
@@ -3918,7 +3739,9 @@ let
 
   xc3sprog = callPackage ../development/tools/misc/xc3sprog { };
 
-  xxdiff = callPackage ../development/tools/misc/xxdiff { };
+  xxdiff = callPackage ../development/tools/misc/xxdiff {
+    bison = bison2;
+  };
 
   yacc = bison;
 
@@ -4133,7 +3956,7 @@ let
 
   dssi = callPackage ../development/libraries/dssi {};
 
-  dragonegg = callPackage ../development/compilers/llvm/dragonegg.nix { llvm = llvmFull; stdenv = overrideGCC stdenv gcc47; };
+  dragonegg = llvmPackages.dragonegg;
 
   dxflib = callPackage ../development/libraries/dxflib {};
 
@@ -4382,15 +4205,17 @@ let
   gmm = callPackage ../development/libraries/gmm { };
 
   gmp = gmp5;
+  gmp5 = gmp51;
 
   gmpxx = appendToName "with-cxx" (gmp.override { cxx = true; });
 
   # The GHC bootstrap binaries link against libgmp.so.3, which is in GMP 4.x.
   gmp4 = callPackage ../development/libraries/gmp/4.3.2.nix { };
 
-  gmp5 = callPackage ../development/libraries/gmp/5.0.5.nix { };
+  gmp51 = callPackage ../development/libraries/gmp/5.1.x.nix { };
 
-  gmp51 = callPackage ../development/libraries/gmp/5.1.3.nix { };
+  #GMP ex-satellite, so better keep it near gmp
+  mpfr = callPackage ../development/libraries/mpfr/default.nix { };
 
   gobjectIntrospection = callPackage ../development/libraries/gobject-introspection { };
 
@@ -4398,10 +4223,6 @@ let
 
   gperftools = callPackage ../development/libraries/gperftools { };
 
-  #GMP ex-satellite, so better keep it near gmp
-  mpfr = callPackage ../development/libraries/mpfr { };
-  mpfr_3_1_2 = callPackage ../development/libraries/mpfr/3.1.2.nix { };
-
   gst_all_1 = recurseIntoAttrs(callPackage ../development/libraries/gstreamer { });
 
   gst_all = {
@@ -4413,7 +4234,9 @@ let
     gstFfmpeg = pkgs.gst_ffmpeg;
   };
 
-  gstreamer = callPackage ../development/libraries/gstreamer/legacy/gstreamer {};
+  gstreamer = callPackage ../development/libraries/gstreamer/legacy/gstreamer {
+    bison = bison2;
+  };
 
   gst_plugins_base = callPackage ../development/libraries/gstreamer/legacy/gst-plugins-base {};
 
@@ -4439,9 +4262,7 @@ let
 
   gnet = callPackage ../development/libraries/gnet { };
 
-  gnu-efi = callPackage ../development/libraries/gnu-efi {
-    stdenv = overrideGCC stdenv gcc47;
-  };
+  gnu-efi = callPackage ../development/libraries/gnu-efi { };
 
   gnutls = callPackage ../development/libraries/gnutls {
     guileBindings = config.gnutls.guile or true;
@@ -5258,7 +5079,7 @@ let
 
   mesaSupported = lib.elem system lib.platforms.mesaPlatforms;
 
-  mesa_original = callPackage ../development/libraries/mesa { };
+  mesa_original = callPackage ../development/libraries/mesa { llvm = llvm_33; };
   mesa_noglu = if stdenv.isDarwin
     then darwinX11AndOpenGL // { driverLink = mesa_noglu; }
     else mesa_original;
@@ -5314,7 +5135,9 @@ let
 
   mtdev = callPackage ../development/libraries/mtdev { };
 
-  mu = callPackage ../tools/networking/mu { };
+  mu = callPackage ../tools/networking/mu {
+    texinfo = texinfo4;
+  };
 
   muparser = callPackage ../development/libraries/muparser { };
 
@@ -5557,6 +5380,7 @@ let
     cups = if stdenv.isLinux then cups else null;
     # GNOME dependencies are not used unless gtkStyle == true
     inherit (gnome) libgnomeui GConf gnome_vfs;
+    bison = bison2; # error: too few arguments to function 'int yylex(...
   };
 
   qt5Full = qt5.override {
@@ -5687,6 +5511,7 @@ let
 
   slibGuile = callPackage ../development/libraries/slib {
     scheme = guile_1_8;
+    texinfo = texinfo4; # otherwise erros: must be after `@defun' to use `@defunx'
   };
 
   smpeg = callPackage ../development/libraries/smpeg { };
@@ -5876,7 +5701,6 @@ let
     };
 
   webkitgtk = callPackage ../development/libraries/webkitgtk {
-    stdenv = overrideGCC stdenv gcc47;
     libsoup = libsoup_2_44;
     harfbuzz = harfbuzz.override {
       withIcu = true;
@@ -7738,6 +7562,7 @@ let
     # TODO: these packages don't build on Darwin.
     gconf = null /* if stdenv.isDarwin then null else gnome.GConf */;
     librsvg = null /* if stdenv.isDarwin then null else librsvg */;
+    texinfo = texinfo4;
   };
 
   emacs24 = callPackage ../applications/editors/emacs-24 {
@@ -8630,9 +8455,7 @@ let
 
   ogmtools = callPackage ../applications/video/ogmtools { };
 
-  omxplayer = callPackage ../applications/video/omxplayer {
-    stdenv = overrideGCC stdenv gcc47;
-  };
+  omxplayer = callPackage ../applications/video/omxplayer { };
 
   oneteam = callPackage ../applications/networking/instant-messengers/oneteam {};
 
@@ -9383,9 +9206,7 @@ let
 
   d2x_rebirth = callPackage ../games/d2x-rebirth { };
 
-  eduke32 = callPackage ../games/eduke32 {
-    stdenv = overrideGCC stdenv gcc47;
-  };
+  eduke32 = callPackage ../games/eduke32 { };
 
   egoboo = callPackage ../games/egoboo { };
 
@@ -9788,9 +9609,7 @@ let
 
       psi = callPackage ../applications/networking/instant-messengers/psi { };
 
-      qtcurve = callPackage ../misc/themes/qtcurve {
-        stdenv = overrideGCC stdenv gcc47;
-      };
+      qtcurve = callPackage ../misc/themes/qtcurve { };
 
       quassel = callPackage ../applications/networking/irc/quassel { };
 
@@ -10293,7 +10112,8 @@ let
     inherit fetchurl stdenv;
     inherit cups ghostscript glibc patchelf;
     gcc = import ../development/compilers/gcc/4.4 {
-      inherit stdenv fetchurl texinfo gmp mpfr noSysDirs gettext which;
+      inherit stdenv fetchurl gmp mpfr noSysDirs gettext which;
+      texinfo = texinfo4;
       profiledCompiler = true;
     };
   };
@@ -10421,8 +10241,12 @@ let
   VisualBoyAdvance = callPackage ../misc/emulators/VisualBoyAdvance { };
 
   # Wine cannot be built in 64-bit; use a 32-bit build instead.
-  wineStable = callPackage_i686 ../misc/emulators/wine/stable.nix { };
-  wineUnstable = lowPrio (callPackage_i686 ../misc/emulators/wine/unstable.nix { });
+  wineStable = callPackage_i686 ../misc/emulators/wine/stable.nix {
+    bison = bison2;
+  };
+  wineUnstable = lowPrio (callPackage_i686 ../misc/emulators/wine/unstable.nix {
+    bison = bison2;
+  });
   wine = wineStable;
 
   # winetricks is a shell script with no binary components. Safe to just use the current platforms
@@ -10479,9 +10303,7 @@ let
     callPackage ../applications/networking/znc/modules.nix { }
   );
 
-  zsnes = callPackage_i686 ../misc/emulators/zsnes {
-    libpng = libpng12;
-  };
+  zsnes = callPackage_i686 ../misc/emulators/zsnes { };
 
   misc = import ../misc/misc.nix { inherit pkgs stdenv; };
 
diff --git a/pkgs/top-level/node-packages-generated.nix b/pkgs/top-level/node-packages-generated.nix
index 07bfa1531255..9aec47445b5f 100644
--- a/pkgs/top-level/node-packages-generated.nix
+++ b/pkgs/top-level/node-packages-generated.nix
@@ -616,14 +616,14 @@
   by-spec."async"."~0.2.9" =
     self.by-version."async"."0.2.9";
   by-spec."aws-sdk"."*" =
-    self.by-version."aws-sdk"."2.0.0-rc7";
-  by-version."aws-sdk"."2.0.0-rc7" = lib.makeOverridable self.buildNodePackage {
-    name = "aws-sdk-2.0.0-rc7";
+    self.by-version."aws-sdk"."2.0.0-rc8";
+  by-version."aws-sdk"."2.0.0-rc8" = lib.makeOverridable self.buildNodePackage {
+    name = "aws-sdk-2.0.0-rc8";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/aws-sdk/-/aws-sdk-2.0.0-rc7.tgz";
-        name = "aws-sdk-2.0.0-rc7.tgz";
-        sha1 = "4b367185bd093f2681aea2cfb1e3e85a06fa04cd";
+        url = "http://registry.npmjs.org/aws-sdk/-/aws-sdk-2.0.0-rc8.tgz";
+        name = "aws-sdk-2.0.0-rc8.tgz";
+        sha1 = "30583789843db95ecd090b0d73f42be09fbd6cf3";
       })
     ];
     buildInputs =
@@ -636,16 +636,16 @@
     ];
     passthru.names = [ "aws-sdk" ];
   };
-  "aws-sdk" = self.by-version."aws-sdk"."2.0.0-rc7";
+  "aws-sdk" = self.by-version."aws-sdk"."2.0.0-rc8";
   by-spec."aws-sdk".">=1.2.0 <2" =
-    self.by-version."aws-sdk"."1.17.2";
-  by-version."aws-sdk"."1.17.2" = lib.makeOverridable self.buildNodePackage {
-    name = "aws-sdk-1.17.2";
+    self.by-version."aws-sdk"."1.17.3";
+  by-version."aws-sdk"."1.17.3" = lib.makeOverridable self.buildNodePackage {
+    name = "aws-sdk-1.17.3";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/aws-sdk/-/aws-sdk-1.17.2.tgz";
-        name = "aws-sdk-1.17.2.tgz";
-        sha1 = "1e9c6ae5baa6f3eca29cece19f199040cd01cd30";
+        url = "http://registry.npmjs.org/aws-sdk/-/aws-sdk-1.17.3.tgz";
+        name = "aws-sdk-1.17.3.tgz";
+        sha1 = "fd0ee0e0222b6a2dc313fa59788ae595fe55dffe";
       })
     ];
     buildInputs =
@@ -973,7 +973,7 @@
       self.by-version."bower-config"."0.5.0"
       self.by-version."bower-endpoint-parser"."0.2.1"
       self.by-version."bower-json"."0.4.0"
-      self.by-version."bower-logger"."0.2.1"
+      self.by-version."bower-logger"."0.2.2"
       self.by-version."bower-registry-client"."0.1.6"
       self.by-version."cardinal"."0.4.4"
       self.by-version."chalk"."0.2.1"
@@ -997,7 +997,7 @@
       self.by-version."request"."2.27.0"
       self.by-version."request-progress"."0.3.1"
       self.by-version."retry"."0.6.0"
-      self.by-version."rimraf"."2.2.5"
+      self.by-version."rimraf"."2.2.6"
       self.by-version."semver"."2.1.0"
       self.by-version."stringify-object"."0.1.7"
       self.by-version."sudo-block"."0.2.1"
@@ -1129,7 +1129,24 @@
     passthru.names = [ "bower-logger" ];
   };
   by-spec."bower-logger"."~0.2.1" =
-    self.by-version."bower-logger"."0.2.1";
+    self.by-version."bower-logger"."0.2.2";
+  by-version."bower-logger"."0.2.2" = lib.makeOverridable self.buildNodePackage {
+    name = "bower-logger-0.2.2";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/bower-logger/-/bower-logger-0.2.2.tgz";
+        name = "bower-logger-0.2.2.tgz";
+        sha1 = "39be07e979b2fc8e03a94634205ed9422373d381";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."bower-logger" or []);
+    deps = [
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "bower-logger" ];
+  };
   by-spec."bower-registry-client"."~0.1.4" =
     self.by-version."bower-registry-client"."0.1.6";
   by-version."bower-registry-client"."0.1.6" = lib.makeOverridable self.buildNodePackage {
@@ -1150,7 +1167,7 @@
       self.by-version."lru-cache"."2.3.1"
       self.by-version."request"."2.27.0"
       self.by-version."request-replay"."0.2.0"
-      self.by-version."rimraf"."2.2.5"
+      self.by-version."rimraf"."2.2.6"
       self.by-version."mkdirp"."0.3.5"
     ];
     peerDependencies = [
@@ -1226,7 +1243,7 @@
     deps = [
       self.by-version."hat"."0.0.3"
       self.by-version."connect"."2.12.0"
-      self.by-version."request"."2.31.0"
+      self.by-version."request"."2.33.0"
     ];
     peerDependencies = [
     ];
@@ -1279,7 +1296,7 @@
       (fetchurl {
         url = "http://registry.npmjs.org/bson/-/bson-0.2.5.tgz";
         name = "bson-0.2.5.tgz";
-        sha1 = "835b266883fc91e00e440efa2a905e9ac8c6c9f9";
+        sha1 = "500d26d883ddc8e02f2c88011627636111c105c5";
       })
     ];
     buildInputs =
@@ -1350,14 +1367,14 @@
     passthru.names = [ "buffers" ];
   };
   by-spec."buffertools"."*" =
-    self.by-version."buffertools"."2.0.0";
-  by-version."buffertools"."2.0.0" = lib.makeOverridable self.buildNodePackage {
-    name = "buffertools-2.0.0";
+    self.by-version."buffertools"."2.0.1";
+  by-version."buffertools"."2.0.1" = lib.makeOverridable self.buildNodePackage {
+    name = "buffertools-2.0.1";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/buffertools/-/buffertools-2.0.0.tgz";
-        name = "buffertools-2.0.0.tgz";
-        sha1 = "925a0333a6b089e86a58c0c25c9dda8d515b25e8";
+        url = "http://registry.npmjs.org/buffertools/-/buffertools-2.0.1.tgz";
+        name = "buffertools-2.0.1.tgz";
+        sha1 = "4611e6430687e7876330285dd1ae7e7e47b47288";
       })
     ];
     buildInputs =
@@ -1368,7 +1385,7 @@
     ];
     passthru.names = [ "buffertools" ];
   };
-  "buffertools" = self.by-version."buffertools"."2.0.0";
+  "buffertools" = self.by-version."buffertools"."2.0.1";
   by-spec."buffertools".">=1.1.1 <2.0.0" =
     self.by-version."buffertools"."1.1.1";
   by-version."buffertools"."1.1.1" = lib.makeOverridable self.buildNodePackage {
@@ -1680,8 +1697,6 @@
     ];
     passthru.names = [ "cheerio" ];
   };
-  by-spec."cheerio"."~0.12.1" =
-    self.by-version."cheerio"."0.12.4";
   by-spec."cheerio"."~0.13.0" =
     self.by-version."cheerio"."0.13.1";
   by-version."cheerio"."0.13.1" = lib.makeOverridable self.buildNodePackage {
@@ -1822,14 +1837,14 @@
     passthru.names = [ "class-extend" ];
   };
   by-spec."clean-css"."2.0.x" =
-    self.by-version."clean-css"."2.0.6";
-  by-version."clean-css"."2.0.6" = lib.makeOverridable self.buildNodePackage {
-    name = "clean-css-2.0.6";
+    self.by-version."clean-css"."2.0.7";
+  by-version."clean-css"."2.0.7" = lib.makeOverridable self.buildNodePackage {
+    name = "clean-css-2.0.7";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/clean-css/-/clean-css-2.0.6.tgz";
-        name = "clean-css-2.0.6.tgz";
-        sha1 = "89f98241ec4026500db7ea3b2e725f9ffaa01ed3";
+        url = "http://registry.npmjs.org/clean-css/-/clean-css-2.0.7.tgz";
+        name = "clean-css-2.0.7.tgz";
+        sha1 = "b973f1370019ad9b05c456ffc4950a6b95cb38f0";
       })
     ];
     buildInputs =
@@ -1842,7 +1857,7 @@
     passthru.names = [ "clean-css" ];
   };
   by-spec."clean-css"."~2.0.0" =
-    self.by-version."clean-css"."2.0.6";
+    self.by-version."clean-css"."2.0.7";
   by-spec."cli"."0.4.x" =
     self.by-version."cli"."0.4.5";
   by-version."cli"."0.4.5" = lib.makeOverridable self.buildNodePackage {
@@ -2175,6 +2190,25 @@
     ];
     passthru.names = [ "colour" ];
   };
+  by-spec."columnify"."0.1.2" =
+    self.by-version."columnify"."0.1.2";
+  by-version."columnify"."0.1.2" = lib.makeOverridable self.buildNodePackage {
+    name = "columnify-0.1.2";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/columnify/-/columnify-0.1.2.tgz";
+        name = "columnify-0.1.2.tgz";
+        sha1 = "ab1a1f1e37b26ba4b87c6920fb717fe51c827042";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."columnify" or []);
+    deps = [
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "columnify" ];
+  };
   by-spec."combined-stream"."~0.0.4" =
     self.by-version."combined-stream"."0.0.4";
   by-version."combined-stream"."0.0.4" = lib.makeOverridable self.buildNodePackage {
@@ -2578,7 +2612,7 @@
     buildInputs =
       (self.nativeDeps."connect-jade-static" or []);
     deps = [
-      self.by-version."jade"."1.1.4"
+      self.by-version."jade"."1.1.5"
     ];
     peerDependencies = [
     ];
@@ -2658,7 +2692,7 @@
     buildInputs =
       (self.nativeDeps."constantinople" or []);
     deps = [
-      self.by-version."uglify-js"."2.4.8"
+      self.by-version."uglify-js"."2.4.11"
     ];
     peerDependencies = [
     ];
@@ -2870,7 +2904,7 @@
     buildInputs =
       (self.nativeDeps."couch-login" or []);
     deps = [
-      self.by-version."request"."2.31.0"
+      self.by-version."request"."2.33.0"
     ];
     peerDependencies = [
     ];
@@ -3295,15 +3329,15 @@
     ];
     passthru.names = [ "debuglog" ];
   };
-  by-spec."decompress"."~0.1.0" =
-    self.by-version."decompress"."0.1.5";
-  by-version."decompress"."0.1.5" = lib.makeOverridable self.buildNodePackage {
-    name = "decompress-0.1.5";
+  by-spec."decompress"."~0.1.5" =
+    self.by-version."decompress"."0.1.6";
+  by-version."decompress"."0.1.6" = lib.makeOverridable self.buildNodePackage {
+    name = "decompress-0.1.6";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/decompress/-/decompress-0.1.5.tgz";
-        name = "decompress-0.1.5.tgz";
-        sha1 = "0925d42a2164bead83f0822a7a2b4ad02e99c76c";
+        url = "http://registry.npmjs.org/decompress/-/decompress-0.1.6.tgz";
+        name = "decompress-0.1.6.tgz";
+        sha1 = "4db64844d80b615b888ca129d12f8accd1e27286";
       })
     ];
     buildInputs =
@@ -3312,10 +3346,10 @@
       self.by-version."adm-zip"."0.4.3"
       self.by-version."mkdirp"."0.3.5"
       self.by-version."mout"."0.6.0"
-      self.by-version."rimraf"."2.2.5"
+      self.by-version."rimraf"."2.2.6"
       self.by-version."stream-combiner"."0.0.4"
       self.by-version."tar"."0.1.19"
-      self.by-version."temp"."0.6.0"
+      self.by-version."tempfile"."0.1.2"
     ];
     peerDependencies = [
     ];
@@ -3665,24 +3699,24 @@
     passthru.names = [ "domutils" ];
   };
   by-spec."download"."~0.1.6" =
-    self.by-version."download"."0.1.7";
-  by-version."download"."0.1.7" = lib.makeOverridable self.buildNodePackage {
-    name = "download-0.1.7";
+    self.by-version."download"."0.1.10";
+  by-version."download"."0.1.10" = lib.makeOverridable self.buildNodePackage {
+    name = "download-0.1.10";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/download/-/download-0.1.7.tgz";
-        name = "download-0.1.7.tgz";
-        sha1 = "d2a941a878a6d2fdaba60588ffffadab32b788b4";
+        url = "http://registry.npmjs.org/download/-/download-0.1.10.tgz";
+        name = "download-0.1.10.tgz";
+        sha1 = "732065fc96259abd47543c2711467bcf7ed66af5";
       })
     ];
     buildInputs =
       (self.nativeDeps."download" or []);
     deps = [
-      self.by-version."decompress"."0.1.5"
+      self.by-version."decompress"."0.1.6"
       self.by-version."each-async"."0.1.1"
       self.by-version."mkdirp"."0.3.5"
-      self.by-version."request"."2.25.0"
-      self.by-version."through2"."0.1.0"
+      self.by-version."request"."2.31.0"
+      self.by-version."through2"."0.4.0"
     ];
     peerDependencies = [
     ];
@@ -3921,14 +3955,14 @@
   };
   "escape-html" = self.by-version."escape-html"."1.0.1";
   by-spec."escodegen"."*" =
-    self.by-version."escodegen"."1.0.1";
-  by-version."escodegen"."1.0.1" = lib.makeOverridable self.buildNodePackage {
-    name = "escodegen-1.0.1";
+    self.by-version."escodegen"."1.1.0";
+  by-version."escodegen"."1.1.0" = lib.makeOverridable self.buildNodePackage {
+    name = "escodegen-1.1.0";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/escodegen/-/escodegen-1.0.1.tgz";
-        name = "escodegen-1.0.1.tgz";
-        sha1 = "84c92c4a07440271b90e6b78e620973bf721226e";
+        url = "http://registry.npmjs.org/escodegen/-/escodegen-1.1.0.tgz";
+        name = "escodegen-1.1.0.tgz";
+        sha1 = "c663923f6e20aad48d0c0fa49f31c6d4f49360cf";
       })
     ];
     buildInputs =
@@ -3967,6 +4001,27 @@
   };
   by-spec."escodegen"."1.0.x" =
     self.by-version."escodegen"."1.0.1";
+  by-version."escodegen"."1.0.1" = lib.makeOverridable self.buildNodePackage {
+    name = "escodegen-1.0.1";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/escodegen/-/escodegen-1.0.1.tgz";
+        name = "escodegen-1.0.1.tgz";
+        sha1 = "84c92c4a07440271b90e6b78e620973bf721226e";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."escodegen" or []);
+    deps = [
+      self.by-version."esprima"."1.0.4"
+      self.by-version."estraverse"."1.5.0"
+      self.by-version."esutils"."1.0.0"
+      self.by-version."source-map"."0.1.31"
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "escodegen" ];
+  };
   by-spec."esprima"."1.0.x" =
     self.by-version."esprima"."1.0.4";
   by-version."esprima"."1.0.4" = lib.makeOverridable self.buildNodePackage {
@@ -4174,7 +4229,7 @@
       self.by-version."node-swt"."0.1.1"
       self.by-version."node-wsfederation"."0.1.1"
       self.by-version."debug"."0.5.0"
-      self.by-version."express"."3.4.7"
+      self.by-version."express"."3.4.8"
     ];
     peerDependencies = [
     ];
@@ -4200,14 +4255,14 @@
     passthru.names = [ "exit" ];
   };
   by-spec."express"."*" =
-    self.by-version."express"."3.4.7";
-  by-version."express"."3.4.7" = lib.makeOverridable self.buildNodePackage {
-    name = "express-3.4.7";
+    self.by-version."express"."3.4.8";
+  by-version."express"."3.4.8" = lib.makeOverridable self.buildNodePackage {
+    name = "express-3.4.8";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/express/-/express-3.4.7.tgz";
-        name = "express-3.4.7.tgz";
-        sha1 = "3b939c47d2aa44dfecf77d50da2123c5bd313366";
+        url = "http://registry.npmjs.org/express/-/express-3.4.8.tgz";
+        name = "express-3.4.8.tgz";
+        sha1 = "aa7a8986de07053337f4bc5ed9a6453d9cc8e2e1";
       })
     ];
     buildInputs =
@@ -4230,7 +4285,7 @@
     ];
     passthru.names = [ "express" ];
   };
-  "express" = self.by-version."express"."3.4.7";
+  "express" = self.by-version."express"."3.4.8";
   by-spec."express"."2.5.11" =
     self.by-version."express"."2.5.11";
   by-version."express"."2.5.11" = lib.makeOverridable self.buildNodePackage {
@@ -4315,7 +4370,7 @@
     passthru.names = [ "express" ];
   };
   by-spec."express"."3.x" =
-    self.by-version."express"."3.4.7";
+    self.by-version."express"."3.4.8";
   by-spec."express"."~3.1.1" =
     self.by-version."express"."3.1.2";
   by-version."express"."3.1.2" = lib.makeOverridable self.buildNodePackage {
@@ -4347,9 +4402,9 @@
     passthru.names = [ "express" ];
   };
   by-spec."express"."~3.4" =
-    self.by-version."express"."3.4.7";
+    self.by-version."express"."3.4.8";
   by-spec."express"."~3.4.4" =
-    self.by-version."express"."3.4.7";
+    self.by-version."express"."3.4.8";
   by-spec."express-form"."*" =
     self.by-version."express-form"."0.10.1";
   by-version."express-form"."0.10.1" = lib.makeOverridable self.buildNodePackage {
@@ -4369,7 +4424,7 @@
       self.by-version."async"."0.2.9"
     ];
     peerDependencies = [
-      self.by-version."express"."3.4.7"
+      self.by-version."express"."3.4.8"
     ];
     passthru.names = [ "express-form" ];
   };
@@ -4597,7 +4652,7 @@
     deps = [
       self.by-version."lodash"."2.1.0"
       self.by-version."iconv-lite"."0.2.11"
-      self.by-version."rimraf"."2.2.5"
+      self.by-version."rimraf"."2.2.6"
       self.by-version."glob"."3.2.8"
       self.by-version."minimatch"."0.2.14"
       self.by-version."findup-sync"."0.1.2"
@@ -4738,14 +4793,14 @@
     passthru.names = [ "follow-redirects" ];
   };
   by-spec."forEachAsync"."~2.2" =
-    self.by-version."forEachAsync"."2.2.0";
-  by-version."forEachAsync"."2.2.0" = lib.makeOverridable self.buildNodePackage {
-    name = "forEachAsync-2.2.0";
+    self.by-version."forEachAsync"."2.2.1";
+  by-version."forEachAsync"."2.2.1" = lib.makeOverridable self.buildNodePackage {
+    name = "forEachAsync-2.2.1";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/forEachAsync/-/forEachAsync-2.2.0.tgz";
-        name = "forEachAsync-2.2.0.tgz";
-        sha1 = "093b32ce868cb69f5166dcf331fae074adc71cee";
+        url = "http://registry.npmjs.org/forEachAsync/-/forEachAsync-2.2.1.tgz";
+        name = "forEachAsync-2.2.1.tgz";
+        sha1 = "e3723f00903910e1eb4b1db3ad51b5c64a319fec";
       })
     ];
     buildInputs =
@@ -4757,25 +4812,6 @@
     ];
     passthru.names = [ "forEachAsync" ];
   };
-  by-spec."foreach"."~2.0.1" =
-    self.by-version."foreach"."2.0.4";
-  by-version."foreach"."2.0.4" = lib.makeOverridable self.buildNodePackage {
-    name = "foreach-2.0.4";
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/foreach/-/foreach-2.0.4.tgz";
-        name = "foreach-2.0.4.tgz";
-        sha1 = "cc5d0d8ae1d46cc9a555c2682f910977859935df";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."foreach" or []);
-    deps = [
-    ];
-    peerDependencies = [
-    ];
-    passthru.names = [ "foreach" ];
-  };
   by-spec."forever"."*" =
     self.by-version."forever"."0.10.11";
   by-version."forever"."0.10.11" = lib.makeOverridable self.buildNodePackage {
@@ -5098,7 +5134,7 @@
       self.by-version."ncp"."0.4.2"
       self.by-version."mkdirp"."0.3.5"
       self.by-version."jsonfile"."1.0.1"
-      self.by-version."rimraf"."2.2.5"
+      self.by-version."rimraf"."2.2.6"
     ];
     peerDependencies = [
     ];
@@ -5163,7 +5199,7 @@
     buildInputs =
       (self.nativeDeps."fstream" or []);
     deps = [
-      self.by-version."rimraf"."2.2.5"
+      self.by-version."rimraf"."2.2.6"
       self.by-version."mkdirp"."0.3.5"
       self.by-version."graceful-fs"."2.0.1"
       self.by-version."inherits"."2.0.1"
@@ -5271,7 +5307,7 @@
     ];
     passthru.names = [ "generator-karma" ];
   };
-  by-spec."generator-mocha"."~0.1.1" =
+  by-spec."generator-mocha".">=0.1.0" =
     self.by-version."generator-mocha"."0.1.3";
   by-version."generator-mocha"."0.1.3" = lib.makeOverridable self.buildNodePackage {
     name = "generator-mocha-0.1.3";
@@ -5293,21 +5329,22 @@
     passthru.names = [ "generator-mocha" ];
   };
   by-spec."generator-webapp"."*" =
-    self.by-version."generator-webapp"."0.4.6";
-  by-version."generator-webapp"."0.4.6" = lib.makeOverridable self.buildNodePackage {
-    name = "generator-webapp-0.4.6";
+    self.by-version."generator-webapp"."0.4.7";
+  by-version."generator-webapp"."0.4.7" = lib.makeOverridable self.buildNodePackage {
+    name = "generator-webapp-0.4.7";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/generator-webapp/-/generator-webapp-0.4.6.tgz";
-        name = "generator-webapp-0.4.6.tgz";
-        sha1 = "6f51516b615aaf807e221a8ac713845fd680648f";
+        url = "http://registry.npmjs.org/generator-webapp/-/generator-webapp-0.4.7.tgz";
+        name = "generator-webapp-0.4.7.tgz";
+        sha1 = "a42b663cbe289358046038229603e8557b6881e5";
       })
     ];
     buildInputs =
       (self.nativeDeps."generator-webapp" or []);
     deps = [
-      self.by-version."yeoman-generator"."0.14.2"
-      self.by-version."cheerio"."0.12.4"
+      self.by-version."yeoman-generator"."0.16.0"
+      self.by-version."cheerio"."0.13.1"
+      self.by-version."chalk"."0.4.0"
     ];
     peerDependencies = [
       self.by-version."yo"."1.1.2"
@@ -5315,7 +5352,7 @@
     ];
     passthru.names = [ "generator-webapp" ];
   };
-  "generator-webapp" = self.by-version."generator-webapp"."0.4.6";
+  "generator-webapp" = self.by-version."generator-webapp"."0.4.7";
   by-spec."getmac"."~1.0.6" =
     self.by-version."getmac"."1.0.6";
   by-version."getmac"."1.0.6" = lib.makeOverridable self.buildNodePackage {
@@ -5707,7 +5744,7 @@
     buildInputs =
       (self.nativeDeps."grunt-contrib-cssmin" or []);
     deps = [
-      self.by-version."clean-css"."2.0.6"
+      self.by-version."clean-css"."2.0.7"
       self.by-version."grunt-lib-contrib"."0.6.1"
     ];
     peerDependencies = [
@@ -5785,28 +5822,29 @@
   };
   "grunt-contrib-requirejs" = self.by-version."grunt-contrib-requirejs"."0.4.1";
   by-spec."grunt-contrib-uglify"."*" =
-    self.by-version."grunt-contrib-uglify"."0.2.7";
-  by-version."grunt-contrib-uglify"."0.2.7" = lib.makeOverridable self.buildNodePackage {
-    name = "grunt-contrib-uglify-0.2.7";
+    self.by-version."grunt-contrib-uglify"."0.3.1";
+  by-version."grunt-contrib-uglify"."0.3.1" = lib.makeOverridable self.buildNodePackage {
+    name = "grunt-contrib-uglify-0.3.1";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-0.2.7.tgz";
-        name = "grunt-contrib-uglify-0.2.7.tgz";
-        sha1 = "e6bda51e0c40a1459f6cead423c65efd725a1bf7";
+        url = "http://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-0.3.1.tgz";
+        name = "grunt-contrib-uglify-0.3.1.tgz";
+        sha1 = "6ce6836d8e8d4078ae2f2758f46d417241516f51";
       })
     ];
     buildInputs =
       (self.nativeDeps."grunt-contrib-uglify" or []);
     deps = [
-      self.by-version."uglify-js"."2.4.8"
+      self.by-version."uglify-js"."2.4.11"
       self.by-version."grunt-lib-contrib"."0.6.1"
+      self.by-version."chalk"."0.4.0"
     ];
     peerDependencies = [
       self.by-version."grunt"."0.4.2"
     ];
     passthru.names = [ "grunt-contrib-uglify" ];
   };
-  "grunt-contrib-uglify" = self.by-version."grunt-contrib-uglify"."0.2.7";
+  "grunt-contrib-uglify" = self.by-version."grunt-contrib-uglify"."0.3.1";
   by-spec."grunt-karma"."*" =
     self.by-version."grunt-karma"."0.7.2";
   by-version."grunt-karma"."0.7.2" = lib.makeOverridable self.buildNodePackage {
@@ -5825,7 +5863,7 @@
     ];
     peerDependencies = [
       self.by-version."grunt"."0.4.2"
-      self.by-version."karma"."0.11.12"
+      self.by-version."karma"."0.11.13"
     ];
     passthru.names = [ "grunt-karma" ];
   };
@@ -5866,7 +5904,7 @@
     buildInputs =
       (self.nativeDeps."grunt-sed" or []);
     deps = [
-      self.by-version."replace"."0.2.7"
+      self.by-version."replace"."0.2.8"
     ];
     peerDependencies = [
       self.by-version."grunt"."0.4.2"
@@ -5889,7 +5927,7 @@
       (self.nativeDeps."guifi-earth" or []);
     deps = [
       self.by-version."coffee-script"."1.6.3"
-      self.by-version."jade"."1.1.4"
+      self.by-version."jade"."1.1.5"
       self.by-version."q"."1.0.0"
       self.by-version."xml2js"."0.4.1"
       self.by-version."msgpack"."0.2.1"
@@ -5941,15 +5979,15 @@
     ];
     passthru.names = [ "handlebars" ];
   };
-  by-spec."handlebars"."1.2.x" =
-    self.by-version."handlebars"."1.2.1";
-  by-version."handlebars"."1.2.1" = lib.makeOverridable self.buildNodePackage {
-    name = "handlebars-1.2.1";
+  by-spec."handlebars"."1.3.x" =
+    self.by-version."handlebars"."1.3.0";
+  by-version."handlebars"."1.3.0" = lib.makeOverridable self.buildNodePackage {
+    name = "handlebars-1.3.0";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/handlebars/-/handlebars-1.2.1.tgz";
-        name = "handlebars-1.2.1.tgz";
-        sha1 = "0a9016379064f8957779bdc2812869120aba9d98";
+        url = "http://registry.npmjs.org/handlebars/-/handlebars-1.3.0.tgz";
+        name = "handlebars-1.3.0.tgz";
+        sha1 = "9e9b130a93e389491322d975cf3ec1818c37ce34";
       })
     ];
     buildInputs =
@@ -6529,9 +6567,9 @@
       (self.nativeDeps."ibrik" or []);
     deps = [
       self.by-version."coffee-script-redux"."2.0.0-beta4"
-      self.by-version."istanbul"."0.2.3"
+      self.by-version."istanbul"."0.2.4"
       self.by-version."optimist"."0.6.0"
-      self.by-version."escodegen"."1.0.1"
+      self.by-version."escodegen"."1.1.0"
       self.by-version."mkdirp"."0.3.5"
       self.by-version."which"."1.0.5"
       self.by-version."estraverse"."1.5.0"
@@ -6561,25 +6599,6 @@
   };
   by-spec."iconv-lite"."~0.2.11" =
     self.by-version."iconv-lite"."0.2.11";
-  by-spec."indexof"."~0.0.1" =
-    self.by-version."indexof"."0.0.1";
-  by-version."indexof"."0.0.1" = lib.makeOverridable self.buildNodePackage {
-    name = "indexof-0.0.1";
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz";
-        name = "indexof-0.0.1.tgz";
-        sha1 = "82dc336d232b9062179d05ab3293a66059fd435d";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."indexof" or []);
-    deps = [
-    ];
-    peerDependencies = [
-    ];
-    passthru.names = [ "indexof" ];
-  };
   by-spec."inherits"."1" =
     self.by-version."inherits"."1.0.0";
   by-version."inherits"."1.0.0" = lib.makeOverridable self.buildNodePackage {
@@ -6665,7 +6684,7 @@
     deps = [
       self.by-version."promzard"."0.2.1"
       self.by-version."read"."1.0.5"
-      self.by-version."read-package-json"."1.1.5"
+      self.by-version."read-package-json"."1.1.6"
       self.by-version."semver"."2.2.1"
       self.by-version."glob"."3.2.8"
     ];
@@ -6808,8 +6827,8 @@
       self.by-version."nconf"."0.6.9"
       self.by-version."fs-walk"."0.0.1"
       self.by-version."async"."0.2.9"
-      self.by-version."express"."3.4.7"
-      self.by-version."jade"."1.1.4"
+      self.by-version."express"."3.4.8"
+      self.by-version."jade"."1.1.5"
       self.by-version."passport"."0.1.18"
       self.by-version."passport-http"."0.2.2"
       self.by-version."js-yaml"."3.0.1"
@@ -6825,44 +6844,6 @@
     passthru.names = [ "ironhorse" ];
   };
   "ironhorse" = self.by-version."ironhorse"."0.0.9";
-  by-spec."is"."~0.2.6" =
-    self.by-version."is"."0.2.7";
-  by-version."is"."0.2.7" = lib.makeOverridable self.buildNodePackage {
-    name = "is-0.2.7";
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/is/-/is-0.2.7.tgz";
-        name = "is-0.2.7.tgz";
-        sha1 = "3b34a2c48f359972f35042849193ae7264b63562";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."is" or []);
-    deps = [
-    ];
-    peerDependencies = [
-    ];
-    passthru.names = [ "is" ];
-  };
-  by-spec."is-object"."~0.1.2" =
-    self.by-version."is-object"."0.1.2";
-  by-version."is-object"."0.1.2" = lib.makeOverridable self.buildNodePackage {
-    name = "is-object-0.1.2";
-    src = [
-      (fetchurl {
-        url = "http://registry.npmjs.org/is-object/-/is-object-0.1.2.tgz";
-        name = "is-object-0.1.2.tgz";
-        sha1 = "00efbc08816c33cfc4ac8251d132e10dc65098d7";
-      })
-    ];
-    buildInputs =
-      (self.nativeDeps."is-object" or []);
-    deps = [
-    ];
-    peerDependencies = [
-    ];
-    passthru.names = [ "is-object" ];
-  };
   by-spec."is-promise"."~1" =
     self.by-version."is-promise"."1.0.0";
   by-version."is-promise"."1.0.0" = lib.makeOverridable self.buildNodePackage {
@@ -6923,14 +6904,14 @@
     passthru.names = [ "isbinaryfile" ];
   };
   by-spec."istanbul"."*" =
-    self.by-version."istanbul"."0.2.3";
-  by-version."istanbul"."0.2.3" = lib.makeOverridable self.buildNodePackage {
-    name = "istanbul-0.2.3";
+    self.by-version."istanbul"."0.2.4";
+  by-version."istanbul"."0.2.4" = lib.makeOverridable self.buildNodePackage {
+    name = "istanbul-0.2.4";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/istanbul/-/istanbul-0.2.3.tgz";
-        name = "istanbul-0.2.3.tgz";
-        sha1 = "bbce67c1d540610e7021becda51d7cbbbecc68cc";
+        url = "http://registry.npmjs.org/istanbul/-/istanbul-0.2.4.tgz";
+        name = "istanbul-0.2.4.tgz";
+        sha1 = "faaaa400f2cf652c3dc8b3d9484b44a5528e3a04";
       })
     ];
     buildInputs =
@@ -6938,7 +6919,7 @@
     deps = [
       self.by-version."esprima"."1.0.4"
       self.by-version."escodegen"."1.0.1"
-      self.by-version."handlebars"."1.2.1"
+      self.by-version."handlebars"."1.3.0"
       self.by-version."mkdirp"."0.3.5"
       self.by-version."nopt"."2.1.2"
       self.by-version."fileset"."0.1.5"
@@ -6953,7 +6934,7 @@
     ];
     passthru.names = [ "istanbul" ];
   };
-  "istanbul" = self.by-version."istanbul"."0.2.3";
+  "istanbul" = self.by-version."istanbul"."0.2.4";
   by-spec."istanbul"."~0.1.45" =
     self.by-version."istanbul"."0.1.46";
   by-version."istanbul"."0.1.46" = lib.makeOverridable self.buildNodePackage {
@@ -6985,14 +6966,14 @@
     passthru.names = [ "istanbul" ];
   };
   by-spec."jade"."*" =
-    self.by-version."jade"."1.1.4";
-  by-version."jade"."1.1.4" = lib.makeOverridable self.buildNodePackage {
-    name = "jade-1.1.4";
+    self.by-version."jade"."1.1.5";
+  by-version."jade"."1.1.5" = lib.makeOverridable self.buildNodePackage {
+    name = "jade-1.1.5";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/jade/-/jade-1.1.4.tgz";
-        name = "jade-1.1.4.tgz";
-        sha1 = "7097f9f17577fa4a1f0b399925dba1752b91cbdc";
+        url = "http://registry.npmjs.org/jade/-/jade-1.1.5.tgz";
+        name = "jade-1.1.5.tgz";
+        sha1 = "e884d3d3565807e280f5ba760f68addb176627a3";
       })
     ];
     buildInputs =
@@ -7010,7 +6991,7 @@
     ];
     passthru.names = [ "jade" ];
   };
-  "jade" = self.by-version."jade"."1.1.4";
+  "jade" = self.by-version."jade"."1.1.5";
   by-spec."jade"."0.26.3" =
     self.by-version."jade"."0.26.3";
   by-version."jade"."0.26.3" = lib.makeOverridable self.buildNodePackage {
@@ -7054,7 +7035,7 @@
     passthru.names = [ "jade" ];
   };
   by-spec."jade".">= 0.0.1" =
-    self.by-version."jade"."1.1.4";
+    self.by-version."jade"."1.1.5";
   by-spec."jade"."~0.35.0" =
     self.by-version."jade"."0.35.0";
   by-version."jade"."0.35.0" = lib.makeOverridable self.buildNodePackage {
@@ -7433,14 +7414,14 @@
     passthru.names = [ "junk" ];
   };
   by-spec."karma"."*" =
-    self.by-version."karma"."0.11.12";
-  by-version."karma"."0.11.12" = lib.makeOverridable self.buildNodePackage {
-    name = "karma-0.11.12";
+    self.by-version."karma"."0.11.13";
+  by-version."karma"."0.11.13" = lib.makeOverridable self.buildNodePackage {
+    name = "karma-0.11.13";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/karma/-/karma-0.11.12.tgz";
-        name = "karma-0.11.12.tgz";
-        sha1 = "a3474cb3b5e305c7182729a5d98f259c09d2af77";
+        url = "http://registry.npmjs.org/karma/-/karma-0.11.13.tgz";
+        name = "karma-0.11.13.tgz";
+        sha1 = "f63da4f9d14669c6b3d2d9feb7f4406c4cd004c0";
       })
     ];
     buildInputs =
@@ -7454,7 +7435,7 @@
       self.by-version."http-proxy"."0.10.4"
       self.by-version."optimist"."0.6.0"
       self.by-version."coffee-script"."1.6.3"
-      self.by-version."rimraf"."2.2.5"
+      self.by-version."rimraf"."2.2.6"
       self.by-version."q"."0.9.7"
       self.by-version."colors"."0.6.2"
       self.by-version."lodash"."2.4.1"
@@ -7469,15 +7450,15 @@
     ];
     passthru.names = [ "karma" ];
   };
-  "karma" = self.by-version."karma"."0.11.12";
+  "karma" = self.by-version."karma"."0.11.13";
   by-spec."karma".">=0.11.11" =
-    self.by-version."karma"."0.11.12";
+    self.by-version."karma"."0.11.13";
   by-spec."karma".">=0.9" =
-    self.by-version."karma"."0.11.12";
+    self.by-version."karma"."0.11.13";
   by-spec."karma".">=0.9.3" =
-    self.by-version."karma"."0.11.12";
+    self.by-version."karma"."0.11.13";
   by-spec."karma"."~0.11.0" =
-    self.by-version."karma"."0.11.12";
+    self.by-version."karma"."0.11.13";
   by-spec."karma-chrome-launcher"."*" =
     self.by-version."karma-chrome-launcher"."0.1.2";
   by-version."karma-chrome-launcher"."0.1.2" = lib.makeOverridable self.buildNodePackage {
@@ -7494,7 +7475,7 @@
     deps = [
     ];
     peerDependencies = [
-      self.by-version."karma"."0.11.12"
+      self.by-version."karma"."0.11.13"
     ];
     passthru.names = [ "karma-chrome-launcher" ];
   };
@@ -7518,7 +7499,7 @@
       self.by-version."dateformat"."1.0.7-1.2.3"
     ];
     peerDependencies = [
-      self.by-version."karma"."0.11.12"
+      self.by-version."karma"."0.11.13"
     ];
     passthru.names = [ "karma-coverage" ];
   };
@@ -7540,7 +7521,7 @@
       self.by-version."xmlbuilder"."0.4.2"
     ];
     peerDependencies = [
-      self.by-version."karma"."0.11.12"
+      self.by-version."karma"."0.11.13"
     ];
     passthru.names = [ "karma-junit-reporter" ];
   };
@@ -7561,7 +7542,7 @@
     deps = [
     ];
     peerDependencies = [
-      self.by-version."karma"."0.11.12"
+      self.by-version."karma"."0.11.13"
       self.by-version."mocha"."1.17.0"
     ];
     passthru.names = [ "karma-mocha" ];
@@ -7583,7 +7564,7 @@
     deps = [
     ];
     peerDependencies = [
-      self.by-version."karma"."0.11.12"
+      self.by-version."karma"."0.11.13"
       self.by-version."requirejs"."2.1.10"
     ];
     passthru.names = [ "karma-requirejs" ];
@@ -7609,7 +7590,7 @@
       self.by-version."saucelabs"."0.1.1"
     ];
     peerDependencies = [
-      self.by-version."karma"."0.11.12"
+      self.by-version."karma"."0.11.13"
     ];
     passthru.names = [ "karma-sauce-launcher" ];
   };
@@ -7837,9 +7818,9 @@
       (self.nativeDeps."less" or []);
     deps = [
       self.by-version."mime"."1.2.11"
-      self.by-version."request"."2.31.0"
+      self.by-version."request"."2.33.0"
       self.by-version."mkdirp"."0.3.5"
-      self.by-version."clean-css"."2.0.6"
+      self.by-version."clean-css"."2.0.7"
       self.by-version."source-map"."0.1.31"
     ];
     peerDependencies = [
@@ -8766,7 +8747,7 @@
       (self.nativeDeps."mocha-unfunk-reporter" or []);
     deps = [
       self.by-version."jsesc"."0.4.3"
-      self.by-version."unfunk-diff"."0.0.1"
+      self.by-version."unfunk-diff"."0.0.2"
       self.by-version."miniwrite"."0.1.3"
       self.by-version."ministyle"."0.1.3"
     ];
@@ -9589,9 +9570,9 @@
       self.by-version."semver"."2.1.0"
       self.by-version."sprintf"."0.1.3"
       self.by-version."temp"."0.6.0"
-      self.by-version."wrench"."1.5.4"
+      self.by-version."wrench"."1.5.6"
       self.by-version."uglify-js"."2.3.6"
-      self.by-version."xmldom"."0.1.17"
+      self.by-version."xmldom"."0.1.18"
     ];
     peerDependencies = [
     ];
@@ -9640,8 +9621,8 @@
       self.by-version."nopt"."2.1.2"
       self.by-version."npmlog"."0.0.6"
       self.by-version."osenv"."0.0.3"
-      self.by-version."request"."2.31.0"
-      self.by-version."rimraf"."2.2.5"
+      self.by-version."request"."2.33.0"
+      self.by-version."rimraf"."2.2.6"
       self.by-version."semver"."2.2.1"
       self.by-version."tar"."0.1.19"
       self.by-version."which"."1.0.5"
@@ -9651,7 +9632,7 @@
     passthru.names = [ "node-gyp" ];
   };
   "node-gyp" = self.by-version."node-gyp"."0.12.2";
-  by-spec."node-gyp"."~0.12.0" =
+  by-spec."node-gyp"."~0.12.2" =
     self.by-version."node-gyp"."0.12.2";
   by-spec."node-inspector"."*" =
     self.by-version."node-inspector"."0.7.0-1";
@@ -9668,11 +9649,11 @@
       (self.nativeDeps."node-inspector" or []);
     deps = [
       self.by-version."socket.io"."0.9.16"
-      self.by-version."express"."3.4.7"
+      self.by-version."express"."3.4.8"
       self.by-version."async"."0.2.9"
       self.by-version."glob"."3.2.8"
-      self.by-version."rc"."0.3.2"
-      self.by-version."strong-data-uri"."0.1.0"
+      self.by-version."rc"."0.3.3"
+      self.by-version."strong-data-uri"."0.1.1"
       self.by-version."debug"."0.7.4"
     ];
     peerDependencies = [
@@ -9898,14 +9879,14 @@
     passthru.names = [ "nodemailer" ];
   };
   by-spec."nodemon"."*" =
-    self.by-version."nodemon"."1.0.8";
-  by-version."nodemon"."1.0.8" = lib.makeOverridable self.buildNodePackage {
-    name = "nodemon-1.0.8";
+    self.by-version."nodemon"."1.0.13";
+  by-version."nodemon"."1.0.13" = lib.makeOverridable self.buildNodePackage {
+    name = "nodemon-1.0.13";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/nodemon/-/nodemon-1.0.8.tgz";
-        name = "nodemon-1.0.8.tgz";
-        sha1 = "fa737c8f0f331ee77c23f993ce3205615f0d27f9";
+        url = "http://registry.npmjs.org/nodemon/-/nodemon-1.0.13.tgz";
+        name = "nodemon-1.0.13.tgz";
+        sha1 = "7ff62ddf0ba03b572fbc22901b33d53531034410";
       })
     ];
     buildInputs =
@@ -9918,7 +9899,7 @@
     ];
     passthru.names = [ "nodemon" ];
   };
-  "nodemon" = self.by-version."nodemon"."1.0.8";
+  "nodemon" = self.by-version."nodemon"."1.0.13";
   by-spec."nomnom"."1.6.x" =
     self.by-version."nomnom"."1.6.2";
   by-version."nomnom"."1.6.2" = lib.makeOverridable self.buildNodePackage {
@@ -9988,9 +9969,9 @@
     name = "nopt-1.0.10";
     src = [
       (fetchurl {
-        url = "https://github.com/Filirom1/nopt/tarball/master#pull-request-in-progress";
+        url = "http://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz";
         name = "nopt-1.0.10.tgz";
-        sha256 = "94daa53a0ab7668be12931b7b551c924c913d1efef7f2a05e60704c9b90a7bad";
+        sha1 = "6ddd21bd2a31417b92727dd585f8a6f37608ebee";
       })
     ];
     buildInputs =
@@ -10031,14 +10012,14 @@
     passthru.names = [ "normalize-package-data" ];
   };
   by-spec."npm"."*" =
-    self.by-version."npm"."1.3.23";
-  by-version."npm"."1.3.23" = lib.makeOverridable self.buildNodePackage {
-    name = "npm-1.3.23";
+    self.by-version."npm"."1.3.24";
+  by-version."npm"."1.3.24" = lib.makeOverridable self.buildNodePackage {
+    name = "npm-1.3.24";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/npm/-/npm-1.3.23.tgz";
-        name = "npm-1.3.23.tgz";
-        sha1 = "8463ddbc060169b48890d639c4be9c839b8a0f3d";
+        url = "http://registry.npmjs.org/npm/-/npm-1.3.24.tgz";
+        name = "npm-1.3.24.tgz";
+        sha1 = "d68273a343562aa969320a218f528930356d99de";
       })
     ];
     buildInputs =
@@ -10051,7 +10032,7 @@
       self.by-version."graceful-fs"."2.0.1"
       self.by-version."minimatch"."0.2.14"
       self.by-version."nopt"."2.1.2"
-      self.by-version."rimraf"."2.2.5"
+      self.by-version."rimraf"."2.2.6"
       self.by-version."request"."2.30.0"
       self.by-version."which"."1.0.5"
       self.by-version."tar"."0.1.19"
@@ -10068,7 +10049,7 @@
       self.by-version."npmlog"."0.0.6"
       self.by-version."ansi"."0.2.1"
       self.by-version."npm-registry-client"."0.3.3"
-      self.by-version."read-package-json"."1.1.5"
+      self.by-version."read-package-json"."1.1.6"
       self.by-version."read-installed"."0.2.5"
       self.by-version."glob"."3.2.8"
       self.by-version."init-package-json"."0.0.14"
@@ -10090,14 +10071,15 @@
       self.by-version."ansicolors"."0.3.2"
       self.by-version."ansistyles"."0.1.3"
       self.by-version."path-is-inside"."1.0.0"
+      self.by-version."columnify"."0.1.2"
     ];
     peerDependencies = [
     ];
     passthru.names = [ "npm" ];
   };
-  "npm" = self.by-version."npm"."1.3.23";
+  "npm" = self.by-version."npm"."1.3.24";
   by-spec."npm"."~1.3.14" =
-    self.by-version."npm"."1.3.23";
+    self.by-version."npm"."1.3.24";
   by-spec."npm-registry-client"."0.2.27" =
     self.by-version."npm-registry-client"."0.2.27";
   by-version."npm-registry-client"."0.2.27" = lib.makeOverridable self.buildNodePackage {
@@ -10112,13 +10094,13 @@
     buildInputs =
       (self.nativeDeps."npm-registry-client" or []);
     deps = [
-      self.by-version."request"."2.31.0"
+      self.by-version."request"."2.33.0"
       self.by-version."graceful-fs"."2.0.1"
       self.by-version."semver"."2.0.11"
       self.by-version."slide"."1.1.5"
       self.by-version."chownr"."0.0.1"
       self.by-version."mkdirp"."0.3.5"
-      self.by-version."rimraf"."2.2.5"
+      self.by-version."rimraf"."2.2.6"
       self.by-version."retry"."0.6.0"
       self.by-version."couch-login"."0.1.19"
       self.by-version."npmlog"."0.0.6"
@@ -10127,7 +10109,7 @@
     ];
     passthru.names = [ "npm-registry-client" ];
   };
-  by-spec."npm-registry-client"."~0.3.2" =
+  by-spec."npm-registry-client"."~0.3.3" =
     self.by-version."npm-registry-client"."0.3.3";
   by-version."npm-registry-client"."0.3.3" = lib.makeOverridable self.buildNodePackage {
     name = "npm-registry-client-0.3.3";
@@ -10141,13 +10123,13 @@
     buildInputs =
       (self.nativeDeps."npm-registry-client" or []);
     deps = [
-      self.by-version."request"."2.31.0"
+      self.by-version."request"."2.33.0"
       self.by-version."graceful-fs"."2.0.1"
       self.by-version."semver"."2.2.1"
       self.by-version."slide"."1.1.5"
       self.by-version."chownr"."0.0.1"
       self.by-version."mkdirp"."0.3.5"
-      self.by-version."rimraf"."2.2.5"
+      self.by-version."rimraf"."2.2.6"
       self.by-version."retry"."0.6.0"
       self.by-version."couch-login"."0.1.19"
       self.by-version."npmlog"."0.0.6"
@@ -10257,7 +10239,7 @@
     ];
     passthru.names = [ "npmconf" ];
   };
-  by-spec."npmconf"."~0.1.2" =
+  by-spec."npmconf"."~0.1.12" =
     self.by-version."npmconf"."0.1.12";
   by-version."npmconf"."0.1.12" = lib.makeOverridable self.buildNodePackage {
     name = "npmconf-0.1.12";
@@ -10284,7 +10266,7 @@
     ];
     passthru.names = [ "npmconf" ];
   };
-  by-spec."npmconf"."~0.1.7" =
+  by-spec."npmconf"."~0.1.2" =
     self.by-version."npmconf"."0.1.12";
   by-spec."npmlog"."*" =
     self.by-version."npmlog"."0.0.6";
@@ -10407,23 +10389,20 @@
     ];
     passthru.names = [ "object-additions" ];
   };
-  by-spec."object-keys"."~0.2.0" =
-    self.by-version."object-keys"."0.2.0";
-  by-version."object-keys"."0.2.0" = lib.makeOverridable self.buildNodePackage {
-    name = "object-keys-0.2.0";
+  by-spec."object-keys"."~0.4.0" =
+    self.by-version."object-keys"."0.4.0";
+  by-version."object-keys"."0.4.0" = lib.makeOverridable self.buildNodePackage {
+    name = "object-keys-0.4.0";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/object-keys/-/object-keys-0.2.0.tgz";
-        name = "object-keys-0.2.0.tgz";
-        sha1 = "cddec02998b091be42bf1035ae32e49f1cb6ea67";
+        url = "http://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz";
+        name = "object-keys-0.4.0.tgz";
+        sha1 = "28a6aae7428dd2c3a92f3d95f21335dd204e0336";
       })
     ];
     buildInputs =
       (self.nativeDeps."object-keys" or []);
     deps = [
-      self.by-version."foreach"."2.0.4"
-      self.by-version."indexof"."0.0.1"
-      self.by-version."is"."0.2.7"
     ];
     peerDependencies = [
     ];
@@ -10894,7 +10873,7 @@
       self.by-version."ncp"."0.4.2"
       self.by-version."npmconf"."0.0.24"
       self.by-version."mkdirp"."0.3.5"
-      self.by-version."rimraf"."2.2.5"
+      self.by-version."rimraf"."2.2.6"
       self.by-version."which"."1.0.5"
     ];
     peerDependencies = [
@@ -11126,14 +11105,14 @@
     passthru.names = [ "proto-list" ];
   };
   by-spec."protobufjs".">= 1.1.4" =
-    self.by-version."protobufjs"."2.0.3";
-  by-version."protobufjs"."2.0.3" = lib.makeOverridable self.buildNodePackage {
-    name = "protobufjs-2.0.3";
+    self.by-version."protobufjs"."2.0.4";
+  by-version."protobufjs"."2.0.4" = lib.makeOverridable self.buildNodePackage {
+    name = "protobufjs-2.0.4";
     src = [
       (self.patchSource fetchurl {
-        url = "http://registry.npmjs.org/protobufjs/-/protobufjs-2.0.3.tgz";
-        name = "protobufjs-2.0.3.tgz";
-        sha1 = "a33bfa95cee12b182ef08c6f3e0a0b296167a67f";
+        url = "http://registry.npmjs.org/protobufjs/-/protobufjs-2.0.4.tgz";
+        name = "protobufjs-2.0.4.tgz";
+        sha1 = "109de55527459ce5bc91d72f1fd86b5a9c7f1058";
       })
     ];
     buildInputs =
@@ -11529,14 +11508,14 @@
   };
   "rbytes" = self.by-version."rbytes"."1.0.0";
   by-spec."rc"."~0.3.0" =
-    self.by-version."rc"."0.3.2";
-  by-version."rc"."0.3.2" = lib.makeOverridable self.buildNodePackage {
-    name = "rc-0.3.2";
+    self.by-version."rc"."0.3.3";
+  by-version."rc"."0.3.3" = lib.makeOverridable self.buildNodePackage {
+    name = "rc-0.3.3";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/rc/-/rc-0.3.2.tgz";
-        name = "rc-0.3.2.tgz";
-        sha1 = "cd8f895690f764621ccec110516b225286e8f69f";
+        url = "http://registry.npmjs.org/rc/-/rc-0.3.3.tgz";
+        name = "rc-0.3.3.tgz";
+        sha1 = "2eac52d221dfdf5ba512def3ea27500a68dc3c07";
       })
     ];
     buildInputs =
@@ -11551,7 +11530,7 @@
     passthru.names = [ "rc" ];
   };
   by-spec."rc"."~0.3.1" =
-    self.by-version."rc"."0.3.2";
+    self.by-version."rc"."0.3.3";
   by-spec."read"."1" =
     self.by-version."read"."1.0.5";
   by-version."read"."1.0.5" = lib.makeOverridable self.buildNodePackage {
@@ -11594,7 +11573,7 @@
     deps = [
       self.by-version."semver"."2.2.1"
       self.by-version."slide"."1.1.5"
-      self.by-version."read-package-json"."1.1.5"
+      self.by-version."read-package-json"."1.1.6"
       self.by-version."graceful-fs"."1.2.3"
     ];
     peerDependencies = [
@@ -11617,7 +11596,7 @@
     deps = [
       self.by-version."semver"."2.2.1"
       self.by-version."slide"."1.1.5"
-      self.by-version."read-package-json"."1.1.5"
+      self.by-version."read-package-json"."1.1.6"
       self.by-version."graceful-fs"."2.0.1"
     ];
     peerDependencies = [
@@ -11625,14 +11604,14 @@
     passthru.names = [ "read-installed" ];
   };
   by-spec."read-package-json"."1" =
-    self.by-version."read-package-json"."1.1.5";
-  by-version."read-package-json"."1.1.5" = lib.makeOverridable self.buildNodePackage {
-    name = "read-package-json-1.1.5";
+    self.by-version."read-package-json"."1.1.6";
+  by-version."read-package-json"."1.1.6" = lib.makeOverridable self.buildNodePackage {
+    name = "read-package-json-1.1.6";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/read-package-json/-/read-package-json-1.1.5.tgz";
-        name = "read-package-json-1.1.5.tgz";
-        sha1 = "f6a7a5820cc958ff02495badc55f7fe49a7677a1";
+        url = "http://registry.npmjs.org/read-package-json/-/read-package-json-1.1.6.tgz";
+        name = "read-package-json-1.1.6.tgz";
+        sha1 = "a851dbbaca48ff78a87f890f0a9fdf43b1759d5a";
       })
     ];
     buildInputs =
@@ -11647,8 +11626,8 @@
     ];
     passthru.names = [ "read-package-json" ];
   };
-  by-spec."read-package-json"."~1.1.4" =
-    self.by-version."read-package-json"."1.1.5";
+  by-spec."read-package-json"."~1.1.6" =
+    self.by-version."read-package-json"."1.1.6";
   by-spec."readable-stream"."1.0" =
     self.by-version."readable-stream"."1.0.24";
   by-version."readable-stream"."1.0.24" = lib.makeOverridable self.buildNodePackage {
@@ -11689,6 +11668,8 @@
     ];
     passthru.names = [ "readable-stream" ];
   };
+  by-spec."readable-stream"."~1.0.17" =
+    self.by-version."readable-stream"."1.0.24";
   by-spec."readable-stream"."~1.0.2" =
     self.by-version."readable-stream"."1.0.24";
   by-spec."readable-stream"."~1.1.8" =
@@ -11875,14 +11856,14 @@
     passthru.names = [ "regexp-clone" ];
   };
   by-spec."replace"."~0.2.4" =
-    self.by-version."replace"."0.2.7";
-  by-version."replace"."0.2.7" = lib.makeOverridable self.buildNodePackage {
-    name = "replace-0.2.7";
+    self.by-version."replace"."0.2.8";
+  by-version."replace"."0.2.8" = lib.makeOverridable self.buildNodePackage {
+    name = "replace-0.2.8";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/replace/-/replace-0.2.7.tgz";
-        name = "replace-0.2.7.tgz";
-        sha1 = "e22d08a9e2e6764337bb530166a4dd89c2558fda";
+        url = "http://registry.npmjs.org/replace/-/replace-0.2.8.tgz";
+        name = "replace-0.2.8.tgz";
+        sha1 = "05fadc9800bf0e91459c229e867bdd9eac1a6d3d";
       })
     ];
     buildInputs =
@@ -11897,14 +11878,14 @@
     passthru.names = [ "replace" ];
   };
   by-spec."request"."2" =
-    self.by-version."request"."2.31.0";
-  by-version."request"."2.31.0" = lib.makeOverridable self.buildNodePackage {
-    name = "request-2.31.0";
+    self.by-version."request"."2.33.0";
+  by-version."request"."2.33.0" = lib.makeOverridable self.buildNodePackage {
+    name = "request-2.33.0";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/request/-/request-2.31.0.tgz";
-        name = "request-2.31.0.tgz";
-        sha1 = "4c8ac967c9a4b9410cb4ba1a61fdb644267eeeff";
+        url = "http://registry.npmjs.org/request/-/request-2.33.0.tgz";
+        name = "request-2.33.0.tgz";
+        sha1 = "5167878131726070ec633752ea230a2379dc65ff";
       })
     ];
     buildInputs =
@@ -11915,7 +11896,7 @@
       self.by-version."forever-agent"."0.5.0"
       self.by-version."node-uuid"."1.4.1"
       self.by-version."mime"."1.2.11"
-      self.by-version."tough-cookie"."0.9.15"
+      self.by-version."tough-cookie"."0.12.1"
       self.by-version."form-data"."0.1.2"
       self.by-version."tunnel-agent"."0.3.0"
       self.by-version."http-signature"."0.10.0"
@@ -11928,9 +11909,9 @@
     passthru.names = [ "request" ];
   };
   by-spec."request"."2 >=2.20.0" =
-    self.by-version."request"."2.31.0";
+    self.by-version."request"."2.33.0";
   by-spec."request"."2 >=2.25.0" =
-    self.by-version."request"."2.31.0";
+    self.by-version."request"."2.33.0";
   by-spec."request"."2.16.2" =
     self.by-version."request"."2.16.2";
   by-version."request"."2.16.2" = lib.makeOverridable self.buildNodePackage {
@@ -12011,9 +11992,9 @@
     passthru.names = [ "request" ];
   };
   by-spec."request".">=2.12.0" =
-    self.by-version."request"."2.31.0";
+    self.by-version."request"."2.33.0";
   by-spec."request"."~2" =
-    self.by-version."request"."2.31.0";
+    self.by-version."request"."2.33.0";
   by-spec."request"."~2.21.0" =
     self.by-version."request"."2.21.0";
   by-version."request"."2.21.0" = lib.makeOverridable self.buildNodePackage {
@@ -12138,6 +12119,37 @@
     ];
     passthru.names = [ "request" ];
   };
+  by-spec."request"."~2.31.0" =
+    self.by-version."request"."2.31.0";
+  by-version."request"."2.31.0" = lib.makeOverridable self.buildNodePackage {
+    name = "request-2.31.0";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/request/-/request-2.31.0.tgz";
+        name = "request-2.31.0.tgz";
+        sha1 = "4c8ac967c9a4b9410cb4ba1a61fdb644267eeeff";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."request" or []);
+    deps = [
+      self.by-version."qs"."0.6.6"
+      self.by-version."json-stringify-safe"."5.0.0"
+      self.by-version."forever-agent"."0.5.0"
+      self.by-version."node-uuid"."1.4.1"
+      self.by-version."mime"."1.2.11"
+      self.by-version."tough-cookie"."0.9.15"
+      self.by-version."form-data"."0.1.2"
+      self.by-version."tunnel-agent"."0.3.0"
+      self.by-version."http-signature"."0.10.0"
+      self.by-version."oauth-sign"."0.3.0"
+      self.by-version."hawk"."1.0.0"
+      self.by-version."aws-sign2"."0.5.0"
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "request" ];
+  };
   by-spec."request-progress"."~0.3.0" =
     self.by-version."request-progress"."0.3.1";
   by-version."request-progress"."0.3.1" = lib.makeOverridable self.buildNodePackage {
@@ -12293,26 +12305,26 @@
     passthru.names = [ "restify" ];
   };
   by-spec."rethinkdb"."*" =
-    self.by-version."rethinkdb"."1.11.0-1";
-  by-version."rethinkdb"."1.11.0-1" = lib.makeOverridable self.buildNodePackage {
-    name = "rethinkdb-1.11.0-1";
+    self.by-version."rethinkdb"."1.11.0-3";
+  by-version."rethinkdb"."1.11.0-3" = lib.makeOverridable self.buildNodePackage {
+    name = "rethinkdb-1.11.0-3";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/rethinkdb/-/rethinkdb-1.11.0-1.tgz";
-        name = "rethinkdb-1.11.0-1.tgz";
-        sha1 = "beab3376b9efa9ecf7f2fbf39c58ce80c8bd5dfd";
+        url = "http://registry.npmjs.org/rethinkdb/-/rethinkdb-1.11.0-3.tgz";
+        name = "rethinkdb-1.11.0-3.tgz";
+        sha1 = "6db00acf53b6fa75b0183b01fa2d7cb24f027881";
       })
     ];
     buildInputs =
       (self.nativeDeps."rethinkdb" or []);
     deps = [
-      self.by-version."protobufjs"."2.0.3"
+      self.by-version."protobufjs"."2.0.4"
     ];
     peerDependencies = [
     ];
     passthru.names = [ "rethinkdb" ];
   };
-  "rethinkdb" = self.by-version."rethinkdb"."1.11.0-1";
+  "rethinkdb" = self.by-version."rethinkdb"."1.11.0-3";
   by-spec."retry"."0.6.0" =
     self.by-version."retry"."0.6.0";
   by-version."retry"."0.6.0" = lib.makeOverridable self.buildNodePackage {
@@ -12373,14 +12385,14 @@
     passthru.names = [ "rimraf" ];
   };
   by-spec."rimraf"."2" =
-    self.by-version."rimraf"."2.2.5";
-  by-version."rimraf"."2.2.5" = lib.makeOverridable self.buildNodePackage {
-    name = "rimraf-2.2.5";
+    self.by-version."rimraf"."2.2.6";
+  by-version."rimraf"."2.2.6" = lib.makeOverridable self.buildNodePackage {
+    name = "rimraf-2.2.6";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/rimraf/-/rimraf-2.2.5.tgz";
-        name = "rimraf-2.2.5.tgz";
-        sha1 = "4e5c4f667b121afa806d0c5b58920996f9478aa0";
+        url = "http://registry.npmjs.org/rimraf/-/rimraf-2.2.6.tgz";
+        name = "rimraf-2.2.6.tgz";
+        sha1 = "c59597569b14d956ad29cacc42bdddf5f0ea4f4c";
       })
     ];
     buildInputs =
@@ -12392,9 +12404,9 @@
     passthru.names = [ "rimraf" ];
   };
   by-spec."rimraf"."2.x.x" =
-    self.by-version."rimraf"."2.2.5";
+    self.by-version."rimraf"."2.2.6";
   by-spec."rimraf"."~2" =
-    self.by-version."rimraf"."2.2.5";
+    self.by-version."rimraf"."2.2.6";
   by-spec."rimraf"."~2.0.2" =
     self.by-version."rimraf"."2.0.3";
   by-version."rimraf"."2.0.3" = lib.makeOverridable self.buildNodePackage {
@@ -12438,11 +12450,11 @@
     passthru.names = [ "rimraf" ];
   };
   by-spec."rimraf"."~2.2.0" =
-    self.by-version."rimraf"."2.2.5";
+    self.by-version."rimraf"."2.2.6";
   by-spec."rimraf"."~2.2.2" =
-    self.by-version."rimraf"."2.2.5";
+    self.by-version."rimraf"."2.2.6";
   by-spec."rimraf"."~2.2.5" =
-    self.by-version."rimraf"."2.2.5";
+    self.by-version."rimraf"."2.2.6";
   by-spec."s3http"."*" =
     self.by-version."s3http"."0.0.4";
   by-version."s3http"."0.0.4" = lib.makeOverridable self.buildNodePackage {
@@ -12457,7 +12469,7 @@
     buildInputs =
       (self.nativeDeps."s3http" or []);
     deps = [
-      self.by-version."aws-sdk"."1.17.2"
+      self.by-version."aws-sdk"."1.17.3"
       self.by-version."commander"."2.0.0"
       self.by-version."http-auth"."2.0.7"
       self.by-version."express"."3.4.4"
@@ -12754,6 +12766,25 @@
   by-spec."send"."0.1.4" =
     self.by-version."send"."0.1.4";
   by-spec."sequence"."*" =
+    self.by-version."sequence"."3.0.0";
+  by-version."sequence"."3.0.0" = lib.makeOverridable self.buildNodePackage {
+    name = "sequence-3.0.0";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/sequence/-/sequence-3.0.0.tgz";
+        name = "sequence-3.0.0.tgz";
+        sha1 = "5957d3e03c70e270b2009a8c8bdaa97338a6e170";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."sequence" or []);
+    deps = [
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "sequence" ];
+  };
+  by-spec."sequence"."2.x" =
     self.by-version."sequence"."2.2.1";
   by-version."sequence"."2.2.1" = lib.makeOverridable self.buildNodePackage {
     name = "sequence-2.2.1";
@@ -12772,8 +12803,6 @@
     ];
     passthru.names = [ "sequence" ];
   };
-  by-spec."sequence".">= 2.2.1" =
-    self.by-version."sequence"."2.2.1";
   by-spec."sha"."~1.2.1" =
     self.by-version."sha"."1.2.3";
   by-version."sha"."1.2.3" = lib.makeOverridable self.buildNodePackage {
@@ -12836,14 +12865,14 @@
     passthru.names = [ "shelljs" ];
   };
   by-spec."should"."*" =
-    self.by-version."should"."2.1.1";
-  by-version."should"."2.1.1" = lib.makeOverridable self.buildNodePackage {
-    name = "should-2.1.1";
+    self.by-version."should"."3.0.1";
+  by-version."should"."3.0.1" = lib.makeOverridable self.buildNodePackage {
+    name = "should-3.0.1";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/should/-/should-2.1.1.tgz";
-        name = "should-2.1.1.tgz";
-        sha1 = "c648b13a8b464465c2f838ea0c93f12e4ae06c6b";
+        url = "http://registry.npmjs.org/should/-/should-3.0.1.tgz";
+        name = "should-3.0.1.tgz";
+        sha1 = "b30fff8968b4701e2ea499de91d9b0ea4d37623e";
       })
     ];
     buildInputs =
@@ -12854,7 +12883,7 @@
     ];
     passthru.names = [ "should" ];
   };
-  "should" = self.by-version."should"."2.1.1";
+  "should" = self.by-version."should"."3.0.1";
   by-spec."sigmund"."~1.0.0" =
     self.by-version."sigmund"."1.0.0";
   by-version."sigmund"."1.0.0" = lib.makeOverridable self.buildNodePackage {
@@ -13537,14 +13566,14 @@
     passthru.names = [ "strip-ansi" ];
   };
   by-spec."strong-data-uri"."~0.1.0" =
-    self.by-version."strong-data-uri"."0.1.0";
-  by-version."strong-data-uri"."0.1.0" = lib.makeOverridable self.buildNodePackage {
-    name = "strong-data-uri-0.1.0";
+    self.by-version."strong-data-uri"."0.1.1";
+  by-version."strong-data-uri"."0.1.1" = lib.makeOverridable self.buildNodePackage {
+    name = "strong-data-uri-0.1.1";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/strong-data-uri/-/strong-data-uri-0.1.0.tgz";
-        name = "strong-data-uri-0.1.0.tgz";
-        sha1 = "a41235806b8c3bf0f6f324dc57dfe85bbab681a0";
+        url = "http://registry.npmjs.org/strong-data-uri/-/strong-data-uri-0.1.1.tgz";
+        name = "strong-data-uri-0.1.1.tgz";
+        sha1 = "8660241807461d1d2dd247c70563f2f33e66c8ab";
       })
     ];
     buildInputs =
@@ -13557,14 +13586,14 @@
     passthru.names = [ "strong-data-uri" ];
   };
   by-spec."stylus"."*" =
-    self.by-version."stylus"."0.42.0";
-  by-version."stylus"."0.42.0" = lib.makeOverridable self.buildNodePackage {
-    name = "stylus-0.42.0";
+    self.by-version."stylus"."0.42.1";
+  by-version."stylus"."0.42.1" = lib.makeOverridable self.buildNodePackage {
+    name = "stylus-0.42.1";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/stylus/-/stylus-0.42.0.tgz";
-        name = "stylus-0.42.0.tgz";
-        sha1 = "5dc4d50dd205dbb7e6af6bf7f19546da24148e44";
+        url = "http://registry.npmjs.org/stylus/-/stylus-0.42.1.tgz";
+        name = "stylus-0.42.1.tgz";
+        sha1 = "8e5bfec922e8d0037748cd05281d53ca602b6e4f";
       })
     ];
     buildInputs =
@@ -13580,7 +13609,7 @@
     ];
     passthru.names = [ "stylus" ];
   };
-  "stylus" = self.by-version."stylus"."0.42.0";
+  "stylus" = self.by-version."stylus"."0.42.1";
   by-spec."stylus"."0.27.2" =
     self.by-version."stylus"."0.27.2";
   by-version."stylus"."0.27.2" = lib.makeOverridable self.buildNodePackage {
@@ -13723,14 +13752,14 @@
     passthru.names = [ "superagent" ];
   };
   by-spec."supertest"."*" =
-    self.by-version."supertest"."0.8.3";
-  by-version."supertest"."0.8.3" = lib.makeOverridable self.buildNodePackage {
-    name = "supertest-0.8.3";
+    self.by-version."supertest"."0.9.0";
+  by-version."supertest"."0.9.0" = lib.makeOverridable self.buildNodePackage {
+    name = "supertest-0.9.0";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/supertest/-/supertest-0.8.3.tgz";
-        name = "supertest-0.8.3.tgz";
-        sha1 = "7af32af5bd74514f3fabc444facc9858ae438593";
+        url = "http://registry.npmjs.org/supertest/-/supertest-0.9.0.tgz";
+        name = "supertest-0.9.0.tgz";
+        sha1 = "955efa32ad01fb9eecfc6f7c3122699a5843bba4";
       })
     ];
     buildInputs =
@@ -13743,7 +13772,7 @@
     ];
     passthru.names = [ "supertest" ];
   };
-  "supertest" = self.by-version."supertest"."0.8.3";
+  "supertest" = self.by-version."supertest"."0.9.0";
   by-spec."swig"."0.14.x" =
     self.by-version."swig"."0.14.0";
   by-version."swig"."0.14.0" = lib.makeOverridable self.buildNodePackage {
@@ -13865,6 +13894,26 @@
     self.by-version."temp"."0.6.0";
   by-spec."temp"."~0.6.0" =
     self.by-version."temp"."0.6.0";
+  by-spec."tempfile"."~0.1.2" =
+    self.by-version."tempfile"."0.1.2";
+  by-version."tempfile"."0.1.2" = lib.makeOverridable self.buildNodePackage {
+    name = "tempfile-0.1.2";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/tempfile/-/tempfile-0.1.2.tgz";
+        name = "tempfile-0.1.2.tgz";
+        sha1 = "81d4e51f35856592f3b51d568135791af3b038e0";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."tempfile" or []);
+    deps = [
+      self.by-version."uuid"."1.4.1"
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "tempfile" ];
+  };
   by-spec."text-table"."~0.1.1" =
     self.by-version."text-table"."0.1.1";
   by-version."text-table"."0.1.1" = lib.makeOverridable self.buildNodePackage {
@@ -13941,22 +13990,22 @@
     ];
     passthru.names = [ "through" ];
   };
-  by-spec."through2"."~0.1.0" =
-    self.by-version."through2"."0.1.0";
-  by-version."through2"."0.1.0" = lib.makeOverridable self.buildNodePackage {
-    name = "through2-0.1.0";
+  by-spec."through2"."~0.4.0" =
+    self.by-version."through2"."0.4.0";
+  by-version."through2"."0.4.0" = lib.makeOverridable self.buildNodePackage {
+    name = "through2-0.4.0";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/through2/-/through2-0.1.0.tgz";
-        name = "through2-0.1.0.tgz";
-        sha1 = "54e756cc6a543c72bb5adf55e8a248686b84c9cc";
+        url = "http://registry.npmjs.org/through2/-/through2-0.4.0.tgz";
+        name = "through2-0.4.0.tgz";
+        sha1 = "4c9a96e385ef082a86cce5b915ef512119bc5225";
       })
     ];
     buildInputs =
       (self.nativeDeps."through2" or []);
     deps = [
       self.by-version."readable-stream"."1.0.24"
-      self.by-version."xtend"."2.0.6"
+      self.by-version."xtend"."2.1.2"
     ];
     peerDependencies = [
     ];
@@ -14020,15 +14069,15 @@
     ];
     passthru.names = [ "tinycolor" ];
   };
-  by-spec."titanium"."*" =
-    self.by-version."titanium"."3.2.1-beta";
-  by-version."titanium"."3.2.1-beta" = lib.makeOverridable self.buildNodePackage {
-    name = "titanium-3.2.1-beta";
+  by-spec."titanium"."3.2.0" =
+    self.by-version."titanium"."3.2.0";
+  by-version."titanium"."3.2.0" = lib.makeOverridable self.buildNodePackage {
+    name = "titanium-3.2.0";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/titanium/-/titanium-3.2.1-beta.tgz";
-        name = "titanium-3.2.1-beta.tgz";
-        sha1 = "3d92e09ea627584f11bec903052c6501f85ee8fa";
+        url = "http://registry.npmjs.org/titanium/-/titanium-3.2.0.tgz";
+        name = "titanium-3.2.0.tgz";
+        sha1 = "97b25af99e99d4543f5cc2c7025b2c2f6199de6e";
       })
     ];
     buildInputs =
@@ -14048,13 +14097,13 @@
       self.by-version."sprintf"."0.1.3"
       self.by-version."temp"."0.6.0"
       self.by-version."winston"."0.6.2"
-      self.by-version."wrench"."1.5.4"
+      self.by-version."wrench"."1.5.6"
     ];
     peerDependencies = [
     ];
     passthru.names = [ "titanium" ];
   };
-  "titanium" = self.by-version."titanium"."3.2.1-beta";
+  "titanium" = self.by-version."titanium"."3.2.0";
   by-spec."tmp"."~0.0.20" =
     self.by-version."tmp"."0.0.23";
   by-version."tmp"."0.0.23" = lib.makeOverridable self.buildNodePackage {
@@ -14094,6 +14143,26 @@
     ];
     passthru.names = [ "touch" ];
   };
+  by-spec."tough-cookie".">=0.12.0" =
+    self.by-version."tough-cookie"."0.12.1";
+  by-version."tough-cookie"."0.12.1" = lib.makeOverridable self.buildNodePackage {
+    name = "tough-cookie-0.12.1";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz";
+        name = "tough-cookie-0.12.1.tgz";
+        sha1 = "8220c7e21abd5b13d96804254bd5a81ebf2c7d62";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."tough-cookie" or []);
+    deps = [
+      self.by-version."punycode"."1.2.3"
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "tough-cookie" ];
+  };
   by-spec."tough-cookie"."~0.9.15" =
     self.by-version."tough-cookie"."0.9.15";
   by-version."tough-cookie"."0.9.15" = lib.makeOverridable self.buildNodePackage {
@@ -14357,14 +14426,14 @@
   by-spec."uglify-js"."~2.3.6" =
     self.by-version."uglify-js"."2.3.6";
   by-spec."uglify-js"."~2.4.0" =
-    self.by-version."uglify-js"."2.4.8";
-  by-version."uglify-js"."2.4.8" = lib.makeOverridable self.buildNodePackage {
-    name = "uglify-js-2.4.8";
+    self.by-version."uglify-js"."2.4.11";
+  by-version."uglify-js"."2.4.11" = lib.makeOverridable self.buildNodePackage {
+    name = "uglify-js-2.4.11";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/uglify-js/-/uglify-js-2.4.8.tgz";
-        name = "uglify-js-2.4.8.tgz";
-        sha1 = "70e33bd9bce9a27b896fd4fead4c7da434fcca09";
+        url = "http://registry.npmjs.org/uglify-js/-/uglify-js-2.4.11.tgz";
+        name = "uglify-js-2.4.11.tgz";
+        sha1 = "ff2c824be664b715c1054e890b4b9027ed45b5c5";
       })
     ];
     buildInputs =
@@ -14532,14 +14601,14 @@
   by-spec."underscore.string"."~2.3.3" =
     self.by-version."underscore.string"."2.3.3";
   by-spec."unfunk-diff"."~0.0.1" =
-    self.by-version."unfunk-diff"."0.0.1";
-  by-version."unfunk-diff"."0.0.1" = lib.makeOverridable self.buildNodePackage {
-    name = "unfunk-diff-0.0.1";
+    self.by-version."unfunk-diff"."0.0.2";
+  by-version."unfunk-diff"."0.0.2" = lib.makeOverridable self.buildNodePackage {
+    name = "unfunk-diff-0.0.2";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/unfunk-diff/-/unfunk-diff-0.0.1.tgz";
-        name = "unfunk-diff-0.0.1.tgz";
-        sha1 = "fd01490b7e53bc268f069f222fda10704c8f1265";
+        url = "http://registry.npmjs.org/unfunk-diff/-/unfunk-diff-0.0.2.tgz";
+        name = "unfunk-diff-0.0.2.tgz";
+        sha1 = "8560d6b5cb3dcb1ed4d541e7fe59cea514697578";
       })
     ];
     buildInputs =
@@ -14567,7 +14636,7 @@
     buildInputs =
       (self.nativeDeps."ungit" or []);
     deps = [
-      self.by-version."express"."3.4.7"
+      self.by-version."express"."3.4.8"
       self.by-version."superagent"."0.15.7"
       self.by-version."lodash"."2.3.0"
       self.by-version."temp"."0.6.0"
@@ -14575,12 +14644,12 @@
       self.by-version."moment"."2.4.0"
       self.by-version."async"."0.2.9"
       self.by-version."ssh2"."0.2.16"
-      self.by-version."rc"."0.3.2"
+      self.by-version."rc"."0.3.3"
       self.by-version."uuid"."1.4.1"
       self.by-version."winston"."0.7.2"
       self.by-version."passport"."0.1.17"
       self.by-version."passport-local"."0.1.6"
-      self.by-version."npm"."1.3.23"
+      self.by-version."npm"."1.3.24"
       self.by-version."semver"."2.2.1"
       self.by-version."forever-monitor"."1.1.0"
       self.by-version."open"."0.0.4"
@@ -14729,7 +14798,7 @@
       self.by-version."i"."0.3.2"
       self.by-version."mkdirp"."0.3.5"
       self.by-version."ncp"."0.4.2"
-      self.by-version."rimraf"."2.2.5"
+      self.by-version."rimraf"."2.2.6"
     ];
     peerDependencies = [
     ];
@@ -14760,6 +14829,8 @@
     ];
     passthru.names = [ "uuid" ];
   };
+  by-spec."uuid"."~1.4.0" =
+    self.by-version."uuid"."1.4.1";
   by-spec."validator"."0.4.x" =
     self.by-version."validator"."0.4.28";
   by-version."validator"."0.4.28" = lib.makeOverridable self.buildNodePackage {
@@ -14934,7 +15005,7 @@
     buildInputs =
       (self.nativeDeps."walk" or []);
     deps = [
-      self.by-version."forEachAsync"."2.2.0"
+      self.by-version."forEachAsync"."2.2.1"
     ];
     peerDependencies = [
     ];
@@ -15113,7 +15184,7 @@
     buildInputs =
       (self.nativeDeps."winser" or []);
     deps = [
-      self.by-version."sequence"."2.2.1"
+      self.by-version."sequence"."3.0.0"
       self.by-version."commander"."2.1.0"
     ];
     peerDependencies = [
@@ -15283,14 +15354,14 @@
     passthru.names = [ "wrench" ];
   };
   by-spec."wrench"."~1.5.0" =
-    self.by-version."wrench"."1.5.4";
-  by-version."wrench"."1.5.4" = lib.makeOverridable self.buildNodePackage {
-    name = "wrench-1.5.4";
+    self.by-version."wrench"."1.5.6";
+  by-version."wrench"."1.5.6" = lib.makeOverridable self.buildNodePackage {
+    name = "wrench-1.5.6";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/wrench/-/wrench-1.5.4.tgz";
-        name = "wrench-1.5.4.tgz";
-        sha1 = "2e8d9d3db3568cc1c001a4c8dceca772e5d21643";
+        url = "http://registry.npmjs.org/wrench/-/wrench-1.5.6.tgz";
+        name = "wrench-1.5.6.tgz";
+        sha1 = "247b7dfe5d7d4374d5e449761fba634190d9b871";
       })
     ];
     buildInputs =
@@ -15302,7 +15373,7 @@
     passthru.names = [ "wrench" ];
   };
   by-spec."wrench"."~1.5.4" =
-    self.by-version."wrench"."1.5.4";
+    self.by-version."wrench"."1.5.6";
   by-spec."ws"."0.4.x" =
     self.by-version."ws"."0.4.31";
   by-version."ws"."0.4.31" = lib.makeOverridable self.buildNodePackage {
@@ -15469,14 +15540,14 @@
     passthru.names = [ "xmlbuilder" ];
   };
   by-spec."xmldom"."~0.1.16" =
-    self.by-version."xmldom"."0.1.17";
-  by-version."xmldom"."0.1.17" = lib.makeOverridable self.buildNodePackage {
-    name = "xmldom-0.1.17";
+    self.by-version."xmldom"."0.1.18";
+  by-version."xmldom"."0.1.18" = lib.makeOverridable self.buildNodePackage {
+    name = "xmldom-0.1.18";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/xmldom/-/xmldom-0.1.17.tgz";
-        name = "xmldom-0.1.17.tgz";
-        sha1 = "c5debadc069f0a3967ddfbc01395a4d7cb0d4282";
+        url = "http://registry.npmjs.org/xmldom/-/xmldom-0.1.18.tgz";
+        name = "xmldom-0.1.18.tgz";
+        sha1 = "cb0ca87d81106ea4e75f632c9fff044d9cd3394a";
       })
     ];
     buildInputs =
@@ -15525,22 +15596,21 @@
     ];
     passthru.names = [ "xoauth2" ];
   };
-  by-spec."xtend"."~2.0.6" =
-    self.by-version."xtend"."2.0.6";
-  by-version."xtend"."2.0.6" = lib.makeOverridable self.buildNodePackage {
-    name = "xtend-2.0.6";
+  by-spec."xtend"."~2.1.1" =
+    self.by-version."xtend"."2.1.2";
+  by-version."xtend"."2.1.2" = lib.makeOverridable self.buildNodePackage {
+    name = "xtend-2.1.2";
     src = [
       (fetchurl {
-        url = "http://registry.npmjs.org/xtend/-/xtend-2.0.6.tgz";
-        name = "xtend-2.0.6.tgz";
-        sha1 = "5ea657a6dba447069c2e59c58a1138cb0c5e6cee";
+        url = "http://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz";
+        name = "xtend-2.1.2.tgz";
+        sha1 = "6efecc2a4dad8e6962c4901b337ce7ba87b5d28b";
       })
     ];
     buildInputs =
       (self.nativeDeps."xtend" or []);
     deps = [
-      self.by-version."is-object"."0.1.2"
-      self.by-version."object-keys"."0.2.0"
+      self.by-version."object-keys"."0.4.0"
     ];
     peerDependencies = [
     ];
@@ -15581,7 +15651,7 @@
     deps = [
       self.by-version."cheerio"."0.12.4"
       self.by-version."request"."2.25.0"
-      self.by-version."rimraf"."2.2.5"
+      self.by-version."rimraf"."2.2.6"
       self.by-version."tar"."0.1.19"
       self.by-version."diff"."1.0.8"
       self.by-version."mime"."1.2.11"
@@ -15619,7 +15689,7 @@
       (self.nativeDeps."yeoman-generator" or []);
     deps = [
       self.by-version."cheerio"."0.12.4"
-      self.by-version."rimraf"."2.2.5"
+      self.by-version."rimraf"."2.2.6"
       self.by-version."diff"."1.0.8"
       self.by-version."mime"."1.2.11"
       self.by-version."underscore.string"."2.3.3"
@@ -15636,7 +15706,7 @@
       self.by-version."findup-sync"."0.1.2"
       self.by-version."chalk"."0.3.0"
       self.by-version."text-table"."0.2.0"
-      self.by-version."download"."0.1.7"
+      self.by-version."download"."0.1.10"
       self.by-version."request"."2.27.0"
       self.by-version."file-utils"."0.1.5"
     ];
@@ -15659,7 +15729,7 @@
       (self.nativeDeps."yeoman-generator" or []);
     deps = [
       self.by-version."cheerio"."0.13.1"
-      self.by-version."rimraf"."2.2.5"
+      self.by-version."rimraf"."2.2.6"
       self.by-version."diff"."1.0.8"
       self.by-version."mime"."1.2.11"
       self.by-version."underscore.string"."2.3.3"
@@ -15676,7 +15746,7 @@
       self.by-version."findup-sync"."0.1.2"
       self.by-version."chalk"."0.4.0"
       self.by-version."text-table"."0.2.0"
-      self.by-version."download"."0.1.7"
+      self.by-version."download"."0.1.10"
       self.by-version."request"."2.30.0"
       self.by-version."file-utils"."0.1.5"
       self.by-version."class-extend"."0.1.1"
diff --git a/pkgs/top-level/node-packages.json b/pkgs/top-level/node-packages.json
index 2f9adca15f32..0e6d45bb5511 100644
--- a/pkgs/top-level/node-packages.json
+++ b/pkgs/top-level/node-packages.json
@@ -114,5 +114,5 @@
 , "rethinkdb"
 , "bower2nix"
 , "fetch-bower"
-, "titanium"
+, { "titanium": "3.2.0" }
 ]
diff --git a/pkgs/top-level/release-python.nix b/pkgs/top-level/release-python.nix
index e371d894ae1c..8eb08d259834 100644
--- a/pkgs/top-level/release-python.nix
+++ b/pkgs/top-level/release-python.nix
@@ -366,7 +366,6 @@ let
   gajim = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
   gav = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
   gcj = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
-  gcj46 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
   gcl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
   gdb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
   gdbCross = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
diff --git a/pkgs/top-level/release-small.nix b/pkgs/top-level/release-small.nix
index 921a6e741343..213358bc8ce7 100644
--- a/pkgs/top-level/release-small.nix
+++ b/pkgs/top-level/release-small.nix
@@ -1,19 +1,18 @@
 /* A small release file, with few packages to be built.  The aim is to reduce
-   the load on Hydra when testing the `stdenv-updates' branch.
+   the load on Hydra when testing the `stdenv-updates' branch. */
 
+{ nixpkgs ? { outPath = (import ./all-packages.nix {}).lib.cleanSource ../..; revCount = 1234; shortRev = "abcdef"; }
+, supportedSystems ? [ "x86_64-linux" "i686-linux" "x86_64-darwin" "x86_64-freebsd" "i686-freebsd" ]
+}:
 
-   This file will be evaluated by hydra with a call like this:
-   hydra_eval_jobs --gc-roots-dir \
-     /nix/var/nix/gcroots/per-user/hydra/hydra-roots --argstr \
-     system i686-linux --argstr system x86_64-linux --arg \
-     nixpkgs "{outPath = ./}" .... release.nix
-
-   Hydra can be installed with "nix-env -i hydra".  */
-with (import ./release-lib.nix);
+with import ./release-lib.nix { inherit supportedSystems; };
 
 {
 
-  tarball = import ./make-tarball.nix;
+  tarball = import ./make-tarball.nix {
+    inherit nixpkgs;
+    officialRelease = false;
+  };
 
 } // (mapTestOn (rec {
 
@@ -47,16 +46,16 @@ with (import ./release-lib.nix);
   file = all;
   findutils = all;
   flex = all;
-  flex2535 = all;
   gcc = all;
   gcc33 = linux;
   gcc34 = linux;
   gcc42 = linux;
   gcc44 = linux;
+  gcj = linux;
   ghdl = linux;
   glibc = linux;
   glibcLocales = linux;
-  gnat44 = linux;
+  gnat = linux;
   gnugrep = all;
   gnum4 = all;
   gnumake = all;
@@ -197,7 +196,7 @@ with (import ./release-lib.nix);
   zile = linux;
   zip = all;
 
-  dbus_all = {
+  dbus = {
     libs = linux;
     daemon = linux;
     tools = linux;
diff --git a/pkgs/top-level/release.nix b/pkgs/top-level/release.nix
index 298188923753..c0800c8cad1d 100644
--- a/pkgs/top-level/release.nix
+++ b/pkgs/top-level/release.nix
@@ -106,7 +106,6 @@ let
       file = all;
       findutils = all;
       flex = all;
-      flex2535 = all;
       fontforge = linux;
       fuse = linux;
       gajim = linux;
@@ -116,6 +115,7 @@ let
       gcc34 = linux;
       gcc42 = linux;
       gcc44 = linux;
+      gcj = linux;
       ghdl = linux;
       ghostscript = linux;
       ghostscriptX = linux;
@@ -126,7 +126,7 @@ let
       glibcLocales = linux;
       glxinfo = linux;
       gnash = linux;
-      gnat44 = linux;
+      gnat = linux;
       gnugrep = all;
       gnum4 = all;
       gnumake = all;