about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/compilers/ats-extsolve/default.nix35
-rw-r--r--pkgs/development/compilers/ats-extsolve/misc-fixes.patch136
-rw-r--r--pkgs/development/compilers/ats2/default.nix2
-rw-r--r--pkgs/development/compilers/ats2/setup-hook.sh1
-rw-r--r--pkgs/development/compilers/elm/elm-compiler.nix2
-rw-r--r--pkgs/development/compilers/gcc/5.1/builder.sh255
-rw-r--r--pkgs/development/compilers/gcc/5.1/default.nix526
-rw-r--r--pkgs/development/compilers/gcc/5.1/gfortran-driving.patch20
-rw-r--r--pkgs/development/compilers/gcc/5.1/gnat-cflags.patch33
-rw-r--r--pkgs/development/compilers/gcc/5.1/java-jvgenmain-link.patch17
-rw-r--r--pkgs/development/compilers/gcc/5.1/libstdc++-target.patch32
-rw-r--r--pkgs/development/compilers/gcc/5.1/no-sys-dirs.patch28
-rw-r--r--pkgs/development/compilers/ghcjs/default.nix2
-rw-r--r--pkgs/development/compilers/gwt/2.4.0.nix2
-rw-r--r--pkgs/development/compilers/scala/2.10.nix2
-rw-r--r--pkgs/development/compilers/scala/2.9.nix2
-rw-r--r--pkgs/development/compilers/yap/default.nix2
-rw-r--r--pkgs/development/coq-modules/bedrock/default.nix2
-rw-r--r--pkgs/development/coq-modules/fiat/default.nix2
-rw-r--r--pkgs/development/coq-modules/flocq/default.nix2
-rw-r--r--pkgs/development/coq-modules/paco/default.nix2
-rw-r--r--pkgs/development/coq-modules/tlc/default.nix2
-rw-r--r--pkgs/development/coq-modules/ynot/default.nix2
-rw-r--r--pkgs/development/libraries/apr/default.nix4
-rw-r--r--pkgs/development/libraries/assimp/default.nix2
-rw-r--r--pkgs/development/libraries/c-ares/default.nix10
-rw-r--r--pkgs/development/libraries/fcgi/default.nix2
-rw-r--r--pkgs/development/libraries/fox/fox-1.6.nix2
-rw-r--r--pkgs/development/libraries/giflib/5.0.nix2
-rw-r--r--pkgs/development/libraries/giflib/5.1.nix2
-rw-r--r--pkgs/development/libraries/isl/0.14.1.nix22
-rw-r--r--pkgs/development/libraries/jansson/default.nix6
-rw-r--r--pkgs/development/libraries/lame/default.nix2
-rw-r--r--pkgs/development/libraries/libtomcrypt/default.nix2
-rw-r--r--pkgs/development/libraries/nghttp2/default.nix72
-rw-r--r--pkgs/development/libraries/npapi-sdk/default.nix2
-rw-r--r--pkgs/development/libraries/physics/geant4/default.nix4
-rw-r--r--pkgs/development/libraries/physics/geant4/g4py/default.nix2
-rw-r--r--pkgs/development/libraries/qmltermwidget/default.nix2
-rw-r--r--pkgs/development/libraries/urt/default.nix2
-rw-r--r--pkgs/development/lisp-modules/lisp-packages.nix2
-rw-r--r--pkgs/development/ocaml-modules/gmetadom/default.nix2
-rw-r--r--pkgs/development/ocaml-modules/ocaml-text/default.nix2
-rw-r--r--pkgs/development/ocaml-modules/ulex/0.8/default.nix2
-rw-r--r--pkgs/development/ocaml-modules/ulex/default.nix2
-rw-r--r--pkgs/development/tools/misc/checkbashisms/default.nix2
-rw-r--r--pkgs/development/tools/ocaml/camlidl/default.nix2
-rw-r--r--pkgs/development/tools/parsing/hammer/default.nix16
-rw-r--r--pkgs/development/tools/profiling/gprof2dot/default.nix19
49 files changed, 1249 insertions, 49 deletions
diff --git a/pkgs/development/compilers/ats-extsolve/default.nix b/pkgs/development/compilers/ats-extsolve/default.nix
new file mode 100644
index 000000000000..9cd6d3adb324
--- /dev/null
+++ b/pkgs/development/compilers/ats-extsolve/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, ats2, python, z3, pkgconfig, json_c }:
+
+stdenv.mkDerivation {
+  name = "ats-extsolve-0pre6a9b752";
+
+  buildInputs = [ python z3 ats2 pkgconfig json_c ];
+
+  src = fetchurl {
+    url = "https://github.com/githwxi/ATS-Postiats-contrib/archive/6a9b752efb8af1e4f77213f9e81fc2b7fa050877.tar.gz";
+    sha256 = "1zz4fqjm1rdvpm0m0sdck6vx55iiqlk2p8z078fca2q9xyxqjkqd";
+  };
+
+  postUnpack = ''
+    export PATSHOMERELOC="$PWD/$sourceRoot";
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$PATSHOMERELOC"
+  '';
+
+  patches = [ ./misc-fixes.patch ];
+
+  preBuild = "cd projects/MEDIUM/ATS-extsolve";
+
+  buildFlags = [ "setup" "patsolve" ];
+
+  installPhase = ''
+    install -d -m755 $out/bin
+    install -m755 patsolve $out/bin
+  '';
+
+  meta = {
+    platforms = ats2.meta.platforms;
+    homepage = http://www.illtyped.com/projects/patsolve;
+    description = "External Constraint-Solving for ATS2";
+    maintainer = [ stdenv.lib.maintainers.shlevy ];
+  };
+}
diff --git a/pkgs/development/compilers/ats-extsolve/misc-fixes.patch b/pkgs/development/compilers/ats-extsolve/misc-fixes.patch
new file mode 100644
index 000000000000..8775bb83ba4c
--- /dev/null
+++ b/pkgs/development/compilers/ats-extsolve/misc-fixes.patch
@@ -0,0 +1,136 @@
+From bfc7216250e666a59e304f3b7518f8b0bccccbae Mon Sep 17 00:00:00 2001
+From: Shea Levy <shea@shealevy.com>
+Date: Thu, 30 Apr 2015 16:50:47 -0400
+Subject: [PATCH] Add missing case in fprint_s2rt
+
+---
+ projects/MEDIUM/ATS-extsolve/constraint/constraint_s2rt.dats | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/projects/MEDIUM/ATS-extsolve/constraint/constraint_s2rt.dats b/projects/MEDIUM/ATS-extsolve/constraint/constraint_s2rt.dats
+index a841b5f..5bc28d7 100644
+--- a/projects/MEDIUM/ATS-extsolve/constraint/constraint_s2rt.dats
++++ b/projects/MEDIUM/ATS-extsolve/constraint/constraint_s2rt.dats
+@@ -113,6 +113,7 @@ case+ s2t0 of
+ | S2RTfun (args, ret) => fprint (out, "S2RTfun()")
+ | S2RTtup () => fprint (out, "S2RTtup()")
+ | S2RTerr () => fprint (out, "S2RTerr()")
++| S2RTuninterp (str) => fprint! (out, "S2RTuninterp(", str, ")")
+ //
+ | S2RTignored () => fprint (out, "S2RTignored()")
+ //
+From 9d4c7669d0d3bc8725648684391a2962ed5a922e Mon Sep 17 00:00:00 2001
+From: Shea Levy <shea@shealevy.com>
+Date: Thu, 30 Apr 2015 17:13:35 -0400
+Subject: [PATCH] ATS-extsolve: Get rid of verbose . overload
+
+---
+ projects/MEDIUM/ATS-extsolve/solving/solver.dats | 2 +-
+ projects/MEDIUM/ATS-extsolve/solving/solver.sats | 6 ------
+ 2 files changed, 1 insertion(+), 7 deletions(-)
+
+diff --git a/projects/MEDIUM/ATS-extsolve/solving/solver.dats b/projects/MEDIUM/ATS-extsolve/solving/solver.dats
+index 8446cd5..f2f77b4 100644
+--- a/projects/MEDIUM/ATS-extsolve/solving/solver.dats
++++ b/projects/MEDIUM/ATS-extsolve/solving/solver.dats
+@@ -250,7 +250,7 @@ end // end of [c3nstr_solve_main]
+ implement c3nstr_solve (c3t, scripts, verbose) = let
+   var env : smtenv
+   val _ = smtenv_nil (env)
+-  val () = env.verbose (verbose)
++  val () = smtenv_set_verbose(env, verbose)
+   val () = 
+       case+ scripts of 
+           | list_nil () => ()
+diff --git a/projects/MEDIUM/ATS-extsolve/solving/solver.sats b/projects/MEDIUM/ATS-extsolve/solving/solver.sats
+index e43a028..dae452c 100644
+--- a/projects/MEDIUM/ATS-extsolve/solving/solver.sats
++++ b/projects/MEDIUM/ATS-extsolve/solving/solver.sats
+@@ -39,14 +39,8 @@ fun smtenv_load_scripts (env: &smtenv, scripts: List0(string)): void
+ 
+ fun smtenv_get_solver (env: &smtenv): solver
+ 
+-fun smtenv_get_verbose (env: &smtenv): bool
+-
+-overload .verbose with smtenv_get_verbose
+-
+ fun smtenv_set_verbose (env: &smtenv, verbose: bool): void
+ 
+-overload .verbose with smtenv_set_verbose
+-
+ fun formula_cst (s2c: s2cst): formula
+ 
+ (* ****** ****** *)
+From e3473a8d9dc7c56cda1111a439db7123254d00b4 Mon Sep 17 00:00:00 2001
+From: Shea Levy <shea@shealevy.com>
+Date: Thu, 30 Apr 2015 18:09:33 -0400
+Subject: [PATCH 1/2] solver_smt.dats: Don't use mapfree on linear list of
+ non-linear values
+
+---
+ projects/MEDIUM/ATS-extsolve/solving/solver_smt.dats | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/projects/MEDIUM/ATS-extsolve/solving/solver_smt.dats b/projects/MEDIUM/ATS-extsolve/solving/solver_smt.dats
+index 04055b9..b49602d 100644
+--- a/projects/MEDIUM/ATS-extsolve/solving/solver_smt.dats
++++ b/projects/MEDIUM/ATS-extsolve/solving/solver_smt.dats
+@@ -348,7 +348,7 @@ in
+         //
+         val () = assertloc (length(pairs) > 0)
+         //
+-        implement list_vt_mapfree$fopr<@(s2exp,s2exp)><formula>(x) = let
++        implement list_vt_map$fopr<@(s2exp,s2exp)><formula>(x) = let
+           val (pf, fpf | Env) = $UN.ptr1_vtake{smtenv}(addr@ env)
+           val met = formula_make (!Env, x.0)
+           val bound = formula_make (!Env, x.1)
+@@ -362,7 +362,8 @@ in
+         end
+         //
+         val assertions =
+-          list_vt_mapfree<(s2exp,s2exp)><formula> (pairs)
++          list_vt_map<(s2exp,s2exp)><formula> (pairs)
++        val () = list_vt_free(pairs)
+         //
+         implement 
+         list_vt_fold$init<formula><formula> (x) = x
+
+From 50de956561e6bf43190d7efb385bb6da658f1637 Mon Sep 17 00:00:00 2001
+From: Shea Levy <shea@shealevy.com>
+Date: Thu, 30 Apr 2015 18:18:56 -0400
+Subject: [PATCH 2/2] ats-extsolve/main.dats: Don't use mapfree on linear list
+ of non-linear values
+
+---
+ projects/MEDIUM/ATS-extsolve/main.dats | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/projects/MEDIUM/ATS-extsolve/main.dats b/projects/MEDIUM/ATS-extsolve/main.dats
+index ac30ca0..930697d 100644
+--- a/projects/MEDIUM/ATS-extsolve/main.dats
++++ b/projects/MEDIUM/ATS-extsolve/main.dats
+@@ -34,7 +34,7 @@ dynload "commarg.dats"
+ 
+ (* ****** ****** *)
+ 
+-overload mapfree with list_vt_mapfree
++overload map with list_vt_map
+ overload filter with list_vt_filter
+ 
+ (* ****** ****** *)
+@@ -56,12 +56,13 @@ implement main0 (argc, argv) = let
+       | Script (s) => true
+       | _ =>> false
+   implement
+-  list_vt_mapfree$fopr<commarg><string> (x) =
++  list_vt_map$fopr<commarg><string> (x) =
+     case- x of
+       | Script (s) => s
+   //
+   val scriptargs = filter (list_vt_copy (args))
+-  val scripts = mapfree<commarg><string> (scriptargs)
++  val scripts = map<commarg><string> (scriptargs)
++  val () = list_vt_free (scriptargs)
+   //
+   implement
+   list_find$pred<commarg> (x) =
diff --git a/pkgs/development/compilers/ats2/default.nix b/pkgs/development/compilers/ats2/default.nix
index 304d5c284aea..8345a353f3f9 100644
--- a/pkgs/development/compilers/ats2/default.nix
+++ b/pkgs/development/compilers/ats2/default.nix
@@ -11,6 +11,8 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ gmp ];
 
