summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/compilers/gcc-4.4/default.nix11
-rw-r--r--pkgs/development/compilers/gcc-4.5/builder.sh10
-rw-r--r--pkgs/development/compilers/gcc-4.5/default.nix28
-rw-r--r--pkgs/development/compilers/gcc-4.5/sources.nix14
-rw-r--r--pkgs/development/compilers/gcc-4.6/default.nix25
-rw-r--r--pkgs/development/interpreters/perl/5.10/default.nix (renamed from pkgs/development/interpreters/perl-5.10/default.nix)0
-rw-r--r--pkgs/development/interpreters/perl/5.10/no-sys-dirs.patch (renamed from pkgs/development/interpreters/perl-5.10/no-sys-dirs.patch)0
-rw-r--r--pkgs/development/interpreters/perl/5.10/setup-hook.sh (renamed from pkgs/development/interpreters/perl-5.10/setup-hook.sh)0
-rw-r--r--pkgs/development/interpreters/perl/5.14/default.nix60
-rw-r--r--pkgs/development/interpreters/perl/5.14/no-sys-dirs.patch134
-rw-r--r--pkgs/development/interpreters/perl/5.14/setup-hook.sh5
-rw-r--r--pkgs/development/interpreters/perl/5.8/default.nix (renamed from pkgs/development/interpreters/perl-5.8/default.nix)0
-rw-r--r--pkgs/development/interpreters/perl/5.8/gcc-4.2.patch (renamed from pkgs/development/interpreters/perl-5.8/gcc-4.2.patch)0
-rw-r--r--pkgs/development/interpreters/perl/5.8/no-sys-dirs.patch (renamed from pkgs/development/interpreters/perl-5.8/no-sys-dirs.patch)0
-rw-r--r--pkgs/development/interpreters/perl/5.8/setup-hook.sh (renamed from pkgs/development/interpreters/perl-5.8/setup-hook.sh)0
-rw-r--r--pkgs/development/libraries/acl/default.nix6
-rw-r--r--pkgs/development/libraries/attr/default.nix6
-rw-r--r--pkgs/development/libraries/cloog-ppl/default.nix22
-rw-r--r--pkgs/development/libraries/cloog/default.nix9
-rw-r--r--pkgs/development/libraries/dbus-glib/0.94.nix23
-rw-r--r--pkgs/development/libraries/dbus-glib/default.nix20
-rw-r--r--pkgs/development/libraries/dbus/1.5.6.nix61
-rw-r--r--pkgs/development/libraries/dbus/default.nix14
-rw-r--r--pkgs/development/libraries/gettext/0.17.nix14
-rw-r--r--pkgs/development/libraries/gettext/default.nix16
-rw-r--r--pkgs/development/libraries/glibc-2.13/builder.sh (renamed from pkgs/development/libraries/glibc-2.12/builder.sh)0
-rw-r--r--pkgs/development/libraries/glibc-2.13/common.nix213
-rw-r--r--pkgs/development/libraries/glibc-2.13/default.nix (renamed from pkgs/development/libraries/glibc-2.12/default.nix)22
-rw-r--r--pkgs/development/libraries/glibc-2.13/glibc-elf-localscope.patch82
-rw-r--r--pkgs/development/libraries/glibc-2.13/info.nix (renamed from pkgs/development/libraries/glibc-2.12/info.nix)0
-rw-r--r--pkgs/development/libraries/glibc-2.13/locales-builder.sh (renamed from pkgs/development/libraries/glibc-2.12/locales-builder.sh)0
-rw-r--r--pkgs/development/libraries/glibc-2.13/locales.nix (renamed from pkgs/development/libraries/glibc-2.12/locales.nix)2
-rw-r--r--pkgs/development/libraries/glibc-2.13/nix-locale-archive.patch (renamed from pkgs/development/libraries/glibc-2.12/nix-locale-archive.patch)0
-rw-r--r--pkgs/development/libraries/glibc-2.13/nss-skip-unavail.patch (renamed from pkgs/development/libraries/glibc-2.12/nss-skip-unavail.patch)0
-rw-r--r--pkgs/development/libraries/glibc-2.13/rpcgen-path.patch (renamed from pkgs/development/libraries/glibc-2.12/rpcgen-path.patch)0
-rw-r--r--pkgs/development/libraries/glibc-2.14/builder.sh55
-rw-r--r--pkgs/development/libraries/glibc-2.14/common.nix (renamed from pkgs/development/libraries/glibc-2.12/common.nix)31
-rw-r--r--pkgs/development/libraries/glibc-2.14/default.nix83
-rw-r--r--pkgs/development/libraries/glibc-2.14/glibc-elf-localscope.patch82
-rw-r--r--pkgs/development/libraries/glibc-2.14/info.nix26
-rw-r--r--pkgs/development/libraries/glibc-2.14/locales-builder.sh17
-rw-r--r--pkgs/development/libraries/glibc-2.14/locales.nix47
-rw-r--r--pkgs/development/libraries/glibc-2.14/nix-locale-archive.patch116
-rw-r--r--pkgs/development/libraries/glibc-2.14/nss-skip-unavail.patch21
-rw-r--r--pkgs/development/libraries/glibc-2.14/rpcgen-path.patch72
-rw-r--r--pkgs/development/libraries/gmp/default.nix24
-rw-r--r--pkgs/development/libraries/haskell/network/2.3.0.7.nix18
-rw-r--r--pkgs/development/libraries/haskell/syb/0.3.5.nix17
-rw-r--r--pkgs/development/libraries/isl/default.nix10
-rw-r--r--pkgs/development/libraries/libsigsegv/default.nix4
-rw-r--r--pkgs/development/libraries/libtirpc/default.nix22
-rw-r--r--pkgs/development/libraries/libwpg/default.nix4
-rw-r--r--pkgs/development/libraries/libxcrypt/default.nix3
-rw-r--r--pkgs/development/libraries/libxcrypt/gcc46.patch18
-rw-r--r--pkgs/development/libraries/mpc/default.nix4
-rw-r--r--pkgs/development/libraries/mpfr/default.nix4
-rw-r--r--pkgs/development/libraries/ncurses/default.nix4
-rw-r--r--pkgs/development/libraries/opencv/changeset_r3190.diff20
-rw-r--r--pkgs/development/libraries/opencv/default.nix4
-rw-r--r--pkgs/development/libraries/opencv/default.nix.edited27
-rw-r--r--pkgs/development/libraries/openssl/default.nix3
-rw-r--r--pkgs/development/libraries/pcre/default.nix10
-rw-r--r--pkgs/development/libraries/ppl/0.11.nix50
-rw-r--r--pkgs/development/libraries/ppl/default.nix99
-rw-r--r--pkgs/development/libraries/readline/readline-6.2-patches.nix (renamed from pkgs/development/libraries/readline/readline-patches.nix)1
-rw-r--r--pkgs/development/libraries/readline/readline6.nix8
-rw-r--r--pkgs/development/libraries/zlib/default.nix17
-rw-r--r--pkgs/development/libraries/zlib/zlib-LARGEFILE64_SOURCE.patch69
-rw-r--r--pkgs/development/tools/build-managers/cmake/default.nix5
-rw-r--r--pkgs/development/tools/misc/binutils/default.nix30
-rw-r--r--pkgs/development/tools/misc/gnum4/default.nix8
-rw-r--r--pkgs/development/tools/misc/gnum4/readlink-EINVAL.patch18
-rw-r--r--pkgs/development/tools/misc/patchelf/0.6.nix16
-rw-r--r--pkgs/development/tools/misc/patchelf/default.nix8
-rw-r--r--pkgs/development/tools/misc/strace/default.nix4
-rw-r--r--pkgs/development/tools/parsing/bison/bison-2.5.nix3
76 files changed, 1440 insertions, 439 deletions
diff --git a/pkgs/development/compilers/gcc-4.4/default.nix b/pkgs/development/compilers/gcc-4.4/default.nix
index fa34364912e..d962d4ac347 100644
--- a/pkgs/development/compilers/gcc-4.4/default.nix
+++ b/pkgs/development/compilers/gcc-4.4/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, noSysDirs
-, langC ? true, langCC ? true, langFortran ? false, langTreelang ? false
+, langC ? true, langCC ? true, langFortran ? false
 , langJava ? false
 , langAda ? false
 , langVhdl ? false
@@ -9,7 +9,6 @@
 , texinfo ? null
 , gmp, mpfr, gettext, which
 , ppl ? null, cloogppl ? null  # used by the Graphite optimization framework
-, bison ? null, flex ? null
 , 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
@@ -25,7 +24,6 @@
 , gnat ? null
 }:
 
-assert langTreelang -> bison != null && flex != null;
 assert langJava     -> zip != null && unzip != null
                        && zlib != null && boehmgc != null;
 assert langAda      -> gnatboot != null;