+  setupHook = ./setup-hook.sh;
+
   meta = {
     description = "Functional programming language with dependent types";
     homepage    = "http://www.ats-lang.org";
diff --git a/pkgs/development/compilers/ats2/setup-hook.sh b/pkgs/development/compilers/ats2/setup-hook.sh
new file mode 100644
index 000000000000..67647b1edf69
--- /dev/null
+++ b/pkgs/development/compilers/ats2/setup-hook.sh
@@ -0,0 +1 @@
+export PATSHOME=@out@/lib/ats2-postiats-@version@
diff --git a/pkgs/development/compilers/elm/elm-compiler.nix b/pkgs/development/compilers/elm/elm-compiler.nix
index 87a0b660d2ad..9cf8eda2d9a3 100644
--- a/pkgs/development/compilers/elm/elm-compiler.nix
+++ b/pkgs/development/compilers/elm/elm-compiler.nix
@@ -27,7 +27,7 @@ cabal.mkDerivation (self: {
   ];
   meta = {
     homepage = "http://elm-lang.org";
-    description = "Values to help with elm-package, elm-make, and elm-lang.org.";
+    description = "Values to help with elm-package, elm-make, and elm-lang.org";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
   };
diff --git a/pkgs/development/compilers/gcc/5.1/builder.sh b/pkgs/development/compilers/gcc/5.1/builder.sh
new file mode 100644
index 000000000000..dd77c67a023e
--- /dev/null
+++ b/pkgs/development/compilers/gcc/5.1/builder.sh
@@ -0,0 +1,255 @@
+source $stdenv/setup
+
+
+export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy
+mkdir $NIX_FIXINC_DUMMY
+
+
+if test "$staticCompiler" = "1"; then
+    EXTRA_LDFLAGS="-static"
+else
+    EXTRA_LDFLAGS=""
+fi
+
+# GCC interprets empty paths as ".", which we don't want.
+if test -z "$CPATH"; then unset CPATH; fi
+if test -z "$LIBRARY_PATH"; then unset LIBRARY_PATH; fi
+echo "\$CPATH is \`$CPATH'"
+echo "\$LIBRARY_PATH is \`$LIBRARY_PATH'"
+
+if test "$noSysDirs" = "1"; then
+
+    if test -e $NIX_CC/nix-support/orig-libc; then
+
+        # Figure out what extra flags to pass to the gcc compilers
+        # being generated to make sure that they use our glibc.
+        extraFlags="$(cat $NIX_CC/nix-support/libc-cflags)"
+        extraLDFlags="$(cat $NIX_CC/nix-support/libc-ldflags) $(cat $NIX_CC/nix-support/libc-ldflags-before)"
+
+        # Use *real* header files, otherwise a limits.h is generated
+        # that does not include Glibc's limits.h (notably missing
+        # SSIZE_MAX, which breaks the build).
+        export NIX_FIXINC_DUMMY=$(cat $NIX_CC/nix-support/orig-libc)/include
+
+        # The path to the Glibc binaries such as `crti.o'.
+        glibc_libdir="$(cat $NIX_CC/nix-support/orig-libc)/lib"
+
+    else
+        # Hack: support impure environments.
+        extraFlags="-isystem /usr/include"
+        extraLDFlags="-L/usr/lib64 -L/usr/lib"
+        glibc_libdir="/usr/lib"
+        export NIX_FIXINC_DUMMY=/usr/include
+    fi
+
+    extraFlags="-I$NIX_FIXINC_DUMMY $extraFlags"
+    extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $extraLDFlags"
+
+    # BOOT_CFLAGS defaults to `-g -O2'; since we override it below,
+    # make sure to explictly add them so that files compiled with the
+    # bootstrap compiler are optimized and (optionally) contain
+    # debugging information (info "(gccinstall) Building").
+    if test -n "$dontStrip"; then
+        extraFlags="-O2 -g $extraFlags"
+    else
+        # Don't pass `-g' at all; this saves space while building.
+        extraFlags="-O2 $extraFlags"
+    fi
+
+    EXTRA_FLAGS="$extraFlags"
+    for i in $extraLDFlags; do
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,$i"
+    done
+
+    if test -n "$targetConfig"; then
+        # Cross-compiling, we need gcc not to read ./specs in order to build
+        # the g++ compiler (after the specs for the cross-gcc are created).
+        # Having LIBRARY_PATH= makes gcc read the specs from ., and the build
+        # breaks. Having this variable comes from the default.nix code to bring
+        # gcj in.
+        unset LIBRARY_PATH
+        unset CPATH
+        if test -z "$crossStageStatic"; then
+            EXTRA_TARGET_CFLAGS="-B${libcCross}/lib -idirafter ${libcCross}/include"
+            EXTRA_TARGET_LDFLAGS="-Wl,-L${libcCross}/lib -Wl,-rpath,${libcCross}/lib -Wl,-rpath-link,${libcCross}/lib"
+        fi
+    else
+        if test -z "$NIX_CC_CROSS"; then
+            EXTRA_TARGET_CFLAGS="$EXTRA_FLAGS"
+            EXTRA_TARGET_CXXFLAGS="$EXTRA_FLAGS"
+            EXTRA_TARGET_LDFLAGS="$EXTRA_LDFLAGS"
+        else
+            # This the case of cross-building the gcc.
+            # We need special flags for the target, different than those of the build
+            # Assertion:
+            test -e $NIX_CC_CROSS/nix-support/orig-libc
+
+            # Figure out what extra flags to pass to the gcc compilers
+            # being generated to make sure that they use our glibc.
+            extraFlags="$(cat $NIX_CC_CROSS/nix-support/libc-cflags)"
+            extraLDFlags="$(cat $NIX_CC_CROSS/nix-support/libc-ldflags) $(cat $NIX_CC_CROSS/nix-support/libc-ldflags-before)"
+
+            # Use *real* header files, otherwise a limits.h is generated
+            # that does not include Glibc's limits.h (notably missing
+            # SSIZE_MAX, which breaks the build).
+            NIX_FIXINC_DUMMY_CROSS=$(cat $NIX_CC_CROSS/nix-support/orig-libc)/include
+
+            # The path to the Glibc binaries such as `crti.o'.
+            glibc_dir="$(cat $NIX_CC_CROSS/nix-support/orig-libc)"
+            glibc_libdir="$glibc_dir/lib"
+            configureFlags="$configureFlags --with-native-system-header-dir=$glibc_dir/include"
+
+            extraFlags="-I$NIX_FIXINC_DUMMY_CROSS $extraFlags"
+            extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $extraLDFlags"
+
+            EXTRA_TARGET_CFLAGS="$extraFlags"
+            for i in $extraLDFlags; do
+                EXTRA_TARGET_LDFLAGS="$EXTRA_TARGET_LDFLAGS -Wl,$i"
+            done
+        fi
+    fi
+
+    # CFLAGS_FOR_TARGET are needed for the libstdc++ configure script to find
+    # the startfiles.
+    # FLAGS_FOR_TARGET are needed for the target libraries to receive the -Bxxx
+    # for the startfiles.
+    makeFlagsArray+=( \
+        NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
+        SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
+        CFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
+        CXXFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
+        CFLAGS_FOR_TARGET="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \
+        CXXFLAGS_FOR_TARGET="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \
+        FLAGS_FOR_TARGET="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \
+        LDFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
+        LDFLAGS_FOR_TARGET="$EXTRA_TARGET_LDFLAGS $EXTRA_TARGET_LDFLAGS" \
+        )
+
+    if test -z "$targetConfig"; then
+        makeFlagsArray+=( \
+            BOOT_CFLAGS="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
+            BOOT_LDFLAGS="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \
+            )
+    fi
+
+    if test -n "$targetConfig" -a "$crossStageStatic" == 1; then
+        # We don't want the gcc build to assume there will be a libc providing
+        # limits.h in this stagae
+        makeFlagsArray+=( \
+            LIMITS_H_TEST=false \
+            )
+    else
+        makeFlagsArray+=( \
+            LIMITS_H_TEST=true \
+            )
+    fi
+fi
+
+if test -n "$targetConfig"; then
+    # The host strip will destroy some important details of the objects
+    dontStrip=1
+fi
+
+providedPreConfigure="$preConfigure";
+preConfigure() {
+    if test -n "$newlibSrc"; then
+        tar xvf "$newlibSrc" -C ..
+        ln -s ../newlib-*/newlib newlib
+        # Patch to get armvt5el working:
+        sed -i -e 's/ arm)/ arm*)/' newlib/configure.host
+    fi
+
+    # Bug - they packaged zlib
+    if test -d "zlib"; then
+        # This breaks the build without-headers, which should build only
+        # the target libgcc as target libraries.
+        # See 'configure:5370'
+        rm -Rf zlib
+    fi
+
+    if test -f "$NIX_CC/nix-support/orig-libc"; then
+        # Patch the configure script so it finds glibc headers.  It's
+        # important for example in order not to get libssp built,
+        # because its functionality is in glibc already.
+        glibc_headers="$(cat $NIX_CC/nix-support/orig-libc)/include"
+        sed -i \
+            -e "s,glibc_header_dir=/usr/include,glibc_header_dir=$glibc_headers", \
+            gcc/configure
+    fi
+
+    if test -n "$crossMingw" -a -n "$crossStageStatic"; then
+        mkdir -p ../mingw
+        # --with-build-sysroot expects that:
+        cp -R $libcCross/include ../mingw
+        configureFlags="$configureFlags --with-build-sysroot=`pwd`/.."
+    fi
+
+    # Eval the preConfigure script from nix expression.
+    eval "$providedPreConfigure"
+
+    # Perform the build in a different directory.
+    mkdir ../build
+    cd ../build
+    configureScript=../$sourceRoot/configure
+}
+
+
+postConfigure() {
+    # Don't store the configure flags in the resulting executables.
+    sed -e '/TOPLEVEL_CONFIGURE_ARGUMENTS=/d' -i Makefile
+}
+
+
+preInstall() {
+    # Make ‘lib64’ a symlink to ‘lib’.
+    if [ -n "$is64bit" -a -z "$enableMultilib" ]; then
+        mkdir -p $out/lib
+        ln -s lib $out/lib64
+    fi
+}
+
+
+postInstall() {
+    # Remove precompiled headers for now.  They are very big and
+    # probably not very useful yet.
+    find $out/include -name "*.gch" -exec rm -rf {} \; -prune
+
+    # Remove `fixincl' to prevent a retained dependency on the
+    # previous gcc.
+    rm -rf $out/libexec/gcc/*/*/install-tools
+    rm -rf $out/lib/gcc/*/*/install-tools
+
+    # More dependencies with the previous gcc or some libs (gccbug stores the build command line)
+    rm -rf $out/bin/gccbug
+    # Take out the bootstrap-tools from the rpath, as it's not needed at all having $out
+    for i in $out/libexec/gcc/*/*/*; do
+        if PREV_RPATH=`patchelf --print-rpath $i`; then
+            patchelf --set-rpath `echo $PREV_RPATH | sed 's,:[^:]*bootstrap-tools/lib,,'` $i
+        fi
+    done
+
+    # Get rid of some "fixed" header files
+    rm -rf $out/lib/gcc/*/*/include/root
+
+    # Replace hard links for i686-pc-linux-gnu-gcc etc. with symlinks.
+    for i in $out/bin/*-gcc*; do
+        if cmp -s $out/bin/gcc $i; then
+            ln -sfn gcc $i
+        fi
+    done
+
+    for i in $out/bin/c++ $out/bin/*-c++* $out/bin/*-g++*; do
+        if cmp -s $out/bin/g++ $i; then
+            ln -sfn g++ $i
+        fi
+    done
+
+    # Disable RANDMMAP on grsec, which causes segfaults when using
+    # precompiled headers.
+    # See https://bugs.gentoo.org/show_bug.cgi?id=301299#c31
+    paxmark r $out/libexec/gcc/*/*/{cc1,cc1plus}
+
+    eval "$postInstallGhdl"
+}
+
+genericBuild
diff --git a/pkgs/development/compilers/gcc/5.1/default.nix b/pkgs/development/compilers/gcc/5.1/default.nix
new file mode 100644
index 000000000000..1c61d57729df
--- /dev/null
+++ b/pkgs/development/compilers/gcc/5.1/default.nix
@@ -0,0 +1,526 @@
+{ stdenv, fetchurl, noSysDirs
+, langC ? true, langCC ? true, langFortran ? false
+, langObjC ? stdenv.isDarwin
+, langObjCpp ? stdenv.isDarwin
+, langJava ? false
+, langAda ? false
+, langVhdl ? false
+, langGo ? false
+, profiledCompiler ? false
+, staticCompiler ? false
+, enableShared ? true
+, texinfo ? null
+, perl ? null # optional, for texi2pod (then pod2man); required for Java
+, gmp, mpfr, libmpc, gettext, which
+, libelf                      # optional, for link-time optimizations (LTO)
+, isl ? null # optional, for the Graphite optimization framework.
+, zlib ? null, boehmgc ? null
+, zip ? null, unzip ? null, pkgconfig ? null
+, gtk ? null, libart_lgpl ? null
+, libX11 ? null, libXt ? null, libSM ? null, libICE ? null, libXtst ? null
+, libXrender ? null, xproto ? null, renderproto ? null, xextproto ? null
+, libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null
+, x11Support ? langJava
+, gnatboot ? null
+, enableMultilib ? false
+, enablePlugin ? true             # whether to support user-supplied plug-ins
+, name ? "gcc"
+, cross ? null
+, binutilsCross ? null
+, libcCross ? null
+, crossStageStatic ? true
+, gnat ? null
+, libpthread ? null, libpthreadCross ? null  # required for GNU/Hurd
+, stripped ? true
+, gnused ? null
+}:
+
+assert langJava     -> zip != null && unzip != null
+                       && zlib != null && boehmgc != null
+                       && perl != null;  # for `--enable-java-home'
+assert langAda      -> gnatboot != null;
+assert langVhdl     -> gnat != null;
+
+# LTO needs libelf and zlib.
+assert libelf != null -> zlib != null;
+
+# Make sure we get GNU sed.
+assert stdenv.isDarwin -> gnused != null;
+
+# The go frontend is written in c++
+assert langGo -> langCC;
+
+with stdenv.lib;
+with builtins;
+
+let version = "5.1.0";
+
+    # Whether building a cross-compiler for GNU/Hurd.
+    crossGNU = cross != null && cross.config == "i586-pc-gnu";
+
+    enableParallelBuilding = true;
+
+    patches = [ ]
+      ++ optional (cross != null) ./libstdc++-target.patch
+      ++ optional noSysDirs ./no-sys-dirs.patch
+      # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
+      # target libraries and tools.
+      ++ optional langAda ./gnat-cflags.patch
+      ++ optional langFortran ./gfortran-driving.patch;
+
+    javaEcj = fetchurl {
+      # The `$(top_srcdir)/ecj.jar' file is automatically picked up at
+      # `configure' time.
+
+      # XXX: Eventually we might want to take it from upstream.
+      url = "ftp://sourceware.org/pub/java/ecj-4.3.jar";
+      sha256 = "0jz7hvc0s6iydmhgh5h2m15yza7p2rlss2vkif30vm9y77m97qcx";
+    };
+
+    # Antlr (optional) allows the Java `gjdoc' tool to be built.  We want a
+    # binary distribution here to allow the whole chain to be bootstrapped.
+    javaAntlr = fetchurl {
+      url = http://www.antlr.org/download/antlr-4.4-complete.jar;
+      sha256 = "02lda2imivsvsis8rnzmbrbp8rh1kb8vmq4i67pqhkwz7lf8y6dz";
+    };
+
+    xlibs = [
+      libX11 libXt libSM libICE libXtst libXrender libXrandr libXi
+      xproto renderproto xextproto inputproto randrproto
+    ];
+
+    javaAwtGtk = langJava && x11Support;
+
+    /* Platform flags */
+    platformFlags = let
+        gccArch = stdenv.platform.gcc.arch or null;
+        gccCpu = stdenv.platform.gcc.cpu or null;
+        gccAbi = stdenv.platform.gcc.abi or null;
+        gccFpu = stdenv.platform.gcc.fpu or null;
+        gccFloat = stdenv.platform.gcc.float or null;
+        gccMode = stdenv.platform.gcc.mode or null;
+        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
+        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
+        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
+        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
+        withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
+        withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
+      in
+        withArch +
+        withCpu +
+        withAbi +
+        withFpu +
+        withFloat +
+        withMode;
+
+    /* Cross-gcc settings */
+    crossMingw = cross != null && cross.libc == "msvcrt";
+    crossDarwin = cross != null && cross.libc == "libSystem";
+    crossConfigureFlags = let
+        gccArch = stdenv.cross.gcc.arch or null;
+        gccCpu = stdenv.cross.gcc.cpu or null;
+        gccAbi = stdenv.cross.gcc.abi or null;
+        gccFpu = stdenv.cross.gcc.fpu or null;
+        gccFloat = stdenv.cross.gcc.float or null;
+        gccMode = stdenv.cross.gcc.mode or null;
+        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
+        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
+        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
+        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
+        withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
+        withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
+      in
+        "--target=${cross.config}" +
+        withArch +
+        withCpu +
+        withAbi +
+        withFpu +
+        withFloat +
+        withMode +
+        (if crossMingw && crossStageStatic then
+          " --with-headers=${libcCross}/include" +
+          " --with-gcc" +
+          " --with-gnu-as" +
+          " --with-gnu-ld" +
+          " --with-gnu-ld" +
+          " --disable-shared" +
+          " --disable-nls" +
+          " --disable-debug" +
+          " --enable-sjlj-exceptions" +
+          " --enable-threads=win32" +
+          " --disable-win32-registry"
+          else if crossStageStatic then
+          " --disable-libssp --disable-nls" +
+          " --without-headers" +
+          " --disable-threads " +
+          " --disable-libmudflap " +
+          " --disable-libgomp " +
+          " --disable-libquadmath" +
+          " --disable-shared" +
+          " --disable-libatomic " +  # libatomic requires libc
+          " --disable-decimal-float" # libdecnumber requires libc
+          else
+          (if crossDarwin then " --with-sysroot=${libcCross}/share/sysroot"
+           else                " --with-headers=${libcCross}/include") +
+          # Ensure that -print-prog-name is able to find the correct programs.
+          (stdenv.lib.optionalString (crossMingw || crossDarwin) (
+            " --with-as=${binutilsCross}/bin/${cross.config}-as" +
+            " --with-ld=${binutilsCross}/bin/${cross.config}-ld"
+          )) +
+          " --enable-__cxa_atexit" +
+          " --enable-long-long" +
+          (if crossMingw then
+            " --enable-threads=win32" +
+            " --enable-sjlj-exceptions" +
+            " --enable-hash-synchronization" +
+            " --disable-libssp" +
+            " --disable-nls" +
+            " --with-dwarf2" +
+            # I think noone uses shared gcc libs in mingw, so we better do the same.
+            # In any case, mingw32 g++ linking is broken by default with shared libs,
+            # unless adding "-lsupc++" to any linking command. I don't know why.
+            " --disable-shared" +
+            # To keep ABI compatibility with upstream mingw-w64
+            " --enable-fully-dynamic-string"
+            else (if cross.libc == "uclibc" then
+              # In uclibc cases, libgomp needs an additional '-ldl'
+              # and as I don't know how to pass it, I disable libgomp.
+              " --disable-libgomp" else "") +
+            " --enable-threads=posix" +
+            " --enable-nls" +
+            " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
+          );
+    stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
+    crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
+
+  bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips;
+
+in
+
+# We need all these X libraries when building AWT with GTK+.
+assert x11Support -> (filter (x: x == null) ([ gtk libart_lgpl ] ++ xlibs)) == [];
+
+stdenv.mkDerivation ({
+  name = "${name}${if stripped then "" else "-debug"}-${version}" + crossNameAddon;
+
+  builder = ./builder.sh;
+
+  src = fetchurl {
+    url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2";
+    sha256 = "1bd5vj4px3s8nlakbgrh38ynxq4s654m6nxz7lrj03mvkkwgvnmp";
+  };
+
+  inherit patches;
+
+  postPatch =
+    if (stdenv.isGNU
+        || (libcCross != null                  # e.g., building `gcc.crossDrv'
+            && libcCross ? crossConfig
+            && libcCross.crossConfig == "i586-pc-gnu")
+        || (crossGNU && libcCross != null))
+    then
+      # On GNU/Hurd glibc refers to Hurd & Mach headers and libpthread is not
+      # in glibc, so add the right `-I' flags to the default spec string.
+      assert libcCross != null -> libpthreadCross != null;
+      let
+        libc = if libcCross != null then libcCross else stdenv.glibc;
+        gnu_h = "gcc/config/gnu.h";
+        extraCPPDeps =
+             libc.propagatedBuildInputs
+          ++ stdenv.lib.optional (libpthreadCross != null) libpthreadCross
+          ++ stdenv.lib.optional (libpthread != null) libpthread;
+        extraCPPSpec =
+          concatStrings (intersperse " "
+                          (map (x: "-I${x}/include") extraCPPDeps));
+        extraLibSpec =
+          if libpthreadCross != null
+          then "-L${libpthreadCross}/lib ${libpthreadCross.TARGET_LDFLAGS}"
+          else "-L${libpthread}/lib";
+      in
+        '' echo "augmenting \`CPP_SPEC' in \`${gnu_h}' with \`${extraCPPSpec}'..."
+           sed -i "${gnu_h}" \
+               -es'|CPP_SPEC *"\(.*\)$|CPP_SPEC "${extraCPPSpec} \1|g'
+
+           echo "augmenting \`LIB_SPEC' in \`${gnu_h}' with \`${extraLibSpec}'..."
+           sed -i "${gnu_h}" \
+               -es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
+
+           echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc}/include'..."
+           sed -i "${gnu_h}" \
+               -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc}/include"|g'
+        ''
+    else if cross != null || stdenv.cc.libc != null then
+      # On NixOS, use the right path to the dynamic linker instead of
+      # `/lib/ld*.so'.
+      let
+        libc = if libcCross != null then libcCross else stdenv.cc.libc;
+      in
+        '' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..."
+           for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
+           do
+             grep -q LIBC_DYNAMIC_LINKER "$header" || continue
+             echo "  fixing \`$header'..."
+             sed -i "$header" \
+                 -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc}\3"|g'
+           done
+        ''
+    else null;
+
+  inherit noSysDirs staticCompiler langJava crossStageStatic
+    libcCross crossMingw;
+
+  nativeBuildInputs = [ texinfo which gettext ]
+    ++ (optional (perl != null) perl)
+    ++ (optional javaAwtGtk pkgconfig);
+
+  buildInputs = [ gmp mpfr libmpc libelf ]
+    ++ (optional (isl != null) isl)
+    ++ (optional (zlib != null) zlib)
+    ++ (optionals langJava [ boehmgc zip unzip ])
+    ++ (optionals javaAwtGtk ([ gtk libart_lgpl ] ++ xlibs))
+    ++ (optionals (cross != null) [binutilsCross])
+    ++ (optionals langAda [gnatboot])
+    ++ (optionals langVhdl [gnat])
+
+    # The builder relies on GNU sed (for instance, Darwin's `sed' fails with
+    # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
+    ++ (optional stdenv.isDarwin gnused)
+    ;
+
+  NIX_LDFLAGS = stdenv.lib.optionalString  stdenv.isSunOS "-lm -ldl";
+
+  preConfigure = stdenv.lib.optionalString (stdenv.isSunOS && stdenv.is64bit) ''
+    export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
+    export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
+    export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
+    export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
+  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    if SDKROOT=$(/usr/bin/xcrun --show-sdk-path); then
+      configureFlagsArray+=(--with-native-system-header-dir=$SDKROOT/usr/include)
+      makeFlagsArray+=( \
+       CFLAGS_FOR_BUILD=-F$SDKROOT/System/Library/Frameworks \
+       CFLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
+       FLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
+      )
+    fi
+  '';
+
+  dontDisableStatic = true;
+
+  configureFlags = "
+    ${if stdenv.isSunOS then
+      " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
+      # On Illumos/Solaris GNU as is preferred
+      " --with-gnu-as --without-gnu-ld "
+      else ""}
+    --enable-lto
+    ${if enableMultilib then "--disable-libquadmath" else "--disable-multilib"}
+    ${if enableShared then "" else "--disable-shared"}
+    ${if enablePlugin then "--enable-plugin" else "--disable-plugin"}
+    ${optionalString (isl != null) "--with-isl=${isl}"}
+    ${if langJava then
+      "--with-ecj-jar=${javaEcj} " +
+
+      # Follow Sun's layout for the convenience of IcedTea/OpenJDK.  See
+      # <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>.
+      "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre "
+      else ""}
+    ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
+    ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""}
+    --with-gmp=${gmp}
+    --with-mpfr=${mpfr}
+    --with-mpc=${libmpc}
+    ${if libelf != null then "--with-libelf=${libelf}" else ""}
+    --disable-libstdcxx-pch
+    --without-included-gettext
+    --with-system-zlib
+    --enable-static
+    --enable-languages=${
+      concatStrings (intersperse ","
+        (  optional langC        "c"
+        ++ optional langCC       "c++"
+        ++ optional langFortran  "fortran"
+        ++ optional langJava     "java"
+        ++ optional langAda      "ada"
+        ++ optional langVhdl     "vhdl"
+        ++ optional langGo       "go"
+        ++ optional langObjC     "objc"
+        ++ optional langObjCpp   "obj-c++"
+        ++ optionals crossDarwin [ "objc" "obj-c++" ]
+        )
+      )
+    }
+    ${if (stdenv ? glibc && cross == null)
+      then " --with-native-system-header-dir=${stdenv.glibc}/include"
+      else ""}
+    ${if langAda then " --enable-libada" else ""}
+    ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
+    ${if cross != null then crossConfigureFlags else ""}
+    ${if !bootstrap then "--disable-bootstrap" else ""}
+    ${if cross == null then platformFlags else ""}
+  ";
+
+  targetConfig = if cross != null then cross.config else null;
+
+  buildFlags = if bootstrap then
+    (if profiledCompiler then "profiledbootstrap" else "bootstrap")
+    else "";
+
+  installTargets =
+    if stripped
+    then "install-strip"
+    else "install";
+
+  crossAttrs = let
+    xgccArch = stdenv.cross.gcc.arch or null;
+    xgccCpu = stdenv.cross.gcc.cpu or null;
+    xgccAbi = stdenv.cross.gcc.abi or null;
+    xgccFpu = stdenv.cross.gcc.fpu or null;
+    xgccFloat = stdenv.cross.gcc.float or null;
+    xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else "";
+    xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else "";
+    xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else "";
+    xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else "";
+    xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else "";
+  in {
+    AR = "${stdenv.cross.config}-ar";
+    LD = "${stdenv.cross.config}-ld";
+    CC = "${stdenv.cross.config}-gcc";
+    CXX = "${stdenv.cross.config}-gcc";
+    AR_FOR_TARGET = "${stdenv.cross.config}-ar";
+    LD_FOR_TARGET = "${stdenv.cross.config}-ld";
+    CC_FOR_TARGET = "${stdenv.cross.config}-gcc";
+    NM_FOR_TARGET = "${stdenv.cross.config}-nm";
+    CXX_FOR_TARGET = "${stdenv.cross.config}-g++";
+    # If we are making a cross compiler, cross != null
+    NIX_CC_CROSS = if cross == null then "${stdenv.ccCross}" else "";
+    dontStrip = true;
+    configureFlags = ''
+      ${if enableMultilib then "" else "--disable-multilib"}
+      ${if enableShared then "" else "--disable-shared"}
+      ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
+      ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
+      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
+      --with-gmp=${gmp.crossDrv}
+      --with-mpfr=${mpfr.crossDrv}
+      --disable-libstdcxx-pch
+      --without-included-gettext
+      --with-system-zlib
+      --enable-languages=${
+        concatStrings (intersperse ","
+          (  optional langC        "c"
+          ++ optional langCC       "c++"
+          ++ optional langFortran  "fortran"
+          ++ optional langJava     "java"
+          ++ optional langAda      "ada"
+          ++ optional langVhdl     "vhdl"
+          ++ optional langGo       "go"
+          )
+        )
+      }
+      ${if langAda then " --enable-libada" else ""}
+      --target=${stdenv.cross.config}
+      ${xwithArch}
+      ${xwithCpu}
+      ${xwithAbi}
+      ${xwithFpu}
+      ${xwithFloat}
+    '';
+    buildFlags = "";
+  };
+
+
+  # Needed for the cross compilation to work
+  AR = "ar";
+  LD = "ld";
+  # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
+  CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc";
+
+  # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find
+  # the library headers and binaries, regarless of the language being
+  # compiled.
+
+  # Note: When building the Java AWT GTK+ peer, the build system doesn't
+  # honor `--with-gmp' et al., e.g., when building
+  # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just
+  # add them to $CPATH and $LIBRARY_PATH in this case.
+  #
+  # Likewise, the LTO code doesn't find zlib.
+
+  CPATH = concatStrings
+            (intersperse ":" (map (x: x + "/include")
+                                  (optionals (zlib != null) [ zlib ]
+                                   ++ optionals langJava [ boehmgc ]
+                                   ++ optionals javaAwtGtk xlibs
+                                   ++ optionals javaAwtGtk [ gmp mpfr ]
+                                   ++ optional (libpthread != null) libpthread
+                                   ++ optional (libpthreadCross != null) libpthreadCross
+
+                                   # On GNU/Hurd glibc refers to Mach & Hurd
+                                   # headers.
+                                   ++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs" )
+                                        libcCross.propagatedBuildInputs)));
+
+  LIBRARY_PATH = concatStrings
+                   (intersperse ":" (map (x: x + "/lib")
+                                         (optionals (zlib != null) [ zlib ]
+                                          ++ optionals langJava [ boehmgc ]
+                                          ++ optionals javaAwtGtk xlibs
+                                          ++ optionals javaAwtGtk [ gmp mpfr ]
+                                          ++ optional (libpthread != null) libpthread)));
+
+  EXTRA_TARGET_CFLAGS =
+    if cross != null && libcCross != null
+    then "-idirafter ${libcCross}/include"
+    else null;
+
+  EXTRA_TARGET_LDFLAGS =
+    if cross != null && libcCross != null
+    then "-B${libcCross}/lib -Wl,-L${libcCross}/lib" +
+         (optionalString (libpthreadCross != null)
+           " -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}")
+    else null;
+
+  passthru =
+    { inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; };
+
+  inherit enableParallelBuilding enableMultilib;
+
+  inherit (stdenv) is64bit;
+
+  meta = {
+    homepage = http://gcc.gnu.org/;
+    license = stdenv.lib.licenses.gpl3Plus;  # runtime support libraries are typically LGPLv3+
+    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++,
+      Objective-C, Fortran, OpenMP for C/C++/Fortran, Java, and Ada, as well
+      as libraries for these languages (libstdc++, libgcj, libgomp,...).
+
+      GCC development is a part of the GNU Project, aiming to improve the
+      compiler used in the GNU system including the GNU/Linux variant.
+    '';
+
+    maintainers = with stdenv.lib.maintainers; [ viric shlevy simons ];
+
+    # gnatboot is not available out of linux platforms, so we disable the darwin build
+    # for the gnat (ada compiler).
+    platforms =
+      stdenv.lib.platforms.linux ++
+      stdenv.lib.platforms.freebsd ++
+      optionals (langAda == false) stdenv.lib.platforms.darwin;
+  };
+}
+
+// optionalAttrs (cross != null && cross.libc == "msvcrt" && crossStageStatic) {
+  makeFlags = [ "all-gcc" "all-target-libgcc" ];
+  installTargets = "install-gcc install-target-libgcc";
+}
+
+# Strip kills static libs of other archs (hence cross != null)
+// optionalAttrs (!stripped || cross != null) { dontStrip = true; NIX_STRIP_DEBUG = 0; }
+
+// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
+)
diff --git a/pkgs/development/compilers/gcc/5.1/gfortran-driving.patch b/pkgs/development/compilers/gcc/5.1/gfortran-driving.patch
new file mode 100644
index 000000000000..70708886b405
--- /dev/null
+++ b/pkgs/development/compilers/gcc/5.1/gfortran-driving.patch
@@ -0,0 +1,20 @@
+This patch fixes interaction with Libtool.
+See <http://thread.gmane.org/gmane.comp.gcc.patches/258777>, for details.
+
+--- a/gcc/fortran/gfortranspec.c
++++ b/gcc/fortran/gfortranspec.c
+@@ -461,8 +461,15 @@ For more information about these matters, see the file named COPYING\n\n"));
+     {
+       fprintf (stderr, _("Driving:"));
+       for (i = 0; i < g77_newargc; i++)
++	{
++	  if (g77_new_decoded_options[i].opt_index == OPT_l)
++	    /* Make sure no white space is inserted after `-l'.  */
++	    fprintf (stderr, " -l%s",
++		     g77_new_decoded_options[i].canonical_option[1]);
++	  else
+ 	fprintf (stderr, " %s",
+ 		 g77_new_decoded_options[i].orig_option_with_args_text);
++	}
+       fprintf (stderr, "\n");
+     }
diff --git a/pkgs/development/compilers/gcc/5.1/gnat-cflags.patch b/pkgs/development/compilers/gcc/5.1/gnat-cflags.patch
new file mode 100644
index 000000000000..bf2acf065e9b
--- /dev/null
+++ b/pkgs/development/compilers/gcc/5.1/gnat-cflags.patch
@@ -0,0 +1,33 @@
+diff --git a/libada/Makefile.in b/libada/Makefile.in
+index f5057a0..337e0c6 100644
+--- a/libada/Makefile.in
++++ b/libada/Makefile.in
+@@ -55,7 +55,7 @@ GCC_WARN_CFLAGS = $(LOOSE_WARN)
+ WARN_CFLAGS = @warn_cflags@
+ 
+ TARGET_LIBGCC2_CFLAGS=
+-GNATLIBCFLAGS= -g -O2
++GNATLIBCFLAGS= -g -O2 $(CFLAGS)
+ GNATLIBCFLAGS_FOR_C = $(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) -fexceptions \
+ 	-DIN_RTS @have_getipinfo@
+ 
+--- a/gcc/ada/gcc-interface/Makefile.in
++++ b/gcc/ada/gcc-interface/Makefile.in
+@@ -105,7 +105,7 @@ ADAFLAGS = -W -Wall -gnatpg -gnata
+ SOME_ADAFLAGS =-gnata
+ FORCE_DEBUG_ADAFLAGS = -g
+ GNATLIBFLAGS = -gnatpg -nostdinc
+-GNATLIBCFLAGS = -g -O2
++GNATLIBCFLAGS = -g -O2 $(CFLAGS_FOR_TARGET)
+ # Pretend that _Unwind_GetIPInfo is available for the target by default.  This
+ # should be autodetected during the configuration of libada and passed down to
+ # here, but we need something for --disable-libada and hope for the best.
+@@ -193,7 +193,7 @@ RTSDIR = rts$(subst /,_,$(MULTISUBDIR))
+ # Link flags used to build gnat tools.  By default we prefer to statically
+ # link with libgcc to avoid a dependency on shared libgcc (which is tricky
+ # to deal with as it may conflict with the libgcc provided by the system).
+-GCC_LINK_FLAGS=-static-libgcc
++GCC_LINK_FLAGS=-static-libgcc $(CFLAGS_FOR_TARGET)
+ 
+ # End of variables for you to override.
+ 
diff --git a/pkgs/development/compilers/gcc/5.1/java-jvgenmain-link.patch b/pkgs/development/compilers/gcc/5.1/java-jvgenmain-link.patch
new file mode 100644
index 000000000000..2612e8bfbbbc
--- /dev/null
+++ b/pkgs/development/compilers/gcc/5.1/java-jvgenmain-link.patch
@@ -0,0 +1,17 @@
+The `jvgenmain' executable must be linked against `vec.o', among others,
+since it uses its vector API.
+
+--- gcc-4.3.3/gcc/java/Make-lang.in	2008-12-05 00:00:19.000000000 +0100
++++ gcc-4.3.3/gcc/java/Make-lang.in	2009-07-03 16:11:41.000000000 +0200
+@@ -109,9 +109,9 @@ jcf-dump$(exeext): $(JCFDUMP_OBJS) $(LIB
+ 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JCFDUMP_OBJS) \
+ 		$(CPPLIBS) $(ZLIB) $(LDEXP_LIB) $(LIBS)
+ 
+-jvgenmain$(exeext): $(JVGENMAIN_OBJS) $(LIBDEPS)
++jvgenmain$(exeext): $(JVGENMAIN_OBJS) $(LIBDEPS) $(BUILD_RTL)
+ 	rm -f $@
+-	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JVGENMAIN_OBJS) $(LIBS)
++	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JVGENMAIN_OBJS) $(BUILD_RTL) $(LIBS)
+ 
+ #
+ # Build hooks:
diff --git a/pkgs/development/compilers/gcc/5.1/libstdc++-target.patch b/pkgs/development/compilers/gcc/5.1/libstdc++-target.patch
new file mode 100644
index 000000000000..fb622b395806
--- /dev/null
+++ b/pkgs/development/compilers/gcc/5.1/libstdc++-target.patch
@@ -0,0 +1,32 @@
+Patch to make the target libraries 'configure' scripts find the proper CPP.
+I noticed that building the mingw32 cross compiler.
+Looking at the build script for mingw in archlinux, I think that only nixos
+needs this patch. I don't know why.
+diff --git a/Makefile.in b/Makefile.in
+index 93f66b6..d691917 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -266,6 +266,7 @@ BASE_TARGET_EXPORTS = \
+ 	AR="$(AR_FOR_TARGET)"; export AR; \
+ 	AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \
+ 	CC="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \
++	CPP="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CC; \
+ 	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ 	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+ 	CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+@@ -291,11 +292,13 @@ BASE_TARGET_EXPORTS = \
+ RAW_CXX_TARGET_EXPORTS = \
+ 	$(BASE_TARGET_EXPORTS) \
+ 	CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
+-	CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX;
++	CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; \
++	CXXCPP="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CXX;
+ 
+ NORMAL_TARGET_EXPORTS = \
+ 	$(BASE_TARGET_EXPORTS) \
+-	CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX;
++	CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; \
++	CXXCPP="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CXX;
+ 
+ # Where to find GMP
+ HOST_GMPLIBS = @gmplibs@
diff --git a/pkgs/development/compilers/gcc/5.1/no-sys-dirs.patch b/pkgs/development/compilers/gcc/5.1/no-sys-dirs.patch
new file mode 100644
index 000000000000..36df51904acf
--- /dev/null
+++ b/pkgs/development/compilers/gcc/5.1/no-sys-dirs.patch
@@ -0,0 +1,28 @@
+diff -ru -x '*~' gcc-4.8.3-orig/gcc/cppdefault.c gcc-4.8.3/gcc/cppdefault.c
+--- gcc-4.8.3-orig/gcc/cppdefault.c	2013-01-10 21:38:27.000000000 +0100
++++ gcc-4.8.3/gcc/cppdefault.c	2014-08-18 16:20:32.893944536 +0200
+@@ -35,6 +35,8 @@
+ # undef CROSS_INCLUDE_DIR
+ #endif
+ 
++#undef LOCAL_INCLUDE_DIR
++
+ const struct default_include cpp_include_defaults[]
+ #ifdef INCLUDE_DEFAULTS
+ = INCLUDE_DEFAULTS;
+diff -ru -x '*~' gcc-4.8.3-orig/gcc/gcc.c gcc-4.8.3/gcc/gcc.c
+--- gcc-4.8.3-orig/gcc/gcc.c	2014-03-23 12:30:57.000000000 +0100
++++ gcc-4.8.3/gcc/gcc.c	2014-08-18 13:19:32.689201690 +0200
+@@ -1162,10 +1162,10 @@
+ /* Default prefixes to attach to command names.  */
+ 
+ #ifndef STANDARD_STARTFILE_PREFIX_1
+-#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
++#define STANDARD_STARTFILE_PREFIX_1 ""
+ #endif
+ #ifndef STANDARD_STARTFILE_PREFIX_2
+-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
++#define STANDARD_STARTFILE_PREFIX_2 ""
+ #endif
+ 
+ #ifdef CROSS_DIRECTORY_STRUCTURE  /* Don't use these prefixes for a cross compiler.  */
diff --git a/pkgs/development/compilers/ghcjs/default.nix b/pkgs/development/compilers/ghcjs/default.nix
index 8206bb19e4fa..54604f548fa7 100644
--- a/pkgs/development/compilers/ghcjs/default.nix
+++ b/pkgs/development/compilers/ghcjs/default.nix
@@ -122,7 +122,7 @@ in mkDerivation (rec {
   };
 
   homepage = "https://github.com/ghcjs/ghcjs";
-  description = "GHCJS is a Haskell to JavaScript compiler that uses the GHC API";
+  description = "A Haskell to JavaScript compiler that uses the GHC API";
   license = stdenv.lib.licenses.bsd3;
   platforms = ghc.meta.platforms;
   maintainers = with stdenv.lib.maintainers; [ jwiegley cstrahan ];
diff --git a/pkgs/development/compilers/gwt/2.4.0.nix b/pkgs/development/compilers/gwt/2.4.0.nix
index f0dc9378c4f0..588861ee42de 100644
--- a/pkgs/development/compilers/gwt/2.4.0.nix
+++ b/pkgs/development/compilers/gwt/2.4.0.nix
@@ -18,6 +18,6 @@ stdenv.mkDerivation {
 
   meta = {
     homepage = http://code.google.com/webtoolkit/;
-    description = "Google Web Toolkit (GWT) is a development toolkit for building and optimizing complex browser-based applications";
+    description = "A development toolkit for building and optimizing complex browser-based applications";
   };
 }
diff --git a/pkgs/development/compilers/scala/2.10.nix b/pkgs/development/compilers/scala/2.10.nix
index b518a9a0e0ec..ab13e0ba7dc3 100644
--- a/pkgs/development/compilers/scala/2.10.nix
+++ b/pkgs/development/compilers/scala/2.10.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    description = "Scala is a general purpose programming language";
+    description = "A general purpose programming language";
     longDescription = ''
       Scala is a general purpose programming language designed to express
       common programming patterns in a concise, elegant, and type-safe way.
diff --git a/pkgs/development/compilers/scala/2.9.nix b/pkgs/development/compilers/scala/2.9.nix
index de5db1eff996..c98e2e75c171 100644
--- a/pkgs/development/compilers/scala/2.9.nix
+++ b/pkgs/development/compilers/scala/2.9.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    description = "Scala is a general purpose programming language";
+    description = "A general purpose programming language";
     longDescription = ''
       Scala is a general purpose programming language designed to express
       common programming patterns in a concise, elegant, and type-safe way.
diff --git a/pkgs/development/compilers/yap/default.nix b/pkgs/development/compilers/yap/default.nix
index f9b587c05049..2482f2ac1316 100644
--- a/pkgs/development/compilers/yap/default.nix
+++ b/pkgs/development/compilers/yap/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = "http://www.dcc.fc.up.pt/~vsc/Yap/";
-    description = "Yap Prolog System is a ISO-compatible high-performance Prolog compiler";
+    description = "A ISO-compatible high-performance Prolog compiler";
     license = stdenv.lib.licenses.artistic2;
 
     maintainers = [ stdenv.lib.maintainers.simons ];
diff --git a/pkgs/development/coq-modules/bedrock/default.nix b/pkgs/development/coq-modules/bedrock/default.nix
index 478f74058bdf..92a3d16963b6 100644
--- a/pkgs/development/coq-modules/bedrock/default.nix
+++ b/pkgs/development/coq-modules/bedrock/default.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = http://plv.csail.mit.edu/bedrock/;
-    description = "Bedrock is a library that turns Coq into a tool much like classical verification systems";
+    description = "A library that turns Coq into a tool much like classical verification systems";
     maintainers = with maintainers; [ jwiegley ];
     platforms = coq.meta.platforms;
   };
diff --git a/pkgs/development/coq-modules/fiat/default.nix b/pkgs/development/coq-modules/fiat/default.nix
index 9f020de15345..92b69319e0bc 100644
--- a/pkgs/development/coq-modules/fiat/default.nix
+++ b/pkgs/development/coq-modules/fiat/default.nix
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = http://plv.csail.mit.edu/fiat/;
-    description = "Fiat is a library for the Coq proof assistant for synthesizing efficient correct-by-construction programs from declarative specifications";
+    description = "A library for the Coq proof assistant for synthesizing efficient correct-by-construction programs from declarative specifications";
     maintainers = with maintainers; [ jwiegley ];
     platforms = coq.meta.platforms;
   };
diff --git a/pkgs/development/coq-modules/flocq/default.nix b/pkgs/development/coq-modules/flocq/default.nix
index 89555c2e13da..05267d6bf6c2 100644
--- a/pkgs/development/coq-modules/flocq/default.nix
+++ b/pkgs/development/coq-modules/flocq/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = http://flocq.gforge.inria.fr/;
-    description = "Flocq (Floats for Coq) is a floating-point formalization for the Coq system";
+    description = "A floating-point formalization for the Coq system";
     license = licenses.lgpl3;
     maintainers = with maintainers; [ jwiegley ];
     platforms = coq.meta.platforms;