@@ -131,11 +129,10 @@ stdenv.mkDerivation ({
   buildInputs = [ gmp mpfr gettext ]
     ++ (optional (ppl != null) ppl)
     ++ (optional (cloogppl != null) cloogppl)
-    ++ (optionals langTreelang [bison flex])
     ++ (optional (zlib != null) zlib)
     ++ (optional (boehmgc != null) boehmgc)
     ++ (optionals langJava [zip unzip])
-    ++ (optionals javaAwtGtk [gtk pkgconfig libart_lgpl] ++ xlibs)
+    ++ (optionals javaAwtGtk ([gtk pkgconfig libart_lgpl] ++ xlibs))
     ++ (optionals (cross != null) [binutilsCross])
     ++ (optionals langAda [gnatboot])
     ++ (optionals langVhdl [gnat])
@@ -160,7 +157,6 @@ stdenv.mkDerivation ({
         ++ optional langCC       "c++"
         ++ optional langFortran  "fortran"
         ++ optional langJava     "java"
-        ++ optional langTreelang "treelang"
         ++ optional langAda      "ada"
         ++ optional langVhdl     "vhdl"
         )
@@ -209,7 +205,6 @@ stdenv.mkDerivation ({
           ++ optional langCC       "c++"
           ++ optional langFortran  "fortran"
           ++ optional langJava     "java"
-          ++ optional langTreelang "treelang"
           ++ optional langAda      "ada"
           ++ optional langVhdl     "vhdl"
           )
@@ -244,7 +239,7 @@ stdenv.mkDerivation ({
                                           ++ optionals javaAwtGtk [ gmp mpfr ])));
 
 
-  passthru = { inherit langC langCC langAda langFortran langTreelang langVhdl
+  passthru = { inherit langC langCC langAda langFortran langVhdl
       enableMultilib version; };
 
   # ghdl does not build fine with parallel building
diff --git a/pkgs/development/compilers/gcc-4.5/builder.sh b/pkgs/development/compilers/gcc-4.5/builder.sh
index aedd5b46b12..e1e56c8574a 100644
--- a/pkgs/development/compilers/gcc-4.5/builder.sh
+++ b/pkgs/development/compilers/gcc-4.5/builder.sh
@@ -46,8 +46,8 @@ if test "$noSysDirs" = "1"; then
         export NIX_FIXINC_DUMMY=/usr/include
     fi
 
-    extraFlags="-g0 -O2 -I$NIX_FIXINC_DUMMY $extraFlags"
-    extraLDFlags="--strip-debug -L$glibc_libdir -rpath $glibc_libdir $extraLDFlags"
+    extraFlags="-I$NIX_FIXINC_DUMMY $extraFlags"
+    extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $extraLDFlags"
 
     EXTRA_FLAGS="$extraFlags"
     for i in $extraLDFlags; do
@@ -63,7 +63,7 @@ if test "$noSysDirs" = "1"; then
         unset LIBRARY_PATH
         unset CPATH
         if test -z "$crossStageStatic"; then
-            EXTRA_TARGET_CFLAGS="-g0 -O2 -B${libcCross}/lib -idirafter ${libcCross}/include"
+            EXTRA_TARGET_CFLAGS="-B${libcCross}/lib -idirafter ${libcCross}/include"
             EXTRA_TARGET_LDFLAGS="-Wl,-L${libcCross}/lib"
         fi
     else
@@ -89,8 +89,8 @@ if test "$noSysDirs" = "1"; then
             # The path to the Glibc binaries such as `crti.o'.
             glibc_libdir="$(cat $NIX_GCC_CROSS/nix-support/orig-libc)/lib"
 
-            extraFlags="-g0 -O2 -I$NIX_FIXINC_DUMMY_CROSS $extraFlags"
-            extraLDFlags="--strip-debug -L$glibc_libdir -rpath $glibc_libdir $extraLDFlags"
+            extraFlags="-I$NIX_FIXINC_DUMMY_CROSS $extraFlags"
+            extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $extraLDFlags"
 
             EXTRA_TARGET_CFLAGS="$extraFlags"
             for i in $extraLDFlags; do
diff --git a/pkgs/development/compilers/gcc-4.5/default.nix b/pkgs/development/compilers/gcc-4.5/default.nix
index 0948e94702e..a86c317e265 100644
--- a/pkgs/development/compilers/gcc-4.5/default.nix
+++ b/pkgs/development/compilers/gcc-4.5/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, noSysDirs
-, langC ? true, langCC ? true, langFortran ? false, langTreelang ? false
+, langC ? true, langCC ? true, langFortran ? false
 , langJava ? false
 , langAda ? false
 , langVhdl ? false
@@ -11,7 +11,6 @@
 , gmp, mpfr, mpc, gettext, which
 , libelf                      # optional, for link-time optimizations (LTO)
 , ppl ? null, cloogppl ? null # optional, for the Graphite optimization framework
-, bison ? null, flex ? null
 , 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
@@ -26,9 +25,9 @@
 , crossStageStatic ? true
 , gnat ? null
 , libpthread ? null, libpthreadCross ? null  # required for GNU/Hurd
+, stripped ? true
 }:
 
-assert langTreelang -> bison != null && flex != null;
 assert langJava     -> zip != null && unzip != null
                        && zlib != null && boehmgc != null
                        && perl != null;  # for `--enable-java-home'
@@ -41,7 +40,7 @@ assert libelf != null -> zlib != null;
 with stdenv.lib;
 with builtins;
 
-let version = "4.5.1";
+let version = "4.5.2";
     javaEcj = fetchurl {
       # The `$(top_srcdir)/ecj.jar' file is automatically picked up at
       # `configure' time.
@@ -212,21 +211,15 @@ stdenv.mkDerivation ({
   buildInputs = [ gmp mpfr mpc libelf gettext ]
     ++ (optional (ppl != null) ppl)
     ++ (optional (cloogppl != null) cloogppl)
-    ++ (optionals langTreelang [bison flex])
     ++ (optional (zlib != null) zlib)
     ++ (optional (boehmgc != null) boehmgc)
     ++ (optionals langJava [zip unzip])
-    ++ (optionals javaAwtGtk [gtk pkgconfig libart_lgpl] ++ xlibs)
+    ++ (optionals javaAwtGtk ([gtk pkgconfig libart_lgpl] ++ xlibs))
     ++ (optionals (cross != null) [binutilsCross])
     ++ (optionals langAda [gnatboot])
     ++ (optionals langVhdl [gnat])
     ;
 
-  configureFlagsArray = stdenv.lib.optionals
-    (ppl != null && ppl.dontDisableStatic == true)
-        [ "--with-host-libstdcxx=-lstdc++ -lgcc_s"
-            "--with-stage1-libs=-lstdc++ -lgcc_s" ];
-
   configureFlags = "
     ${if enableMultilib then "" else "--disable-multilib"}
     ${if enableShared then "" else "--disable-shared"}
@@ -254,7 +247,6 @@ stdenv.mkDerivation ({
         ++ optional langCC       "c++"
         ++ optional langFortran  "fortran"
         ++ optional langJava     "java"
-        ++ optional langTreelang "treelang"
         ++ optional langAda      "ada"
         ++ optional langVhdl     "vhdl"
         )
@@ -301,7 +293,6 @@ stdenv.mkDerivation ({
           ++ optional langCC       "c++"
           ++ optional langFortran  "fortran"
           ++ optional langJava     "java"
-          ++ optional langTreelang "treelang"
           ++ optional langAda      "ada"
           ++ optional langVhdl     "vhdl"
           )
@@ -356,7 +347,7 @@ stdenv.mkDerivation ({
 
   EXTRA_TARGET_CFLAGS =
     if cross != null && libcCross != null
-    then "-g0 -O2 -idirafter ${libcCross}/include"
+    then "-idirafter ${libcCross}/include"
     else null;
 
   EXTRA_TARGET_LDFLAGS =
@@ -366,7 +357,7 @@ stdenv.mkDerivation ({
            " -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}")
     else null;
 
-  passthru = { inherit langC langCC langAda langFortran langTreelang langVhdl
+  passthru = { inherit langC langCC langAda langFortran langVhdl
       enableMultilib version; };
 
   enableParallelBuilding = true;
@@ -374,7 +365,8 @@ stdenv.mkDerivation ({
   meta = {
     homepage = http://gcc.gnu.org/;
     license = "GPLv3+";  # runtime support libraries are typically LGPLv3+
-    description = "GNU Compiler Collection, version ${version}";
+    description = "GNU Compiler Collection, version ${version}"
+      + (if stripped then "" else " (with debugging info)");
 
     longDescription = ''
       The GNU Compiler Collection includes compiler front ends for C, C++,
@@ -409,6 +401,10 @@ stdenv.mkDerivation ({
   installTargets = "install-gcc install-target-libgcc";
 }
 
+# GCC 4.5.2 doesn't support the `install-strip' target, so let `stdenv' do
+# the stripping by default.
+// optionalAttrs (!stripped) { dontStrip = true; }
+
 // optionalAttrs langVhdl rec {
   name = "ghdl-0.29";
 
diff --git a/pkgs/development/compilers/gcc-4.5/sources.nix b/pkgs/development/compilers/gcc-4.5/sources.nix
index 6059e03880b..6e702f79ed0 100644
--- a/pkgs/development/compilers/gcc-4.5/sources.nix
+++ b/pkgs/development/compilers/gcc-4.5/sources.nix
@@ -1,26 +1,26 @@
 /* Automatically generated by `update-gcc.sh', do not edit.
-   For GCC 4.5.1.  */
+   For GCC 4.5.2.  */
 { fetchurl, optional, version, langC, langCC, langFortran, langJava, langAda }:
 
-assert version == "4.5.1";
+assert version == "4.5.2";
 optional /* langC */ true (fetchurl {
   url = "mirror://gcc/releases/gcc-${version}/gcc-core-${version}.tar.bz2";
-  sha256 = "0sjjw3qfcpdk0fs5d2rhl0xqcaclg86ifbq45dbk9ca072l3fyxm";
+  sha256 = "d1099165702ccdfd65f2411ed8d1015452190fe6bc7b87baf124794e5c8e7464";
 }) ++
 optional langCC (fetchurl {
   url = "mirror://gcc/releases/gcc-${version}/gcc-g++-${version}.tar.bz2";
-  sha256 = "0j6ffb96b3r75hrjshg52llv21ax7r8jdx44hhj0maiisnl9wd55";
+  sha256 = "fdd45dc9158d1d5a1c2ef0054b353d5f403e29ec360c1f8e058dc7e4531fe83b";
 }) ++
 optional langFortran (fetchurl {
   url = "mirror://gcc/releases/gcc-${version}/gcc-fortran-${version}.tar.bz2";
-  sha256 = "0xgwjc3h5fc5c100bnw24c35255il33lj5qbgpxf0zl8di2q13aw";
+  sha256 = "19c3c8a4b23c880a369d3229ef65406fde6af47f5127d494a87f19e1de3d9a13";
 }) ++
 optional langJava (fetchurl {
   url = "mirror://gcc/releases/gcc-${version}/gcc-java-${version}.tar.bz2";
-  sha256 = "0mh37q4ibg05h1hdh39pkj1hycvdg6i79m4698knw7pppm14ax8q";
+  sha256 = "c120e2dc39dd707a3d5461744b879e41f5e642661d7b8a023fc620b24bb7a2ab";
 }) ++
 optional langAda (fetchurl {
   url = "mirror://gcc/releases/gcc-${version}/gcc-ada-${version}.tar.bz2";
-  sha256 = "11chdbl7h046lnl83k79vj7dvgxz6kq7cnmwx94z644vaiflg153";
+  sha256 = "7ed5bb26b72dfbfaf533d09e3d34df96305c09f57f5da67939087fb2726cc771";
 }) ++
 []
diff --git a/pkgs/development/compilers/gcc-4.6/default.nix b/pkgs/development/compilers/gcc-4.6/default.nix
index 5fdb61576fa..9ae35014916 100644
--- a/pkgs/development/compilers/gcc-4.6/default.nix
+++ b/pkgs/development/compilers/gcc-4.6/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, noSysDirs
-, langC ? true, langCC ? true, langFortran ? false, langTreelang ? false
+, langC ? true, langCC ? true, langFortran ? false
 , langJava ? false
 , langAda ? false
 , langVhdl ? false
@@ -11,8 +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, cloogppl ? null, cloog ? null # optional, for the Graphite optimization framework. Cannot pass both cloog and cloogppl
-, bison ? null, flex ? null
+, ppl ? null, cloog ? 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
@@ -30,7 +29,6 @@
 , stripped ? true
 }:
 
-assert langTreelang -> bison != null && flex != null;
 assert langJava     -> zip != null && unzip != null
                        && zlib != null && boehmgc != null
                        && perl != null;  # for `--enable-java-home'
@@ -40,9 +38,6 @@ assert langVhdl     -> gnat != null;
 # LTO needs libelf and zlib.
 assert libelf != null -> zlib != null;
 
-# Cannot use both cloog and cloog-ppl
-assert cloog != null -> cloogppl == null;
-
 with stdenv.lib;
 with builtins;
 
@@ -214,30 +209,27 @@ stdenv.mkDerivation ({
 
   buildNativeInputs = [ texinfo which gettext ]
     ++ (optional (perl != null) perl)
-    ++ (optional javaAwtGtk pkgconfig)
-    ++ (optionals langTreelang [bison flex]);
+    ++ (optional javaAwtGtk pkgconfig);
 
   buildInputs = [ gmp mpfr mpc libelf ]
     ++ (optional (ppl != null) ppl)
-    ++ (optional (cloogppl != null) cloogppl)
     ++ (optional (cloog != null) cloog)
     ++ (optional (zlib != null) zlib)
     ++ (optionals langJava [ boehmgc zip unzip ])
-    ++ (optionals javaAwtGtk [ gtk libart_lgpl ] ++ xlibs)
+    ++ (optionals javaAwtGtk ([ gtk libart_lgpl ] ++ xlibs))
     ++ (optionals (cross != null) [binutilsCross])
     ++ (optionals langAda [gnatboot])
     ++ (optionals langVhdl [gnat])
     ;
 
   configureFlagsArray = stdenv.lib.optionals
-    (ppl != null && ppl.dontDisableStatic == true)
+    (ppl != null && ppl ? dontDisableStatic && ppl.dontDisableStatic)
         [ "--with-host-libstdcxx=-lstdc++ -lgcc_s" ];
 
   configureFlags = "
     ${if enableMultilib then "" else "--disable-multilib"}
     ${if enableShared then "" else "--disable-shared"}
     ${if ppl != null then "--with-ppl=${ppl}" else ""}
-    ${if cloogppl != null then "--with-cloog=${cloogppl}" else ""}
     ${if cloog != null then 
       "--with-cloog=${cloog} --enable-cloog-backend=isl" 
       else ""}
@@ -263,7 +255,6 @@ stdenv.mkDerivation ({
         ++ optional langCC       "c++"
         ++ optional langFortran  "fortran"
         ++ optional langJava     "java"
-        ++ optional langTreelang "treelang"
         ++ optional langAda      "ada"
         ++ optional langVhdl     "vhdl"
         ++ optional langGo       "go"
@@ -301,7 +292,6 @@ stdenv.mkDerivation ({
       ${if enableMultilib then "" else "--disable-multilib"}
       ${if enableShared then "" else "--disable-shared"}
       ${if ppl != null then "--with-ppl=${ppl.hostDrv}" else ""}
-      ${if cloogppl != null then "--with-cloog=${cloogppl.hostDrv}" else ""}
       ${if cloog != null then "--with-cloog=${cloog.hostDrv} --enable-cloog-backend=isl" else ""}
       ${if langJava then "--with-ecj-jar=${javaEcj.hostDrv}" else ""}
       ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
@@ -317,7 +307,6 @@ stdenv.mkDerivation ({
           ++ optional langCC       "c++"
           ++ optional langFortran  "fortran"
           ++ optional langJava     "java"
-          ++ optional langTreelang "treelang"
           ++ optional langAda      "ada"
           ++ optional langVhdl     "vhdl"
           ++ optional langGo       "go"
@@ -383,7 +372,7 @@ stdenv.mkDerivation ({
            " -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}")
     else null;
 
-  passthru = { inherit langC langCC langAda langFortran langTreelang langVhdl
+  passthru = { inherit langC langCC langAda langFortran langVhdl
       langGo enableMultilib version; };
 
   enableParallelBuilding = true;
@@ -421,7 +410,7 @@ stdenv.mkDerivation ({
   installTargets = "install-gcc install-target-libgcc";
 }
 
-// optionalAttrs (!stripped) { dontStrip = true; NIX_STRIP_DEBUG = false; }
+// optionalAttrs (!stripped) { dontStrip = true; }
 
 // optionalAttrs langVhdl rec {
   name = "ghdl-0.29";
diff --git a/pkgs/development/interpreters/perl-5.10/default.nix b/pkgs/development/interpreters/perl/5.10/default.nix
index 76928d10448..76928d10448 100644
--- a/pkgs/development/interpreters/perl-5.10/default.nix
+++ b/pkgs/development/interpreters/perl/5.10/default.nix
diff --git a/pkgs/development/interpreters/perl-5.10/no-sys-dirs.patch b/pkgs/development/interpreters/perl/5.10/no-sys-dirs.patch
index 29edf68bb64..29edf68bb64 100644
--- a/pkgs/development/interpreters/perl-5.10/no-sys-dirs.patch
+++ b/pkgs/development/interpreters/perl/5.10/no-sys-dirs.patch
diff --git a/pkgs/development/interpreters/perl-5.10/setup-hook.sh b/pkgs/development/interpreters/perl/5.10/setup-hook.sh
index 6a144a7f780..6a144a7f780 100644
--- a/pkgs/development/interpreters/perl-5.10/setup-hook.sh
+++ b/pkgs/development/interpreters/perl/5.10/setup-hook.sh
diff --git a/pkgs/development/interpreters/perl/5.14/default.nix b/pkgs/development/interpreters/perl/5.14/default.nix
new file mode 100644
index 00000000000..bdd3365b8b0
--- /dev/null
+++ b/pkgs/development/interpreters/perl/5.14/default.nix
@@ -0,0 +1,60 @@
+{ stdenv, fetchurl }:
+
+let 
+  
+  libc = if stdenv ? gcc && stdenv.gcc.libc != null then stdenv.gcc.libc else "/usr";
+
+in
+
+stdenv.mkDerivation rec {
+  name = "perl-5.14.2";
+
+  src = fetchurl {
+    url = "mirror://cpan/src/${name}.tar.gz";
+    sha256 = "1ls8cpbgnlaxfydyyqgr7pxj1hkxh9pzcdgr3dv42zdxffakb234";
+  };
+
+  patches = 
+    [ # Do not look in /usr etc. for dependencies.
+      ./no-sys-dirs.patch
+    ];
+
+  # Build a thread-safe Perl with a dynamic libperls.o.  We need the
+  # "installstyle" option to ensure that modules are put under
+  # $out/lib/perl5 - this is the general default, but because $out
+  # contains the string "perl", Configure would select $out/lib.
+  # Miniperl needs -lm. perl needs -lrt.
+  configureFlags = 
+    [ "-de"
+      "-Dcc=gcc"
+      "-Uinstallusrbinperl"
+      "-Dinstallstyle=lib/perl5"
+      "-Duseshrplib"
+      "-Dlocincpth=${libc}/include"
+      "-Dloclibpth=${libc}/lib"
+    ] 
+    ++ stdenv.lib.optional (stdenv ? glibc) "-Dusethreads";
+
+  configureScript = "${stdenv.shell} ./Configure";
+
+  dontAddPrefix = true;
+
+  enableParallelBuilding = true;
+
+  preConfigure =
+    ''
+      configureFlags="$configureFlags -Dprefix=$out -Dman1dir=$out/share/man/man1 -Dman3dir=$out/share/man/man3"
+
+      ${stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") ''
+        configureFlagsArray=(-Dldflags="-lm -lrt")
+      ''}
+    '';
+
+  preBuild = stdenv.lib.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)'"
+    '';
+
+  setupHook = ./setup-hook.sh;
+}
diff --git a/pkgs/development/interpreters/perl/5.14/no-sys-dirs.patch b/pkgs/development/interpreters/perl/5.14/no-sys-dirs.patch
new file mode 100644
index 00000000000..a7fa7725c89
--- /dev/null
+++ b/pkgs/development/interpreters/perl/5.14/no-sys-dirs.patch
@@ -0,0 +1,134 @@
+diff -ru 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	2011-10-27 17:42:26.791103662 +0200
+@@ -106,15 +106,7 @@
+ fi
+ 
+ : Proper PATH setting
+-paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
+-paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
+-paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
+-paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
+-paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
+-paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
+-paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
+-paths="$paths /sbin /usr/sbin /usr/libexec"
+-paths="$paths /system/gnu_library/bin"
++paths=''
+ 
+ for p in $paths
+ do
+@@ -1311,8 +1303,7 @@
+ archname=''
+ : Possible local include directories to search.
+ : Set locincpth to "" in a hint file to defeat local include searches.
+-locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
+-locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
++locincpth=""
+ :
+ : no include file wanted by default
+ inclwanted=''
+@@ -1328,17 +1319,12 @@
+ archobjs=''
+ libnames=''
+ : change the next line if compiling for Xenix/286 on Xenix/386
+-xlibpth='/usr/lib/386 /lib/386'
++xlibpth=''
+ : Possible local library directories to search.
+-loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
+-loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
++loclibpth=""
+ 
+ : general looking path for locating libraries
+-glibpth="/lib /usr/lib $xlibpth"
+-glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
+-test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
+-test -f /shlib/libc.so     && glibpth="/shlib $glibpth"
+-test -d /usr/lib64         && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
++glibpth=""
+ 
+ : Private path used by Configure to find libraries.  Its value
+ : is prepended to libpth. This variable takes care of special
+@@ -1371,8 +1357,6 @@
+ 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.
+-glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
+-glibpth="/usr/shlib $glibpth"
+ : Do not use vfork unless overridden by a hint file.
+ usevfork=false
+ 
+@@ -2380,7 +2364,6 @@
+ zip
+ "
+ pth=`echo $PATH | sed -e "s/$p_/ /g"`
+-pth="$pth /lib /usr/lib"
+ for file in $loclist; do
+ 	eval xxx=\$$file
+ 	case "$xxx" in
+@@ -8390,13 +8373,8 @@
+ echo " "
+ case "$sysman" in
+ '') 
+-	syspath='/usr/share/man/man1 /usr/man/man1'
+-	syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
+-	syspath="$syspath /usr/man/u_man/man1"
+-	syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
+-	syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
+-	syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
+-	sysman=`./loc . /usr/man/man1 $syspath`
++	syspath=''
++	sysman=''
+ 	;;
+ esac
+ if $test -d "$sysman"; then
+@@ -19721,9 +19699,10 @@
+ case "$full_ar" in
+ '') full_ar=$ar ;;
+ esac
++full_ar=ar
+ 
+ : Store the full pathname to the sed program for use in the C program
+-full_sed=$sed
++full_sed=sed
+ 
+ : see what type gids are declared as in the kernel
+ echo " "
+Only in perl-5.14.2-orig/cpan/Module-Pluggable/t/lib/EditorJunk/Plugin: Bar.pm~
+diff -ru 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	2011-10-27 17:40:13.083352010 +0200
+@@ -137,11 +137,7 @@
+ 	if ($dep =~ /(\S+errno\.h)/) {
+ 	     $file{$1} = 1;
+ 	}
+-    } elsif ($^O eq 'linux' &&
+-	      $Config{gccversion} ne '' && 
+-	      $Config{gccversion} !~ /intel/i
+-	      # might be using, say, Intel's icc
+-	     ) {
++    } elsif (0) {
+ 	# Some Linuxes have weird errno.hs which generate
+ 	# no #file or #line directives
+ 	my $linux_errno_h = -e '/usr/include/errno.h' ?
+diff -ru 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	2011-10-27 17:40:13.083352010 +0200
+@@ -118,13 +118,13 @@
+         objformat=`/usr/bin/objformat`
+         if [ x$objformat = xaout ]; then
+             if [ -e /usr/lib/aout ]; then
+-                libpth="/usr/lib/aout /usr/local/lib /usr/lib"
+-                glibpth="/usr/lib/aout /usr/local/lib /usr/lib"
++                libpth=""
++                glibpth=""
+             fi
+             lddlflags='-Bshareable'
+         else
+-            libpth="/usr/lib /usr/local/lib"
+-            glibpth="/usr/lib /usr/local/lib"
++            libpth=""
++            glibpth=""
+             ldflags="-Wl,-E "
+             lddlflags="-shared "
+         fi
diff --git a/pkgs/development/interpreters/perl/5.14/setup-hook.sh b/pkgs/development/interpreters/perl/5.14/setup-hook.sh
new file mode 100644
index 00000000000..6a144a7f780
--- /dev/null
+++ b/pkgs/development/interpreters/perl/5.14/setup-hook.sh
@@ -0,0 +1,5 @@
+addPerlLibPath () {
+    addToSearchPath PERL5LIB $1/lib/perl5/site_perl
+}
+
+envHooks=(${envHooks[@]} addPerlLibPath)
diff --git a/pkgs/development/interpreters/perl-5.8/default.nix b/pkgs/development/interpreters/perl/5.8/default.nix
index 4b965999910..4b965999910 100644
--- a/pkgs/development/interpreters/perl-5.8/default.nix
+++ b/pkgs/development/interpreters/perl/5.8/default.nix
diff --git a/pkgs/development/interpreters/perl-5.8/gcc-4.2.patch b/pkgs/development/interpreters/perl/5.8/gcc-4.2.patch
index 679a7abde3b..679a7abde3b 100644
--- a/pkgs/development/interpreters/perl-5.8/gcc-4.2.patch
+++ b/pkgs/development/interpreters/perl/5.8/gcc-4.2.patch
diff --git a/pkgs/development/interpreters/perl-5.8/no-sys-dirs.patch b/pkgs/development/interpreters/perl/5.8/no-sys-dirs.patch
index 48588d5a429..48588d5a429 100644
--- a/pkgs/development/interpreters/perl-5.8/no-sys-dirs.patch
+++ b/pkgs/development/interpreters/perl/5.8/no-sys-dirs.patch
diff --git a/pkgs/development/interpreters/perl-5.8/setup-hook.sh b/pkgs/development/interpreters/perl/5.8/setup-hook.sh
index d61ec82f4f0..d61ec82f4f0 100644
--- a/pkgs/development/interpreters/perl-5.8/setup-hook.sh
+++ b/pkgs/development/interpreters/perl/5.8/setup-hook.sh
diff --git a/pkgs/development/libraries/acl/default.nix b/pkgs/development/libraries/acl/default.nix
index 5ce81105fa3..3ccb5691980 100644
--- a/pkgs/development/libraries/acl/default.nix
+++ b/pkgs/development/libraries/acl/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, gettext, attr }:
 
 stdenv.mkDerivation rec {
-  name = "acl-2.2.49";
+  name = "acl-2.2.51";
 
   src = fetchurl {
     url = "mirror://savannah/acl/${name}.src.tar.gz";
-    sha256 = "1mg5nxr0r9y08lmyxmm2lfss5jz1xzbs0npsc8597x2f5rsz9ixr";
+    sha256 = "09aj30m49ivycl3irram8c3givc0crivjm3ymw0nhfaxrwhlb186";
   };
 
-  buildNativeInputs = [gettext];
+  buildNativeInputs = [ gettext ];
   buildInputs = [ attr ];
 
   # Upstream use C++-style comments in C code. Remove them.
diff --git a/pkgs/development/libraries/attr/default.nix b/pkgs/development/libraries/attr/default.nix
index 6477b443dcf..adc53086306 100644
--- a/pkgs/development/libraries/attr/default.nix
+++ b/pkgs/development/libraries/attr/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, gettext }:
 
 stdenv.mkDerivation rec {
-  name = "attr-2.4.44";
+  name = "attr-2.4.46";
 
   src = fetchurl {
     url = "mirror://savannah/attr/${name}.src.tar.gz";
-    sha256 = "16244r2vrd57i5fnf7dz3yi2mcckc47jr9y539jvljrzwnw18qlz";
+    sha256 = "07qf6kb2zk512az481bbnsk9jycn477xpva1a726n5pzlzf9pmnw";
   };
 
-  buildNativeInputs = [gettext];
+  buildNativeInputs = [ gettext ];
 
   configureFlags = "MAKE=make MSGFMT=msgfmt MSGMERGE=msgmerge XGETTEXT=xgettext ECHO=echo SED=sed AWK=gawk";
 
diff --git a/pkgs/development/libraries/cloog-ppl/default.nix b/pkgs/development/libraries/cloog-ppl/default.nix
index ca662d30eb0..d9dae7bfd41 100644
--- a/pkgs/development/libraries/cloog-ppl/default.nix
+++ b/pkgs/development/libraries/cloog-ppl/default.nix
@@ -1,31 +1,19 @@
-{ fetchurl, stdenv, ppl, static ? false }:
-
-let
-
-  # --with-host-libstdcxx helps when *ppl* is built statically.
-  # But I will suppose that this is statically built only when ppl is also
-  # statically built.
-  staticFlags =
-    assert static -> ppl.dontDisableStatic == true;
-    if static then " --enable-static --disable-shared --with-host-libstdcxx=-lstdc++" else "";
-    
-in
+{ fetchurl, stdenv, ppl }:
 
 stdenv.mkDerivation rec {
-  name = "cloog-ppl-0.15.9";
+  name = "cloog-ppl-0.15.11";
 
   src = fetchurl {
     url = "mirror://gcc/infrastructure/${name}.tar.gz";
-    sha256 = "19a2n75k3d3n8llng25f2g88lpvd4zn0lm073rkndjw6l6yd8m4c";
+    sha256 = "0psdm0bn5gx60glfh955x5b3b23zqrd92idmjr0b00dlnb839mkw";
   };
 
   propagatedBuildInputs = [ ppl ];
 
-  configureFlags = "--with-ppl=${ppl}" + staticFlags;
-  dontDisableStatic = if static then true else false;
+  configureFlags = "--with-ppl=${ppl}";
 
   crossAttrs = {
-    configureFlags = "--with-ppl=${ppl.hostDrv}" + staticFlags;
+    configureFlags = "--with-ppl=${ppl.hostDrv}";
   };
 
   doCheck = true;
diff --git a/pkgs/development/libraries/cloog/default.nix b/pkgs/development/libraries/cloog/default.nix
index 7bd0d68c3ec..ab5737b20ed 100644
--- a/pkgs/development/libraries/cloog/default.nix
+++ b/pkgs/development/libraries/cloog/default.nix
@@ -1,6 +1,4 @@
-{ fetchurl, stdenv, gmp, isl, static ? false }:
-
-assert static -> isl.dontDisableStatic;
+{ fetchurl, stdenv, gmp, isl }:
 
 stdenv.mkDerivation rec {
   name = "cloog-0.16.3";
@@ -14,10 +12,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ isl ];
 
-  configureFlags = [ "--with-isl=system" ]
-    ++ (stdenv.lib.optionals static [ "--enable-static" "--disable-shared" ]);
-
-  dontDisableStatic = static;
+  configureFlags = [ "--with-isl=system" ];
 
   doCheck = true;
 
diff --git a/pkgs/development/libraries/dbus-glib/0.94.nix b/pkgs/development/libraries/dbus-glib/0.94.nix
deleted file mode 100644
index 83c1693d80f..00000000000
--- a/pkgs/development/libraries/dbus-glib/0.94.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, expat, gettext, libiconv, dbus, glib }:
-
-stdenv.mkDerivation rec {
-  name = "dbus-glib-0.94";
-
-  src = fetchurl {
-    url = "${meta.homepage}/releases/dbus-glib/${name}.tar.gz";
-    sha256 = "16yk106bp58in6vz2li2s3iwk1si65f0n22m8c2mplzh2j9zlq74";
-  };
-
-  buildInputs = [ pkgconfig expat gettext ]
-                ++ stdenv.lib.optional (!stdenv.isLinux) libiconv;
-
-  propagatedBuildInputs = [ dbus glib ];
-
-  passthru = { inherit dbus glib; };
-
-  meta = {
-    homepage = http://dbus.freedesktop.org;
-    license = "AFL-2.1 or GPL-2";
-    description = "GLib bindings for D-Bus lightweight IPC mechanism";
-  };
-}
diff --git a/pkgs/development/libraries/dbus-glib/default.nix b/pkgs/development/libraries/dbus-glib/default.nix
index 467b9c4d506..5fccc7ad66b 100644
--- a/pkgs/development/libraries/dbus-glib/default.nix
+++ b/pkgs/development/libraries/dbus-glib/default.nix
@@ -1,23 +1,25 @@
 { stdenv, fetchurl, pkgconfig, expat, gettext, libiconv, dbus, glib }:
 
 stdenv.mkDerivation rec {
-  name = "dbus-glib-0.86";
+  name = "dbus-glib-0.98";
 
   src = fetchurl {
     url = "${meta.homepage}/releases/dbus-glib/${name}.tar.gz";
-    sha256 = "1p0bm5p8g8h0mimhj0d58dqdrhfipvcwv95l6hf69z4gygksclak";
+    sha256 = "04fiwld5yaxyggxlvdmbaqkngh4fn8gfkkqckcp3274bpgb82z19";
   };
-  
-  buildInputs = [ pkgconfig expat gettext ]
-                ++ stdenv.lib.optional (!stdenv.isLinux) libiconv;
-  
-  propagatedBuildInputs = [ dbus.libs glib ];
-  
+
+  buildNativeInputs = [ pkgconfig gettext ];
+
+  buildInputs = [ expat ] ++ stdenv.lib.optional (!stdenv.isLinux) libiconv;
+
+  propagatedBuildInputs = [ dbus glib ];
+
   passthru = { inherit dbus glib; };
 
   meta = {
     homepage = http://dbus.freedesktop.org;
     license = "AFL-2.1 or GPL-2";
-    description = "GLib bindings for D-Bus lightweight IPC mechanism";
+    description = "Obsolete glib bindings for D-Bus lightweight IPC mechanism";
+    maintainers = [ stdenv.lib.maintainers.urkud ];
   };
 }
diff --git a/pkgs/development/libraries/dbus/1.5.6.nix b/pkgs/development/libraries/dbus/1.5.6.nix
deleted file mode 100644
index 9c158933cb0..00000000000
--- a/pkgs/development/libraries/dbus/1.5.6.nix
+++ /dev/null
@@ -1,61 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, expat, libX11, libICE, libSM, useX11 ? true }:
-
-let
-  version = "1.5.6";
-
-  src = fetchurl {
-    url = "http://dbus.freedesktop.org/releases/dbus/dbus-${version}.tar.gz";
-    sha256 = "18g5328wnh25p0hihv5gg55q5l019zzwr04shvp67myvwy07m851";
-  };
-
-  patches = [ ./ignore-missing-includedirs.patch ];
-
-  configureFlags = "--localstatedir=/var --sysconfdir=/etc --with-session-socket-dir=/tmp";
-
-in rec {
-
-  libs = stdenv.mkDerivation {
-    name = "dbus-library-" + version;
-
-    buildInputs = [ pkgconfig expat ];
-
-    inherit src patches configureFlags;
-
-    preConfigure =
-      ''
-        sed -i '/mkinstalldirs.*localstatedir/d' bus/Makefile.in
-        sed -i '/SUBDIRS/s/ tools//' Makefile.in
-      '';
-
-    # Enable X11 autolaunch support in libdbus.  This doesn't actually
-    # depend on X11 (it just execs dbus-launch in dbus.tools),
-    # contrary to what the configure script demands.
-    NIX_CFLAGS_COMPILE = "-DDBUS_ENABLE_X11_AUTOLAUNCH=1";
-
-    installFlags = "sysconfdir=$(out)/etc";
-  };
-
-  tools = stdenv.mkDerivation {
-    name = "dbus-tools-" + version;
-
-    inherit src patches;
-
-    configureFlags = "${configureFlags} --with-dbus-daemondir=${daemon}/bin";
-
-    buildInputs = [ pkgconfig expat libs ]
-      ++ stdenv.lib.optionals useX11 [ libX11 libICE libSM ];
-
-    NIX_LDFLAGS = "-ldbus-1";
-
-    preConfigure =
-      ''
-        sed -i 's@$(top_builddir)/dbus/libdbus-1.la@@' tools/Makefile.in
-        substituteInPlace tools/Makefile.in --replace 'install-localstatelibDATA:' 'disabled:'
-      '';
-
-    postConfigure = "cd tools";
-  };
-
-  # I'm too lazy to separate daemon and libs now.
-  daemon = libs;
-}
diff --git a/pkgs/development/libraries/dbus/default.nix b/pkgs/development/libraries/dbus/default.nix
index 1d0bcc11146..c943fe87fb3 100644
--- a/pkgs/development/libraries/dbus/default.nix
+++ b/pkgs/development/libraries/dbus/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, expat, libX11, libICE, libSM, useX11 ? true }:
 
 let
-  version = "1.4.14";
+  version = "1.4.16";
 
   src = fetchurl {
     url = "http://dbus.freedesktop.org/releases/dbus/dbus-${version}.tar.gz";
-    sha256 = "0xsqkq2q2hb09dcdsw0y359zvml480h79qvl9g31r7da57y7xwj7";
+    sha256 = "1ii93d0lzj5xm564dcq6ca4s0nvm5i9fx3jp0s7i9hlc5wkfd3hx";
   };
 
   patches = [ ./ignore-missing-includedirs.patch ];
@@ -17,7 +17,9 @@ in rec {
   libs = stdenv.mkDerivation {
     name = "dbus-library-" + version;
 
-    buildInputs = [ pkgconfig expat ];
+    buildNativeInputs = [ pkgconfig ];
+
+    buildInputs = [ expat ];
 
     inherit src patches configureFlags;
 
@@ -42,14 +44,16 @@ in rec {
 
     configureFlags = "${configureFlags} --with-dbus-daemondir=${daemon}/bin";
 
-    buildInputs = [ pkgconfig expat libs ]
+    buildNativeInputs = [ pkgconfig ];
+
+    buildInputs = [ expat libs ]
       ++ stdenv.lib.optionals useX11 [ libX11 libICE libSM ];
 
     NIX_LDFLAGS = "-ldbus-1";
 
     preConfigure =
       ''
-        sed -i 's@ $(top_builddir)/dbus/libdbus-1.la@@' tools/Makefile.in
+        sed -i 's@$(top_builddir)/dbus/libdbus-1.la@@' tools/Makefile.in
         substituteInPlace tools/Makefile.in --replace 'install-localstatelibDATA:' 'disabled:'
       '';
 
diff --git a/pkgs/development/libraries/gettext/0.17.nix b/pkgs/development/libraries/gettext/0.17.nix
index 6b094fdc839..bee2042f116 100644
--- a/pkgs/development/libraries/gettext/0.17.nix
+++ b/pkgs/development/libraries/gettext/0.17.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, libiconv }:
 
-stdenv.mkDerivation (rec {
+stdenv.mkDerivation rec {
   name = "gettext-0.17";
   
   src = fetchurl {
@@ -21,6 +21,8 @@ stdenv.mkDerivation (rec {
     fi
   '';
 
+  buildInputs = stdenv.lib.optional (!stdenv.isLinux) libiconv;
+  
   meta = {
     description = "GNU gettext, a well integrated set of translation tools and documentation";
 
@@ -47,12 +49,4 @@ stdenv.mkDerivation (rec {
 
     maintainers = [ stdenv.lib.maintainers.ludo ];
   };
-}
-
-//
-
-(if (!stdenv.isLinux) # any non-GNU system
-    then {
-      buildInputs = [ libiconv ];
-    }
-    else {}))
+}
\ No newline at end of file
diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix
index ddcfc327a9e..f7b31139b56 100644
--- a/pkgs/development/libraries/gettext/default.nix
+++ b/pkgs/development/libraries/gettext/default.nix
@@ -1,8 +1,6 @@
-# XXX: Remove me when `stdenv-updates' is merged.
-
 { stdenv, fetchurl, libiconv }:
 
-stdenv.mkDerivation (rec {
+stdenv.mkDerivation rec {
   name = "gettext-0.18.1.1";
   
   src = fetchurl {
@@ -23,6 +21,10 @@ stdenv.mkDerivation (rec {
     fi
   '';
 
+  buildInputs = stdenv.lib.optional (!stdenv.isLinux) libiconv;
+  
+  enableParallelBuilding = true;
+      
   crossAttrs = {
     buildInputs = stdenv.lib.optional (stdenv.gccCross.libc ? libiconv)
       stdenv.gccCross.libc.libiconv.hostDrv;
@@ -58,11 +60,3 @@ stdenv.mkDerivation (rec {
     platforms = stdenv.lib.platforms.all;
   };
 }
-
-//
-
-(if (!stdenv.isLinux) # any non-GNU system
-    then {
-      buildInputs = [ libiconv ];
-    }
-    else {}))
diff --git a/pkgs/development/libraries/glibc-2.12/builder.sh b/pkgs/development/libraries/glibc-2.13/builder.sh
index 9a1c1490019..9a1c1490019 100644
--- a/pkgs/development/libraries/glibc-2.12/builder.sh
+++ b/pkgs/development/libraries/glibc-2.13/builder.sh
diff --git a/pkgs/development/libraries/glibc-2.13/common.nix b/pkgs/development/libraries/glibc-2.13/common.nix
new file mode 100644
index 00000000000..d63e7e99e48
--- /dev/null
+++ b/pkgs/development/libraries/glibc-2.13/common.nix
@@ -0,0 +1,213 @@
+/* Build configuration used to build glibc, Info files, and locale
+   information.  */
+
+cross :
+
+{ name, fetchurl, stdenv, installLocales ? false
+, gccCross ? null, kernelHeaders ? null
+, machHeaders ? null, hurdHeaders ? null, mig ? null, fetchgit ? null
+, profilingLibraries ? false, meta
+, preConfigure ? "", ... }@args :
+
+let
+  # For GNU/Hurd, see below.
+  version = if hurdHeaders != null then "20100512" else "2.13";
+
+  needsPortsNative = stdenv.isMips || stdenv.isArm;
+  needsPortsCross = cross.arch == "mips" || cross.arch == "arm";
+  needsPorts = if (stdenv ? cross) && stdenv.cross != null then true
+    else if cross == null then needsPortsNative
+    else needsPortsCross;
+
+  srcPorts = fetchurl {
+    url = "mirror://gnu/glibc/glibc-ports-2.13.tar.bz2";
+    sha256 = "0npffql62m1xba15l1wkaqf2p0l2bvb33720gx28764jmq0la75i";
+  };
+
+in
+
+assert (cross != null) -> (gccCross != null);
+
+assert (mig != null) -> (machHeaders != null);
+assert (machHeaders != null) -> (hurdHeaders != null);
+assert (hurdHeaders != null) -> (fetchgit != null);
+
+stdenv.mkDerivation ({
+  inherit kernelHeaders installLocales;
+
+  # The host/target system.
+  crossConfig = if (cross != null) then cross.config else null;
+
+  inherit (stdenv) is64bit;
+
+  enableParallelBuilding = true;
+
+  patches =
+    stdenv.lib.optional (fetchgit == null)
+    /* Fix for NIXPKGS-79: when doing host name lookups, when
+       nsswitch.conf contains a line like
+
+         hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
+
+       don't return an error when mdns4_minimal can't be found.  This
+       is a bug in Glibc: when a service can't be found, NSS should
+       continue to the next service unless "UNAVAIL=return" is set.
+       ("NOTFOUND=return" refers to the service returning a NOTFOUND
+       error, not the service itself not being found.)  The reason is
+       that the "status" variable (while initialised to UNAVAIL) is
+       outside of the loop that iterates over the services, the
+       "files" service sets status to NOTFOUND.  So when the call to
+       find "mdns4_minimal" fails, "status" will still be NOTFOUND,
+       and it will return instead of continuing to "dns".  Thus, the
+       line
+
+         hosts: mdns4_minimal [NOTFOUND=return] dns mdns4
+
+       does work because "status" will contain UNAVAIL after the
+       failure to find mdns4_minimal. */
+    ./nss-skip-unavail.patch
+  ++ [
+    /* Have rpcgen(1) look for cpp(1) in $PATH.  */
+    ./rpcgen-path.patch
+
+    /* Allow nixos and nix handle the locale-archive. */
+    ./nix-locale-archive.patch
+
+    /* Without this patch many KDE binaries crash. */
+    ./glibc-elf-localscope.patch
+  ];
+
+  postPatch = ''
+    # Needed for glibc to build with the gnumake 3.82
+    # http://comments.gmane.org/gmane.linux.lfs.support/31227
+    sed -i 's/ot \$/ot:\n\ttouch $@\n$/' manual/Makefile
+
+    # nscd needs libgcc, and we don't want it dynamically linked
+    # because we don't want it to depend on bootstrap-tools libs.
+    echo "LDFLAGS-nscd += -static-libgcc" >> nscd/Makefile
+  '';
+
+  configureFlags = [
+    "-C"
+    "--enable-add-ons"
+    "--sysconfdir=/etc"
+    "--localedir=/var/run/current-system/sw/lib/locale"
+    (if kernelHeaders != null
+     then "--with-headers=${kernelHeaders}/include"
+     else "--without-headers")
+    (if profilingLibraries
+     then "--enable-profile"
+     else "--disable-profile")
+  ] ++ stdenv.lib.optionals (cross != null) [
+    (if cross.withTLS then "--with-tls" else "--without-tls")
+    (if cross.float == "soft" then "--without-fp" else "--with-fp")
+    "--enable-kernel=2.6.0"
+    "--with-__thread"
+  ] ++ stdenv.lib.optionals (stdenv.system == "armv5tel-linux") [
+    "--host=arm-linux-gnueabi"
+    "--build=arm-linux-gnueabi"
+    "--without-fp"
+
+    # To avoid linking with -lgcc_s (dynamic link)
+    # so the glibc does not depend on its compiler store path
+    "libc_cv_as_needed=no"
+  ];
+
+  installFlags = [ "sysconfdir=$(out)/etc" ];
+  
+  buildInputs = stdenv.lib.optionals (cross != null) [ gccCross ]
+    ++ stdenv.lib.optional (mig != null) mig;
+
+  # Needed to install share/zoneinfo/zone.tab.  Set to impure /bin/sh to
+  # prevent a retained dependency on the bootstrap tools in the stdenv-linux
+  # bootstrap.
+  BASH_SHELL = "/bin/sh";
+
+  # Workaround for this bug:
+  #   http://sourceware.org/bugzilla/show_bug.cgi?id=411
+  # I.e. when gcc is compiled with --with-arch=i686, then the
+  # preprocessor symbol `__i686' will be defined to `1'.  This causes
+  # the symbol __i686.get_pc_thunk.dx to be mangled.
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.system == "i686-linux") "-U__i686";
+}
+
+# Remove the `gccCross' attribute so that the *native* glibc store path
+# doesn't depend on whether `gccCross' is null or not.
+// (removeAttrs args [ "gccCross" ]) //
+
+{
+  name = name + "-${version}" +
+    stdenv.lib.optionalString (cross != null) "-${cross.config}";
+
+  src =
+    if hurdHeaders != null
+    then fetchgit {
+      # Shamefully the "official" glibc won't build on GNU, so use the one
+      # maintained by the Hurd folks, `tschwinge/Roger_Whittaker' branch.
+      # See <http://www.gnu.org/software/hurd/source_repositories/glibc.html>.
+      url = "git://git.sv.gnu.org/hurd/glibc.git";
+      sha256 = "f3590a54a9d897d121f91113949edbaaf3e30cdeacbb8d0a44de7b6564f6643e";
+      rev = "df4c3faf0ccc848b5a8086c222bdb42679a9798f";
+    }
+    else fetchurl {
+      url = "mirror://gnu/glibc/glibc-${version}.tar.bz2";
+      sha256 = "1cnv319ysc8nkwpqw6f6ymb6b8hbl0nyvyx48sddkrj50lmcjwq1";
+    };
+
+  # `fetchurl' is a function and thus should not be passed to the
+  # `derivation' primitive.
+  fetchurl = null;
+
+  # Remove absolute paths from `configure' & co.; build out-of-tree.
+  preConfigure = ''
+    export PWD_P=$(type -tP pwd)
+    for i in configure io/ftwtest-sh; do
+        # Can't use substituteInPlace here because replace hasn't been
+        # built yet in the bootstrap.
+        sed -i "$i" -e "s^/bin/pwd^$PWD_P^g"
+    done
+
+    ${if needsPorts then "tar xvf ${srcPorts}" else ""}
+
+    mkdir ../build
+    cd ../build
+
+    configureScript="`pwd`/../$sourceRoot/configure"
+
+    ${preConfigure}
+  '';
+
+  meta = {
+    homepage = http://www.gnu.org/software/libc/;
+    description = "The GNU C Library";
+
+    longDescription =
+      '' Any Unix-like operating system needs a C library: the library which
+         defines the "system calls" and other basic facilities such as
+         open, malloc, printf, exit...
+
+         The GNU C library is used as the C library in the GNU system and
+         most systems with the Linux kernel.
+      '';
+
+    license = "LGPLv2+";
+
+    maintainers = [ stdenv.lib.maintainers.ludo ];
+    platforms = stdenv.lib.platforms.linux;
+  } // meta;
+}
+
+//
+
+(if hurdHeaders != null
+ then {
+   # Work around the fact that the configure snippet that looks for
+   # <hurd/version.h> does not honor `--with-headers=$sysheaders' and that
+   # glibc expects both Mach and Hurd headers to be in the same place.
+   CPATH = "${hurdHeaders}/include:${machHeaders}/include";
+
+   # `fetchgit' is a function and thus should not be passed to the
+   # `derivation' primitive.
+   fetchgit = null;
+ }
+ else { }))
diff --git a/pkgs/development/libraries/glibc-2.12/default.nix b/pkgs/development/libraries/glibc-2.13/default.nix
index 89e8c60b7da..31a8ef13a4f 100644
--- a/pkgs/development/libraries/glibc-2.12/default.nix
+++ b/pkgs/development/libraries/glibc-2.13/default.nix
@@ -1,10 +1,8 @@
 { stdenv, fetchurl, kernelHeaders
-, machHeaders ? null, hurdHeaders ? null, libpthreadHeaders ? null
-, mig ? null, fetchgit ? null
+, machHeaders ? null, hurdHeaders ? null, mig ? null, fetchgit ? null
 , installLocales ? true
 , profilingLibraries ? false
 , gccCross ? null
-, debugSymbols ? false
 }:
 
 assert stdenv.gcc.gcc != null;
@@ -14,7 +12,7 @@ let
   cross = if gccCross != null then gccCross.target else null;
 in
   build cross ({
-    name = "glibc${if debugSymbols then "-debug" else ""}";
+    name = "glibc";
 
     inherit fetchurl stdenv kernelHeaders installLocales profilingLibraries
       gccCross;
@@ -40,23 +38,11 @@ in
 
   //
 
-  (if debugSymbols
-   then {
-     # Build with debugging symbols, but leave optimizations on and don't
-     # attempt to keep the build tree.
-     dontStrip = true;
-     dontCrossStrip = true;
-     NIX_STRIP_DEBUG = 0;
-   }
-   else {})
-
-  //
-
   (if hurdHeaders != null
    then rec {
-     inherit machHeaders hurdHeaders libpthreadHeaders mig fetchgit;
+     inherit machHeaders hurdHeaders mig fetchgit;
 
-     propagatedBuildInputs = [ machHeaders hurdHeaders libpthreadHeaders ];
+     propagatedBuildInputs = [ machHeaders hurdHeaders ];
 
      passthru = {
        # When building GCC itself `propagatedBuildInputs' above is not
diff --git a/pkgs/development/libraries/glibc-2.13/glibc-elf-localscope.patch b/pkgs/development/libraries/glibc-2.13/glibc-elf-localscope.patch
new file mode 100644
index 00000000000..98f7f81087b
--- /dev/null
+++ b/pkgs/development/libraries/glibc-2.13/glibc-elf-localscope.patch
@@ -0,0 +1,82 @@
+diff -ru a/elf/dl-close.c b/elf/dl-close.c
+--- a/elf/dl-close.c	2011-02-04 00:35:03.000000000 +0100
++++ b/elf/dl-close.c	2011-02-22 02:16:12.367883000 +0100
+@@ -180,24 +186,28 @@
+       /* Signal the object is still needed.  */
+       l->l_idx = IDX_STILL_USED;
+ 
++#define mark_used(dmap) \
++  do {								\
++    if ((dmap)->l_idx != IDX_STILL_USED)			\
++      {								\
++	assert ((dmap)->l_idx >= 0 && (dmap)->l_idx < nloaded);	\
++								\
++	if (!used[(dmap)->l_idx])				\
++	  {							\
++	    used[(dmap)->l_idx] = 1;				\
++	    if ((dmap)->l_idx - 1 < done_index)			\
++	      done_index = (dmap)->l_idx - 1;			\
++	  }							\
++      }								\
++  } while (0)
++
+       /* Mark all dependencies as used.  */
+       if (l->l_initfini != NULL)
+ 	{
+ 	  struct link_map **lp = &l->l_initfini[1];
+ 	  while (*lp != NULL)
+ 	    {
+-	      if ((*lp)->l_idx != IDX_STILL_USED)
+-		{
+-		  assert ((*lp)->l_idx >= 0 && (*lp)->l_idx < nloaded);
+-
+-		  if (!used[(*lp)->l_idx])
+-		    {
+-		      used[(*lp)->l_idx] = 1;
+-		      if ((*lp)->l_idx - 1 < done_index)
+-			done_index = (*lp)->l_idx - 1;
+-		    }
+-		}
+-
++	      mark_used(*lp);
+ 	      ++lp;
+ 	    }
+ 	}
+@@ -206,19 +216,25 @@
+ 	for (unsigned int j = 0; j < l->l_reldeps->act; ++j)
+ 	  {
+ 	    struct link_map *jmap = l->l_reldeps->list[j];
+-
+-	    if (jmap->l_idx != IDX_STILL_USED)
+-	      {
+-		assert (jmap->l_idx >= 0 && jmap->l_idx < nloaded);
+-
+-		if (!used[jmap->l_idx])
+-		  {
+-		    used[jmap->l_idx] = 1;
+-		    if (jmap->l_idx - 1 < done_index)
+-		      done_index = jmap->l_idx - 1;
+-		  }
+-	      }
++	    mark_used(jmap);
+ 	  }
++      /* And the same for owners of our scopes; normally, our last
++	 scope provider would render us unused, but this can be
++	 prevented by the NODELETE flag. */
++      if (__builtin_expect(l->l_type == lt_loaded
++	                   && (l->l_flags_1 & DF_1_NODELETE), 0))
++	for (size_t cnt = 0; l->l_scope[cnt] != NULL; ++cnt)
++	  /* This relies on l_scope[] entries being always set either
++	     to its own l_symbolic_searchlist address, or some map's
++	     l_searchlist address.  */
++	  if (l->l_scope[cnt] != &l->l_symbolic_searchlist)
++	    {
++	      struct link_map *ls = (struct link_map *)
++		((char *) l->l_scope[cnt]
++		 - offsetof (struct link_map, l_searchlist));
++	      assert (ls->l_ns == nsid);
++	      mark_used(ls);
++	    }
+     }
+ 
+   /* Sort the entries.  */
diff --git a/pkgs/development/libraries/glibc-2.12/info.nix b/pkgs/development/libraries/glibc-2.13/info.nix
index 84a16fefce9..84a16fefce9 100644
--- a/pkgs/development/libraries/glibc-2.12/info.nix
+++ b/pkgs/development/libraries/glibc-2.13/info.nix
diff --git a/pkgs/development/libraries/glibc-2.12/locales-builder.sh b/pkgs/development/libraries/glibc-2.13/locales-builder.sh
index d732e208fa2..d732e208fa2 100644
--- a/pkgs/development/libraries/glibc-2.12/locales-builder.sh
+++ b/pkgs/development/libraries/glibc-2.13/locales-builder.sh
diff --git a/pkgs/development/libraries/glibc-2.12/locales.nix b/pkgs/development/libraries/glibc-2.13/locales.nix
index 31a03c48d85..d598e0e094d 100644
--- a/pkgs/development/libraries/glibc-2.12/locales.nix
+++ b/pkgs/development/libraries/glibc-2.13/locales.nix
@@ -40,7 +40,7 @@ in
     installPhase =
       ''
         ensureDir "$out/lib/locale"
-        cp -v "$TMPDIR/$NIX_STORE/"*"/lib/locale/locale-archive" "$out/lib/locale"
+        cp -v "$TMPDIR/nix/store/"*"/lib/locale/locale-archive" "$out/lib/locale"
       '';
 
     meta.description = "Locale information for the GNU C Library";
diff --git a/pkgs/development/libraries/glibc-2.12/nix-locale-archive.patch b/pkgs/development/libraries/glibc-2.13/nix-locale-archive.patch
index aca904f7ff4..aca904f7ff4 100644
--- a/pkgs/development/libraries/glibc-2.12/nix-locale-archive.patch
+++ b/pkgs/development/libraries/glibc-2.13/nix-locale-archive.patch
diff --git a/pkgs/development/libraries/glibc-2.12/nss-skip-unavail.patch b/pkgs/development/libraries/glibc-2.13/nss-skip-unavail.patch
index e48dc2bc0a6..e48dc2bc0a6 100644
--- a/pkgs/development/libraries/glibc-2.12/nss-skip-unavail.patch
+++ b/pkgs/development/libraries/glibc-2.13/nss-skip-unavail.patch
diff --git a/pkgs/development/libraries/glibc-2.12/rpcgen-path.patch b/pkgs/development/libraries/glibc-2.13/rpcgen-path.patch
index fbb03dd5fad..fbb03dd5fad 100644
--- a/pkgs/development/libraries/glibc-2.12/rpcgen-path.patch
+++ b/pkgs/development/libraries/glibc-2.13/rpcgen-path.patch
diff --git a/pkgs/development/libraries/glibc-2.14/builder.sh b/pkgs/development/libraries/glibc-2.14/builder.sh
new file mode 100644
index 00000000000..9a1c1490019
--- /dev/null
+++ b/pkgs/development/libraries/glibc-2.14/builder.sh
@@ -0,0 +1,55 @@
+# Glibc cannot have itself in its RPATH.
+export NIX_NO_SELF_RPATH=1
+
+source $stdenv/setup
+
+postConfigure() {
+    # Hack: get rid of the `-static' flag set by the bootstrap stdenv.
+    # This has to be done *after* `configure' because it builds some
+    # test binaries.
+    export NIX_CFLAGS_LINK=
+    export NIX_LDFLAGS_BEFORE=
+
+    export NIX_DONT_SET_RPATH=1
+    unset CFLAGS
+}
+
+
+postInstall() {
+    if test -n "$installLocales"; then
+        make -j${NIX_BUILD_CORES:-1} -l${NIX_BUILD_CORES:-1} localedata/install-locales
+    fi
+    
+    test -f $out/etc/ld.so.cache && rm $out/etc/ld.so.cache
+
+    # FIXME: Use `test -n $linuxHeaders' when `kernelHeaders' has been
+    # renamed.
+    if test -z "$hurdHeaders"; then
+        # Include the Linux kernel headers in Glibc, except the `scsi'
+        # subdirectory, which Glibc provides itself.
+	(cd $out/include && \
+	 ln -sv $(ls -d $kernelHeaders/include/* | grep -v 'scsi$') .)
+    fi
+
+    if test -f "$out/lib/libhurduser.so"; then
+	# libc.so, libhurduser.so, and libmachuser.so depend on each
+	# other, so add them to libc.so (a RUNPATH on libc.so.0.3
+	# would be ignored by the cross-linker.)
+	echo "adding \`libhurduser.so' and \`libmachuser.so' to the \`libc.so' linker script..."
+	sed -i "$out/lib/libc.so" \
+	    -e"s|\(libc\.so\.[^ ]\+\>\)|\1 $out/lib/libhurduser.so $out/lib/libmachuser.so|g"
+    fi
+	
+    # Fix for NIXOS-54 (ldd not working on x86_64).  Make a symlink
+    # "lib64" to "lib".
+    if test -n "$is64bit"; then
+        ln -s lib $out/lib64
+    fi
+
+    # This file, that should not remain in the glibc derivation,
+    # may have not been created during the preInstall
+    rm -f $out/lib/libgcc_s.so.1
+}
+
+
+genericBuild
diff --git a/pkgs/development/libraries/glibc-2.12/common.nix b/pkgs/development/libraries/glibc-2.14/common.nix
index 0d56d877018..e24089fd192 100644
--- a/pkgs/development/libraries/glibc-2.12/common.nix
+++ b/pkgs/development/libraries/glibc-2.14/common.nix
@@ -5,14 +5,13 @@ cross :
 
 { name, fetchurl, stdenv, installLocales ? false
 , gccCross ? null, kernelHeaders ? null
-, machHeaders ? null, hurdHeaders ? null, libpthreadHeaders ? null
-, mig ? null, fetchgit ? null
+, machHeaders ? null, hurdHeaders ? null, mig ? null, fetchgit ? null
 , profilingLibraries ? false, meta
 , preConfigure ? "", ... }@args :
 
 let
   # For GNU/Hurd, see below.
-  version = if hurdHeaders != null then "20111025" else "2.12.2";
+  version = if hurdHeaders != null then "20100512" else "2.14.1";
 
   needsPortsNative = stdenv.isMips || stdenv.isArm;
   needsPortsCross = cross.arch == "mips" || cross.arch == "arm";
@@ -21,9 +20,8 @@ let
     else needsPortsCross;
 
   srcPorts = fetchurl {
-    # These should work equally well for 2.12.2
-    url = "mirror://gnu/glibc/glibc-ports-2.12.1.tar.bz2";
-    sha256 = "041ix0nq7nc5r7jf80jsdlw4idah2mjp5nf7khybhc4cs1kc31ir";
+    url = "mirror://gnu/glibc/glibc-ports-2.14.1.tar.bz2";
+    sha256 = "1acs4sd5mjzmssmd0md6dfqwnziph2am7v09mbnnd8aadpxhm0qw";
   };
 
 in
@@ -32,7 +30,6 @@ assert (cross != null) -> (gccCross != null);
 
 assert (mig != null) -> (machHeaders != null);
 assert (machHeaders != null) -> (hurdHeaders != null);
-assert (hurdHeaders != null) -> (libpthreadHeaders != null);
 assert (hurdHeaders != null) -> (fetchgit != null);
 
 stdenv.mkDerivation ({
@@ -75,6 +72,9 @@ stdenv.mkDerivation ({
 
     /* Allow nixos and nix handle the locale-archive. */
     ./nix-locale-archive.patch
+
+    /* Without this patch many KDE binaries crash. */
+    ./glibc-elf-localscope.patch
   ];
 
   postPatch = ''
@@ -90,6 +90,7 @@ stdenv.mkDerivation ({
   configureFlags = [
     "-C"
     "--enable-add-ons"
+    "--sysconfdir=/etc"
     "--localedir=/var/run/current-system/sw/lib/locale"
     (if kernelHeaders != null
      then "--with-headers=${kernelHeaders}/include"
@@ -111,6 +112,8 @@ stdenv.mkDerivation ({
     # so the glibc does not depend on its compiler store path
     "libc_cv_as_needed=no"
   ];
+
+  installFlags = [ "sysconfdir=$(out)/etc" ];
   
   buildInputs = stdenv.lib.optionals (cross != null) [ gccCross ]
     ++ stdenv.lib.optional (mig != null) mig;
@@ -143,12 +146,12 @@ stdenv.mkDerivation ({
       # maintained by the Hurd folks, `tschwinge/Roger_Whittaker' branch.
       # See <http://www.gnu.org/software/hurd/source_repositories/glibc.html>.
       url = "git://git.sv.gnu.org/hurd/glibc.git";
-      sha256 = "3fb3dd7030a4b6d3e144fa94c32a0c4f46f17f94e2dfbc6bef41cfc3198725ca";
-      rev = "d740cf9d201dc9ecb0335b0a585828dea9cce793";
+      sha256 = "f3590a54a9d897d121f91113949edbaaf3e30cdeacbb8d0a44de7b6564f6643e";
+      rev = "df4c3faf0ccc848b5a8086c222bdb42679a9798f";
     }
     else fetchurl {
       url = "mirror://gnu/glibc/glibc-${version}.tar.bz2";
-      sha256 = "05hjz816a2hmzc44gxxi9vrdx6l9f23az794zj45xsxr94yfpy12";
+      sha256 = "0fsvf5d6sib483rp7asdy8hs0dysxqkrvw316c82hsxy7vxa51bf";
     };
 
   # `fetchurl' is a function and thus should not be passed to the
@@ -200,15 +203,11 @@ stdenv.mkDerivation ({
  then {
    # Work around the fact that the configure snippet that looks for
    # <hurd/version.h> does not honor `--with-headers=$sysheaders' and that
-   # glibc expects Mach, Hurd, and pthread headers to be in the same place.
-   CPATH = "${hurdHeaders}/include:${machHeaders}/include:${libpthreadHeaders}/include";
+   # glibc expects both Mach and Hurd headers to be in the same place.
+   CPATH = "${hurdHeaders}/include:${machHeaders}/include";
 
    # `fetchgit' is a function and thus should not be passed to the
    # `derivation' primitive.
    fetchgit = null;
-
-   # Install NSS stuff in the right place.
-   # XXX: This will be needed for all new glibcs and isn't Hurd-specific.
-   makeFlags = ''vardbdir="$out/var/db"'';
  }
  else { }))
diff --git a/pkgs/development/libraries/glibc-2.14/default.nix b/pkgs/development/libraries/glibc-2.14/default.nix
new file mode 100644
index 00000000000..31a8ef13a4f
--- /dev/null
+++ b/pkgs/development/libraries/glibc-2.14/default.nix
@@ -0,0 +1,83 @@
+{ stdenv, fetchurl, kernelHeaders
+, machHeaders ? null, hurdHeaders ? null, mig ? null, fetchgit ? null
+, installLocales ? true
+, profilingLibraries ? false
+, gccCross ? null
+}:
+
+assert stdenv.gcc.gcc != null;
+
+let
+  build = import ./common.nix;
+  cross = if gccCross != null then gccCross.target else null;
+in
+  build cross ({
+    name = "glibc";
+
+    inherit fetchurl stdenv kernelHeaders installLocales profilingLibraries
+      gccCross;
+
+    builder = ./builder.sh;
+
+    # When building glibc from bootstrap-tools, we need libgcc_s at RPATH for
+    # any program we run, because the gcc will have been placed at a new
+    # store path than that determined when built (as a source for the
+    # bootstrap-tools tarball)
+    # Building from a proper gcc staying in the path where it was installed,
+    # libgcc_s will not be at {gcc}/lib, and gcc's libgcc will be found without
+    # any special hack.
+    preInstall = ''
+      if [ -f ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 ]; then
+          ensureDir $out/lib
+          ln -s ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1
+      fi
+    '';
+
+    meta.description = "The GNU C Library";
+  }
+
+  //
+
+  (if hurdHeaders != null
+   then rec {
+     inherit machHeaders hurdHeaders mig fetchgit;
+
+     propagatedBuildInputs = [ machHeaders hurdHeaders ];
+
+     passthru = {
+       # When building GCC itself `propagatedBuildInputs' above is not
+       # honored, so we pass it here so that the GCC builder can do the right
+       # thing.
+       inherit propagatedBuildInputs;
+     };
+   }
+   else { })
+
+  //
+
+  (if cross != null
+   then {
+      preConfigure = ''
+        sed -i s/-lgcc_eh//g "../$sourceRoot/Makeconfig"
+
+        cat > config.cache << "EOF"
+        libc_cv_forced_unwind=yes
+        libc_cv_c_cleanup=yes
+        libc_cv_gnu89_inline=yes
+        # Only due to a problem in gcc configure scripts:
+        libc_cv_sparc64_tls=${if cross.withTLS then "yes" else "no"}
+        EOF
+        export BUILD_CC=gcc
+        export CC="$crossConfig-gcc"
+        export AR="$crossConfig-ar"
+        export RANLIB="$crossConfig-ranlib"
+
+        dontStrip=1
+      '';
+
+      # To avoid a dependency on the build system 'bash'.
+      preFixup = ''
+        rm $out/bin/{ldd,tzselect,catchsegv,xtrace}
+      '';
+    }
+   else {}))
diff --git a/pkgs/development/libraries/glibc-2.14/glibc-elf-localscope.patch b/pkgs/development/libraries/glibc-2.14/glibc-elf-localscope.patch
new file mode 100644
index 00000000000..98f7f81087b
--- /dev/null
+++ b/pkgs/development/libraries/glibc-2.14/glibc-elf-localscope.patch
@@ -0,0 +1,82 @@
+diff -ru a/elf/dl-close.c b/elf/dl-close.c
+--- a/elf/dl-close.c	2011-02-04 00:35:03.000000000 +0100
++++ b/elf/dl-close.c	2011-02-22 02:16:12.367883000 +0100
+@@ -180,24 +186,28 @@
+       /* Signal the object is still needed.  */
+       l->l_idx = IDX_STILL_USED;
+ 
++#define mark_used(dmap) \
++  do {								\
++    if ((dmap)->l_idx != IDX_STILL_USED)			\
++      {								\
++	assert ((dmap)->l_idx >= 0 && (dmap)->l_idx < nloaded);	\
++								\
++	if (!used[(dmap)->l_idx])				\
++	  {							\
++	    used[(dmap)->l_idx] = 1;				\
++	    if ((dmap)->l_idx - 1 < done_index)			\
++	      done_index = (dmap)->l_idx - 1;			\
++	  }							\
++      }								\
++  } while (0)
++
+       /* Mark all dependencies as used.  */
+       if (l->l_initfini != NULL)
+ 	{
+ 	  struct link_map **lp = &l->l_initfini[1];
+ 	  while (*lp != NULL)
+ 	    {
+-	      if ((*lp)->l_idx != IDX_STILL_USED)
+-		{
+-		  assert ((*lp)->l_idx >= 0 && (*lp)->l_idx < nloaded);
+-
+-		  if (!used[(*lp)->l_idx])
+-		    {
+-		      used[(*lp)->l_idx] = 1;
+-		      if ((*lp)->l_idx - 1 < done_index)
+-			done_index = (*lp)->l_idx - 1;
+-		    }
+-		}
+-
++	      mark_used(*lp);
+ 	      ++lp;
+ 	    }
+ 	}
+@@ -206,19 +216,25 @@
+ 	for (unsigned int j = 0; j < l->l_reldeps->act; ++j)
+ 	  {
+ 	    struct link_map *jmap = l->l_reldeps->list[j];
+-
+-	    if (jmap->l_idx != IDX_STILL_USED)
+-	      {
+-		assert (jmap->l_idx >= 0 && jmap->l_idx < nloaded);
+-
+-		if (!used[jmap->l_idx])
+-		  {
+-		    used[jmap->l_idx] = 1;
+-		    if (jmap->l_idx - 1 < done_index)
+-		      done_index = jmap->l_idx - 1;
+-		  }
+-	      }
++	    mark_used(jmap);
+ 	  }
++      /* And the same for owners of our scopes; normally, our last
++	 scope provider would render us unused, but this can be
++	 prevented by the NODELETE flag. */
++      if (__builtin_expect(l->l_type == lt_loaded
++	                   && (l->l_flags_1 & DF_1_NODELETE), 0))
++	for (size_t cnt = 0; l->l_scope[cnt] != NULL; ++cnt)
++	  /* This relies on l_scope[] entries being always set either
++	     to its own l_symbolic_searchlist address, or some map's
++	     l_searchlist address.  */
++	  if (l->l_scope[cnt] != &l->l_symbolic_searchlist)
++	    {
++	      struct link_map *ls = (struct link_map *)
++		((char *) l->l_scope[cnt]
++		 - offsetof (struct link_map, l_searchlist));
++	      assert (ls->l_ns == nsid);
++	      mark_used(ls);
++	    }
+     }
+ 
+   /* Sort the entries.  */
diff --git a/pkgs/development/libraries/glibc-2.14/info.nix b/pkgs/development/libraries/glibc-2.14/info.nix
new file mode 100644
index 00000000000..84a16fefce9
--- /dev/null
+++ b/pkgs/development/libraries/glibc-2.14/info.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, texinfo, perl }:
+
+let build = import ./common.nix;
+in
+  /* null cross builder */
+  build null {
+    name = "glibc-info";
+
+    inherit fetchurl stdenv;
+
+    configureFlags = [ "--enable-add-ons" ];
+
+    buildInputs = [ texinfo perl ];
+
+    buildPhase = "make info";
+
+    # I don't know why the info is not generated in 'build'
+    # Somehow building the info still does not work, because the final
+    # libc.info hasn't a Top node.
+    installPhase = ''
+      ensureDir "$out/share/info"
+      cp -v "../$sourceRoot/manual/"*.info* "$out/share/info"
+    '';
+
+    meta.description = "GNU Info manual of the GNU C Library";
+  }
diff --git a/pkgs/development/libraries/glibc-2.14/locales-builder.sh b/pkgs/development/libraries/glibc-2.14/locales-builder.sh
new file mode 100644
index 00000000000..d732e208fa2
--- /dev/null
+++ b/pkgs/development/libraries/glibc-2.14/locales-builder.sh
@@ -0,0 +1,17 @@
+# Glibc cannot have itself in its RPATH.
+export NIX_NO_SELF_RPATH=1
+
+source $stdenv/setup
+
+postConfigure() {
+    # Hack: get rid of the `-static' flag set by the bootstrap stdenv.
+    # This has to be done *after* `configure' because it builds some
+    # test binaries.
+    export NIX_CFLAGS_LINK=
+    export NIX_LDFLAGS_BEFORE=
+
+    export NIX_DONT_SET_RPATH=1
+    unset CFLAGS
+}
+
+genericBuild
diff --git a/pkgs/development/libraries/glibc-2.14/locales.nix b/pkgs/development/libraries/glibc-2.14/locales.nix
new file mode 100644
index 00000000000..d598e0e094d
--- /dev/null
+++ b/pkgs/development/libraries/glibc-2.14/locales.nix
@@ -0,0 +1,47 @@
+/* This function builds just the `lib/locale/locale-archive' file from
+   Glibc and nothing else.  If `allLocales' is true, all supported
+   locales are included; otherwise, just the locales listed in
+   `locales'.  See localedata/SUPPORTED in the Glibc source tree for
+   the list of all supported locales:
+   http://sourceware.org/cgi-bin/cvsweb.cgi/libc/localedata/SUPPORTED?cvsroot=glibc
+*/
+
+{ stdenv, fetchurl, allLocales ? true, locales ? ["en_US.UTF-8/UTF-8"] }:
+
+let build = import ./common.nix;
+in
+  build null {
+    name = "glibc-locales";
+
+    inherit fetchurl stdenv;
+    installLocales = true;
+
+    builder = ./locales-builder.sh;
+
+    # Awful hack: `localedef' doesn't allow the path to `locale-archive'
+    # to be overriden, but you *can* specify a prefix, i.e. it will use
+    # <prefix>/<path-to-glibc>/lib/locale/locale-archive.  So we use
+    # $TMPDIR as a prefix, meaning that the locale-archive is placed in
+    # $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive.
+    buildPhase =
+      ''
+        mkdir -p $TMPDIR/"$(dirname $(readlink -f $(type -p localedef)))/../lib/locale"
+
+        # Hack to allow building of the locales (needed since glibc-2.12)
+        sed -i -e "s,^LOCALEDEF=.*,LOCALEDEF=localedef --prefix=$TMPDIR," -e \
+            /library-path/d ../glibc-2*/localedata/Makefile
+        ${if allLocales then "" else
+            "echo SUPPORTED-LOCALES=\"${toString locales}\" > ../glibc-2*/localedata/SUPPORTED"}
+
+        make localedata/install-locales \
+            localedir=$out/lib/locale \
+      '';
+
+    installPhase =
+      ''
+        ensureDir "$out/lib/locale"
+        cp -v "$TMPDIR/nix/store/"*"/lib/locale/locale-archive" "$out/lib/locale"
+      '';
+
+    meta.description = "Locale information for the GNU C Library";
+  }
diff --git a/pkgs/development/libraries/glibc-2.14/nix-locale-archive.patch b/pkgs/development/libraries/glibc-2.14/nix-locale-archive.patch
new file mode 100644
index 00000000000..aca904f7ff4
--- /dev/null
+++ b/pkgs/development/libraries/glibc-2.14/nix-locale-archive.patch
@@ -0,0 +1,116 @@
+diff --git a/locale/loadarchive.c b/locale/loadarchive.c
+index d545f17..0d8638a 100644
+--- a/locale/loadarchive.c
++++ b/locale/loadarchive.c
+@@ -124,6 +124,25 @@ calculate_head_size (const struct locarhead *h)
+ }
+ 
+ 
++static int
++open_locale_archive ()
++{
++  int fd = -1;
++  char *path = getenv ("LOCALE_ARCHIVE_2_11");
++  char *path2 = getenv ("LOCALE_ARCHIVE");
++  const char *usualpath = "/usr/lib/locale/locale-archive";
++  if (path)
++    fd = open_not_cancel_2 (path, O_RDONLY|O_LARGEFILE);
++  if (path2 && fd < 0)
++    fd = open_not_cancel_2 (path2, O_RDONLY|O_LARGEFILE);
++  if (fd < 0)
++    fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
++  if (fd < 0)
++    fd = open_not_cancel_2 (usualpath, O_RDONLY|O_LARGEFILE);
++  return fd;
++}
++
++
+ /* Find the locale *NAMEP in the locale archive, and return the
+    internalized data structure for its CATEGORY data.  If this locale has
+    already been loaded from the archive, just returns the existing data
+@@ -203,7 +222,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
+       archmapped = &headmap;
+ 
+       /* The archive has never been opened.  */
+-      fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
++      fd = open_locale_archive ();
+       if (fd < 0)
+ 	/* Cannot open the archive, for whatever reason.  */
+ 	return NULL;
+@@ -394,7 +413,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
+ 	  if (fd == -1)
+ 	    {
+ 	      struct stat64 st;
+-	      fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
++	      fd = open_locale_archive ();
+ 	      if (fd == -1)
+ 		/* Cannot open the archive, for whatever reason.  */
+ 		return NULL;
+diff --git a/locale/programs/locale.c b/locale/programs/locale.c
+index 77262b7..fddc00d 100644
+--- a/locale/programs/locale.c
++++ b/locale/programs/locale.c
+@@ -628,6 +628,20 @@ nameentcmp (const void *a, const void *b)
+ 		  ((const struct nameent *) b)->name);
+ }
+ 
++static int
++open_nix_locale_archive (const char * fname, int access)
++{
++  int fd = -1;
++  char *path = getenv ("LOCALE_ARCHIVE_2_11");
++  char *path2 = getenv ("LOCALE_ARCHIVE");
++  if (path)
++    fd = open64 (path, access);
++  if (path2 && fd < 0)
++    fd = open64 (path2, access);
++  if (fd < 0)
++    fd = open64 (fname, access);
++  return fd;
++}
+ 
+ static int
+ write_archive_locales (void **all_datap, char *linebuf)
+@@ -641,7 +658,7 @@ write_archive_locales (void **all_datap, char *linebuf)
+   int fd, ret = 0;
+   uint32_t cnt;
+ 
+-  fd = open64 (ARCHIVE_NAME, O_RDONLY);
++  fd = open_nix_locale_archive (ARCHIVE_NAME, O_RDONLY);
+   if (fd < 0)
+     return 0;
+ 
+diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
+index 85ba77d..3ad2af8 100644
+--- a/locale/programs/locarchive.c
++++ b/locale/programs/locarchive.c
+@@ -512,6 +512,20 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
+   *ah = new_ah;
+ }
+ 
++static int
++open_nix_locale_archive (const char * fname, int access)
++{
++  int fd = -1;
++  char *path = getenv ("LOCALE_ARCHIVE_2_11");
++  char *path2 = getenv ("LOCALE_ARCHIVE");
++  if (path)
++    fd = open64 (path, access);
++  if (path2 && fd < 0)
++    fd = open64 (path2, access);
++  if (fd < 0)
++    fd = open64 (fname, access);
++  return fd;
++}
+ 
+ void
+ open_archive (struct locarhandle *ah, bool readonly)
+@@ -531,7 +548,7 @@ open_archive (struct locarhandle *ah, bool readonly)
+   while (1)
+     {
+       /* Open the archive.  We must have exclusive write access.  */
+-      fd = open64 (archivefname, readonly ? O_RDONLY : O_RDWR);
++      fd = open_nix_locale_archive (archivefname, readonly ? O_RDONLY : O_RDWR);
+       if (fd == -1)
+ 	{
+ 	  /* Maybe the file does not yet exist.  */
diff --git a/pkgs/development/libraries/glibc-2.14/nss-skip-unavail.patch b/pkgs/development/libraries/glibc-2.14/nss-skip-unavail.patch
new file mode 100644
index 00000000000..e48dc2bc0a6
--- /dev/null
+++ b/pkgs/development/libraries/glibc-2.14/nss-skip-unavail.patch
@@ -0,0 +1,21 @@
+diff -ru glibc-2.11.2-orig/sysdeps/posix/getaddrinfo.c glibc-2.11.2/sysdeps/posix/getaddrinfo.c
+--- glibc-2.11.2-orig/sysdeps/posix/getaddrinfo.c	2010-05-19 22:38:20.000000000 +0200
++++ glibc-2.11.2/sysdeps/posix/getaddrinfo.c	2010-08-05 18:39:54.259556327 +0200
+@@ -505,8 +505,6 @@
+ 	  int no_data = 0;
+ 	  int no_inet6_data = 0;
+ 	  service_user *nip = NULL;
+-	  enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
+-	  enum nss_status status = NSS_STATUS_UNAVAIL;
+ 	  int no_more;
+ 	  int old_res_options;
+ 
+@@ -702,6 +700,8 @@
+ 
+ 	  while (!no_more)
+ 	    {
++ 	      enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
++ 	      enum nss_status status = NSS_STATUS_UNAVAIL;
+ 	      no_data = 0;
+ 	      nss_gethostbyname4_r fct4
+ 		= __nss_lookup_function (nip, "gethostbyname4_r");
diff --git a/pkgs/development/libraries/glibc-2.14/rpcgen-path.patch b/pkgs/development/libraries/glibc-2.14/rpcgen-path.patch
new file mode 100644
index 00000000000..fbb03dd5fad
--- /dev/null
+++ b/pkgs/development/libraries/glibc-2.14/rpcgen-path.patch
@@ -0,0 +1,72 @@
+By default, rpcgen(1) looks for cpp(1) from a list of fixed absolute paths
+(`/lib/cpp', etc.), which may only be overrided with the `-Y' option.  This
+patch makes it run any `cpp' command found in $PATH.
+
+--- glibc-2.7/sunrpc/rpc_main.c	2006-11-10 21:54:46.000000000 +0100
++++ glibc-2.7/sunrpc/rpc_main.c	2009-04-22 14:32:10.000000000 +0200
+@@ -79,7 +79,7 @@ static const char *cmdname;
+ 
+ static const char *svcclosetime = "120";
+ static int cppDefined;	/* explicit path for C preprocessor */
+-static const char *CPP = SUNOS_CPP;
++static const char *CPP = "cpp";
+ static const char CPPFLAGS[] = "-C";
+ static char *pathbuf;
+ static int cpp_pid;
+@@ -108,7 +108,6 @@ static char *extendfile (const char *fil
+ static void open_output (const char *infile, const char *outfile);
+ static void add_warning (void);
+ static void clear_args (void);
+-static void find_cpp (void);
+ static void open_input (const char *infile, const char *define);
+ static int check_nettype (const char *name, const char *list_to_check[]);
+ static void c_output (const char *infile, const char *define,
+@@ -327,31 +326,6 @@ clear_args (void)
+   argcount = FIXEDARGS;
+ }
+ 
+-/* make sure that a CPP exists */
+-static void
+-find_cpp (void)
+-{
+-  struct stat buf;
+-
+-  if (stat (CPP, &buf) < 0)
+-    {				/* /lib/cpp or explicit cpp does not exist */
+-      if (cppDefined)
+-	{
+-	  fprintf (stderr, _ ("cannot find C preprocessor: %s \n"), CPP);
+-	  crash ();
+-	}
+-      else
+-	{			/* try the other one */
+-	  CPP = SVR4_CPP;
+-	  if (stat (CPP, &buf) < 0)
+-	    {			/* can't find any cpp */
+-	      fputs (_ ("cannot find any C preprocessor (cpp)\n"), stdout);
+-	      crash ();
+-	    }
+-	}
+-    }
+-}
+-
+ /*
+  * Open input file with given define for C-preprocessor
+  */
+@@ -370,7 +344,6 @@ open_input (const char *infile, const ch
+   switch (cpp_pid)
+     {
+     case 0:
+-      find_cpp ();
+       putarg (0, CPP);
+       putarg (1, CPPFLAGS);
+       addarg (define);
+@@ -380,7 +353,7 @@ open_input (const char *infile, const ch
+       close (1);
+       dup2 (pd[1], 1);
+       close (pd[0]);
+-      execv (arglist[0], (char **) arglist);
++      execvp (arglist[0], (char **) arglist);
+       perror ("execv");
+       exit (1);
+     case -1:
diff --git a/pkgs/development/libraries/gmp/default.nix b/pkgs/development/libraries/gmp/default.nix
index 338debaa81e..a633177c128 100644
--- a/pkgs/development/libraries/gmp/default.nix
+++ b/pkgs/development/libraries/gmp/default.nix
@@ -1,27 +1,19 @@
-{stdenv, fetchurl, m4, cxx ? true, static ? false}:
-
-let
-  staticFlags = if static then " --enable-static --disable-shared" else "";
-in
+{ stdenv, fetchurl, m4, cxx ? true }:
 
 stdenv.mkDerivation rec {
-  name = "gmp-5.0.1";
+  name = "gmp-5.0.2";
 
   src = fetchurl {
     url = "mirror://gnu/gmp/${name}.tar.bz2";
-    sha256 = "1yrr14l6vvhm1g27y8nb3c75j0i4ii4k1gw7ik08safk3zq119m2";
+    sha256 = "0a2ch2kpbzrsf3c1pfc6sph87hk2xmwa6np3sn2rzsflzmvdphnv";
   };
 
-  buildNativeInputs = [m4];
-
-  # Prevent the build system from using sub-architecture-specific
-  # instructions (e.g., SSE2 on i686).
-  preConfigure = "ln -sf configfsf.guess config.guess";
-
-  configureFlags = if cxx then "--enable-cxx" else "--disable-cxx" +
-      staticFlags;
+  buildNativeInputs = [ m4 ];
 
-  dontDisableStatic = if static then true else false;
+  configureFlags =
+    # Build a "fat binary", with routines for several sub-architectures (x86).
+    [ "--enable-fat" ]
+    ++ (if cxx then [ "--enable-cxx" ] else [ "--disable-cxx" ]);
 
   doCheck = true;
 
diff --git a/pkgs/development/libraries/haskell/network/2.3.0.7.nix b/pkgs/development/libraries/haskell/network/2.3.0.7.nix
new file mode 100644
index 00000000000..3c0e0065ed9
--- /dev/null
+++ b/pkgs/development/libraries/haskell/network/2.3.0.7.nix
@@ -0,0 +1,18 @@
+{ cabal, parsec }:
+
+cabal.mkDerivation (self: {
+  pname = "network";
+  version = "2.3.0.7";
+  sha256 = "1rlzdacgaq8nv0bwczsrkw47rw4aamf9y4ynm3xjw0r3w1xcg9yv";
+  buildDepends = [ parsec ];
+  meta = {
+    homepage = "http://github.com/haskell/network";
+    description = "Low-level networking interface";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/syb/0.3.5.nix b/pkgs/development/libraries/haskell/syb/0.3.5.nix
new file mode 100644
index 00000000000..f15911c08bd
--- /dev/null
+++ b/pkgs/development/libraries/haskell/syb/0.3.5.nix
@@ -0,0 +1,17 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "syb";
+  version = "0.3.5";
+  sha256 = "17gwhn0rqjf9zkx1dsmsaj41qdjlk4mq5lzpqkgy3slq30nwwwbr";
+  meta = {
+    homepage = "http://www.cs.uu.nl/wiki/GenericProgramming/SYB";
+    description = "Scrap Your Boilerplate";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
+  };
+})
diff --git a/pkgs/development/libraries/isl/default.nix b/pkgs/development/libraries/isl/default.nix
index 2261baba030..b080064d393 100644
--- a/pkgs/development/libraries/isl/default.nix
+++ b/pkgs/development/libraries/isl/default.nix
@@ -1,7 +1,7 @@
-{stdenv, fetchurl, gmp, static ? false}:
+{ stdenv, fetchurl, gmp }:
 
 stdenv.mkDerivation rec {
-  name = "isl-0.07";             # CLooG 0.16.3 fails to build with ISL 0.08.
+  name = "isl-0.07"; # CLooG 0.16.3 fails to build with ISL 0.08.
 
   src = fetchurl {
     url = "http://www.kotnet.org/~skimo/isl/${name}.tar.bz2";
@@ -10,14 +10,10 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ gmp ];
 
-  dontDisableStatic = static;
-  configureFlags =
-    stdenv.lib.optionals static [ " --enable-static" "--disable-shared" ];
-
   meta = {
     homepage = http://www.kotnet.org/~skimo/isl/;
     license = "LGPLv2.1";
-    description = "A library for manipulating sets and relations of integer points bounded by linear constraints.";
+    description = "A library for manipulating sets and relations of integer points bounded by linear constraints";
     maintainers = [ stdenv.lib.maintainers.shlevy ];
     platforms = stdenv.lib.platforms.all;
   };
diff --git a/pkgs/development/libraries/libsigsegv/default.nix b/pkgs/development/libraries/libsigsegv/default.nix
index 8987797ca8b..b0a726ed7f3 100644
--- a/pkgs/development/libraries/libsigsegv/default.nix
+++ b/pkgs/development/libraries/libsigsegv/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv }:
 
 stdenv.mkDerivation rec {
-  name = "libsigsegv-2.8";
+  name = "libsigsegv-2.10";
 
   src = fetchurl {
     url = "mirror://gnu/libsigsegv/${name}.tar.gz";
-    sha256 = "052vcxgajdlvc77dqcs48axjz698r1g2gyagz2qcr6zvkyw304w6";
+    sha256 = "16hrs8k3nmc7a8jam5j1fpspd6sdpkamskvsdpcw6m29vnis8q44";
   };
 
   doCheck = true;
diff --git a/pkgs/development/libraries/libtirpc/default.nix b/pkgs/development/libraries/libtirpc/default.nix
new file mode 100644
index 00000000000..d9678f646b8
--- /dev/null
+++ b/pkgs/development/libraries/libtirpc/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl }:
+
+let
+  version = "0.2.2";
+in
+stdenv.mkDerivation {
+  name = "libtirpc-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libtirpc/libtirpc-${version}.tar.bz2";
+    sha256 = "f05eb17c85d62423858b8f74512cfe66a9ae1cedf93f03c2a0a32e04f0a33705";
+  };
+
+  meta = {
+    homepage = "http://sourceforge.net/projects/libtirpc/";
+    description = "a port of Suns Transport-Independent RPC library to Linux";
+    license = stdenv.lib.licenses.bsd3;
+
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.simons ];
+  };
+}
diff --git a/pkgs/development/libraries/libwpg/default.nix b/pkgs/development/libraries/libwpg/default.nix
index 3da153c3dc5..d140b8b8a0c 100644
--- a/pkgs/development/libraries/libwpg/default.nix
+++ b/pkgs/development/libraries/libwpg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libwpd, xz }:
+{ stdenv, fetchurl, pkgconfig, libwpd }:
 
 stdenv.mkDerivation rec {
   name = "libwpg-0.2.1";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ libwpd ];
-  buildNativeInputs = [ pkgconfig xz ];
+  buildNativeInputs = [ pkgconfig ];
 
   meta = {
     homepage = http://libwpg.sourceforge.net;
diff --git a/pkgs/development/libraries/libxcrypt/default.nix b/pkgs/development/libraries/libxcrypt/default.nix
index aea9e53eef6..b2c9a2c9cf5 100644
--- a/pkgs/development/libraries/libxcrypt/default.nix
+++ b/pkgs/development/libraries/libxcrypt/default.nix
@@ -11,4 +11,7 @@ stdenv.mkDerivation {
     url = ftp://ftp.suse.com/pub/people/kukuk/libxcrypt/libxcrypt-3.0.2.tar.bz2;
     sha256 = "15l2xvhi3r3b40x4665c101ikylh5xsbpw03gnszypfjgn1jkcii";
   };
+
+  patches = [ ./gcc46.patch ];
+
 }
diff --git a/pkgs/development/libraries/libxcrypt/gcc46.patch b/pkgs/development/libraries/libxcrypt/gcc46.patch
new file mode 100644
index 00000000000..0664f96aa68
--- /dev/null
+++ b/pkgs/development/libraries/libxcrypt/gcc46.patch
@@ -0,0 +1,18 @@
+For gcc 4.6 to build this. Otherwise it says 's unused variable', and it's built
+with -Werror.
+
+diff --git a/src/cert.c b/src/cert.c
+index 28c7b11..34570a4 100644
+--- a/src/cert.c
++++ b/src/cert.c
+@@ -87,9 +87,7 @@ char *cp;
+ 	int i,j,t;
+ 
+ 	for(i=0;i<8;i++){
+-		int s;
+-                  
+-                s = scanf("%2x",&t);
++                scanf("%2x",&t);
+ 		if(feof(stdin))
+ 		  good_bye();
+ 		for(j=0; j<8 ; j++) {
diff --git a/pkgs/development/libraries/mpc/default.nix b/pkgs/development/libraries/mpc/default.nix
index 88c18565b78..3824e3d3755 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.8.2";
+  name = "mpc-0.9";
 
   src = fetchurl {
     url = "http://www.multiprecision.org/mpc/download/${name}.tar.gz";
-    sha256 = "1iw0ag28l5r88k7kpn6i89rqn3yhk2irqzk0d1mlb1la3paghydf";
+    sha1 = "229722d553030734d49731844abfef7617b64f1a";
   };
 
   buildInputs = [ gmp mpfr ];
diff --git a/pkgs/development/libraries/mpfr/default.nix b/pkgs/development/libraries/mpfr/default.nix
index 51d33f9593c..0ab745879ac 100644
--- a/pkgs/development/libraries/mpfr/default.nix
+++ b/pkgs/development/libraries/mpfr/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, gmp}:
 
 stdenv.mkDerivation rec {
-  name = "mpfr-3.0.0";
+  name = "mpfr-3.1.0";
 
   src = fetchurl {
     url = "mirror://gnu/mpfr/${name}.tar.bz2";
-    sha256 = "07w24h8by7n319p2vwwa1xdcg7qzkd1aqm84lfcbfv2kaff5yklg";
+    sha256 = "105nx8qqx5x8f4rlplr2wk4cyv61iw5j3jgi2k21rpb8s6xbp9vl";
   };
 
   buildInputs = [ gmp ];
diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix
index b503493ac88..93126d51135 100644
--- a/pkgs/development/libraries/ncurses/default.nix
+++ b/pkgs/development/libraries/ncurses/default.nix
@@ -11,11 +11,11 @@ let
   cxx = stdenv.system != "i686-solaris";
 in
 stdenv.mkDerivation (rec {
-  name = "ncurses-5.7";
+  name = "ncurses-5.9";
 
   src = fetchurl {
     url = "mirror://gnu/ncurses/${name}.tar.gz";
-    sha256 = "1x4q6kma6zgg438llbgiac3kik7j2lln9v97jdffv3fyqyjxx6qa";
+    sha256 = "0fsn7xis81za62afan0vvm38bvgzg5wfmv1m86flqcj0nj7jjilh";
   };
 
   crossAttrs = {
diff --git a/pkgs/development/libraries/opencv/changeset_r3190.diff b/pkgs/development/libraries/opencv/changeset_r3190.diff
new file mode 100644
index 00000000000..4a614659e72
--- /dev/null
+++ b/pkgs/development/libraries/opencv/changeset_r3190.diff
@@ -0,0 +1,20 @@
+--- opencv/src/highgui/cvcap_ffmpeg.cpp

++++ opencv/src/highgui/cvcap_ffmpeg.cpp

+@@ -49,6 +49,15 @@

+ #if !defined(WIN32) || defined(__MINGW32__)

+ // some versions of FFMPEG assume a C99 compiler, and don't define INT64_C

+-#ifndef INT64_C

+-#define INT64_C

++#if !defined INT64_C || !defined UINT64_C

++# if __WORDSIZE == 64

++#  define INT64_C(c)	c ## UL

++# else

++#  define INT64_C(c)	c ## ULL

++# endif

++# if __WORDSIZE == 64

++#  define UINT64_C(c)	c ## UL

++# else

++#  define UINT64_C(c)	c ## ULL

++# endif

+ #define __STDC_CONSTANT_MACROS

+ // force re-inclusion of stdint.h to get INT64_C macro

diff --git a/pkgs/development/libraries/opencv/default.nix b/pkgs/development/libraries/opencv/default.nix
index 05db48095c3..46c170d33f9 100644
--- a/pkgs/development/libraries/opencv/default.nix
+++ b/pkgs/development/libraries/opencv/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, cmake, gtk, libjpeg, libpng, libtiff, jasper, ffmpeg
-, pkgconfig, gstreamer }:
+, pkgconfig, gstreamer, xineLib, glib }:
 
 let v = "2.3.1a"; in
 
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "0325s7pa2npcw2gc06pr6q5ik4xdyf08rvkfc0myn10w20lzb8m9";
   };
 
-  buildInputs = [ gtk libjpeg libpng libtiff jasper ffmpeg gstreamer ];
+  buildInputs = [ gtk glib libjpeg libpng libtiff jasper ffmpeg xineLib gstreamer ];
 
   buildNativeInputs = [ cmake pkgconfig ];
 
diff --git a/pkgs/development/libraries/opencv/default.nix.edited b/pkgs/development/libraries/opencv/default.nix.edited
new file mode 100644
index 00000000000..05db48095c3
--- /dev/null
+++ b/pkgs/development/libraries/opencv/default.nix.edited
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, cmake, gtk, libjpeg, libpng, libtiff, jasper, ffmpeg
+, pkgconfig, gstreamer }:
+
+let v = "2.3.1a"; in
+
+stdenv.mkDerivation rec {
+  name = "opencv-${v}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/opencvlibrary/OpenCV-${v}.tar.bz2";
+    sha256 = "0325s7pa2npcw2gc06pr6q5ik4xdyf08rvkfc0myn10w20lzb8m9";
+  };
+
+  buildInputs = [ gtk libjpeg libpng libtiff jasper ffmpeg gstreamer ];
+
+  buildNativeInputs = [ cmake pkgconfig ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Open Computer Vision Library with more than 500 algorithms";
+    homepage = http://opencv.willowgarage.com/;
+    license = "BSD";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix
index 4b34c3500ec..5301a449a81 100644
--- a/pkgs/development/libraries/openssl/default.nix
+++ b/pkgs/development/libraries/openssl/default.nix
@@ -32,7 +32,8 @@ stdenv.mkDerivation {
            ./gnu.patch                # submitted upstream
          ])
 
-    ++ (stdenv.lib.optional stdenv.isDarwin ./darwin-arch.patch);
+    ++ (stdenv.lib.optional stdenv.isDarwin ./darwin-arch.patch)
+    ++ stdenv.lib.optional (stdenv.system == "x86_64-freebsd") ./freebsd-x86_64-asm.patch;;
 
   buildNativeInputs = [ perl ];
 
diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix
index 65eb51af9b0..7802f89807d 100644
--- a/pkgs/development/libraries/pcre/default.nix
+++ b/pkgs/development/libraries/pcre/default.nix
@@ -1,11 +1,11 @@
-{stdenv, fetchurl, unicodeSupport ? false, cplusplusSupport ? true}:
+{ stdenv, fetchurl, unicodeSupport ? true, cplusplusSupport ? true }:
 
-stdenv.mkDerivation {
-  name = "pcre-8.10";
+stdenv.mkDerivation rec {
+  name = "pcre-8.21";
 
   src = fetchurl {
-    url = mirror://sourceforge/pcre/pcre-8.10.tar.bz2;
-    sha256 = "7ac4e016f6bad8c7d990e6de9bce58c04ff5dd8838be0c5ada0afad1d6a07480";
+    url = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${name}.tar.bz2";
+    sha256 = "1qwrqldbwszbmr4cw4f0xmcl889cmmjbf58l9vxn89zw26fm1f54";
   };
 
   # The compiler on Darwin crashes with an internal error while building the
diff --git a/pkgs/development/libraries/ppl/0.11.nix b/pkgs/development/libraries/ppl/0.11.nix
deleted file mode 100644
index d8ffde644de..00000000000
--- a/pkgs/development/libraries/ppl/0.11.nix
+++ /dev/null
@@ -1,50 +0,0 @@
-{ fetchurl, stdenv, gmpxx, perl, gnum4, static ? false }:
-
-let
-  version = "0.11";
-  staticFlags = if static then " --enable-static --disable-shared --disable-watchdog" else "";
-in
-  stdenv.mkDerivation rec {
-    name = "ppl-${version}";
-
-    src = fetchurl {
-      url = "mirror://gcc/infrastructure/ppl-${version}.tar.gz";
-      sha256 = "0xqwyaj232gi0pgm6z2rihk6p8l1rngbbibnhmcrbq4jq550clrl";
-    };
-
-    buildNativeInputs = [ perl gnum4 ];
-    propagatedBuildInputs = [ gmpxx ];
-
-    dontDisableStatic = if static then true else false;
-    configureFlags = staticFlags;
-
-    # 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.
-    doCheck = false;
-
-    meta = {
-      description = "PPL: The Parma Polyhedra Library";
-
-      longDescription = ''
-        The Parma Polyhedra Library (PPL) provides numerical abstractions
-        especially targeted at applications in the field of analysis and
-        verification of complex systems.  These abstractions include convex
-        polyhedra, defined as the intersection of a finite number of (open or
-        closed) halfspaces, each described by a linear inequality (strict or
-        non-strict) with rational coefficients; some special classes of
-        polyhedra shapes that offer interesting complexity/precision tradeoffs;
-        and grids which represent regularly spaced points that satisfy a set of
-        linear congruence relations.  The library also supports finite
-        powersets and products of (any kind of) polyhedra and grids and a mixed
-        integer linear programming problem solver using an exact-arithmetic
-        version of the simplex algorithm.
-      '';
-
-      homepage = http://www.cs.unipr.it/ppl/;
-
-      license = "GPLv3+";
-
-      maintainers = [ stdenv.lib.maintainers.ludo ];
-    };
-  }
diff --git a/pkgs/development/libraries/ppl/default.nix b/pkgs/development/libraries/ppl/default.nix
index 677d578e242..8cad9022d91 100644
--- a/pkgs/development/libraries/ppl/default.nix
+++ b/pkgs/development/libraries/ppl/default.nix
@@ -1,50 +1,49 @@
-{ fetchurl, stdenv, gmpxx, perl, gnum4, static ? false }:
-
-let
-  version = "0.10.2";
-  staticFlags = if static then " --enable-static --disable-shared" else "";
-in
-  stdenv.mkDerivation rec {
-    name = "ppl-${version}";
-
-    src = fetchurl {
-      url = "mirror://gcc/infrastructure/ppl-${version}.tar.gz";
-      sha256 = "0lly44sac4jd72klnhhil3wha15vak76r6gy88sh0zjsaww9hf6h";
-    };
-
-    buildNativeInputs = [ perl gnum4 ];
-    propagatedBuildInputs = [ gmpxx ];
-
-    dontDisableStatic = if static then true else false;
-    configureFlags = staticFlags;
-
-    # 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.
-    doCheck = false;
-
-    meta = {
-      description = "PPL: The Parma Polyhedra Library";
-
-      longDescription = ''
-        The Parma Polyhedra Library (PPL) provides numerical abstractions
-        especially targeted at applications in the field of analysis and
-        verification of complex systems.  These abstractions include convex
-        polyhedra, defined as the intersection of a finite number of (open or
-        closed) halfspaces, each described by a linear inequality (strict or
-        non-strict) with rational coefficients; some special classes of
-        polyhedra shapes that offer interesting complexity/precision tradeoffs;
-        and grids which represent regularly spaced points that satisfy a set of
-        linear congruence relations.  The library also supports finite
-        powersets and products of (any kind of) polyhedra and grids and a mixed
-        integer linear programming problem solver using an exact-arithmetic
-        version of the simplex algorithm.
-      '';
-
-      homepage = http://www.cs.unipr.it/ppl/;
-
-      license = "GPLv3+";
-
-      maintainers = [ stdenv.lib.maintainers.ludo ];
-    };
-  }
+{ fetchurl, stdenv, gmpxx, perl, gnum4 }:
+
+let version = "0.11.2"; 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";
+  };
+
+  buildNativeInputs = [ perl gnum4 ];
+  propagatedBuildInputs = [ gmpxx ];
+
+  configureFlags = "--disable-watchdog";
+
+  # 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.
+  doCheck = false;
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "PPL: The Parma Polyhedra Library";
+
+    longDescription = ''
+      The Parma Polyhedra Library (PPL) provides numerical abstractions
+      especially targeted at applications in the field of analysis and
+      verification of complex systems.  These abstractions include convex
+      polyhedra, defined as the intersection of a finite number of (open or
+      closed) halfspaces, each described by a linear inequality (strict or
+      non-strict) with rational coefficients; some special classes of
+      polyhedra shapes that offer interesting complexity/precision tradeoffs;
+      and grids which represent regularly spaced points that satisfy a set of
+      linear congruence relations.  The library also supports finite
+      powersets and products of (any kind of) polyhedra and grids and a mixed
+      integer linear programming problem solver using an exact-arithmetic
+      version of the simplex algorithm.
+    '';
+
+    homepage = http://www.cs.unipr.it/ppl/;
+
+    license = "GPLv3+";
+
+    maintainers = [ stdenv.lib.maintainers.ludo ];
+  };
+}
diff --git a/pkgs/development/libraries/readline/readline-patches.nix b/pkgs/development/libraries/readline/readline-6.2-patches.nix
index b8019fb3350..ae1e67224af 100644
--- a/pkgs/development/libraries/readline/readline-patches.nix
+++ b/pkgs/development/libraries/readline/readline-6.2-patches.nix
@@ -1,4 +1,5 @@
 # Automatically generated by `update-patch-set.sh'; do not edit.
 
 patch: [
+(patch "001" "1qxl74f4n0hv4a807byrgbk4ixd8m50apj3922q2ss9pfi0nra1q")
 ]
diff --git a/pkgs/development/libraries/readline/readline6.nix b/pkgs/development/libraries/readline/readline6.nix
index 1bd88069127..0826e6c5f7c 100644
--- a/pkgs/development/libraries/readline/readline6.nix
+++ b/pkgs/development/libraries/readline/readline6.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, ncurses }:
 
 stdenv.mkDerivation (rec {
-  name = "readline-6.1";
+  name = "readline-6.2";
 
   src = fetchurl {
     url = "mirror://gnu/readline/${name}.tar.gz";
-    sha256 = "0sd97zqdh4fc0zzgzpskkczwa2fmb0s89qdyndb6vkbcq04gdjph";
+    sha256 = "10ckm2bd2rkxhvdmj7nmbsylmihw0abwcsnxf8y27305183rd9kr";
   };
 
   propagatedBuildInputs = [ncurses];
@@ -17,11 +17,11 @@ stdenv.mkDerivation (rec {
     (let
        patch = nr: sha256:
          fetchurl {
-           url = "mirror://gnu/readline/${name}-patches/readline61-${nr}";
+           url = "mirror://gnu/readline/${name}-patches/readline62-${nr}";
            inherit sha256;
          };
      in
-       import ./readline-patches.nix patch);
+       import ./readline-6.2-patches.nix patch);
 
   meta = {
     description = "GNU Readline, a library for interactive line editing";
diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix
index f1b8a006ecf..a2f11bca87d 100644
--- a/pkgs/development/libraries/zlib/default.nix
+++ b/pkgs/development/libraries/zlib/default.nix
@@ -1,6 +1,6 @@
-{stdenv, fetchurl, static ? false}:
+{ stdenv, fetchurl, static ? false }:
 
-stdenv.mkDerivation (rec {
+stdenv.mkDerivation rec {
   name = "zlib-1.2.5";
   
   src = fetchurl {
@@ -8,6 +8,10 @@ stdenv.mkDerivation (rec {
     sha256 = "0n7rlgvjn73pyil3s1l6p77m7wkc809n934rnzxv1b1za4pfar30";
   };
 
+  patches =
+    [ ./zlib-LARGEFILE64_SOURCE.patch ]
+    ++ stdenv.lib.optional (stdenv.system == "i686-cygwin") [ ./no-shared.patch ];
+
   configureFlags = if static then "" else "--shared";
 
   preConfigure = ''
@@ -17,6 +21,10 @@ stdenv.mkDerivation (rec {
     fi
   '';
 
+  # As zlib takes part in the stdenv building, we don't want references
+  # to the bootstrap-tools libgcc (as uses to happen on arm/mips)
+  NIX_CFLAGS_COMPILE = "-static-libgcc";
+
   crossAttrs = {
     dontStrip = if static then true else false;
   } // (if stdenv.cross.libc == "msvcrt" then {
@@ -31,7 +39,4 @@ stdenv.mkDerivation (rec {
 
   # zlib doesn't like the automatic --disable-shared from the Cygwin stdenv.
   cygwinConfigureEnableShared = true;
-  
-} // stdenv.lib.optionalAttrs (stdenv.system == "i686-cygwin") {
-  patches = [ ./no-shared.patch ];
-})
+}
diff --git a/pkgs/development/libraries/zlib/zlib-LARGEFILE64_SOURCE.patch b/pkgs/development/libraries/zlib/zlib-LARGEFILE64_SOURCE.patch
new file mode 100644
index 00000000000..6ddb0ad7066
--- /dev/null
+++ b/pkgs/development/libraries/zlib/zlib-LARGEFILE64_SOURCE.patch
@@ -0,0 +1,69 @@
+http://mail.madler.net/pipermail/zlib-devel_madler.net/2011-June/002583.html
+
+[Zlib-devel] Possible typo in zlib.h
+
+Mark Adler madler at madler.net
+
+*** a/zlib.h    2010-04-19 21:12:48.000000000 -0700
+--- b/zlib.h  2011-02-26 21:23:30.000000000 -0800
+***************
+*** 1572,1584 ****
+  #endif
+  
+  #if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0
+! #  define gzopen gzopen64
+! #  define gzseek gzseek64
+! #  define gztell gztell64
+! #  define gzoffset gzoffset64
+! #  define adler32_combine adler32_combine64
+! #  define crc32_combine crc32_combine64
+! #  ifdef _LARGEFILE64_SOURCE
+       ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+       ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
+       ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
+--- 1580,1601 ----
+  #endif
+  
+  #if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0
+! #  ifdef Z_PREFIX_SET
+! #    define z_gzopen z_gzopen64
+! #    define z_gzseek z_gzseek64
+! #    define z_gztell z_gztell64
+! #    define z_gzoffset z_gzoffset64
+! #    define z_adler32_combine z_adler32_combine64
+! #    define z_crc32_combine z_crc32_combine64
+! #  else
+! #    define gzopen gzopen64
+! #    define gzseek gzseek64
+! #    define gztell gztell64
+! #    define gzoffset gzoffset64
+! #    define adler32_combine adler32_combine64
+! #    define crc32_combine crc32_combine64
+! #  endif
+! #  ifndef _LARGEFILE64_SOURCE
+       ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+       ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
+       ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
+*** a/zconf.h.in    2010-04-18 10:58:06.000000000 -0700
+--- b/zconf.h.in  2010-07-18 09:05:49.000000000 -0700
+***************
+*** 374,380 ****
+  #  undef _LARGEFILE64_SOURCE
+  #endif
+  
+! #if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+  #  include <unistd.h>       /* for SEEK_* and off_t */
+  #  ifdef VMS
+  #    include <unixio.h>     /* for off_t */
+--- 375,385 ----
+  #  undef _LARGEFILE64_SOURCE
+  #endif
+  
+! #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
+! #  define Z_LARGE
+! #endif
+! 
+! #if defined(Z_HAVE_UNISTD_H) || defined(Z_LARGE)
+  #  include <unistd.h>       /* for SEEK_* and off_t */
+  #  ifdef VMS
+  #    include <unixio.h>     /* for off_t */
diff --git a/pkgs/development/tools/build-managers/cmake/default.nix b/pkgs/development/tools/build-managers/cmake/default.nix
index 80958e2885f..53e27836d73 100644
--- a/pkgs/development/tools/build-managers/cmake/default.nix
+++ b/pkgs/development/tools/build-managers/cmake/default.nix
@@ -7,11 +7,10 @@ with stdenv.lib;
 let
   os = stdenv.lib.optionalString;
   majorVersion = "2.8";
-  minorVersion = "4";
+  minorVersion = "7";
   version = "${majorVersion}.${minorVersion}";
 in
 
-# WARNING: Do NOT upgrade cmake in trunk: it fails to build on i686-linux
 stdenv.mkDerivation rec {
   name = "cmake-${os useNcurses "cursesUI-"}${os useQt4 "qt4UI-"}${version}";
 
@@ -19,7 +18,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "${meta.homepage}files/v${majorVersion}/cmake-${version}.tar.gz";
-    sha256 = "1k2kjaj3vfifb329ff7fr4hcbpbaqb66l97pshq70h7m0zwajznr";
+    sha256 = "17zmxh0gyis6w05d2km0swlvy94h3w10jgra0fpa5qcg7l2j628k";
   };
 
   patches =
diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix
index 4ccaa550313..526bc45f8bc 100644
--- a/pkgs/development/tools/misc/binutils/default.nix
+++ b/pkgs/development/tools/misc/binutils/default.nix
@@ -1,30 +1,12 @@
 { stdenv, fetchurl, noSysDirs, zlib, cross ? null, gold ? false, bison ? null, flex2535 ? null, bc ? null, dejagnu ? null }:
 
-let
-    basename = "binutils-2.21";
-in
+let basename = "binutils-2.21.1a"; in
 stdenv.mkDerivation rec {
   name = basename + stdenv.lib.optionalString (cross != null) "-${cross.config}";
 
-  # WARNING: Upstream made a mistake in packaging that may mean anyone
-  # but the FSF hosting this tarball is accidentally in violation of
-  # the GPL. We can't update binutils until the next stdenv-updates,
-  # so we are stuck with this version. The issue is discussed in
-  # this email: http://sourceware.org/ml/binutils/2011-08/msg00198.html
-  # The tarball for this minor version will not be fixed, as only the
-  # tarballs for the latest minor version of each major version will
-  # be repackaged. The fixed sources for the closest version to this one
-  # can be found at mirror://gnu/binutils/binutils-2.21.1a.tar.bz2
-  # or http://ftp.gnu.org/gnu/binutils/binutils-2.21.1a.tar.bz2
-  # The sources missing from this tarball come from cgen. It is unclear
-  # WHICH sources should be included, but the cvs tree can be checked out
-  # by:
-  # cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src login
-  # {enter "anoncvs" as the password}
-  # cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src co cgen
   src = fetchurl {
-    url = "http://nixos.org/tarballs/${basename}.tar.bz2";
-    sha256 = "1iyhc42zfa0j2gaxy4zvpk47sdqj4rqvib0mb8597ss8yidyrav0";
+    url = "mirror://gnu/binutils/${basename}.tar.bz2";
+    sha256 = "0m7nmd7gc9d9md43wbrv65hz6lbi2crqwryzpigv19ray1lzmv6d";
   };
 
   patches = [
@@ -53,12 +35,18 @@ stdenv.mkDerivation rec {
     done
   '';
 
+  # As binutils takes part in the stdenv building, we don't want references
+  # 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 == "mips64-linux")
         " --enable-fix-loongson2f-nop"
       + stdenv.lib.optionalString (cross != null) " --target=${cross.config}"
       + stdenv.lib.optionalString gold " --enable-gold";
 
+  enableParallelBuilding = true;
+      
   meta = {
     description = "GNU Binutils, tools for manipulating binaries (linker, assembler, etc.)";
 
diff --git a/pkgs/development/tools/misc/gnum4/default.nix b/pkgs/development/tools/misc/gnum4/default.nix
index df417c3e55e..12cc50a37a0 100644
--- a/pkgs/development/tools/misc/gnum4/default.nix
+++ b/pkgs/development/tools/misc/gnum4/default.nix
@@ -1,17 +1,17 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation {
-  name = "gnum4-1.4.15";
+  name = "gnum4-1.4.16";
 
   src = fetchurl {
-    url = mirror://gnu/m4/m4-1.4.15.tar.bz2;
-    sha256 = "1ygzshj4h6l6wh52vjqczkyahmv67r3yzi1m6nkh94qgndffmbqa";
+    url = mirror://gnu/m4/m4-1.4.16.tar.bz2;
+    sha256 = "035r7ma272j2cwni2961jp22k6bn3n9xwn3b3qbcn2yrvlghql22";
   };
 
   doCheck = !stdenv.isDarwin;
 
   # Upstream is aware of it; it may be in the next release.
-  patches = [ ./s_isdir.patch ];
+  patches = [ ./s_isdir.patch ./readlink-EINVAL.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
new file mode 100644
index 00000000000..dd371584a79
--- /dev/null
+++ b/pkgs/development/tools/misc/gnum4/readlink-EINVAL.patch
@@ -0,0 +1,18 @@
+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/0.6.nix b/pkgs/development/tools/misc/patchelf/0.6.nix
deleted file mode 100644
index 857aa1cabcf..00000000000
--- a/pkgs/development/tools/misc/patchelf/0.6.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-{ stdenv, fetchurl }:
-
-stdenv.mkDerivation rec {
-  name = "patchelf-0.6";
-
-  src = fetchurl {
-    url = "http://nixos.org/releases/patchelf/${name}/${name}.tar.bz2";
-    sha256 = "fc7e7fa95f282fc37a591a802629e0e1ed07bc2a8bf162228d9a69dd76127c01";
-  };
-
-  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/patchelf/default.nix b/pkgs/development/tools/misc/patchelf/default.nix
index 43944ca9acd..857aa1cabcf 100644
--- a/pkgs/development/tools/misc/patchelf/default.nix
+++ b/pkgs/development/tools/misc/patchelf/default.nix
@@ -1,11 +1,11 @@
-{stdenv, fetchurl}:
+{ stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "patchelf-0.5";
-  
+  name = "patchelf-0.6";
+
   src = fetchurl {
     url = "http://nixos.org/releases/patchelf/${name}/${name}.tar.bz2";
-    sha256 = "24b9a850af45e1a277e234b9eb090b52305a2e1c6b02addeb3ae98b4b49d37ce";
+    sha256 = "fc7e7fa95f282fc37a591a802629e0e1ed07bc2a8bf162228d9a69dd76127c01";
   };
 
   meta = {
diff --git a/pkgs/development/tools/misc/strace/default.nix b/pkgs/development/tools/misc/strace/default.nix
index 6bd2619e4d3..b3cf2fcbdda 100644
--- a/pkgs/development/tools/misc/strace/default.nix
+++ b/pkgs/development/tools/misc/strace/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, xz, perl }:
+{ stdenv, fetchurl, perl }:
 
 stdenv.mkDerivation rec {
   name = "strace-4.6";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "12n2faqq7whmszpjhv2lcb06r7900j53p0zl7vipi18inr0smycy";
   };
 
-  buildNativeInputs = [ xz perl ];
+  buildNativeInputs = [ perl ];
 
   meta = {
     homepage = http://strace.sourceforge.net/;
diff --git a/pkgs/development/tools/parsing/bison/bison-2.5.nix b/pkgs/development/tools/parsing/bison/bison-2.5.nix
index 24fc0d1bbb3..98c465a185c 100644
--- a/pkgs/development/tools/parsing/bison/bison-2.5.nix
+++ b/pkgs/development/tools/parsing/bison/bison-2.5.nix
@@ -10,6 +10,9 @@ stdenv.mkDerivation rec {
 
   buildNativeInputs = [ m4 ]
     ++ stdenv.lib.optional doCheck perl;
+  propagatedBuildInputs = [ m4 ];
+
+  M4 = "m4";
 
   doCheck = true;