diff --git a/pkgs/development/coq-modules/paco/default.nix b/pkgs/development/coq-modules/paco/default.nix
index c885d14aa3f2..98d447d21d38 100644
--- a/pkgs/development/coq-modules/paco/default.nix
+++ b/pkgs/development/coq-modules/paco/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = http://plv.mpi-sws.org/paco/;
-    description = "Paco is a Coq library implementing parameterized coinduction";
+    description = "A Coq library implementing parameterized coinduction";
     maintainers = with maintainers; [ jwiegley ];
     platforms = coq.meta.platforms;
   };
diff --git a/pkgs/development/coq-modules/tlc/default.nix b/pkgs/development/coq-modules/tlc/default.nix
index e47ffbdd4562..b98ff613f9d9 100644
--- a/pkgs/development/coq-modules/tlc/default.nix
+++ b/pkgs/development/coq-modules/tlc/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
 
   meta = with stdenv.lib; {
     homepage = http://www.chargueraud.org/softs/tlc/;
-    description = "TLC is a general purpose Coq library that provides an alternative to Coq's standard library";
+    description = "A general purpose Coq library that provides an alternative to Coq's standard library";
     maintainers = with maintainers; [ jwiegley ];
     platforms = coq.meta.platforms;
   };
diff --git a/pkgs/development/coq-modules/ynot/default.nix b/pkgs/development/coq-modules/ynot/default.nix
index 555945068b1a..d83e2c5c7909 100644
--- a/pkgs/development/coq-modules/ynot/default.nix
+++ b/pkgs/development/coq-modules/ynot/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = http://ynot.cs.harvard.edu/;
-    description = "Ynot is a library for writing and verifying imperative programs";
+    description = "A library for writing and verifying imperative programs";
     maintainers = with maintainers; [ jwiegley ];
     platforms = coq.meta.platforms;
   };
diff --git a/pkgs/development/libraries/apr/default.nix b/pkgs/development/libraries/apr/default.nix
index 3810a47fac3f..08fd1fe4d5f3 100644
--- a/pkgs/development/libraries/apr/default.nix
+++ b/pkgs/development/libraries/apr/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "apr-1.5.1";
+  name = "apr-1.5.2";
 
   src = fetchurl {
     url = "mirror://apache/apr/${name}.tar.bz2";
-    sha256 = "1b4qw686bwjn19iyb0lg918q23xxd6s2gnyczhjq992d3m1vwjp9";
+    sha256 = "0ypn51xblix5ys9xy7da3ngdydip0qqh9rdq8nz54w9aq8lys0vx";
   };
 
   patches = stdenv.lib.optionals stdenv.isDarwin [ ./is-this-a-compiler-bug.patch ];
diff --git a/pkgs/development/libraries/assimp/default.nix b/pkgs/development/libraries/assimp/default.nix
index 229db910ffd2..70447d9f8853 100644
--- a/pkgs/development/libraries/assimp/default.nix
+++ b/pkgs/development/libraries/assimp/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
   buildInputs = [ unzip cmake boost ];
 
   meta = with stdenv.lib; {
-    description = "Open Asset Import Library is a library to import various 3D model formats";
+    description = "A library to import various 3D model formats";
     homepage = http://assimp.sourceforge.net/;
     license = licenses.bsd3;
     maintainers = with maintainers; [ emery ];
diff --git a/pkgs/development/libraries/c-ares/default.nix b/pkgs/development/libraries/c-ares/default.nix
index 58e7c17f2495..678c7e151122 100644
--- a/pkgs/development/libraries/c-ares/default.nix
+++ b/pkgs/development/libraries/c-ares/default.nix
@@ -8,13 +8,11 @@ stdenv.mkDerivation rec {
     sha256 = "1nyka87yf2jfd0y6sspll0yxwb8zi7kyvajrdbjmh4axc5s1cw1x";
   };
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "A C library for asynchronous DNS requests";
-
     homepage = http://c-ares.haxx.se;
-
-    license = stdenv.lib.licenses.mit;
-
-    maintainers = [ stdenv.lib.maintainers.shlevy ];
+    license = licenses.mit;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ shlevy ];
   };
 }
diff --git a/pkgs/development/libraries/fcgi/default.nix b/pkgs/development/libraries/fcgi/default.nix
index f75c21170840..6808ea52adff 100644
--- a/pkgs/development/libraries/fcgi/default.nix
+++ b/pkgs/development/libraries/fcgi/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   postInstall = "ln -s . $out/include/fastcgi";
 
   meta = with stdenv.lib; {
-    description = "FastCGI  is a language independent, scalable, open extension to CG";
+    description = "A language independent, scalable, open extension to CG";
     homepage = http://www.fastcgi.com/;
     license = "FastCGI see LICENSE.TERMS";
     platforms = platforms.all;
diff --git a/pkgs/development/libraries/fox/fox-1.6.nix b/pkgs/development/libraries/fox/fox-1.6.nix
index 604fe3c2fdf0..e966388b2ad9 100644
--- a/pkgs/development/libraries/fox/fox-1.6.nix
+++ b/pkgs/development/libraries/fox/fox-1.6.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     branch = "1.6";
-    description = "FOX is a C++ based class library for building Graphical User Interfaces";
+    description = "A C++ based class library for building Graphical User Interfaces";
     longDescription = ''
         FOX stands for Free Objects for X.
         It is a C++ based class library for building Graphical User Interfaces.
diff --git a/pkgs/development/libraries/giflib/5.0.nix b/pkgs/development/libraries/giflib/5.0.nix
index 49e3fc40ba66..95038284cd60 100644
--- a/pkgs/development/libraries/giflib/5.0.nix
+++ b/pkgs/development/libraries/giflib/5.0.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
 
   buildInputs = [ xmlto docbook_xml_dtd_412 docbook_xsl libxml2 ];
   meta = {
-    description = "giflib is a library for reading and writing gif images";
+    description = "A library for reading and writing gif images";
     platforms = stdenv.lib.platforms.unix;
     license = stdenv.lib.licenses.mit;
     maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
diff --git a/pkgs/development/libraries/giflib/5.1.nix b/pkgs/development/libraries/giflib/5.1.nix
index dcd52fc93f46..0bccb857d350 100644
--- a/pkgs/development/libraries/giflib/5.1.nix
+++ b/pkgs/development/libraries/giflib/5.1.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
 
   buildInputs = [ xmlto docbook_xml_dtd_412 docbook_xsl libxml2 ];
   meta = {
-    description = "giflib is a library for reading and writing gif images";
+    description = "A library for reading and writing gif images";
     platforms = stdenv.lib.platforms.unix;
     license = stdenv.lib.licenses.mit;
     maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
diff --git a/pkgs/development/libraries/isl/0.14.1.nix b/pkgs/development/libraries/isl/0.14.1.nix
new file mode 100644
index 000000000000..dc13bbae9892
--- /dev/null
+++ b/pkgs/development/libraries/isl/0.14.1.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, gmp }:
+
+stdenv.mkDerivation rec {
+  name = "isl-0.14.1";
+
+  src = fetchurl {
+    url = "http://isl.gforge.inria.fr/${name}.tar.xz";
+    sha256 = "0xa6xagah5rywkywn19rzvbvhfvkmylhcxr6z9z7bz29cpiwk0l8";
+  };
+
+  buildInputs = [ gmp ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = http://www.kotnet.org/~skimo/isl/;
+    license = stdenv.lib.licenses.lgpl21;
+    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/jansson/default.nix b/pkgs/development/libraries/jansson/default.nix
index 7b78c39924fd..f0f9cc65cb2b 100644
--- a/pkgs/development/libraries/jansson/default.nix
+++ b/pkgs/development/libraries/jansson/default.nix
@@ -8,9 +8,11 @@ stdenv.mkDerivation rec {
     sha256 = "1mvq9p85khsl818i4vbszyfab0fd45mdrwrxjkzw05mk1xcyc1br";
   };
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = "http://www.digip.org/jansson/";
     description = "C library for encoding, decoding and manipulating JSON data";
-    license = stdenv.lib.licenses.mit;
+    license = licenses.mit;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ wkennington ];
   };
 }
diff --git a/pkgs/development/libraries/lame/default.nix b/pkgs/development/libraries/lame/default.nix
index abf05f4c1385..562e292791ab 100644
--- a/pkgs/development/libraries/lame/default.nix
+++ b/pkgs/development/libraries/lame/default.nix
@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
   ];
 
   meta = {
-    description = "LAME is a high quality MPEG Audio Layer III (MP3) encoder";
+    description = "A high quality MPEG Audio Layer III (MP3) encoder";
     homepage    = http://lame.sourceforge.net;
     license     = licenses.lgpl2;
     maintainers = with maintainers; [ codyopel ];
diff --git a/pkgs/development/libraries/libtomcrypt/default.nix b/pkgs/development/libraries/libtomcrypt/default.nix
index 4a3196e44b88..e960f5ef57f3 100644
--- a/pkgs/development/libraries/libtomcrypt/default.nix
+++ b/pkgs/development/libraries/libtomcrypt/default.nix
@@ -21,6 +21,6 @@ stdenv.mkDerivation {
 
   meta = {
     homepage = "http://libtom.org/?page=features&newsitems=5&whatfile=crypt";
-    description = "LibTomCrypt is a fairly comprehensive, modular and portable cryptographic toolkit";
+    description = "A fairly comprehensive, modular and portable cryptographic toolkit";
   };
 }
diff --git a/pkgs/development/libraries/nghttp2/default.nix b/pkgs/development/libraries/nghttp2/default.nix
new file mode 100644
index 000000000000..b72abb57e8f2
--- /dev/null
+++ b/pkgs/development/libraries/nghttp2/default.nix
@@ -0,0 +1,72 @@
+{ stdenv, fetchurl, pkgconfig
+
+# Optinal Dependencies
+, openssl ? null, libev ? null, zlib ? null, jansson ? null, boost ? null
+, libxml2 ? null, jemalloc ? null
+
+# Extra argument
+, prefix ? ""
+}:
+
+let
+  mkFlag = trueStr: falseStr: cond: name: val:
+    if cond == null then null else
+      "--${if cond != false then trueStr else falseStr}${name}${if val != null && cond != false then "=${val}" else ""}";
+  mkEnable = mkFlag "enable-" "disable-";
+  mkWith = mkFlag "with-" "without-";
+  mkOther = mkFlag "" "" true;
+
+  shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
+
+  isLib = prefix == "lib";
+
+  optOpenssl = if isLib then null else shouldUsePkg openssl;
+  optLibev = if isLib then null else shouldUsePkg libev;
+  optZlib = if isLib then null else shouldUsePkg zlib;
+
+  hasApp = optOpenssl != null && optLibev != null && optZlib != null;
+
+  optJansson = if isLib then null else shouldUsePkg jansson;
+  #optBoost = if isLib then null else shouldUsePkg boost;
+  optBoost = null; # Currently detection is broken
+  optLibxml2 = if !hasApp then null else shouldUsePkg libxml2;
+  optJemalloc = if !hasApp then null else shouldUsePkg jemalloc;
+in
+stdenv.mkDerivation rec {
+  name = "${prefix}nghttp2-${version}";
+  version = "0.7.13";
+
+  # Don't use fetchFromGitHub since this needs a bootstrap curl
+  src = fetchurl {
+    url = "http://pub.wak.io/nixos/tarballs/nghttp2-0.7.13.tar.xz";
+    sha256 = "1nz14hmfhsxljmf7f3763q9kpn9prfdivrvdr7c74x72s75bzwli";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ optJansson optBoost optLibxml2 optJemalloc ]
+    ++ stdenv.lib.optionals hasApp [ optOpenssl optLibev optZlib ];
+
+  configureFlags = [
+    (mkEnable false                 "werror"          null)
+    (mkEnable false                 "debug"           null)
+    (mkEnable true                  "threads"         null)
+    (mkEnable hasApp                "app"             null)
+    (mkEnable (optJansson != null)  "hpack-tools"     null)
+    (mkEnable (optBoost != null)    "asio-lib"        null)
+    (mkEnable false                 "examples"        null)
+    (mkEnable false                 "python-bindings" null)
+    (mkEnable false                 "failmalloc"      null)
+    (mkWith   (optLibxml2 != null)  "libxml2"         null)
+    (mkWith   (optJemalloc != null) "jemalloc"        null)
+    (mkWith   false                 "spdylay"         null)
+    (mkWith   false                 "cython"          null)
+  ];
+
+  meta = with stdenv.lib; {
+    homepage = http://nghttp2.org/;
+    description = "an implementation of HTTP/2 in C";
+    license = licenses.mit;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ wkennington ];
+  };
+}
diff --git a/pkgs/development/libraries/npapi-sdk/default.nix b/pkgs/development/libraries/npapi-sdk/default.nix
index 57b1b3af2d1c..c2799d039cc1 100644
--- a/pkgs/development/libraries/npapi-sdk/default.nix
+++ b/pkgs/development/libraries/npapi-sdk/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   };
 
   meta = with stdenv.lib; {
-    description = "NPAPI-SDK is a bundle of NPAPI headers by Mozilla";
+    description = "A bundle of NPAPI headers by Mozilla";
 
     homepage = https://code.google.com/p/npapi-sdk/;
     license = licenses.bsd3;
diff --git a/pkgs/development/libraries/physics/geant4/default.nix b/pkgs/development/libraries/physics/geant4/default.nix
index 1e1fc7ea3b8f..872576d9fb02 100644
--- a/pkgs/development/libraries/physics/geant4/default.nix
+++ b/pkgs/development/libraries/physics/geant4/default.nix
@@ -92,7 +92,7 @@ let
       '';
 
       meta = {
-        description = "A toolkit for the simulation of the passage of particles through matter.";
+        description = "A toolkit for the simulation of the passage of particles through matter";
         longDescription = ''
           Geant4 is a toolkit for the simulation of the passage of particles through matter.
           Its areas of application include high energy, nuclear and accelerator physics, as well as studies in medical and space science.
@@ -129,7 +129,7 @@ let
       '';
 
       meta = {
-        description = "Data files for the Geant4 toolkit.";
+        description = "Data files for the Geant4 toolkit";
         homepage = http://www.geant4.org;
         license = stdenv.lib.licenses.g4sl;
         maintainers = [ ];
diff --git a/pkgs/development/libraries/physics/geant4/g4py/default.nix b/pkgs/development/libraries/physics/geant4/g4py/default.nix
index f90b2e6c4aee..e023b1220910 100644
--- a/pkgs/development/libraries/physics/geant4/g4py/default.nix
+++ b/pkgs/development/libraries/physics/geant4/g4py/default.nix
@@ -45,7 +45,7 @@ let
       '';
 
       meta = {
-        description = "Python bindings and utilities for Geant4.";
+        description = "Python bindings and utilities for Geant4";
         longDescription = ''
           Geant4 is a toolkit for the simulation of the passage of particles through matter.      
           Its areas of application include high energy, nuclear and accelerator physics, as well as studies in medical and space science.
diff --git a/pkgs/development/libraries/qmltermwidget/default.nix b/pkgs/development/libraries/qmltermwidget/default.nix
index a1be2afcd6ce..32d9bd0a8e5f 100644
--- a/pkgs/development/libraries/qmltermwidget/default.nix
+++ b/pkgs/development/libraries/qmltermwidget/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   meta = {
-    description = "This project is a QML port of qtermwidget";
+    description = "A QML port of qtermwidget";
     homepage = "https://github.com/Swordifish90/qmltermwidget";
     license = with stdenv.lib.licenses; [ gpl2 ];
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/development/libraries/urt/default.nix b/pkgs/development/libraries/urt/default.nix
index 8570af2b2834..090ca28d7c45 100644
--- a/pkgs/development/libraries/urt/default.nix
+++ b/pkgs/development/libraries/urt/default.nix
@@ -56,6 +56,6 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = http://www.cs.utah.edu/gdc/projects/urt/;
-    description = "The Utah Raster Toolkit is a library for dealing with raster images";
+    description = "A library for dealing with raster images";
   };
 }
\ No newline at end of file
diff --git a/pkgs/development/lisp-modules/lisp-packages.nix b/pkgs/development/lisp-modules/lisp-packages.nix
index d7bd2348244e..7d4c88e5c9e0 100644
--- a/pkgs/development/lisp-modules/lisp-packages.nix
+++ b/pkgs/development/lisp-modules/lisp-packages.nix
@@ -98,7 +98,7 @@ let lispPackages = rec {
   clx-truetype = buildLispPackage rec {
     baseName = "clx-truetype";
     version = "git-20141112";
-    description = "clx-truetype is pure common lisp solution for antialiased TrueType font rendering using CLX and XRender extension";
+    description = "A pure Common Lisp solution for antialiased TrueType font rendering using CLX and the XRender extension";
     deps = [cl-fad cl-store cl-vectors clx trivial-features zpb-ttf];
     # Source type: git
     src = pkgs.fetchgit {
diff --git a/pkgs/development/ocaml-modules/gmetadom/default.nix b/pkgs/development/ocaml-modules/gmetadom/default.nix
index f1ec69143b07..f0a9387a537e 100644
--- a/pkgs/development/ocaml-modules/gmetadom/default.nix
+++ b/pkgs/development/ocaml-modules/gmetadom/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation {
 
   meta = {
     homepage = http://gmetadom.sourceforge.net/;
-    description = "GMetaDOM is a collection of librares, each library providing a DOM implementation";
+    description = "A collection of librares, each library providing a DOM implementation";
     license = stdenv.lib.licenses.lgpl21Plus;
     maintainers = [ stdenv.lib.maintainers.roconnor ];
   };
diff --git a/pkgs/development/ocaml-modules/ocaml-text/default.nix b/pkgs/development/ocaml-modules/ocaml-text/default.nix
index 44b30b368b32..c82785e4aa94 100644
--- a/pkgs/development/ocaml-modules/ocaml-text/default.nix
+++ b/pkgs/development/ocaml-modules/ocaml-text/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
 
   meta = {
     homepage = "http://ocaml-text.forge.ocamlcore.org/";
-    description = "OCaml-Text is a library for dealing with ``text'', i.e. sequence of unicode characters, in a convenient way. ";
+    description = "A library for convenient text manipulation";
     license = stdenv.lib.licenses.bsd3;
     platforms = ocaml.meta.platforms;
   };
diff --git a/pkgs/development/ocaml-modules/ulex/0.8/default.nix b/pkgs/development/ocaml-modules/ulex/0.8/default.nix
index 77ffa7528981..eddc71aeace2 100644
--- a/pkgs/development/ocaml-modules/ulex/0.8/default.nix
+++ b/pkgs/development/ocaml-modules/ulex/0.8/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation {
 
   meta = {
     homepage = http://www.cduce.org/download.html;
-    description = "ulex is a lexer generator for Unicode and OCaml";
+    description = "A lexer generator for Unicode and OCaml";
     license = stdenv.lib.licenses.mit;
     maintainers = [ stdenv.lib.maintainers.roconnor ];
   };
diff --git a/pkgs/development/ocaml-modules/ulex/default.nix b/pkgs/development/ocaml-modules/ulex/default.nix
index 123641ba1ac0..28950078f39e 100644
--- a/pkgs/development/ocaml-modules/ulex/default.nix
+++ b/pkgs/development/ocaml-modules/ulex/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation {
 
   meta = {
     homepage = http://www.cduce.org/download.html;
-    description = "ulex is a lexer generator for Unicode and OCaml";
+    description = "A lexer generator for Unicode and OCaml";
     license = stdenv.lib.licenses.mit;
     platforms = stdenv.lib.platforms.linux;
     maintainers = [ stdenv.lib.maintainers.roconnor ];
diff --git a/pkgs/development/tools/misc/checkbashisms/default.nix b/pkgs/development/tools/misc/checkbashisms/default.nix
index 9c48227c9a83..1585b126961b 100644
--- a/pkgs/development/tools/misc/checkbashisms/default.nix
+++ b/pkgs/development/tools/misc/checkbashisms/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = http://sourceforge.net/projects/checkbaskisms/;
-    description = "Performs basic checks on shell scripts for the presence of non portable syntax";
+    description = "Check shell scripts for non-portable syntax";
     license = stdenv.lib.licenses.gpl2;
   };
 
diff --git a/pkgs/development/tools/ocaml/camlidl/default.nix b/pkgs/development/tools/ocaml/camlidl/default.nix
index dee605ced570..7a980c69c183 100644
--- a/pkgs/development/tools/ocaml/camlidl/default.nix
+++ b/pkgs/development/tools/ocaml/camlidl/default.nix
@@ -37,7 +37,7 @@ stdenv.mkDerivation {
   '';
 
   meta = {
-    description = "CamlIDL is a stub code generator and COM binding for Objective Caml";
+    description = "A stub code generator and COM binding for Objective Caml";
     homepage = "${webpage}";
     license = "LGPL";
     maintainers = [ stdenv.lib.maintainers.roconnor ];
diff --git a/pkgs/development/tools/parsing/hammer/default.nix b/pkgs/development/tools/parsing/hammer/default.nix
index f04d773c374b..5392f14926b8 100644
--- a/pkgs/development/tools/parsing/hammer/default.nix
+++ b/pkgs/development/tools/parsing/hammer/default.nix
@@ -15,13 +15,15 @@ stdenv.mkDerivation rec {
   installPhase = "scons prefix=$out install";
 
   meta = with stdenv.lib; {
-    description = "Hammer is a parsing library";
-    longDescription = "Hammer is a parsing library. Like many modern parsing libraries,
-	       it provides a parser combinator interface for writing grammars
-	       as inline domain-specific languages, but Hammer also provides a
-	       variety of parsing backends. It's also bit-oriented rather than
-	       character-oriented, making it ideal for parsing binary data such
-	       as images, network packets, audio, and executables.";
+    description = "A bit-oriented parser combinator library";
+    longDescription = ''
+      Hammer is a parsing library. Like many modern parsing libraries,
+      it provides a parser combinator interface for writing grammars
+      as inline domain-specific languages, but Hammer also provides a
+      variety of parsing backends. It's also bit-oriented rather than
+      character-oriented, making it ideal for parsing binary data such
+      as images, network packets, audio, and executables.
+    '';
     homepage = https://github.com/UpstandingHackers/hammer;
     license = licenses.gpl2;
     platforms = platforms.linux;
diff --git a/pkgs/development/tools/profiling/gprof2dot/default.nix b/pkgs/development/tools/profiling/gprof2dot/default.nix
new file mode 100644
index 000000000000..38315116eeb7
--- /dev/null
+++ b/pkgs/development/tools/profiling/gprof2dot/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchFromGitHub, pythonPackages }:
+
+pythonPackages.buildPythonPackage {
+  name = "gprof2dot-2015-04-27";
+
+  src = fetchFromGitHub {
+    owner = "jrfonseca";
+    repo = "gprof2dot";
+    rev = "6fbb81559609c12e7c64ae5dce7d102a414a7514";
+    sha256 = "1fff7w6dm6lld11hp2ij97f85ma1154h62dvchq19c5jja3zjw3c";
+  };
+
+  meta = with stdenv.lib; {
+    homepage = "https://github.com/jrfonseca/gprof2dot";
+    description = "Python script to convert the output from many profilers into a dot graph";
+    license = licenses.lgpl3Plus;
+    platforms = platforms.linux;
+  };
+}