summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/adoptopenjdk-bin/jdk-darwin-base.nix59
-rw-r--r--pkgs/development/compilers/adoptopenjdk-bin/jdk-linux-base.nix119
-rw-r--r--pkgs/development/compilers/adoptopenjdk-bin/jdk11-darwin.nix26
-rw-r--r--pkgs/development/compilers/adoptopenjdk-bin/jdk11-linux.nix36
-rw-r--r--pkgs/development/compilers/closure/default.nix4
-rw-r--r--pkgs/development/compilers/crystal/default.nix4
-rw-r--r--pkgs/development/compilers/cudatoolkit/default.nix40
-rw-r--r--pkgs/development/compilers/gcc-arm-embedded/6/default.nix45
-rw-r--r--pkgs/development/compilers/gcc-arm-embedded/7/default.nix39
-rw-r--r--pkgs/development/compilers/gcc-arm-embedded/default.nix50
-rw-r--r--pkgs/development/compilers/gcc/4.8/default.nix29
-rw-r--r--pkgs/development/compilers/gcc/4.9/default.nix29
-rw-r--r--pkgs/development/compilers/gcc/5/default.nix29
-rw-r--r--pkgs/development/compilers/gcc/6/default.nix29
-rw-r--r--pkgs/development/compilers/gcc/7/default.nix41
-rw-r--r--pkgs/development/compilers/gcc/8/default.nix32
-rw-r--r--pkgs/development/compilers/gcc/snapshot/default.nix25
-rw-r--r--pkgs/development/compilers/ghc/7.10.3.nix194
-rw-r--r--pkgs/development/compilers/ghc/8.0.2.nix201
-rw-r--r--pkgs/development/compilers/ghc/8.2.1-binary.nix1
-rw-r--r--pkgs/development/compilers/ghc/8.6.2.nix (renamed from pkgs/development/compilers/ghc/8.4.3.nix)25
-rw-r--r--pkgs/development/compilers/ghc/ghc-8.0.2-no-cpp-warnings.patch23
-rw-r--r--pkgs/development/compilers/ghc/ghc-gold-linker.patch54
-rw-r--r--pkgs/development/compilers/ghc/ghc-no-madv-free.patch18
-rw-r--r--pkgs/development/compilers/ghc/relocation.patch27
-rw-r--r--pkgs/development/compilers/ghcjs/7.10/boot.patch104
-rw-r--r--pkgs/development/compilers/ghcjs/7.10/default.nix50
-rw-r--r--pkgs/development/compilers/ghcjs/7.10/shims.nix7
-rw-r--r--pkgs/development/compilers/ghcjs/7.10/stage2.nix344
-rw-r--r--pkgs/development/compilers/ghcjs/8.0/boot.patch86
-rw-r--r--pkgs/development/compilers/ghcjs/8.0/default.nix50
-rw-r--r--pkgs/development/compilers/ghcjs/8.0/shims.nix7
-rw-r--r--pkgs/development/compilers/ghcjs/8.0/stage2.nix545
-rw-r--r--pkgs/development/compilers/graalvm/default.nix44
-rw-r--r--pkgs/development/compilers/mentor/default.nix80
-rw-r--r--pkgs/development/compilers/microscheme/default.nix7
-rw-r--r--pkgs/development/compilers/mono/4.0.nix9
-rw-r--r--pkgs/development/compilers/mono/4.4.nix8
-rw-r--r--pkgs/development/compilers/mono/4.6.nix1
-rw-r--r--pkgs/development/compilers/nim/default.nix41
-rw-r--r--pkgs/development/compilers/ocaml/4.07.nix4
-rw-r--r--pkgs/development/compilers/openjdk/11.nix (renamed from pkgs/development/compilers/openjdk/10.nix)70
-rw-r--r--pkgs/development/compilers/openjdk/bootstrap.nix4
-rw-r--r--pkgs/development/compilers/openjdk/darwin/11.nix (renamed from pkgs/development/compilers/openjdk/darwin/10.nix)15
-rw-r--r--pkgs/development/compilers/oraclejdk/jdk10-linux.nix156
-rw-r--r--pkgs/development/compilers/sbcl/default.nix13
-rw-r--r--pkgs/development/compilers/swift/default.nix43
-rw-r--r--pkgs/development/compilers/swift/patches/0001-build-presets-linux-don-t-require-using-Ninja.patch2
-rw-r--r--pkgs/development/compilers/swift/patches/0002-build-presets-linux-allow-custom-install-prefix.patch2
-rw-r--r--pkgs/development/compilers/swift/patches/0004-build-presets-linux-plumb-extra-cmake-options.patch2
-rw-r--r--pkgs/development/compilers/swift/patches/build-script-pax.patch4
-rw-r--r--pkgs/development/compilers/swift/patches/glibc-arch-headers.patch13
-rw-r--r--pkgs/development/compilers/swift/patches/llvm-include-dirs.patch13
-rw-r--r--pkgs/development/compilers/swift/purity.patch2
-rw-r--r--pkgs/development/compilers/x11basic/default.nix48
55 files changed, 602 insertions, 2351 deletions
diff --git a/pkgs/development/compilers/adoptopenjdk-bin/jdk-darwin-base.nix b/pkgs/development/compilers/adoptopenjdk-bin/jdk-darwin-base.nix
new file mode 100644
index 000000000000..c2c13649f885
--- /dev/null
+++ b/pkgs/development/compilers/adoptopenjdk-bin/jdk-darwin-base.nix
@@ -0,0 +1,59 @@
+{ name
+, url
+, sha256
+}:
+
+{ swingSupport ? true # not used for now
+, stdenv
+, fetchurl
+}:
+
+let result = stdenv.mkDerivation rec {
+  inherit name;
+
+  src = fetchurl {
+    inherit url sha256;
+  };
+
+  # See: https://github.com/NixOS/patchelf/issues/10
+  dontStrip = 1;
+
+  installPhase = ''
+    cd ..
+
+    mv $sourceRoot $out
+
+    rm -rf $out/Home/demo
+
+    # Remove some broken manpages.
+    rm -rf $out/Home/man/ja*
+
+    # for backward compatibility
+    ln -s $out/Contents/Home $out/jre
+
+    ln -s $out/Contents/Home/* $out/
+
+    mkdir -p $out/nix-support
+
+    # Set JAVA_HOME automatically.
+    cat <<EOF >> $out/nix-support/setup-hook
+    if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi
+    EOF
+  '';
+
+  # FIXME: use multiple outputs or return actual JRE package
+  passthru.jre = result;
+
+  passthru.home = result;
+
+  # for backward compatibility
+  passthru.architecture = "";
+
+  meta = with stdenv.lib; {
+    license = licenses.gpl2Classpath;
+    description = "AdoptOpenJDK, prebuilt OpenJDK binary";
+    platforms = [ "x86_64-darwin" ]; # some inherit jre.meta.platforms
+    maintainers = with stdenv.lib.maintainers; [ taku0 ];
+  };
+
+}; in result
diff --git a/pkgs/development/compilers/adoptopenjdk-bin/jdk-linux-base.nix b/pkgs/development/compilers/adoptopenjdk-bin/jdk-linux-base.nix
new file mode 100644
index 000000000000..cf38ca9eaebe
--- /dev/null
+++ b/pkgs/development/compilers/adoptopenjdk-bin/jdk-linux-base.nix
@@ -0,0 +1,119 @@
+{ name
+, url
+, sha256
+}:
+
+{ swingSupport ? true
+, stdenv
+, fetchurl
+, file
+, xorg ? null
+, glib
+, libxml2
+, ffmpeg_2
+, libxslt
+, libGL
+, freetype
+, fontconfig
+, gtk2
+, pango
+, cairo
+, alsaLib
+, atk
+, gdk_pixbuf
+, zlib
+, elfutils
+}:
+
+assert swingSupport -> xorg != null;
+
+let
+  rSubPaths = [
+    "lib/jli"
+    "lib/server"
+    "lib/compressedrefs" # OpenJ9
+    "lib/j9vm" # OpenJ9
+    "lib"
+  ];
+
+  libraries = [
+    stdenv.cc.libc glib libxml2 ffmpeg_2 libxslt libGL
+    xorg.libXxf86vm alsaLib fontconfig freetype pango gtk2 cairo gdk_pixbuf
+    atk zlib elfutils
+  ] ++ (stdenv.lib.optionals swingSupport [
+    xorg.libX11 xorg.libXext xorg.libXtst xorg.libXi xorg.libXp xorg.libXt
+    xorg.libXrender
+    stdenv.cc.cc
+  ]);
+in
+
+let result = stdenv.mkDerivation rec {
+  inherit name;
+
+  src = fetchurl {
+    inherit url sha256;
+  };
+
+  nativeBuildInputs = [ file ];
+
+  # See: https://github.com/NixOS/patchelf/issues/10
+  dontStrip = 1;
+
+  installPhase = ''
+    cd ..
+
+    # Set PaX markings
+    exes=$(file $sourceRoot/bin/* 2> /dev/null | grep -E 'ELF.*(executable|shared object)' | sed -e 's/: .*$//')
+    for file in $exes; do
+      paxmark m "$file"
+      # On x86 for heap sizes over 700MB disable SEGMEXEC and PAGEEXEC as well.
+      ${stdenv.lib.optionalString stdenv.isi686 ''paxmark msp "$file"''}
+    done
+
+    mv $sourceRoot $out
+
+    rm -rf $out/demo
+
+    # Remove some broken manpages.
+    rm -rf $out/man/ja*
+
+    # for backward compatibility
+    ln -s $out $out/jre
+
+    mkdir -p $out/nix-support
+
+    # Set JAVA_HOME automatically.
+    cat <<EOF >> $out/nix-support/setup-hook
+    if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi
+    EOF
+  '';
+
+  postFixup = ''
+    rpath+="''${rpath:+:}${stdenv.lib.concatStringsSep ":" (map (a: "$out/${a}") rSubPaths)}"
+
+    # set all the dynamic linkers
+    find $out -type f -perm -0100 \
+        -exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+        --set-rpath "$rpath" {} \;
+
+    find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \;
+  '';
+
+  rpath = stdenv.lib.strings.makeLibraryPath libraries;
+
+  # FIXME: use multiple outputs or return actual JRE package
+  passthru.jre = result;
+
+  passthru.home = result;
+
+  # for backward compatibility
+  passthru.architecture = "";
+
+  meta = with stdenv.lib; {
+    license = licenses.gpl2Classpath;
+    description = "AdoptOpenJDK, prebuilt OpenJDK binary";
+    platforms = [ "x86_64-linux" ]; # some inherit jre.meta.platforms
+    maintainers = with stdenv.lib.maintainers; [ taku0 ];
+  };
+
+}; in result
diff --git a/pkgs/development/compilers/adoptopenjdk-bin/jdk11-darwin.nix b/pkgs/development/compilers/adoptopenjdk-bin/jdk11-darwin.nix
new file mode 100644
index 000000000000..77d9d85aaa93
--- /dev/null
+++ b/pkgs/development/compilers/adoptopenjdk-bin/jdk11-darwin.nix
@@ -0,0 +1,26 @@
+let
+  version = "11";
+  buildNumber = "28";
+  baseUrl = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-${version}%2B${buildNumber}";
+  makePackage = { packageType, vmType, sha256 }: import ./jdk-darwin-base.nix {
+    name = if packageType == "jdk"
+      then
+        "adoptopenjdk-${vmType}-bin-${version}"
+      else
+        "adoptopenjdk-${packageType}-${vmType}-bin-${version}";
+    url = "${baseUrl}/OpenJDK${version}-${packageType}_x64_mac_${vmType}_${version}_${buildNumber}.tar.gz";
+    inherit sha256;
+  };
+in
+{
+  jdk-hotspot = makePackage {
+    packageType = "jdk";
+    vmType = "hotspot";
+    sha256 = "ca0ec49548c626904061b491cae0a29b9b4b00fb34d8973dc217e10ab21fb0f3";
+  };
+  jre-hotspot = makePackage {
+    packageType = "jre";
+    vmType = "hotspot";
+    sha256 = "ef4dbfe5aed6ab2278fcc14db6cc73abbaab56e95f6ebb023790a7ebc6d7f30c";
+  };
+}
diff --git a/pkgs/development/compilers/adoptopenjdk-bin/jdk11-linux.nix b/pkgs/development/compilers/adoptopenjdk-bin/jdk11-linux.nix
new file mode 100644
index 000000000000..6e00782c3918
--- /dev/null
+++ b/pkgs/development/compilers/adoptopenjdk-bin/jdk11-linux.nix
@@ -0,0 +1,36 @@
+let
+  version = "11";
+  buildNumber = "28";
+  baseUrl = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-${version}%2B${buildNumber}";
+  makePackage = { packageType, vmType, sha256 }: import ./jdk-linux-base.nix {
+    name = if packageType == "jdk"
+      then
+        "adoptopenjdk-${vmType}-bin-${version}"
+      else
+        "adoptopenjdk-${packageType}-${vmType}-bin-${version}";
+    url = "${baseUrl}/OpenJDK${version}-${packageType}_x64_linux_${vmType}_${version}_${buildNumber}.tar.gz";
+    inherit sha256;
+  };
+in
+{
+  jdk-hotspot = makePackage {
+    packageType = "jdk";
+    vmType = "hotspot";
+    sha256 = "e1e18fc9ce2917473da3e0acb5a771bc651f600c0195a3cb40ef6f22f21660af";
+  };
+  jre-hotspot = makePackage {
+    packageType = "jre";
+    vmType = "hotspot";
+    sha256 = "346448142d46c6e51d0fadcaadbcde31251d7678922ec3eb010fcb1b6e17804c";
+  };
+  jdk-openj9 = makePackage {
+    packageType = "jdk";
+    vmType = "openj9";
+    sha256 = "fd77f22eb74078bcf974415abd888296284d2ceb81dbaca6ff32f59416ebc57f";
+  };
+  jre-openj9 = makePackage {
+    packageType = "jre";
+    vmType = "openj9";
+    sha256 = "83a7c95e6b2150a739bdd5e8a6fe0315904fd13d8867c95db67c0318304a2c42";
+  };
+}
diff --git a/pkgs/development/compilers/closure/default.nix b/pkgs/development/compilers/closure/default.nix
index 63b31c60d986..d26f731c21f9 100644
--- a/pkgs/development/compilers/closure/default.nix
+++ b/pkgs/development/compilers/closure/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "closure-compiler-${version}";
-  version = "20180805";
+  version = "20180910";
 
   src = fetchurl {
     url = "https://dl.google.com/closure-compiler/compiler-${version}.tar.gz";
-    sha256 = "1jis9ykbbynq6pa8sl1jy8888l2bk9g4xsiiiab51zn62shqnq26";
+    sha256 = "12k4cp9f8g03k3zf2g70pn6ybx8gk0hfh81ypiyb5hkfij95bi9k";
   };
 
   sourceRoot = ".";
diff --git a/pkgs/development/compilers/crystal/default.nix b/pkgs/development/compilers/crystal/default.nix
index 0648a245a4c8..51cea9810bc9 100644
--- a/pkgs/development/compilers/crystal/default.nix
+++ b/pkgs/development/compilers/crystal/default.nix
@@ -1,6 +1,6 @@
 { stdenv, lib, fetchFromGitHub, fetchurl, makeWrapper
 , gmp, openssl, readline, tzdata, libxml2, libyaml
-, boehmgc, libatomic_ops, pcre, libevent, libiconv, llvm, clang, which }:
+, boehmgc, libatomic_ops, pcre, libevent, libiconv, llvm, clang, which, zlib }:
 
 let
   binaryVersion = "0.26.0";
@@ -57,7 +57,7 @@ let
 
     buildInputs = [
       boehmgc libatomic_ops pcre libevent
-      llvm
+      llvm zlib openssl
     ] ++ stdenv.lib.optionals stdenv.isDarwin [
       libiconv
     ];
diff --git a/pkgs/development/compilers/cudatoolkit/default.nix b/pkgs/development/compilers/cudatoolkit/default.nix
index e44c21abe946..7a062a552150 100644
--- a/pkgs/development/compilers/cudatoolkit/default.nix
+++ b/pkgs/development/compilers/cudatoolkit/default.nix
@@ -149,8 +149,7 @@ let
       };
     };
 
-in {
-
+in rec {
   cudatoolkit_6 = common {
     version = "6.0.37";
     url = "http://developer.download.nvidia.com/compute/cuda/6_0/rel/installers/cuda_6.0.37_linux_64.run";
@@ -199,8 +198,8 @@ in {
     gcc = gcc6;
   };
 
-  cudatoolkit_9 = common {
-    version = "9.1.85.1";
+  cudatoolkit_9_1 = common {
+    version = "9.1.85.3";
     url = "https://developer.nvidia.com/compute/cuda/9.1/Prod/local_installers/cuda_9.1.85_387.26_linux";
     sha256 = "0lz9bwhck1ax4xf1fyb5nicb7l1kssslj518z64iirpy2qmwg5l4";
     runPatches = [
@@ -208,9 +207,40 @@ in {
         url = "https://developer.nvidia.com/compute/cuda/9.1/Prod/patches/1/cuda_9.1.85.1_linux";
         sha256 = "1f53ij5nb7g0vb5pcpaqvkaj1x4mfq3l0mhkfnqbk8sfrvby775g";
       })
+      (fetchurl {
+        url = "https://developer.nvidia.com/compute/cuda/9.1/Prod/patches/2/cuda_9.1.85.2_linux";
+        sha256 = "16g0w09h3bqmas4hy1m0y6j5ffyharslw52fn25gql57bfihg7ym";
+      })
+      (fetchurl {
+        url = "https://developer.nvidia.com/compute/cuda/9.1/Prod/patches/3/cuda_9.1.85.3_linux";
+        sha256 = "12mcv6f8z33z8y41ja8bv5p5iqhv2vx91mv3b5z6fcj7iqv98422";
+      })
     ];
     gcc = gcc6;
   };
 
-}
+  cudatoolkit_9_2 = common {
+    version = "9.2.148.1";
+    url = "https://developer.nvidia.com/compute/cuda/9.2/Prod2/local_installers/cuda_9.2.148_396.37_linux";
+    sha256 = "04c6v9b50l4awsf9w9zj5vnxvmc0hk0ypcfjksbh4vnzrz14wigm";
+    runPatches = [
+      (fetchurl {
+        url = "https://developer.nvidia.com/compute/cuda/9.2/Prod2/patches/1/cuda_9.2.148.1_linux";
+        sha256 = "1kx6l4yzsamk6q1f4vllcpywhbfr2j5wfl4h5zx8v6dgfpsjm2lw";
+      })
+    ];
+    gcc = gcc6;
+  };
+
+  cudatoolkit_9 = cudatoolkit_9_2;
+
+  cudatoolkit_10_0 = common {
+    version = "10.0.130";
+    url = "https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda_10.0.130_410.48_linux";
+    sha256 = "16p3bv1lwmyqpxil8r951h385sy9asc578afrc7lssa68c71ydcj";
 
+    gcc = gcc6;
+  };
+
+  cudatoolkit_10 = cudatoolkit_10_0;
+}
diff --git a/pkgs/development/compilers/gcc-arm-embedded/6/default.nix b/pkgs/development/compilers/gcc-arm-embedded/6/default.nix
deleted file mode 100644
index 945649b29781..000000000000
--- a/pkgs/development/compilers/gcc-arm-embedded/6/default.nix
+++ /dev/null
@@ -1,45 +0,0 @@
-{ stdenv, fetchurl, ncurses5, python27 }:
-
-stdenv.mkDerivation rec {
-  name = "gcc-arm-embedded-${version}";
-  version = "6-2017-q2-update";
-  subdir = "6-2017q2";
-
-  platformString =
-    if stdenv.isLinux then "linux"
-    else if stdenv.isDarwin then "mac"
-    else throw "unsupported platform";
-
-  urlString = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-${platformString}.tar.bz2";
-
-  src =
-    if stdenv.isLinux then fetchurl { url=urlString; sha256="1hvwi02mx34al525sngnl0cm7dkmzxfkb1brq9kvbv28wcplp3p6"; }
-    else if stdenv.isDarwin then fetchurl { url=urlString; sha256="0019ylpq4inq7p5gydpmc9m8ni72fz2csrjlqmgx1698998q0c3x"; }
-    else throw "unsupported platform";
-
-  phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
-
-  installPhase = ''
-    mkdir -p $out
-    cp -r * $out
-  '';
-
-  dontPatchELF = true;
-  dontStrip = true;
-
-  preFixup = ''
-    find $out -type f | while read f; do
-      patchelf $f > /dev/null 2>&1 || continue
-      patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
-      patchelf --set-rpath ${stdenv.lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true
-    done
-  '';
-
-  meta = {
-    description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors (Cortex-M0/M0+/M3/M4/M7, Cortex-R4/R5/R7/R8)";
-    homepage = https://developer.arm.com/open-source/gnu-toolchain/gnu-rm;
-    license = with stdenv.lib.licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ];
-    maintainers = with stdenv.lib.maintainers; [ vinymeuh ];
-    platforms = with stdenv.lib.platforms; linux ++ darwin;
-  };
-}
diff --git a/pkgs/development/compilers/gcc-arm-embedded/7/default.nix b/pkgs/development/compilers/gcc-arm-embedded/7/default.nix
deleted file mode 100644
index c22683dae03a..000000000000
--- a/pkgs/development/compilers/gcc-arm-embedded/7/default.nix
+++ /dev/null
@@ -1,39 +0,0 @@
-{ stdenv, lib, fetchurl, ncurses5, python27 }:
-
-with lib;
-
-stdenv.mkDerivation rec {
-  name = "gcc-arm-embedded-${version}";
-  version = "7-2018-q2-update";
-  subdir = "7-2018q2";
-
-  urlString = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-linux.tar.bz2";
-
-  src = fetchurl { url=urlString; sha256="0sgysp3hfpgrkcbfiwkp0a7ymqs02khfbrjabm52b5z61sgi05xv"; };
-
-  phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
-
-  installPhase = ''
-    mkdir -p $out
-    cp -r * $out
-  '';
-
-  dontPatchELF = true;
-  dontStrip = true;
-
-  preFixup = ''
-    find $out -type f | while read f; do
-      patchelf $f > /dev/null 2>&1 || continue
-      patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
-      patchelf --set-rpath ${stdenv.lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true
-    done
-  '';
-
-  meta = {
-    description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors (Cortex-M0/M0+/M3/M4/M7, Cortex-R4/R5/R7/R8)";
-    homepage = https://developer.arm.com/open-source/gnu-toolchain/gnu-rm;
-    license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ];
-    maintainers = with maintainers; [ prusnak ];
-    platforms = platforms.linux;
-  };
-}
diff --git a/pkgs/development/compilers/gcc-arm-embedded/default.nix b/pkgs/development/compilers/gcc-arm-embedded/default.nix
deleted file mode 100644
index 039b5a9ce362..000000000000
--- a/pkgs/development/compilers/gcc-arm-embedded/default.nix
+++ /dev/null
@@ -1,50 +0,0 @@
-{ stdenv, bzip2, patchelf, glibc, gcc, fetchurl, version, releaseType, sha256, ncurses
-, dirName ? null, subdirName ? null }:
-with stdenv.lib;
-let
-  versionParts = splitString "-" version; # 4.7 2013q3 20130916
-  majorVersion = elemAt versionParts 0; # 4.7
-  yearQuarter = elemAt versionParts 1; # 2013q3
-  underscoreVersion = replaceChars ["."] ["_"] version; # 4_7-2013q3-20130916
-  yearQuarterParts = splitString "q" yearQuarter; # 2013 3
-  year = elemAt yearQuarterParts 0; # 2013
-  quarter = elemAt yearQuarterParts 1; # 3
-  dirName_ = if dirName != null then dirName else majorVersion;
-  subdirName_ = if subdirName != null then subdirName
-    else "${majorVersion}-${year}-q${quarter}-${releaseType}"; # 4.7-2013-q3-update
-in
-stdenv.mkDerivation {
-  name = "gcc-arm-embedded-${version}";
-
-  src = fetchurl {
-    url = "https://launchpad.net/gcc-arm-embedded/${dirName_}/${subdirName_}/+download/gcc-arm-none-eabi-${underscoreVersion}-linux.tar.bz2";
-    sha256 = sha256;
-  };
-
-  nativeBuildInputs = [ bzip2 patchelf ];
-
-  dontPatchELF = true;
-
-  phases = "unpackPhase patchPhase installPhase";
-
-  installPhase = ''
-    mkdir -pv $out
-    cp -r ./* $out
-
-    for f in $(find $out); do
-      if [ -f "$f" ] && patchelf "$f" 2> /dev/null; then
-        patchelf --set-interpreter ${getLib glibc}/lib/ld-linux.so.2 \
-                 --set-rpath ${stdenv.lib.makeLibraryPath [ "$out" gcc ncurses ]} \
-                 "$f" || true
-      fi
-    done
-  '';
-
-  meta = with stdenv.lib; {
-    description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors (Cortex-M0/M0+/M3/M4, Cortex-R4/R5/R7)";
-    homepage = https://launchpad.net/gcc-arm-embedded;
-    license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ];
-    maintainers = [ maintainers.rasendubi ];
-    platforms = platforms.linux;
-  };
-}
diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix
index d9376f597a70..e585f296e877 100644
--- a/pkgs/development/compilers/gcc/4.8/default.nix
+++ b/pkgs/development/compilers/gcc/4.8/default.nix
@@ -130,7 +130,7 @@ let version = "4.8.5";
         "--disable-libmpx" # requires libc
       ] else [
         (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
-         else                "--with-headers=${getDev libcCross}/include")
+         else                "--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}")
         "--enable-__cxa_atexit"
         "--enable-long-long"
       ] ++
@@ -148,10 +148,15 @@ let version = "4.8.5";
             # In uclibc cases, libgomp needs an additional '-ldl'
             # and as I don't know how to pass it, I disable libgomp.
             "--disable-libgomp"
-          ] ++ [
-          "--enable-threads=posix"
-          "--enable-nls"
-          "--disable-decimal-float" # No final libdecnumber (it may work only in 386)
+          ]
+          ++ optional (targetPlatform.libc == "newlib") "--with-newlib"
+          ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc"
+          ++ [
+            "--enable-threads=${if targetPlatform.isUnix then "posix"
+                                else if targetPlatform.isWindows then "win32"
+                                else "single"}"
+            "--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 targetPlatform != hostPlatform then "${targetPlatform.config}${stageNameAddon}-" else "";
@@ -270,7 +275,7 @@ stdenv.mkDerivation ({
       }"
     ] ++
 
-    (if enableMultilib
+    (if (enableMultilib || targetPlatform.isAvr)
       then ["--enable-multilib" "--disable-libquadmath"]
       else ["--disable-multilib"]) ++
     optional (!enableShared) "--disable-shared" ++
@@ -360,20 +365,20 @@ stdenv.mkDerivation ({
   EXTRA_TARGET_FLAGS = optionals
     (targetPlatform != hostPlatform && libcCross != null)
     ([
-      "-idirafter ${libcCross.dev}/include"
+      "-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
     ] ++ optionals (! crossStageStatic) [
-      "-B${libcCross.out}/lib"
+      "-B${libcCross.out}${libcCross.libdir or "/lib"}"
     ]);
 
   EXTRA_TARGET_LDFLAGS = optionals
     (targetPlatform != hostPlatform && libcCross != null)
     ([
-      "-Wl,-L${libcCross.out}/lib"
+      "-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
     ] ++ (if crossStageStatic then [
-        "-B${libcCross.out}/lib"
+        "-B${libcCross.out}${libcCross.libdir or "/lib"}"
       ] else [
-        "-Wl,-rpath,${libcCross.out}/lib"
-        "-Wl,-rpath-link,${libcCross.out}/lib"
+        "-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
+        "-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
     ]));
 
   passthru = {
diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix
index c60f54f1560c..9dae061ecbb3 100644
--- a/pkgs/development/compilers/gcc/4.9/default.nix
+++ b/pkgs/development/compilers/gcc/4.9/default.nix
@@ -135,7 +135,7 @@ let version = "4.9.4";
         "--disable-libmpx" # requires libc
       ] else [
         (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
-         else                "--with-headers=${getDev libcCross}/include")
+         else                "--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}")
         "--enable-__cxa_atexit"
         "--enable-long-long"
       ] ++
@@ -156,10 +156,15 @@ let version = "4.9.4";
             # In uclibc cases, libgomp needs an additional '-ldl'
             # and as I don't know how to pass it, I disable libgomp.
             "--disable-libgomp"
-          ] ++ [
-          "--enable-threads=posix"
-          "--enable-nls"
-          "--disable-decimal-float" # No final libdecnumber (it may work only in 386)
+          ]
+          ++ optional (targetPlatform.libc == "newlib") "--with-newlib"
+          ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc"
+          ++ [
+            "--enable-threads=${if targetPlatform.isUnix then "posix"
+                                else if targetPlatform.isWindows then "win32"
+                                else "single"}"
+            "--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 targetPlatform != hostPlatform then "${targetPlatform.config}${stageNameAddon}-" else "";
@@ -292,7 +297,7 @@ stdenv.mkDerivation ({
       }"
     ] ++
 
-    (if enableMultilib
+    (if (enableMultilib || targetPlatform.isAvr)
       then ["--enable-multilib" "--disable-libquadmath"]
       else ["--disable-multilib"]) ++
     optional (!enableShared) "--disable-shared" ++
@@ -381,20 +386,20 @@ stdenv.mkDerivation ({
   EXTRA_TARGET_FLAGS = optionals
     (targetPlatform != hostPlatform && libcCross != null)
     ([
-      "-idirafter ${getDev libcCross}/include"
+      "-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
     ] ++ optionals (! crossStageStatic) [
-      "-B${libcCross.out}/lib"
+      "-B${libcCross.out}${libcCross.libdir or "/lib"}"
     ]);
 
   EXTRA_TARGET_LDFLAGS = optionals
     (targetPlatform != hostPlatform && libcCross != null)
     ([
-      "-Wl,-L${libcCross.out}/lib"
+      "-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
     ] ++ (if crossStageStatic then [
-        "-B${libcCross.out}/lib"
+        "-B${libcCross.out}${libcCross.libdir or "/lib"}"
       ] else [
-        "-Wl,-rpath,${libcCross.out}/lib"
-        "-Wl,-rpath-link,${libcCross.out}/lib"
+        "-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
+        "-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
     ]));
 
   passthru =
diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix
index 47c849d2dcc8..fbc192752c72 100644
--- a/pkgs/development/compilers/gcc/5/default.nix
+++ b/pkgs/development/compilers/gcc/5/default.nix
@@ -122,7 +122,7 @@ let version = "5.5.0";
         "--disable-libmpx" # requires libc
       ] else [
         (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
-         else                "--with-headers=${getDev libcCross}/include")
+         else                "--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}")
         "--enable-__cxa_atexit"
         "--enable-long-long"
       ] ++
@@ -143,10 +143,15 @@ let version = "5.5.0";
             # In uclibc cases, libgomp needs an additional '-ldl'
             # and as I don't know how to pass it, I disable libgomp.
             "--disable-libgomp"
-          ] ++ [
-          "--enable-threads=posix"
-          "--enable-nls"
-          "--disable-decimal-float" # No final libdecnumber (it may work only in 386)
+          ]
+          ++ optional (targetPlatform.libc == "newlib") "--with-newlib"
+          ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc"
+          ++ [
+            "--enable-threads=${if targetPlatform.isUnix then "posix"
+                                else if targetPlatform.isWindows then "win32"
+                                else "single"}"
+            "--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 targetPlatform != hostPlatform then "${targetPlatform.config}${stageNameAddon}-" else "";
@@ -296,7 +301,7 @@ stdenv.mkDerivation ({
       }"
     ] ++
 
-    (if enableMultilib
+    (if (enableMultilib || targetPlatform.isAvr)
       then ["--enable-multilib" "--disable-libquadmath"]
       else ["--disable-multilib"]) ++
     optional (!enableShared) "--disable-shared" ++
@@ -387,20 +392,20 @@ stdenv.mkDerivation ({
   EXTRA_TARGET_FLAGS = optionals
     (targetPlatform != hostPlatform && libcCross != null)
     ([
-      "-idirafter ${getDev libcCross}/include"
+      "-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
     ] ++ optionals (! crossStageStatic) [
-      "-B${libcCross.out}/lib"
+      "-B${libcCross.out}${libcCross.libdir or "/lib"}"
     ]);
 
   EXTRA_TARGET_LDFLAGS = optionals
     (targetPlatform != hostPlatform && libcCross != null)
     ([
-      "-Wl,-L${libcCross.out}/lib"
+      "-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
     ] ++ (if crossStageStatic then [
-        "-B${libcCross.out}/lib"
+        "-B${libcCross.out}${libcCross.libdir or "/lib"}"
       ] else [
-        "-Wl,-rpath,${libcCross.out}/lib"
-        "-Wl,-rpath-link,${libcCross.out}/lib"
+        "-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
+        "-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
     ]));
 
   passthru =
diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix
index eeb57be97157..793752dee19e 100644
--- a/pkgs/development/compilers/gcc/6/default.nix
+++ b/pkgs/development/compilers/gcc/6/default.nix
@@ -120,7 +120,7 @@ let version = "6.4.0";
         "--disable-libmpx" # requires libc
       ] else [
         (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
-         else                "--with-headers=${getDev libcCross}/include")
+         else                "--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}")
         "--enable-__cxa_atexit"
         "--enable-long-long"
       ] ++
@@ -143,10 +143,15 @@ let version = "6.4.0";
             "--disable-libgomp"
             # musl at least, disable: https://git.buildroot.net/buildroot/commit/?id=873d4019f7fb00f6a80592224236b3ba7d657865
             "--disable-libmpx"
-          ] ++ [
-          "--enable-threads=posix"
-          "--enable-nls"
-          "--disable-decimal-float" # No final libdecnumber (it may work only in 386)
+          ]
+          ++ optional (targetPlatform.libc == "newlib") "--with-newlib"
+          ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc"
+          ++ [
+            "--enable-threads=${if targetPlatform.isUnix then "posix"
+                                else if targetPlatform.isWindows then "win32"
+                                else "single"}"
+            "--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 targetPlatform != hostPlatform then "${targetPlatform.config}${stageNameAddon}-" else "";
@@ -301,7 +306,7 @@ stdenv.mkDerivation ({
       }"
     ] ++
 
-    (if enableMultilib
+    (if (enableMultilib || targetPlatform.isAvr)
       then ["--enable-multilib" "--disable-libquadmath"]
       else ["--disable-multilib"]) ++
     optional (!enableShared) "--disable-shared" ++
@@ -391,20 +396,20 @@ stdenv.mkDerivation ({
   EXTRA_TARGET_FLAGS = optionals
     (targetPlatform != hostPlatform && libcCross != null)
     ([
-      "-idirafter ${getDev libcCross}/include"
+      "-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
     ] ++ optionals (! crossStageStatic) [
-      "-B${libcCross.out}/lib"
+      "-B${libcCross.out}${libcCross.libdir or "/lib"}"
     ]);
 
   EXTRA_TARGET_LDFLAGS = optionals
     (targetPlatform != hostPlatform && libcCross != null)
     ([
-      "-Wl,-L${libcCross.out}/lib"
+      "-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
     ] ++ (if crossStageStatic then [
-        "-B${libcCross.out}/lib"
+        "-B${libcCross.out}${libcCross.libdir or "/lib"}"
       ] else [
-        "-Wl,-rpath,${libcCross.out}/lib"
-        "-Wl,-rpath-link,${libcCross.out}/lib"
+        "-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
+        "-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
     ]));
 
   passthru =
diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix
index 59897ccff426..c75a6c6e68f8 100644
--- a/pkgs/development/compilers/gcc/7/default.nix
+++ b/pkgs/development/compilers/gcc/7/default.nix
@@ -67,7 +67,7 @@ let version = "7.3.0";
       [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as"
         "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++
       (if crossMingw && crossStageStatic then [
-        "--with-headers=${libcCross}/include"
+        "--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}"
         "--with-gcc"
         "--with-gnu-as"
         "--with-gnu-ld"
@@ -92,7 +92,7 @@ let version = "7.3.0";
         "--disable-libmpx" # requires libc
       ] else [
         (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
-         else                "--with-headers=${getDev libcCross}/include")
+         else                "--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}")
         "--enable-__cxa_atexit"
         "--enable-long-long"
       ] ++
@@ -115,11 +115,17 @@ let version = "7.3.0";
             "--disable-libgomp"
             # musl at least, disable: https://git.buildroot.net/buildroot/commit/?id=873d4019f7fb00f6a80592224236b3ba7d657865
             "--disable-libmpx"
-          ] ++ [
-          "--enable-threads=posix"
-          "--enable-nls"
-          "--disable-decimal-float" # No final libdecnumber (it may work only in 386)
-        ]));
+          ]
+          ++ optional (targetPlatform.libc == "newlib") "--with-newlib"
+          ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc"
+          ++ [
+            "--enable-threads=${if targetPlatform.isUnix then "posix"
+                                else if targetPlatform.isWindows then "win32"
+                                else "single"}"
+            "--enable-nls"
+            # No final libdecnumber (it may work only in 386)
+            "--disable-decimal-float"
+          ]));
     stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
     crossNameAddon = if targetPlatform != hostPlatform then "${targetPlatform.config}${stageNameAddon}-" else "";
 
@@ -188,7 +194,12 @@ stdenv.mkDerivation ({
             sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR'
         ''
         )
-    else "");
+    else "")
+      + stdenv.lib.optionalString targetPlatform.isAvr ''
+        makeFlagsArray+=(
+           'LIMITS_H_TEST=false'
+        )
+      '';
 
   inherit noSysDirs staticCompiler crossStageStatic
     libcCross crossMingw;
@@ -267,7 +278,7 @@ stdenv.mkDerivation ({
       }"
     ] ++
 
-    (if enableMultilib
+    (if (enableMultilib || targetPlatform.isAvr)
       then ["--enable-multilib" "--disable-libquadmath"]
       else ["--disable-multilib"]) ++
     optional (!enableShared) "--disable-shared" ++
@@ -334,20 +345,20 @@ stdenv.mkDerivation ({
   EXTRA_TARGET_FLAGS = optionals
     (targetPlatform != hostPlatform && libcCross != null)
     ([
-      "-idirafter ${getDev libcCross}/include"
+      "-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
     ] ++ optionals (! crossStageStatic) [
-      "-B${libcCross.out}/lib"
+      "-B${libcCross.out}${libcCross.libdir or "/lib"}"
     ]);
 
   EXTRA_TARGET_LDFLAGS = optionals
     (targetPlatform != hostPlatform && libcCross != null)
     ([
-      "-Wl,-L${libcCross.out}/lib"
+      "-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
     ] ++ (if crossStageStatic then [
-        "-B${libcCross.out}/lib"
+        "-B${libcCross.out}${libcCross.libdir or "/lib"}"
       ] else [
-        "-Wl,-rpath,${libcCross.out}/lib"
-        "-Wl,-rpath-link,${libcCross.out}/lib"
+        "-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
+        "-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
     ]));
 
   passthru =
diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix
index 7842110a2146..bcac577712aa 100644
--- a/pkgs/development/compilers/gcc/8/default.nix
+++ b/pkgs/development/compilers/gcc/8/default.nix
@@ -87,7 +87,7 @@ let version = "8.2.0";
         "--disable-libmpx" # requires libc
       ] else [
         (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
-         else                "--with-headers=${getDev libcCross}/include")
+         else                "--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}")
         "--enable-__cxa_atexit"
         "--enable-long-long"
       ] ++
@@ -110,10 +110,15 @@ let version = "8.2.0";
             "--disable-libgomp"
             # musl at least, disable: https://git.buildroot.net/buildroot/commit/?id=873d4019f7fb00f6a80592224236b3ba7d657865
             "--disable-libmpx"
-          ] ++ [
-          "--enable-threads=posix"
-          "--enable-nls"
-          "--disable-decimal-float" # No final libdecnumber (it may work only in 386)
+          ]
+          ++ optional (targetPlatform.libc == "newlib") "--with-newlib"
+          ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc"
+          ++ [
+            "--enable-threads=${if targetPlatform.isUnix then "posix"
+                                else if targetPlatform.isWindows then "win32"
+                                else "single"}"
+            "--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 targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
@@ -261,7 +266,7 @@ stdenv.mkDerivation ({
       }"
     ] ++
 
-    (if enableMultilib
+    (if (enableMultilib || targetPlatform.isAvr)
       then ["--enable-multilib" "--disable-libquadmath"]
       else ["--disable-multilib"]) ++
     optional (!enableShared) "--disable-shared" ++
@@ -322,23 +327,16 @@ stdenv.mkDerivation ({
 
   LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib));
 
-  EXTRA_TARGET_FLAGS = optionals
-    (targetPlatform != hostPlatform && libcCross != null)
-    ([
-      "-idirafter ${getDev libcCross}/include"
-    ] ++ optionals (! crossStageStatic) [
-      "-B${libcCross.out}/lib"
-    ]);
 
   EXTRA_TARGET_LDFLAGS = optionals
     (targetPlatform != hostPlatform && libcCross != null)
     ([
-      "-Wl,-L${libcCross.out}/lib"
+      "-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
     ] ++ (if crossStageStatic then [
-        "-B${libcCross.out}/lib"
+        "-B${libcCross.out}${libcCross.libdir or "/lib"}"
       ] else [
-        "-Wl,-rpath,${libcCross.out}/lib"
-        "-Wl,-rpath-link,${libcCross.out}/lib"
+        "-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
+        "-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
     ]));
 
   passthru =
diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix
index 0de6be36c351..a308abd9c16f 100644
--- a/pkgs/development/compilers/gcc/snapshot/default.nix
+++ b/pkgs/development/compilers/gcc/snapshot/default.nix
@@ -104,10 +104,15 @@ let version = "7-20170409";
             # In uclibc cases, libgomp needs an additional '-ldl'
             # and as I don't know how to pass it, I disable libgomp.
             "--disable-libgomp"
-          ] ++ [
-          "--enable-threads=posix"
-          "--enable-nls"
-          "--disable-decimal-float" # No final libdecnumber (it may work only in 386)
+          ]
+          ++ optional (targetPlatform.libc == "newlib") "--with-newlib"
+          ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc"
+          ++ [
+            "--enable-threads=${if targetPlatform.isUnix then "posix"
+                                else if targetPlatform.isWindows then "win32"
+                                else "single"}"
+            "--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 targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
@@ -290,20 +295,20 @@ stdenv.mkDerivation ({
   EXTRA_TARGET_FLAGS = optionals
     (targetPlatform != hostPlatform && libcCross != null)
     ([
-      "-idirafter ${getDev libcCross}/include"
+      "-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
     ] ++ optionals (! crossStageStatic) [
-      "-B${libcCross.out}/lib"
+      "-B${libcCross.out}${libcCross.libdir or "/lib"}"
     ]);
 
   EXTRA_TARGET_LDFLAGS = optionals
     (targetPlatform != hostPlatform && libcCross != null)
     ([
-      "-Wl,-L${libcCross.out}/lib"
+      "-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
     ] ++ (if crossStageStatic then [
-        "-B${libcCross.out}/lib"
+        "-B${libcCross.out}${libcCross.libdir or "/lib"}"
       ] else [
-        "-Wl,-rpath,${libcCross.out}/lib"
-        "-Wl,-rpath-link,${libcCross.out}/lib"
+        "-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
+        "-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
     ]));
 
   passthru =
diff --git a/pkgs/development/compilers/ghc/7.10.3.nix b/pkgs/development/compilers/ghc/7.10.3.nix
deleted file mode 100644
index b69ae80d0db5..000000000000
--- a/pkgs/development/compilers/ghc/7.10.3.nix
+++ /dev/null
@@ -1,194 +0,0 @@
-{ stdenv, targetPackages
-
-# build-tools
-, bootPkgs
-, coreutils, fetchurl, perl
-, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, libxml2, libxslt
-
-, libiconv ? null, ncurses
-
-, useLLVM ? !stdenv.targetPlatform.isx86
-, # LLVM is conceptually a run-time-only depedendency, but for
-  # non-x86, we need LLVM to bootstrap later stages, so it becomes a
-  # build-time dependency too.
-  buildLlvmPackages, llvmPackages
-
-, # If enabled, GHC will be built with the GPL-free but slower integer-simple
-  # library instead of the faster but GPLed integer-gmp library.
-  enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
-
-, # If enabled, use -fPIC when compiling static libs.
-  enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
-
-, # Whether to build dynamic libs for the standard library (on the target
-  # platform). Static libs are always built.
-  enableShared ? true
-
-, # What flavour to build. An empty string indicates no
-  # specific flavour and falls back to ghc default values.
-  ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "perf-cross"
-}:
-
-let
-  inherit (stdenv) buildPlatform hostPlatform targetPlatform;
-
-  inherit (bootPkgs) ghc;
-
-  # TODO(@Ericson2314) Make unconditional
-  targetPrefix = stdenv.lib.optionalString
-    (targetPlatform != hostPlatform)
-    "${targetPlatform.config}-";
-
-  docFixes = fetchurl {
-    url = "https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3a.patch";
-    sha256 = "1j45z4kcd3w1rzm4hapap2xc16bbh942qnzzdbdjcwqznsccznf0";
-  };
-
-  buildMK = ''
-    BuildFlavour = ${ghcFlavour}
-    ifneq \"\$(BuildFlavour)\" \"\"
-    include mk/flavours/\$(BuildFlavour).mk
-    endif
-    DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
-  '' + stdenv.lib.optionalString enableIntegerSimple ''
-    INTEGER_LIBRARY = integer-simple
-  '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
-    Stage1Only = YES
-    HADDOCK_DOCS = NO
-  '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
-    GhcLibHcOpts += -fPIC
-    GhcRtsHcOpts += -fPIC
-  '';
-
-  # Splicer will pull out correct variations
-  libDeps = platform: [ ncurses ]
-    ++ stdenv.lib.optional (!enableIntegerSimple) gmp
-    ++ stdenv.lib.optional (platform.libc != "glibc") libiconv;
-
-  toolsForTarget =
-    if hostPlatform == buildPlatform then
-      [ targetPackages.stdenv.cc ] ++ stdenv.lib.optional useLLVM llvmPackages.llvm
-    else assert targetPlatform == hostPlatform; # build != host == target
-      [ stdenv.cc ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm;
-
-  targetCC = builtins.head toolsForTarget;
-
-in
-stdenv.mkDerivation rec {
-  version = "7.10.3";
-  name = "${targetPrefix}ghc-${version}";
-
-  src = fetchurl {
-    url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz";
-    sha256 = "1vsgmic8csczl62ciz51iv8nhrkm72lyhbz7p7id13y2w7fcx46g";
-  };
-
-  enableParallelBuilding = true;
-
-  outputs = [ "out" "doc" ];
-
-  patches = [
-    docFixes
-    ./relocation.patch
-  ];
-
-  postPatch = "patchShebangs .";
-
-  # GHC is a bit confused on its cross terminology.
-  preConfigure = ''
-    for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
-      export "''${env#TARGET_}=''${!env}"
-    done
-    # GHC is a bit confused on its cross terminology, as these would normally be
-    # the *host* tools.
-    export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
-    export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
-    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld"
-    export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
-    export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
-    export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
-    export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
-    export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
-    export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
-
-    echo -n "${buildMK}" > mk/build.mk
-    sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
-  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
-    export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
-    export NIX_LDFLAGS+=" -no_dtrace_dof"
-  '';
-
-  # TODO(@Ericson2314): Always pass "--target" and always prefix.
-  configurePlatforms = [ "build" "host" ]
-    ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
-  # `--with` flags for libraries needed for RTS linker
-  configureFlags = [
-    "--datadir=$doc/share/doc/ghc"
-    "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
-  ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && ! enableIntegerSimple) [
-    "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
-  ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc") [
-    "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
-    "--enable-bootstrap-with-devel-snapshot"
-  ] ++ stdenv.lib.optionals (targetPlatform.isDarwin && targetPlatform.isAarch64) [
-    # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
-    "--disable-large-address-space"
-  ];
-
-  # Make sure we never relax`$PATH` and hooks support for compatability.
-  strictDeps = true;
-
-  nativeBuildInputs = [
-    perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42
-    ghc bootPkgs.hscolour
-  ];
-
-  # For building runtime libs
-  depsBuildTarget = toolsForTarget;
-
-  buildInputs = libDeps hostPlatform;
-
-  propagatedBuildInputs = [ targetPackages.stdenv.cc ]
-    ++ stdenv.lib.optional useLLVM llvmPackages.llvm;
-
-  depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform);
-  depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform);
-
-  # required, because otherwise all symbols from HSffi.o are stripped, and
-  # that in turn causes GHCi to abort
-  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
-
-  hardeningDisable = [ "format" ];
-
-  postInstall = ''
-    # Install the bash completion file.
-    install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
-
-    # Patch scripts to include "readelf" and "cat" in $PATH.
-    for i in "$out/bin/"*; do
-      test ! -h $i || continue
-      egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
-    done
-  '';
-
-  passthru = {
-    inherit bootPkgs targetPrefix;
-
-    inherit llvmPackages;
-    inherit enableShared;
-
-    # Our Cabal compiler name
-    haskellCompilerName = "ghc-7.10.3";
-  };
-
-  meta = {
-    homepage = http://haskell.org/ghc;
-    description = "The Glasgow Haskell Compiler";
-    maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ];
-    inherit (ghc.meta) license platforms;
-  };
-
-}
diff --git a/pkgs/development/compilers/ghc/8.0.2.nix b/pkgs/development/compilers/ghc/8.0.2.nix
deleted file mode 100644
index f7422d150ac0..000000000000
--- a/pkgs/development/compilers/ghc/8.0.2.nix
+++ /dev/null
@@ -1,201 +0,0 @@
-{ stdenv, targetPackages
-
-# build-tools
-, bootPkgs
-, coreutils, fetchpatch, fetchurl, perl, sphinx
-
-, libiconv ? null, ncurses
-
-, useLLVM ? !stdenv.targetPlatform.isx86
-, # LLVM is conceptually a run-time-only depedendency, but for
-  # non-x86, we need LLVM to bootstrap later stages, so it becomes a
-  # build-time dependency too.
-  buildLlvmPackages, llvmPackages
-
-, # If enabled, GHC will be built with the GPL-free but slower integer-simple
-  # library instead of the faster but GPLed integer-gmp library.
-  enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
-
-, # If enabled, use -fPIC when compiling static libs.
-  enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
-
-, # Whether to build dynamic libs for the standard library (on the target
-  # platform). Static libs are always built.
-  enableShared ? true
-
-, # What flavour to build. An empty string indicates no
-  # specific flavour and falls back to ghc default values.
-  ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "perf-cross"
-}:
-
-assert !enableIntegerSimple -> gmp != null;
-
-let
-  inherit (stdenv) buildPlatform hostPlatform targetPlatform;
-
-  inherit (bootPkgs) ghc;
-
-  # TODO(@Ericson2314) Make unconditional
-  targetPrefix = stdenv.lib.optionalString
-    (targetPlatform != hostPlatform)
-    "${targetPlatform.config}-";
-
-  buildMK = ''
-    BuildFlavour = ${ghcFlavour}
-    ifneq \"\$(BuildFlavour)\" \"\"
-    include mk/flavours/\$(BuildFlavour).mk
-    endif
-    DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
-    INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"}
-  '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
-    Stage1Only = YES
-    HADDOCK_DOCS = NO
-  '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
-    GhcLibHcOpts += -fPIC
-    GhcRtsHcOpts += -fPIC
-  '';
-
-  # Splicer will pull out correct variations
-  libDeps = platform: [ ncurses ]
-    ++ stdenv.lib.optional (!enableIntegerSimple) gmp
-    ++ stdenv.lib.optional (platform.libc != "glibc") libiconv;
-
-  toolsForTarget =
-    if hostPlatform == buildPlatform then
-      [ targetPackages.stdenv.cc ] ++ stdenv.lib.optional useLLVM llvmPackages.llvm
-    else assert targetPlatform == hostPlatform; # build != host == target
-      [ stdenv.cc ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm;
-
-  targetCC = builtins.head toolsForTarget;
-
-in
-stdenv.mkDerivation rec {
-  version = "8.0.2";
-  name = "${targetPrefix}ghc-${version}";
-
-  src = fetchurl {
-    url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz";
-    sha256 = "1c8qc4fhkycynk4g1f9hvk53dj6a1vvqi6bklqznns6hw59m8qhi";
-  };
-
-  enableParallelBuilding = true;
-
-  outputs = [ "out" "man" "doc" ];
-
-  patches = [
-    ./ghc-gold-linker.patch
-    (fetchpatch { # Unreleased 1.24.x commit
-      url = "https://github.com/haskell/cabal/commit/6394cb0b6eba91a8692a3d04b2b56935aed7cccd.patch";
-      sha256 = "14xxjg0nb1j1pw0riac3v385ka92qhxxblfmwyvbghz7kry6axy0";
-      stripLen = 1;
-      extraPrefix = "libraries/Cabal/";
-    })
-  ] ++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch
-    ++ stdenv.lib.optional stdenv.isDarwin ./ghc-8.0.2-no-cpp-warnings.patch
-    ++ stdenv.lib.optional stdenv.isDarwin ./backport-dylib-command-size-limit.patch;
-
-  postPatch = "patchShebangs .";
-
-  # GHC is a bit confused on its cross terminology.
-  preConfigure = ''
-    for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
-      export "''${env#TARGET_}=''${!env}"
-    done
-    # GHC is a bit confused on its cross terminology, as these would normally be
-    # the *host* tools.
-    export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
-    export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
-    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld"
-    export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
-    export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
-    export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
-    export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
-    export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
-    export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
-
-    echo -n "${buildMK}" > mk/build.mk
-    sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
-  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
-    export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
-    export NIX_LDFLAGS+=" -no_dtrace_dof"
-  '';
-
-  # TODO(@Ericson2314): Always pass "--target" and always prefix.
-  configurePlatforms = [ "build" "host" ]
-    ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
-  # `--with` flags for libraries needed for RTS linker
-  configureFlags = [
-    "--datadir=$doc/share/doc/ghc"
-    "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
-  ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && ! enableIntegerSimple) [
-    "--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
-  ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc") [
-    "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
-    "--enable-bootstrap-with-devel-snapshot"
-  ] ++ stdenv.lib.optionals (targetPlatform.isDarwin && targetPlatform.isAarch64) [
-    # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
-    "--disable-large-address-space"
-  ];
-
-  # Make sure we never relax`$PATH` and hooks support for compatability.
-  strictDeps = true;
-
-  nativeBuildInputs = [
-    perl sphinx
-    ghc bootPkgs.hscolour
-  ];
-
-  # For building runtime libs
-  depsBuildTarget = toolsForTarget;
-
-  buildInputs = libDeps hostPlatform;
-
-  propagatedBuildInputs = [ targetPackages.stdenv.cc ]
-    ++ stdenv.lib.optional useLLVM llvmPackages.llvm;
-
-  depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform);
-  depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform);
-
-  # required, because otherwise all symbols from HSffi.o are stripped, and
-  # that in turn causes GHCi to abort
-  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
-
-  hardeningDisable = [ "format" ];
-
-  postInstall = ''
-    for bin in "$out"/lib/${name}/bin/*; do
-      isELF "$bin" || continue
-      paxmark m "$bin"
-    done
-
-    # Install the bash completion file.
-    install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
-
-    # Patch scripts to include "readelf" and "cat" in $PATH.
-    for i in "$out/bin/"*; do
-      test ! -h $i || continue
-      egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
-    done
-  '';
-
-  passthru = {
-    inherit bootPkgs targetPrefix;
-
-    inherit llvmPackages;
-    inherit enableShared;
-
-    # Our Cabal compiler name
-    haskellCompilerName = "ghc-8.0.2";
-  };
-
-  meta = {
-    homepage = http://haskell.org/ghc;
-    description = "The Glasgow Haskell Compiler";
-    maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ];
-    inherit (ghc.meta) license platforms;
-  };
-
-}
diff --git a/pkgs/development/compilers/ghc/8.2.1-binary.nix b/pkgs/development/compilers/ghc/8.2.1-binary.nix
index 6caeaf20f64c..626c0d8ca9c2 100644
--- a/pkgs/development/compilers/ghc/8.2.1-binary.nix
+++ b/pkgs/development/compilers/ghc/8.2.1-binary.nix
@@ -75,6 +75,7 @@ stdenv.mkDerivation rec {
     # Some scripts used during the build need to have their shebangs patched
     ''
       patchShebangs ghc-${version}/utils/
+      patchShebangs ghc-${version}/configure
     '' +
 
     # Strip is harmful, see also below. It's important that this happens
diff --git a/pkgs/development/compilers/ghc/8.4.3.nix b/pkgs/development/compilers/ghc/8.6.2.nix
index e43f9a57d0a4..6470f7b02957 100644
--- a/pkgs/development/compilers/ghc/8.4.3.nix
+++ b/pkgs/development/compilers/ghc/8.6.2.nix
@@ -29,10 +29,6 @@
 , # What flavour to build. An empty string indicates no
   # specific flavour and falls back to ghc default values.
   ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "perf-cross"
-, # Whether to backport https://phabricator.haskell.org/D4388 for
-  # deterministic profiling symbol names, at the cost of a slightly
-  # non-standard GHC API
-  deterministicProfiling ? false
 }:
 
 assert !enableIntegerSimple -> gmp != null;
@@ -82,34 +78,23 @@ let
 
 in
 stdenv.mkDerivation (rec {
-  version = "8.4.3";
+  version = "8.6.2";
   name = "${targetPrefix}ghc-${version}";
 
   src = fetchurl {
     url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz";
-    sha256 = "1mk046vb561j75saz05rghhbkps46ym5aci4264dwc2qk3dayixf";
+    sha256 = "1mbn3n2ynmpfpb7jfnhpzzli31qqxqyi8ws71blws3i846fq3ana";
   };
 
   enableParallelBuilding = true;
 
   outputs = [ "out" "doc" ];
 
-  patches = [(fetchpatch {
-    url = "https://git.haskell.org/hsc2hs.git/patch/738f3666c878ee9e79c3d5e819ef8b3460288edf";
-    sha256 = "0plzsbfaq6vb1023lsarrjglwgr9chld4q3m99rcfzx0yx5mibp3";
-    extraPrefix = "utils/hsc2hs/";
-    stripLen = 1;
-  }) (fetchpatch rec { # https://phabricator.haskell.org/D5123
+  patches = [(fetchpatch rec { # https://phabricator.haskell.org/D5123
     url = "http://tarballs.nixos.org/sha256/${sha256}";
     name = "D5123.diff";
     sha256 = "0nhqwdamf2y4gbwqxcgjxs0kqx23w9gv5kj0zv6450dq19rji82n";
-  })] ++ stdenv.lib.optional deterministicProfiling
-    (fetchpatch rec {
-      url = "http://tarballs.nixos.org/sha256/${sha256}";
-      name = "D4388.diff";
-      sha256 = "0w6sdcvnqjlnlzpvnzw20b80v150ijjyjvs9548ildc1928j0w7s";
-    })
-    ++ stdenv.lib.optional stdenv.isDarwin ./backport-dylib-command-size-limit.patch;
+  })];
 
   postPatch = "patchShebangs .";
 
@@ -230,7 +215,7 @@ stdenv.mkDerivation (rec {
     inherit enableShared;
 
     # Our Cabal compiler name
-    haskellCompilerName = "ghc-8.4.3";
+    haskellCompilerName = "ghc-8.6.2";
   };
 
   meta = {
diff --git a/pkgs/development/compilers/ghc/ghc-8.0.2-no-cpp-warnings.patch b/pkgs/development/compilers/ghc/ghc-8.0.2-no-cpp-warnings.patch
deleted file mode 100644
index 90224df19f61..000000000000
--- a/pkgs/development/compilers/ghc/ghc-8.0.2-no-cpp-warnings.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- b/includes/rts/storage/ClosureMacros.h        2017-05-21 12:54:09.000000000 +0200
-+++ a/includes/rts/storage/ClosureMacros.h        2017-05-21 12:55:57.000000000 +0200
-@@ -499,8 +499,17 @@
-
-    -------------------------------------------------------------------------- */
-
--#define ZERO_SLOP_FOR_LDV_PROF     (defined(PROFILING))
--#define ZERO_SLOP_FOR_SANITY_CHECK (defined(DEBUG) && !defined(THREADED_RTS))
-+#if defined(PROFILING)
-+#define ZERO_SLOP_FOR_LDV_PROF 1
-+#else
-+#define ZERO_SLOP_FOR_LDV_PROF 0
-+#endif
-+
-+#if defined(DEBUG) && !defined(THREADED_RTS)
-+#define ZERO_SLOP_FOR_SANITY_CHECK 1
-+#else
-+#define ZERO_SLOP_FOR_SANITY_CHECK 0
-+#endif
-
- #if ZERO_SLOP_FOR_LDV_PROF || ZERO_SLOP_FOR_SANITY_CHECK
- #define OVERWRITING_CLOSURE(c) overwritingClosure(c)
-
diff --git a/pkgs/development/compilers/ghc/ghc-gold-linker.patch b/pkgs/development/compilers/ghc/ghc-gold-linker.patch
deleted file mode 100644
index edce7ef3a178..000000000000
--- a/pkgs/development/compilers/ghc/ghc-gold-linker.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 46fe80ab7c0013a929d0934e61429820042a70a9 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= <mail@nh2.me>
-Date: Fri, 21 Jul 2017 20:09:11 +0200
-Subject: [PATCH 1/2] base: Add `extra-libraries: m` because base uses libm
- functions.
-
-Linking with gold needs this because in contrast to ld, gold
-doesn't implicitly link libm.
-
-Found by Michael Bishop <cleverca22@gmail.com>.
----
- libraries/base/base.cabal | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/libraries/base/base.cabal b/libraries/base/base.cabal
-index f00fb8768e5..fd91f268ffe 100644
---- a/libraries/base/base.cabal
-+++ b/libraries/base/base.cabal
-@@ -342,6 +342,10 @@ Library
-         WCsubst.h
-         consUtils.h
- 
-+    -- Base uses libm functions. ld.bfd links libm implicitly when necessary.
-+    -- Other linkers, like gold, don't, so we have to declare it explicitly.
-+    extra-libraries: m
-+
-     -- OS Specific
-     if os(windows)
-         -- Windows requires some extra libraries for linking because the RTS
-
-From 900a8f4931e9bc6d3219d9263cfecfc6af8fc766 Mon Sep 17 00:00:00 2001
-From: michael bishop <cleverca22@gmail.com>
-Date: Sat, 22 Jul 2017 13:12:39 -0300
-Subject: [PATCH 2/2] also add -lm to ghc-prim
-
----
- libraries/ghc-prim/ghc-prim.cabal | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/libraries/ghc-prim/ghc-prim.cabal b/libraries/ghc-prim/ghc-prim.cabal
-index 00a029efedf..6db85dd69fc 100644
---- a/libraries/ghc-prim/ghc-prim.cabal
-+++ b/libraries/ghc-prim/ghc-prim.cabal
-@@ -42,6 +42,10 @@ Library
-         UnliftedFFITypes
- 
-     build-depends: rts == 1.0.*
-+    
-+    -- Base uses libm functions. ld.bfd links libm implicitly when necessary.
-+    -- Other linkers, like gold, don't, so we have to declare it explicitly.
-+    extra-libraries: m
- 
-     exposed-modules:
-         GHC.CString
diff --git a/pkgs/development/compilers/ghc/ghc-no-madv-free.patch b/pkgs/development/compilers/ghc/ghc-no-madv-free.patch
deleted file mode 100644
index 8fea9f920126..000000000000
--- a/pkgs/development/compilers/ghc/ghc-no-madv-free.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff --git a/rts/posix/OSMem.c b/rts/posix/OSMem.c
-index 99620ee..e052a84 100644
---- a/rts/posix/OSMem.c
-+++ b/rts/posix/OSMem.c
-@@ -523,13 +523,7 @@ void osDecommitMemory(void *at, W_ size)
-         sysErrorBelch("unable to make released memory unaccessible");
- #endif
- 
--#ifdef MADV_FREE
--    // Try MADV_FREE first, FreeBSD has both and MADV_DONTNEED
--    // just swaps memory out
--    r = madvise(at, size, MADV_FREE);
--#else
-     r = madvise(at, size, MADV_DONTNEED);
--#endif
-     if(r < 0)
-         sysErrorBelch("unable to decommit memory");
- }
diff --git a/pkgs/development/compilers/ghc/relocation.patch b/pkgs/development/compilers/ghc/relocation.patch
deleted file mode 100644
index b9becfc86b54..000000000000
--- a/pkgs/development/compilers/ghc/relocation.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Adding support for the R_X86_64_REX_GOTPCRELX relocation type. 
-This relocation is treated by the linker the same as the R_X86_64_GOTPCRELX type
-G + GOT + A - P to generate relative offsets to the GOT.
-The REX prefix has no influence in this stage.
-
-This caused breakage when enabling relro/bindnow hardening e.g. in ghcPaclages.vector
-
-Source: https://phabricator.haskell.org/D2303#67070
-diff --git a/rts/Linker.c b/rts/Linker.c
---- a/rts/Linker.c
-+++ b/rts/Linker.c
-@@ -5681,7 +5681,13 @@
-           *(Elf64_Sword *)P = (Elf64_Sword)value;
- #endif
-           break;
--
-+/* These two relocations were introduced in glibc 2.23 and binutils 2.26.
-+    But in order to use them the system which compiles the bindist for GHC needs
-+    to have glibc >= 2.23. So only use them if they're defined. */
-+#if defined(R_X86_64_REX_GOTPCRELX) && defined(R_X86_64_GOTPCRELX)
-+      case R_X86_64_REX_GOTPCRELX:
-+      case R_X86_64_GOTPCRELX:
-+#endif
-       case R_X86_64_GOTPCREL:
-       {
-           StgInt64 gotAddress = (StgInt64) &makeSymbolExtra(oc, ELF_R_SYM(info), S)->addr;
-
diff --git a/pkgs/development/compilers/ghcjs/7.10/boot.patch b/pkgs/development/compilers/ghcjs/7.10/boot.patch
deleted file mode 100644
index 9f4fa3a8b7ae..000000000000
--- a/pkgs/development/compilers/ghcjs/7.10/boot.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-diff --git a/src-bin/Boot.hs b/src-bin/Boot.hs
-index db8b12e..7b815c5 100644
---- a/src-bin/Boot.hs
-+++ b/src-bin/Boot.hs
-@@ -540,9 +540,7 @@ initPackageDB :: B ()
- initPackageDB = do
-   msg info "creating package databases"
-   initDB "--global" <^> beLocations . blGlobalDB
--  traverseOf_ _Just initUser <^> beLocations . blUserDBDir
-   where
--    initUser dir = rm_f (dir </> "package.conf") >> initDB "--user" (dir </> "package.conf.d")
-     initDB dbName db = do
-       rm_rf db >> mkdir_p db
-       ghcjs_pkg_ ["init", toTextI db] `catchAny_` return ()
-@@ -566,29 +564,22 @@ installDevelopmentTree = subTop $ do
-   msgD info $ "preparing development boot tree"
-   checkpoint' "ghcjs-boot-git" "ghcjs-boot repository already cloned and prepared" $ do
-     testGit "ghcjs-boot" >>= \case
--      Just False -> failWith "ghcjs-boot already exists and is not a git repository"
--      Just True  -> do
--        msg info "ghcjs-boot repository already exists but checkpoint not reached, cleaning first, then cloning"
--        rm_rf "ghcjs-boot"
-+      Just _ -> do
-+        msg info "ghcjs-boot repository already exists; initializing ghcjs-boot"
-         initGhcjsBoot
-       Nothing    -> do
-         msgD info "cloning ghcjs-boot git repository"
-         initGhcjsBoot
-   checkpoint' "shims-git" "shims repository already cloned" $ do
-     testGit "shims" >>= \case
--      Just False -> failWith "shims already exists and is not a git repository"
--      Just True  -> do
--        msgD info "shims repository already exists but checkpoint not reached, cleaning first, then cloning"
--        rm_rf "shims"
--        cloneGit shimsDescr "shims" bsrcShimsDevBranch bsrcShimsDev
-+      Just _ -> do
-+        msgD info "shims repository already exists; moving on"
-       Nothing    -> do
-         msgD info "cloning shims git repository"
-         cloneGit shimsDescr "shims" bsrcShimsDevBranch bsrcShimsDev
-   where
-     initGhcjsBoot = sub $ do
--      cloneGit bootDescr "ghcjs-boot"  bsrcBootDevBranch bsrcBootDev
-       cd "ghcjs-boot"
--      git_ ["submodule", "update", "--init", "--recursive"]
-       mapM_ patchPackage =<< allPackages
-       preparePrimops
-       buildGenPrim
-@@ -1141,7 +1132,7 @@ cabalStage1 pkgs = sub $ do
-   globalFlags <- cabalGlobalFlags
-   flags <- cabalInstallFlags (length pkgs == 1)
-   let args = globalFlags ++ ("install" : pkgs) ++
--             [ "--solver=topdown" -- the modular solver refuses to install stage1 packages
-+             [ "--allow-boot-library-installs"
-              ] ++ map ("--configure-option="<>) configureOpts ++ flags
-   checkInstallPlan pkgs args
-   cabal_ args
-@@ -1162,7 +1153,7 @@ cabalInstall pkgs = do
- -- uses somewhat fragile parsing of --dry-run output, find a better way
- checkInstallPlan :: [Package] -> [Text] -> B ()
- checkInstallPlan pkgs opts = do
--  plan <- cabal (opts ++ ["-v2", "--dry-run"])
-+  plan <- cabal (opts ++ ["-vverbose+nowrap", "--dry-run"])
-   when (hasReinstalls plan || hasUnexpectedInstalls plan || hasNewVersion plan) (err plan)
-   where
-     hasReinstalls = T.isInfixOf "(reinstall)"   -- reject reinstalls
-@@ -1201,14 +1192,14 @@ cabalInstallFlags parmakeGhcjs = do
-            , "--avoid-reinstalls"
-            , "--builddir",      "dist"
-            , "--with-compiler", ghcjs ^. pgmLocText
-+           , "--with-gcc",      "@CC@"
-            , "--with-hc-pkg",   ghcjsPkg ^. pgmLocText
--           , "--prefix",        toTextI instDir
-+           , "--prefix",        "@PREFIX@"
-+           , "--libdir",        "$prefix/lib/$compiler"
-+           , "--libsubdir",     "$pkgid"
-            , bool haddock "--enable-documentation" "--disable-documentation"
-            , "--haddock-html"
---- workaround for hoogle support being broken in haddock for GHC 7.10RC1
--#if !(__GLASGOW_HASKELL__ >= 709)
-            , "--haddock-hoogle"
--#endif
-            , "--haddock-hyperlink-source"
- -- don't slow down Windows builds too much, on other platforms we get this more
- -- or less for free, thanks to dynamic-too
-diff --git a/src/Compiler/Info.hs b/src/Compiler/Info.hs
-index 33a401f..e2405a7 100644
---- a/src/Compiler/Info.hs
-+++ b/src/Compiler/Info.hs
-@@ -48,13 +48,7 @@ compilerInfo nativeToo dflags = do
- 
- -- | the directory to use if started without -B flag
- getDefaultTopDir :: IO FilePath
--getDefaultTopDir = do
--  appdir <- getAppUserDataDirectory "ghcjs"
--  return (appdir </> subdir </> "ghcjs")
--      where
--        targetARCH = arch
--        targetOS   = os
--        subdir     = targetARCH ++ '-':targetOS ++ '-':getFullCompilerVersion
-+getDefaultTopDir = return "@PREFIX@/lib/ghcjs-@VERSION@"
- 
- getDefaultLibDir :: IO FilePath
- getDefaultLibDir = getDefaultTopDir
diff --git a/pkgs/development/compilers/ghcjs/7.10/default.nix b/pkgs/development/compilers/ghcjs/7.10/default.nix
deleted file mode 100644
index f18a094aa3cf..000000000000
--- a/pkgs/development/compilers/ghcjs/7.10/default.nix
+++ /dev/null
@@ -1,50 +0,0 @@
-{ fetchgit, fetchFromGitHub, bootPkgs, cabal-install }:
-
-bootPkgs.callPackage ../base.nix {
-  version = "0.2.0";
-
-  inherit bootPkgs cabal-install;
-
-  ghcjsSrc = fetchFromGitHub {
-    owner = "ghcjs";
-    repo = "ghcjs";
-    rev = "689c7753f50353dd05606ed79c51cd5a94d3922a";
-    sha256 = "076020a9gjv8ldj5ckm43sbzq9s6c5xj6lpd8v28ybpiama3m6b4";
-  };
-  ghcjsBootSrc = fetchgit {
-    url = git://github.com/ghcjs/ghcjs-boot.git;
-    rev = "8c549931da27ba9e607f77195208ec156c840c8a";
-    sha256 = "0yg9bnabja39qysh9pg1335qbvbc0r2mdw6cky94p7kavacndfdv";
-    fetchSubmodules = true;
-  };
-
-  shims = import ./shims.nix { inherit fetchFromGitHub; };
-  stage1Packages = [
-    "array"
-    "base"
-    "binary"
-    "bytestring"
-    "containers"
-    "deepseq"
-    "directory"
-    "filepath"
-    "ghc-boot"
-    "ghc-boot-th"
-    "ghc-prim"
-    "ghci"
-    "ghcjs-prim"
-    "ghcjs-th"
-    "integer-gmp"
-    "pretty"
-    "primitive"
-    "process"
-    "rts"
-    "template-haskell"
-    "time"
-    "transformers"
-    "unix"
-  ];
-  stage2 = import ./stage2.nix;
-
-  patches = [ ./boot.patch ];
-}
diff --git a/pkgs/development/compilers/ghcjs/7.10/shims.nix b/pkgs/development/compilers/ghcjs/7.10/shims.nix
deleted file mode 100644
index fa706699449a..000000000000
--- a/pkgs/development/compilers/ghcjs/7.10/shims.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-{ fetchFromGitHub }:
-fetchFromGitHub {
-  owner = "ghcjs";
-  repo = "shims";
-  rev = "b97015229c58eeab7c1d0bb575794b14a9f6efca";
-  sha256 = "1p5adkqvmb1gsv9hnn3if0rdpnaq3v9a1zkfdy282yw05jaaaggz";
-}
diff --git a/pkgs/development/compilers/ghcjs/7.10/stage2.nix b/pkgs/development/compilers/ghcjs/7.10/stage2.nix
deleted file mode 100644
index 3483afc99ef0..000000000000
--- a/pkgs/development/compilers/ghcjs/7.10/stage2.nix
+++ /dev/null
@@ -1,344 +0,0 @@
-{ ghcjsBoot }: { callPackage }:
-
-{
-  async = callPackage
-    ({ mkDerivation, base, HUnit, stdenv, stm, test-framework
-      , test-framework-hunit
-      }:
-      mkDerivation {
-        pname = "async";
-        version = "2.0.1.6";
-        src = "${ghcjsBoot}/boot/async";
-        doCheck = false;
-        libraryHaskellDepends = [ base stm ];
-        testHaskellDepends = [
-          base HUnit test-framework test-framework-hunit
-        ];
-        jailbreak = true;
-        homepage = https://github.com/simonmar/async;
-        description = "Run IO operations asynchronously and wait for their results";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  aeson = callPackage
-    ({ mkDerivation, attoparsec, base, bytestring, containers, deepseq
-      , dlist, ghc-prim, hashable, HUnit, mtl, QuickCheck, scientific
-      , stdenv, syb, template-haskell, test-framework
-      , test-framework-hunit, test-framework-quickcheck2, text, time
-      , transformers, unordered-containers, vector
-      }:
-      mkDerivation {
-        pname = "aeson";
-        version = "0.9.0.1";
-        src = "${ghcjsBoot}/boot/aeson";
-        doCheck = false;
-        libraryHaskellDepends = [
-          attoparsec base bytestring containers deepseq dlist ghc-prim
-          hashable mtl scientific syb template-haskell text time transformers
-          unordered-containers vector
-        ];
-        testHaskellDepends = [
-          attoparsec base bytestring containers ghc-prim HUnit QuickCheck
-          template-haskell test-framework test-framework-hunit
-          test-framework-quickcheck2 text time unordered-containers vector
-        ];
-        jailbreak = true;
-        homepage = https://github.com/bos/aeson;
-        description = "Fast JSON parsing and encoding";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  attoparsec = callPackage
-    ({ mkDerivation, array, base, bytestring, containers, deepseq
-      , QuickCheck, quickcheck-unicode, scientific, stdenv
-      , test-framework, test-framework-quickcheck2, text, transformers
-      , vector
-      }:
-      mkDerivation {
-        pname = "attoparsec";
-        version = "0.13.0.1";
-        src = "${ghcjsBoot}/boot/attoparsec";
-        doCheck = false;
-        libraryHaskellDepends = [
-          array base bytestring containers deepseq scientific text
-          transformers
-        ];
-        testHaskellDepends = [
-          array base bytestring containers deepseq QuickCheck
-          quickcheck-unicode scientific test-framework
-          test-framework-quickcheck2 text transformers vector
-        ];
-        jailbreak = true;
-        homepage = https://github.com/bos/attoparsec;
-        description = "Fast combinator parsing for bytestrings and text";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  case-insensitive = callPackage
-    ({ mkDerivation, base, bytestring, deepseq, hashable, HUnit, stdenv
-      , test-framework, test-framework-hunit, text
-      }:
-      mkDerivation {
-        pname = "case-insensitive";
-        version = "1.2.0.4";
-        src = "${ghcjsBoot}/boot/case-insensitive";
-        doCheck = false;
-        libraryHaskellDepends = [ base bytestring deepseq hashable text ];
-        testHaskellDepends = [
-          base bytestring HUnit test-framework test-framework-hunit text
-        ];
-        jailbreak = true;
-        homepage = https://github.com/basvandijk/case-insensitive;
-        description = "Case insensitive string comparison";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  dlist = callPackage
-    ({ mkDerivation, base, Cabal, deepseq, QuickCheck, stdenv }:
-      mkDerivation {
-        pname = "dlist";
-        version = "0.7.1.1";
-        src = "${ghcjsBoot}/boot/dlist";
-        doCheck = false;
-        libraryHaskellDepends = [ base deepseq ];
-        testHaskellDepends = [ base Cabal QuickCheck ];
-        jailbreak = true;
-        homepage = https://github.com/spl/dlist;
-        description = "Difference lists";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  extensible-exceptions = callPackage
-    ({ mkDerivation, base, stdenv }:
-      mkDerivation {
-        pname = "extensible-exceptions";
-        version = "0.1.1.4";
-        src = "${ghcjsBoot}/boot/extensible-exceptions";
-        doCheck = false;
-        libraryHaskellDepends = [ base ];
-        jailbreak = true;
-        description = "Extensible exceptions";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  hashable = callPackage
-    ({ mkDerivation, base, bytestring, ghc-prim, HUnit, integer-gmp
-      , QuickCheck, random, stdenv, test-framework, test-framework-hunit
-      , test-framework-quickcheck2, text, unix
-      }:
-      mkDerivation {
-        pname = "hashable";
-        version = "1.2.3.2";
-        src = "${ghcjsBoot}/boot/hashable";
-        doCheck = false;
-        libraryHaskellDepends = [
-          base bytestring ghc-prim integer-gmp text
-        ];
-        testHaskellDepends = [
-          base bytestring ghc-prim HUnit QuickCheck random test-framework
-          test-framework-hunit test-framework-quickcheck2 text unix
-        ];
-        jailbreak = true;
-        homepage = https://github.com/tibbe/hashable;
-        description = "A class for types that can be converted to a hash value";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  mtl = callPackage
-    ({ mkDerivation, base, stdenv, transformers }:
-      mkDerivation {
-        pname = "mtl";
-        version = "2.2.1";
-        src = "${ghcjsBoot}/boot/mtl";
-        doCheck = false;
-        libraryHaskellDepends = [ base transformers ];
-        jailbreak = true;
-        homepage = https://github.com/ekmett/mtl;
-        description = "Monad classes, using functional dependencies";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  old-time = callPackage
-    ({ mkDerivation, base, old-locale, stdenv }:
-      mkDerivation {
-        pname = "old-time";
-        version = "1.1.0.3";
-        src = "${ghcjsBoot}/boot/old-time";
-        doCheck = false;
-        libraryHaskellDepends = [ base old-locale ];
-        jailbreak = true;
-        description = "Time library";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  parallel = callPackage
-    ({ mkDerivation, array, base, containers, deepseq, stdenv }:
-      mkDerivation {
-        pname = "parallel";
-        version = "3.2.0.6";
-        src = "${ghcjsBoot}/boot/parallel";
-        doCheck = false;
-        libraryHaskellDepends = [ array base containers deepseq ];
-        jailbreak = true;
-        description = "Parallel programming library";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  scientific = callPackage
-    ({ mkDerivation, array, base, bytestring, deepseq, ghc-prim
-      , hashable, integer-gmp, QuickCheck, smallcheck, stdenv, tasty
-      , tasty-ant-xml, tasty-hunit, tasty-quickcheck, tasty-smallcheck
-      , text
-      }:
-      mkDerivation {
-        pname = "scientific";
-        version = "0.3.3.8";
-        src = "${ghcjsBoot}/boot/scientific";
-        doCheck = false;
-        libraryHaskellDepends = [
-          array base bytestring deepseq ghc-prim hashable integer-gmp text
-        ];
-        testHaskellDepends = [
-          base bytestring QuickCheck smallcheck tasty tasty-ant-xml
-          tasty-hunit tasty-quickcheck tasty-smallcheck text
-        ];
-        jailbreak = true;
-        homepage = https://github.com/basvandijk/scientific;
-        description = "Numbers represented using scientific notation";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  stm = callPackage
-    ({ mkDerivation, array, base, stdenv }:
-      mkDerivation {
-        pname = "stm";
-        version = "2.4.4";
-        src = "${ghcjsBoot}/boot/stm";
-        doCheck = false;
-        libraryHaskellDepends = [ array base ];
-        jailbreak = true;
-        description = "Software Transactional Memory";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  syb = callPackage
-    ({ mkDerivation, base, containers, HUnit, mtl, stdenv }:
-      mkDerivation {
-        pname = "syb";
-        version = "0.5.1";
-        src = "${ghcjsBoot}/boot/syb";
-        doCheck = false;
-        libraryHaskellDepends = [ base ];
-        testHaskellDepends = [ base containers HUnit mtl ];
-        jailbreak = true;
-        homepage = http://www.cs.uu.nl/wiki/GenericProgramming/SYB;
-        description = "Scrap Your Boilerplate";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  text = callPackage
-    ({ mkDerivation, array, base, binary, bytestring, deepseq, directory
-      , ghc-prim, HUnit, integer-gmp, QuickCheck, quickcheck-unicode
-      , random, stdenv, test-framework, test-framework-hunit
-      , test-framework-quickcheck2
-      }:
-      mkDerivation {
-        pname = "text";
-        version = "1.2.1.1";
-        src = "${ghcjsBoot}/boot/text";
-        doCheck = false;
-        libraryHaskellDepends = [
-          array base binary bytestring deepseq ghc-prim integer-gmp
-        ];
-        testHaskellDepends = [
-          array base binary bytestring deepseq directory ghc-prim HUnit
-          integer-gmp QuickCheck quickcheck-unicode random test-framework
-          test-framework-hunit test-framework-quickcheck2
-        ];
-        jailbreak = true;
-        homepage = https://github.com/bos/text;
-        description = "An efficient packed Unicode text type";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  unordered-containers = callPackage
-    ({ mkDerivation, base, ChasingBottoms, containers, deepseq, hashable
-      , HUnit, QuickCheck, stdenv, test-framework, test-framework-hunit
-      , test-framework-quickcheck2
-      }:
-      mkDerivation {
-        pname = "unordered-containers";
-        version = "0.2.5.1";
-        src = "${ghcjsBoot}/boot/unordered-containers";
-        doCheck = false;
-        libraryHaskellDepends = [ base deepseq hashable ];
-        testHaskellDepends = [
-          base ChasingBottoms containers hashable HUnit QuickCheck
-          test-framework test-framework-hunit test-framework-quickcheck2
-        ];
-        jailbreak = true;
-        homepage = https://github.com/tibbe/unordered-containers;
-        description = "Efficient hashing-based container types";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  vector = callPackage
-    ({ mkDerivation, base, deepseq, ghc-prim, primitive, QuickCheck
-      , random, stdenv, template-haskell, test-framework
-      , test-framework-quickcheck2, transformers
-      }:
-      mkDerivation {
-        pname = "vector";
-        version = "0.11.0.0";
-        src = "${ghcjsBoot}/boot/vector";
-        doCheck = false;
-        libraryHaskellDepends = [ base deepseq ghc-prim primitive ];
-        testHaskellDepends = [
-          base QuickCheck random template-haskell test-framework
-          test-framework-quickcheck2 transformers
-        ];
-        jailbreak = true;
-        homepage = https://github.com/haskell/vector;
-        description = "Efficient Arrays";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  ghcjs-base = callPackage
-    ({ mkDerivation, aeson, array, attoparsec, base, bytestring
-      , containers, deepseq, directory, dlist, ghc-prim, ghcjs-prim
-      , hashable, HUnit, integer-gmp, primitive, QuickCheck
-      , quickcheck-unicode, random, scientific, stdenv, test-framework
-      , test-framework-hunit, test-framework-quickcheck2, text, time
-      , transformers, unordered-containers, vector
-      }:
-      mkDerivation {
-        pname = "ghcjs-base";
-        version = "0.2.0.0";
-        src = "${ghcjsBoot}/ghcjs/ghcjs-base";
-        doCheck = false;
-        libraryHaskellDepends = [
-          aeson attoparsec base bytestring containers deepseq dlist ghc-prim
-          ghcjs-prim hashable integer-gmp primitive scientific text time
-          transformers unordered-containers vector
-        ];
-        testHaskellDepends = [
-          array base bytestring deepseq directory ghc-prim ghcjs-prim HUnit
-          primitive QuickCheck quickcheck-unicode random test-framework
-          test-framework-hunit test-framework-quickcheck2 text
-        ];
-        jailbreak = true;
-        homepage = https://github.com/ghcjs/ghcjs-base;
-        description = "Base library for GHCJS";
-        license = stdenv.lib.licenses.mit;
-      }) {};
-  Cabal = callPackage
-    ({ mkDerivation, array, base, binary, bytestring, containers
-      , deepseq, directory, extensible-exceptions, filepath, HUnit
-      , old-time, pretty, process, QuickCheck, regex-posix, stdenv
-      , test-framework, test-framework-hunit, test-framework-quickcheck2
-      , time, unix
-      }:
-      mkDerivation {
-        pname = "Cabal";
-        version = "1.22.8.0";
-        src = "${ghcjsBoot}/boot/cabal/Cabal";
-        doCheck = false;
-        libraryHaskellDepends = [
-          array base binary bytestring containers deepseq directory filepath
-          pretty process time unix
-        ];
-        testHaskellDepends = [
-          base bytestring containers directory extensible-exceptions filepath
-          HUnit old-time process QuickCheck regex-posix test-framework
-          test-framework-hunit test-framework-quickcheck2 unix
-        ];
-        jailbreak = true;
-        homepage = http://www.haskell.org/cabal/;
-        description = "A framework for packaging Haskell software";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-}
diff --git a/pkgs/development/compilers/ghcjs/8.0/boot.patch b/pkgs/development/compilers/ghcjs/8.0/boot.patch
deleted file mode 100644
index bbb5b30468cb..000000000000
--- a/pkgs/development/compilers/ghcjs/8.0/boot.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-diff --git a/src-bin/Boot.hs b/src-bin/Boot.hs
-index db8b12e..7b815c5 100644
---- a/src-bin/Boot.hs
-+++ b/src-bin/Boot.hs
-@@ -540,9 +540,7 @@ initPackageDB :: B ()
- initPackageDB = do
-   msg info "creating package databases"
-   initDB "--global" <^> beLocations . blGlobalDB
--  traverseOf_ _Just initUser <^> beLocations . blUserDBDir
-   where
--    initUser dir = rm_f (dir </> "package.conf") >> initDB "--user" (dir </> "package.conf.d")
-     initDB dbName db = do
-       rm_rf db >> mkdir_p db
-       ghcjs_pkg_ ["init", toTextI db] `catchAny_` return ()
-@@ -566,29 +564,22 @@ installDevelopmentTree = subTop $ do
-   msgD info $ "preparing development boot tree"
-   checkpoint' "ghcjs-boot-git" "ghcjs-boot repository already cloned and prepared" $ do
-     testGit "ghcjs-boot" >>= \case
--      Just False -> failWith "ghcjs-boot already exists and is not a git repository"
--      Just True  -> do
--        msg info "ghcjs-boot repository already exists but checkpoint not reached, cleaning first, then cloning"
--        rm_rf "ghcjs-boot"
-+      Just _ -> do
-+        msg info "ghcjs-boot repository already exists; initializing ghcjs-boot"
-         initGhcjsBoot
-       Nothing    -> do
-         msgD info "cloning ghcjs-boot git repository"
-         initGhcjsBoot
-   checkpoint' "shims-git" "shims repository already cloned" $ do
-     testGit "shims" >>= \case
--      Just False -> failWith "shims already exists and is not a git repository"
--      Just True  -> do
--        msgD info "shims repository already exists but checkpoint not reached, cleaning first, then cloning"
--        rm_rf "shims"
--        cloneGit shimsDescr "shims" bsrcShimsDevBranch bsrcShimsDev
-+      Just _ -> do
-+        msgD info "shims repository already exists; moving on"
-       Nothing    -> do
-         msgD info "cloning shims git repository"
-         cloneGit shimsDescr "shims" bsrcShimsDevBranch bsrcShimsDev
-   where
-     initGhcjsBoot = sub $ do
--      cloneGit bootDescr "ghcjs-boot"  bsrcBootDevBranch bsrcBootDev
-       cd "ghcjs-boot"
--      git_ ["submodule", "update", "--init", "--recursive"]
-       mapM_ patchPackage =<< allPackages
-       preparePrimops
-       buildGenPrim
-@@ -1201,14 +1192,14 @@ cabalInstallFlags parmakeGhcjs = do
-            , "--avoid-reinstalls"
-            , "--builddir",      "dist"
-            , "--with-compiler", ghcjs ^. pgmLocText
-+           , "--with-gcc",      "@CC@"
-            , "--with-hc-pkg",   ghcjsPkg ^. pgmLocText
--           , "--prefix",        toTextI instDir
-+           , "--prefix",        "@PREFIX@"
-+           , "--libdir",        "$prefix/lib/$compiler"
-+           , "--libsubdir",     "$pkgid"
-            , bool haddock "--enable-documentation" "--disable-documentation"
-            , "--haddock-html"
---- workaround for hoogle support being broken in haddock for GHC 7.10RC1
--#if !(__GLASGOW_HASKELL__ >= 709)
-            , "--haddock-hoogle"
--#endif
-            , "--haddock-hyperlink-source"
- -- don't slow down Windows builds too much, on other platforms we get this more
- -- or less for free, thanks to dynamic-too
-diff --git a/src/Compiler/Info.hs b/src/Compiler/Info.hs
-index 33a401f..e2405a7 100644
---- a/src/Compiler/Info.hs
-+++ b/src/Compiler/Info.hs
-@@ -48,13 +48,7 @@ compilerInfo nativeToo dflags = do
- 
- -- | the directory to use if started without -B flag
- getDefaultTopDir :: IO FilePath
--getDefaultTopDir = do
--  appdir <- getAppUserDataDirectory "ghcjs"
--  return (appdir </> subdir </> "ghcjs")
--      where
--        targetARCH = arch
--        targetOS   = os
--        subdir     = targetARCH ++ '-':targetOS ++ '-':getFullCompilerVersion
-+getDefaultTopDir = return "@PREFIX@/lib/ghcjs-@VERSION@"
- 
- getDefaultLibDir :: IO FilePath
- getDefaultLibDir = getDefaultTopDir
diff --git a/pkgs/development/compilers/ghcjs/8.0/default.nix b/pkgs/development/compilers/ghcjs/8.0/default.nix
deleted file mode 100644
index a786f536eb9b..000000000000
--- a/pkgs/development/compilers/ghcjs/8.0/default.nix
+++ /dev/null
@@ -1,50 +0,0 @@
-{ fetchgit, fetchFromGitHub, bootPkgs, cabal-install }:
-
-bootPkgs.callPackage ../base.nix {
-  version = "0.2.020170323";
-
-  inherit bootPkgs cabal-install;
-
-  ghcjsSrc = fetchFromGitHub {
-    owner = "ghcjs";
-    repo = "ghcjs";
-    rev = "2b3759942fb5b2fc1a58d314d9b098d4622fa6b6";
-    sha256 = "15asapg0va8dvcdycsx8dgk4xcpdnhml4h31wka6vvxf5anzz8aw";
-  };
-  ghcjsBootSrc = fetchgit {
-    url = git://github.com/ghcjs/ghcjs-boot.git;
-    rev = "106e144cca6529a1b9612c11aea5d6ef65b96745";
-    sha256 = "0gxg8iiwvm93x1dwhxypczn9qiz4m1xvj8i7cf4snfdy2jdyhi5l";
-    fetchSubmodules = true;
-  };
-
-  shims = import ./shims.nix { inherit fetchFromGitHub; };
-  stage1Packages = [
-    "array"
-    "base"
-    "binary"
-    "bytestring"
-    "containers"
-    "deepseq"
-    "directory"
-    "filepath"
-    "ghc-boot"
-    "ghc-boot-th"
-    "ghc-prim"
-    "ghci"
-    "ghcjs-prim"
-    "ghcjs-th"
-    "integer-gmp"
-    "pretty"
-    "primitive"
-    "process"
-    "rts"
-    "template-haskell"
-    "time"
-    "transformers"
-    "unix"
-  ];
-  stage2 = import ./stage2.nix;
-
-  patches = [ ./boot.patch ];
-}
diff --git a/pkgs/development/compilers/ghcjs/8.0/shims.nix b/pkgs/development/compilers/ghcjs/8.0/shims.nix
deleted file mode 100644
index a9a7f8d45e27..000000000000
--- a/pkgs/development/compilers/ghcjs/8.0/shims.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-{ fetchFromGitHub }:
-fetchFromGitHub {
-  owner = "ghcjs";
-  repo = "shims";
-  rev = "85395dce971e23a39e5f93af4ed139ca36d4e448";
-  sha256 = "1kqgik75jx681s1kjx1s7dryigr3m940c3zb9vy0r3psxrw6sf2g";
-}
diff --git a/pkgs/development/compilers/ghcjs/8.0/stage2.nix b/pkgs/development/compilers/ghcjs/8.0/stage2.nix
deleted file mode 100644
index 18c7a76dd3af..000000000000
--- a/pkgs/development/compilers/ghcjs/8.0/stage2.nix
+++ /dev/null
@@ -1,545 +0,0 @@
-{ ghcjsBoot }: { callPackage }:
-
-{
-  async = callPackage
-    ({ mkDerivation, base, HUnit, stdenv, stm, test-framework
-      , test-framework-hunit
-      }:
-      mkDerivation {
-        pname = "async";
-        version = "2.1.1";
-        src = "${ghcjsBoot}/boot/async";
-        doCheck = false;
-        libraryHaskellDepends = [ base stm ];
-        testHaskellDepends = [
-          base HUnit test-framework test-framework-hunit
-        ];
-        jailbreak = true;
-        homepage = "https://github.com/simonmar/async";
-        description = "Run IO operations asynchronously and wait for their results";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  aeson = callPackage
-    ({ mkDerivation, attoparsec, base, base-compat, base-orphans
-      , base16-bytestring, bytestring, containers, deepseq, directory
-      , dlist, filepath, generic-deriving, ghc-prim, hashable
-      , hashable-time, HUnit, integer-logarithms, QuickCheck
-      , quickcheck-instances, scientific, stdenv, tagged
-      , template-haskell, test-framework, test-framework-hunit
-      , test-framework-quickcheck2, text, th-abstraction, time
-      , time-locale-compat, unordered-containers, uuid-types, vector
-      }:
-      mkDerivation {
-        pname = "aeson";
-        version = "1.2.2.0";
-        src = "${ghcjsBoot}/boot/aeson";
-        doCheck = false;
-        libraryHaskellDepends = [
-          attoparsec base base-compat bytestring containers deepseq dlist
-          ghc-prim hashable scientific tagged template-haskell text
-          th-abstraction time time-locale-compat unordered-containers
-          uuid-types vector
-        ];
-        testHaskellDepends = [
-          attoparsec base base-compat base-orphans base16-bytestring
-          bytestring containers directory dlist filepath generic-deriving
-          ghc-prim hashable hashable-time HUnit integer-logarithms QuickCheck
-          quickcheck-instances scientific tagged template-haskell
-          test-framework test-framework-hunit test-framework-quickcheck2 text
-          time time-locale-compat unordered-containers uuid-types vector
-        ];
-        jailbreak = true;
-        homepage = "https://github.com/bos/aeson";
-        description = "Fast JSON parsing and encoding";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  attoparsec = callPackage
-    ({ mkDerivation, array, base, bytestring, case-insensitive
-      , containers, criterion, deepseq, directory, filepath, ghc-prim
-      , http-types, parsec, QuickCheck, quickcheck-unicode, scientific
-      , stdenv, tasty, tasty-quickcheck, text, transformers
-      , unordered-containers, vector
-      }:
-      mkDerivation {
-        pname = "attoparsec";
-        version = "0.13.1.0";
-        src = "${ghcjsBoot}/boot/attoparsec";
-        doCheck = false;
-        libraryHaskellDepends = [
-          array base bytestring containers deepseq scientific text
-          transformers
-        ];
-        testHaskellDepends = [
-          array base bytestring deepseq QuickCheck quickcheck-unicode
-          scientific tasty tasty-quickcheck text transformers vector
-        ];
-        benchmarkHaskellDepends = [
-          array base bytestring case-insensitive containers criterion deepseq
-          directory filepath ghc-prim http-types parsec scientific text
-          transformers unordered-containers vector
-        ];
-        jailbreak = true;
-        homepage = "https://github.com/bos/attoparsec";
-        description = "Fast combinator parsing for bytestrings and text";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  base-compat = callPackage
-    ({ mkDerivation, base, hspec, QuickCheck, stdenv, unix }:
-      mkDerivation {
-        pname = "base-compat";
-        version = "0.9.3";
-        src = "${ghcjsBoot}/boot/base-compat";
-        doCheck = false;
-        libraryHaskellDepends = [ base unix ];
-        testHaskellDepends = [ base hspec QuickCheck ];
-        jailbreak = true;
-        description = "A compatibility layer for base";
-        license = stdenv.lib.licenses.mit;
-      }) {};
-  bytestring-builder = callPackage
-    ({ mkDerivation, base, bytestring, deepseq, stdenv }:
-      mkDerivation {
-        pname = "bytestring-builder";
-        version = "0.10.8.1.0";
-        src = "${ghcjsBoot}/boot/bytestring-builder";
-        doCheck = false;
-        libraryHaskellDepends = [ base bytestring deepseq ];
-        jailbreak = true;
-        description = "The new bytestring builder, packaged outside of GHC";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  case-insensitive = callPackage
-    ({ mkDerivation, base, bytestring, criterion, deepseq, hashable
-      , HUnit, stdenv, test-framework, test-framework-hunit, text
-      }:
-      mkDerivation {
-        pname = "case-insensitive";
-        version = "1.2.0.8";
-        src = "${ghcjsBoot}/boot/case-insensitive";
-        doCheck = false;
-        libraryHaskellDepends = [ base bytestring deepseq hashable text ];
-        testHaskellDepends = [
-          base bytestring HUnit test-framework test-framework-hunit text
-        ];
-        benchmarkHaskellDepends = [ base bytestring criterion deepseq ];
-        jailbreak = true;
-        homepage = "https://github.com/basvandijk/case-insensitive";
-        description = "Case insensitive string comparison";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  dlist = callPackage
-    ({ mkDerivation, base, Cabal, deepseq, QuickCheck, stdenv }:
-      mkDerivation {
-        pname = "dlist";
-        version = "0.8.0.2";
-        src = "${ghcjsBoot}/boot/dlist";
-        doCheck = false;
-        libraryHaskellDepends = [ base deepseq ];
-        testHaskellDepends = [ base Cabal QuickCheck ];
-        jailbreak = true;
-        homepage = "https://github.com/spl/dlist";
-        description = "Difference lists";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  extensible-exceptions = callPackage
-    ({ mkDerivation, base, stdenv }:
-      mkDerivation {
-        pname = "extensible-exceptions";
-        version = "0.1.1.4";
-        src = "${ghcjsBoot}/boot/extensible-exceptions";
-        doCheck = false;
-        libraryHaskellDepends = [ base ];
-        jailbreak = true;
-        description = "Extensible exceptions";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  fail = callPackage
-    ({ mkDerivation, stdenv }:
-      mkDerivation {
-        pname = "fail";
-        version = "4.9.0.0";
-        src = "${ghcjsBoot}/boot/fail";
-        jailbreak = true;
-        homepage = "https://prime.haskell.org/wiki/Libraries/Proposals/MonadFail";
-        description = "Forward-compatible MonadFail class";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  hashable = callPackage
-    ({ mkDerivation, base, bytestring, criterion, ghc-prim, HUnit
-      , integer-gmp, QuickCheck, random, siphash, stdenv, test-framework
-      , test-framework-hunit, test-framework-quickcheck2, text, unix
-      }:
-      mkDerivation {
-        pname = "hashable";
-        version = "1.2.4.0";
-        src = "${ghcjsBoot}/boot/hashable";
-        doCheck = false;
-        libraryHaskellDepends = [
-          base bytestring ghc-prim integer-gmp text
-        ];
-        testHaskellDepends = [
-          base bytestring ghc-prim HUnit QuickCheck random test-framework
-          test-framework-hunit test-framework-quickcheck2 text unix
-        ];
-        benchmarkHaskellDepends = [
-          base bytestring criterion ghc-prim integer-gmp siphash text
-        ];
-        jailbreak = true;
-        homepage = "http://github.com/tibbe/hashable";
-        description = "A class for types that can be converted to a hash value";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  integer-logarithms = callPackage
-    ({ mkDerivation, array, base, ghc-prim, integer-gmp, QuickCheck
-      , smallcheck, stdenv, tasty, tasty-hunit, tasty-quickcheck
-      , tasty-smallcheck
-      }:
-      mkDerivation {
-        pname = "integer-logarithms";
-        version = "1.0.2";
-        src = "${ghcjsBoot}/boot/integer-logarithms";
-        doCheck = false;
-        libraryHaskellDepends = [ array base ghc-prim integer-gmp ];
-        testHaskellDepends = [
-          base QuickCheck smallcheck tasty tasty-hunit tasty-quickcheck
-          tasty-smallcheck
-        ];
-        jailbreak = true;
-        homepage = "https://github.com/phadej/integer-logarithms";
-        description = "Integer logarithms";
-        license = stdenv.lib.licenses.mit;
-      }) {};
-  mtl = callPackage
-    ({ mkDerivation, base, stdenv, transformers }:
-      mkDerivation {
-        pname = "mtl";
-        version = "2.2.1";
-        src = "${ghcjsBoot}/boot/mtl";
-        doCheck = false;
-        libraryHaskellDepends = [ base transformers ];
-        jailbreak = true;
-        homepage = "http://github.com/ekmett/mtl";
-        description = "Monad classes, using functional dependencies";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  nats = callPackage
-    ({ mkDerivation, stdenv }:
-      mkDerivation {
-        pname = "nats";
-        version = "1.1.1";
-        src = "${ghcjsBoot}/boot/nats";
-        jailbreak = true;
-        homepage = "http://github.com/ekmett/nats/";
-        description = "Natural numbers";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  old-time = callPackage
-    ({ mkDerivation, base, old-locale, stdenv }:
-      mkDerivation {
-        pname = "old-time";
-        version = "1.1.0.3";
-        src = "${ghcjsBoot}/boot/old-time";
-        doCheck = false;
-        libraryHaskellDepends = [ base old-locale ];
-        jailbreak = true;
-        description = "Time library";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  parallel = callPackage
-    ({ mkDerivation, array, base, containers, deepseq, stdenv }:
-      mkDerivation {
-        pname = "parallel";
-        version = "3.2.1.0";
-        src = "${ghcjsBoot}/boot/parallel";
-        doCheck = false;
-        libraryHaskellDepends = [ array base containers deepseq ];
-        jailbreak = true;
-        description = "Parallel programming library";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  random = callPackage
-    ({ mkDerivation, base, stdenv, time }:
-      mkDerivation {
-        pname = "random";
-        version = "1.1";
-        src = "${ghcjsBoot}/boot/random";
-        doCheck = false;
-        libraryHaskellDepends = [ base time ];
-        testHaskellDepends = [ base ];
-        jailbreak = true;
-        description = "random number library";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  scientific = callPackage
-    ({ mkDerivation, base, binary, bytestring, containers, criterion
-      , deepseq, ghc-prim, hashable, integer-gmp, integer-logarithms
-      , QuickCheck, smallcheck, stdenv, tasty, tasty-ant-xml, tasty-hunit
-      , tasty-quickcheck, tasty-smallcheck, text, vector
-      }:
-      mkDerivation {
-        pname = "scientific";
-        version = "0.3.4.10";
-        src = "${ghcjsBoot}/boot/scientific";
-        doCheck = false;
-        libraryHaskellDepends = [
-          base binary bytestring containers deepseq ghc-prim hashable
-          integer-gmp integer-logarithms text vector
-        ];
-        testHaskellDepends = [
-          base binary bytestring QuickCheck smallcheck tasty tasty-ant-xml
-          tasty-hunit tasty-quickcheck tasty-smallcheck text
-        ];
-        benchmarkHaskellDepends = [ base criterion ];
-        jailbreak = true;
-        homepage = "https://github.com/basvandijk/scientific";
-        description = "Numbers represented using scientific notation";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  semigroups = callPackage
-    ({ mkDerivation, base, stdenv }:
-      mkDerivation {
-        pname = "semigroups";
-        version = "0.18.3";
-        src = "${ghcjsBoot}/boot/semigroups";
-        doCheck = false;
-        libraryHaskellDepends = [ base ];
-        jailbreak = true;
-        homepage = "http://github.com/ekmett/semigroups/";
-        description = "Anything that associates";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  stm = callPackage
-    ({ mkDerivation, array, base, stdenv }:
-      mkDerivation {
-        pname = "stm";
-        version = "2.4.4.1";
-        src = "${ghcjsBoot}/boot/stm";
-        doCheck = false;
-        libraryHaskellDepends = [ array base ];
-        jailbreak = true;
-        description = "Software Transactional Memory";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  syb = callPackage
-    ({ mkDerivation, base, containers, HUnit, mtl, stdenv }:
-      mkDerivation {
-        pname = "syb";
-        version = "0.6";
-        src = "${ghcjsBoot}/boot/syb";
-        doCheck = false;
-        libraryHaskellDepends = [ base ];
-        testHaskellDepends = [ base containers HUnit mtl ];
-        jailbreak = true;
-        homepage = "http://www.cs.uu.nl/wiki/GenericProgramming/SYB";
-        description = "Scrap Your Boilerplate";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  tagged = callPackage
-    ({ mkDerivation, base, deepseq, stdenv, template-haskell
-      , transformers, transformers-compat
-      }:
-      mkDerivation {
-        pname = "tagged";
-        version = "0.8.5";
-        src = "${ghcjsBoot}/boot/tagged";
-        doCheck = false;
-        libraryHaskellDepends = [
-          base deepseq template-haskell transformers transformers-compat
-        ];
-        jailbreak = true;
-        homepage = "http://github.com/ekmett/tagged";
-        description = "Haskell 98 phantom types to avoid unsafely passing dummy arguments";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  text = callPackage
-    ({ mkDerivation, array, base, binary, bytestring, deepseq, directory
-      , ghc-prim, HUnit, integer-gmp, QuickCheck, quickcheck-unicode
-      , random, stdenv, test-framework, test-framework-hunit
-      , test-framework-quickcheck2
-      }:
-      mkDerivation {
-        pname = "text";
-        version = "1.2.2.1";
-        src = "${ghcjsBoot}/boot/text";
-        doCheck = false;
-        libraryHaskellDepends = [
-          array base binary bytestring deepseq ghc-prim integer-gmp
-        ];
-        testHaskellDepends = [
-          array base binary bytestring deepseq directory ghc-prim HUnit
-          integer-gmp QuickCheck quickcheck-unicode random test-framework
-          test-framework-hunit test-framework-quickcheck2
-        ];
-        jailbreak = true;
-        homepage = "https://github.com/bos/text";
-        description = "An efficient packed Unicode text type";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  th-abstraction = callPackage
-    ({ mkDerivation, base, containers, ghc-prim, stdenv
-      , template-haskell
-      }:
-      mkDerivation {
-        pname = "th-abstraction";
-        version = "0.2.6.0";
-        src = "${ghcjsBoot}/boot/th-abstraction";
-        doCheck = false;
-        libraryHaskellDepends = [
-          base containers ghc-prim template-haskell
-        ];
-        testHaskellDepends = [ base containers template-haskell ];
-        jailbreak = true;
-        homepage = "https://github.com/glguy/th-abstraction";
-        description = "Nicer interface for reified information about data types";
-        license = stdenv.lib.licenses.isc;
-      }) {};
-  time-locale-compat = callPackage
-    ({ mkDerivation, base, old-locale, stdenv, time }:
-      mkDerivation {
-        pname = "time-locale-compat";
-        version = "0.1.1.3";
-        src = "${ghcjsBoot}/boot/time-locale-compat";
-        doCheck = false;
-        libraryHaskellDepends = [ base old-locale time ];
-        jailbreak = true;
-        homepage = "https://github.com/khibino/haskell-time-locale-compat";
-        description = "Compatibility of TimeLocale between old-locale and time-1.5";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  transformers-compat = callPackage
-    ({ mkDerivation, base, ghc-prim, stdenv, transformers }:
-      mkDerivation {
-        pname = "transformers-compat";
-        version = "0.5.1.4";
-        src = "${ghcjsBoot}/boot/transformers-compat";
-        doCheck = false;
-        libraryHaskellDepends = [ base ghc-prim transformers ];
-        jailbreak = true;
-        homepage = "http://github.com/ekmett/transformers-compat/";
-        description = "A small compatibility shim exposing the new types from transformers 0.3 and 0.4 to older Haskell platforms.";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  unordered-containers = callPackage
-    ({ mkDerivation, base, bytestring, ChasingBottoms, containers
-      , criterion, deepseq, deepseq-generics, hashable, hashmap, HUnit
-      , mtl, QuickCheck, random, stdenv, test-framework
-      , test-framework-hunit, test-framework-quickcheck2
-      }:
-      mkDerivation {
-        pname = "unordered-containers";
-        version = "0.2.7.2";
-        src = "${ghcjsBoot}/boot/unordered-containers";
-        doCheck = false;
-        libraryHaskellDepends = [ base deepseq hashable ];
-        testHaskellDepends = [
-          base ChasingBottoms containers hashable HUnit QuickCheck
-          test-framework test-framework-hunit test-framework-quickcheck2
-        ];
-        benchmarkHaskellDepends = [
-          base bytestring containers criterion deepseq deepseq-generics
-          hashable hashmap mtl random
-        ];
-        jailbreak = true;
-        homepage = "https://github.com/tibbe/unordered-containers";
-        description = "Efficient hashing-based container types";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  uuid-types = callPackage
-    ({ mkDerivation, base, binary, bytestring, containers, criterion
-      , deepseq, hashable, HUnit, QuickCheck, random, stdenv, tasty
-      , tasty-hunit, tasty-quickcheck, text, unordered-containers
-      }:
-      mkDerivation {
-        pname = "uuid-types";
-        version = "1.0.3";
-        src = "${ghcjsBoot}/boot/uuid/uuid-types";
-        doCheck = false;
-        libraryHaskellDepends = [
-          base binary bytestring deepseq hashable random text
-        ];
-        testHaskellDepends = [
-          base bytestring HUnit QuickCheck tasty tasty-hunit tasty-quickcheck
-        ];
-        benchmarkHaskellDepends = [
-          base bytestring containers criterion deepseq random
-          unordered-containers
-        ];
-        jailbreak = true;
-        homepage = "https://github.com/hvr/uuid";
-        description = "Type definitions for Universally Unique Identifiers";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  vector = callPackage
-    ({ mkDerivation, base, deepseq, ghc-prim, primitive, QuickCheck
-      , random, stdenv, template-haskell, test-framework
-      , test-framework-quickcheck2, transformers
-      }:
-      mkDerivation {
-        pname = "vector";
-        version = "0.11.0.0";
-        src = "${ghcjsBoot}/boot/vector";
-        doCheck = false;
-        libraryHaskellDepends = [ base deepseq ghc-prim primitive ];
-        testHaskellDepends = [
-          base QuickCheck random template-haskell test-framework
-          test-framework-quickcheck2 transformers
-        ];
-        jailbreak = true;
-        homepage = "https://github.com/haskell/vector";
-        description = "Efficient Arrays";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-  ghcjs-base = callPackage
-    ({ mkDerivation, aeson, array, attoparsec, base, bytestring
-      , containers, deepseq, directory, dlist, ghc-prim, ghcjs-prim
-      , hashable, HUnit, integer-gmp, primitive, QuickCheck
-      , quickcheck-unicode, random, scientific, stdenv, test-framework
-      , test-framework-hunit, test-framework-quickcheck2, text, time
-      , transformers, unordered-containers, vector
-      }:
-      mkDerivation {
-        pname = "ghcjs-base";
-        version = "0.2.0.0";
-        src = "${ghcjsBoot}/ghcjs/ghcjs-base";
-        doCheck = false;
-        libraryHaskellDepends = [
-          aeson attoparsec base bytestring containers deepseq dlist ghc-prim
-          ghcjs-prim hashable integer-gmp primitive scientific text time
-          transformers unordered-containers vector
-        ];
-        testHaskellDepends = [
-          array base bytestring deepseq directory ghc-prim ghcjs-prim HUnit
-          primitive QuickCheck quickcheck-unicode random test-framework
-          test-framework-hunit test-framework-quickcheck2 text
-        ];
-        jailbreak = true;
-        homepage = "http://github.com/ghcjs/ghcjs-base";
-        description = "base library for GHCJS";
-        license = stdenv.lib.licenses.mit;
-      }) {};
-  Cabal = callPackage
-    ({ mkDerivation, array, base, binary, bytestring, containers
-      , deepseq, directory, exceptions, filepath, old-time, pretty
-      , process, QuickCheck, regex-posix, stdenv, tagged, tasty
-      , tasty-hunit, tasty-quickcheck, time, transformers, unix
-      }:
-      mkDerivation {
-        pname = "Cabal";
-        version = "1.24.0.0";
-        src = "${ghcjsBoot}/boot/cabal/Cabal";
-        doCheck = false;
-        libraryHaskellDepends = [
-          array base binary bytestring containers deepseq directory filepath
-          pretty process time unix
-        ];
-        testHaskellDepends = [
-          base bytestring containers directory exceptions filepath old-time
-          pretty process QuickCheck regex-posix tagged tasty tasty-hunit
-          tasty-quickcheck transformers unix
-        ];
-        jailbreak = true;
-        homepage = "http://www.haskell.org/cabal/";
-        description = "A framework for packaging Haskell software";
-        license = stdenv.lib.licenses.bsd3;
-      }) {};
-}
diff --git a/pkgs/development/compilers/graalvm/default.nix b/pkgs/development/compilers/graalvm/default.nix
index 7721ce06a561..a35143b43496 100644
--- a/pkgs/development/compilers/graalvm/default.nix
+++ b/pkgs/development/compilers/graalvm/default.nix
@@ -50,6 +50,9 @@ let
     rec { sha1 = "280c265b789e041c02e5c97815793dfc283fb1e6"; name = "LIBFFI_${sha1}/libffi.tar.gz";                                                    url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/libffi-3.2.1.tar.gz; }
     rec { sha1 = "8819cea8bfe22c9c63f55465e296b3855ea41786"; name = "TruffleJSON_${sha1}/trufflejson.jar";                                             url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/trufflejson-20180130.jar; }
     rec { sha1 = "9712a8124c40298015f04a74f61b3d81a51513af"; name = "CHECKSTYLE_8.8_${sha1}/checkstyle-8.8.jar";                                       url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/checkstyle-8.8-all.jar; }
+    rec { sha1 = "a828a4f32caf9ac0b74f2548f87310959558c526"; name = "VISUALVM_COMMON_${sha1}/visualvm-common.tar.gz";                                  url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/visualvm-612.tar.gz; }
+    rec { sha1 = "7ac829f0c9a37f5cc39afd2265588a365480720d"; name = "VISUALVM_PLATFORM_SPECIFIC_${sha1}/visualvm-platform-specific.tar.gz";            url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/visualvm-612-linux-amd64.tar.gz; }
+    rec { sha1 = "e6e60889b7211a80b21052a249bd7e0f88f79fee"; name = "Java-WebSocket_${sha1}/java-websocket.jar";                                       url = mirror://maven/org/java-websocket/Java-WebSocket/1.3.9/Java-WebSocket-1.3.9.jar; }
   ];
 
   findbugs = fetchzip {
@@ -61,13 +64,13 @@ let
 in rec {
 
   mx = stdenv.mkDerivation rec {
-    version = "5.176.4";
+    version = "5.192.0";
     name = "mx";
     src = fetchFromGitHub {
       owner  = "graalvm";
       repo   = "mx";
       rev    = version;
-      sha256 = "0xmx4hpnd6m9hk49lgwnvwd0q11s2m4d8axwq7zzc8wm10d692xw";
+      sha256 = "04gdf1gzlc8a6li8lcnrs2j9zicj11fs1vqqf7cmhb4pm2h72hml";
     };
     nativeBuildInputs = [ makeWrapper ];
     buildPhase = ''
@@ -79,6 +82,11 @@ in rec {
         'def download(path, urls, verbose=False, abortOnError=True, verifyOnly=False):
           print("FAKE download(path={} urls={} verbose={} abortOnError={} verifyOnly={})".format(path, urls, verbose, abortOnError, verifyOnly))
           return True'
+
+      # avoid crash with 'ValueError: ZIP does not support timestamps before 1980'
+      substituteInPlace mx.py --replace \
+        'zipfile.ZipInfo(arcname, time.localtime(os.path.getmtime(join(root, f)))[:6])' \
+        'zipfile.ZipInfo(arcname, time.strptime ("1 Jan 1980", "%d %b %Y"       )[:6])'
     '';
     installPhase = ''
       mkdir -p $out/bin
@@ -97,9 +105,9 @@ in rec {
 
   # copy of pkgs.oraclejvm8 with JVMCI interface (TODO: it should work with pkgs.openjdk8 too)
   jvmci8 = stdenv.mkDerivation rec {
-    version = "0.45";
+    version = "0.49";
     name = let
-             n = "jvmci8u171-${version}";
+             n = "jvmci${/*"8u191"*/ lib.removePrefix "oraclejdk-" oraclejdk8.name}-${version}";
            in if (lib.stringLength n) == (lib.stringLength oraclejdk8.name) then
                 n
               else
@@ -108,7 +116,7 @@ in rec {
       owner  = "graalvm";
       repo   = "graal-jvmci-8";
       rev    = "jvmci-${version}";
-      sha256 = "1nppk9dpamisiadss1iy82i3rf6igndbf1vax85w9lz310kh0d12";
+      sha256 = "1zgin0w1qa7wmfhcisx470fhnmddfxxp5nyyix31yaa7dznql82k";
     };
     buildInputs = [ mx mercurial ];
     postUnpack = ''
@@ -146,7 +154,7 @@ in rec {
   };
 
   graalvm8 = stdenv.mkDerivation rec {
-    version = "1.0.0-rc3";
+    version = "1.0.0-rc8";
     name = let
              n = "graal-${version}";
            in if (lib.stringLength n) == (lib.stringLength jvmci8.name) then
@@ -157,7 +165,7 @@ in rec {
       owner  = "oracle";
       repo   = "graal";
       rev    = "vm-${version}";
-      sha256 = "1hcs4m6ailapgi3bikav1i517vqn5pn595cyqqjfvlnkjwihbnc3";
+      sha256 = "1fada4awrr8bhw294xdiq4bagvgrlcr44mw6338gaal0ky3vkm0p";
     };
     buildInputs = [ mx zlib mercurial jvmci8 ];
     postUnpack = ''
@@ -170,6 +178,17 @@ in rec {
         hg checkout ${lib.escapeShellArg src.rev}
       )
     '';
+    postPatch = ''
+      substituteInPlace substratevm/src/com.oracle.svm.core.posix/src/com/oracle/svm/core/posix/headers/PosixDirectives.java \
+        --replace '<zlib.h>' '<${zlib.dev}/include/zlib.h>'
+      substituteInPlace substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/CCLinkerInvocation.java \
+        --replace 'cmd.add("-v");' 'cmd.add("-v"); cmd.add("-L${zlib}/lib");'
+      substituteInPlace substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/c/codegen/CCompilerInvoker.java \
+        --replace 'command.add(Platform.includedIn(Platform.WINDOWS.class) ? "CL" : "gcc");' \
+          'command.add(Platform.includedIn(Platform.WINDOWS.class) ? "CL" : "${stdenv.cc}/bin/gcc");'
+      substituteInPlace substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/CCLinkerInvocation.java \
+        --replace 'protected String compilerCommand = "cc";' 'protected String compilerCommand = "${stdenv.cc}/bin/cc";'
+    '';
     buildPhase = ''
       # make a copy of jvmci8
       cp -dpR ${jvmci8} $out
@@ -178,13 +197,14 @@ in rec {
 
       export MX_ALT_OUTPUT_ROOT=$NIX_BUILD_TOP/mxbuild
       export MX_CACHE_DIR=${makeMxCache graal-mxcache}
+
       ( cd substratevm
 
         mkdir -p clibraries
         mx --java-home $out build
 
         # bootstrap native-image (that was removed from mx build in https://github.com/oracle/graal/commit/140d7a7edf54ec5872a8ff45869cd1ae499efde4)
-        mx --java-home $out native-image -cp $MX_ALT_OUTPUT_ROOT/substratevm/dists/svm-driver.jar com.oracle.svm.driver.NativeImage
+        mx --java-home $out native-image -cp $MX_ALT_OUTPUT_ROOT/substratevm/dists/jdk1.8/svm-driver.jar com.oracle.svm.driver.NativeImage
       )
       ( cd tools
         mx --java-home $out build
@@ -195,17 +215,17 @@ in rec {
       mkdir -p $out/jre/tools/{profiler,chromeinspector,truffle/builder} $out/jre/lib/{graal,include,truffle/include}
       cp -vpLR substratevm/svmbuild/native-image-root/lib/*                         $out/jre/lib/           || true # ignore "same file" error when dereferencing symlinks
       cp -vp   $MX_ALT_OUTPUT_ROOT/truffle/linux-amd64/truffle-nfi-native/bin/*     $out/jre/lib/amd64/
-      cp -vp   $MX_ALT_OUTPUT_ROOT/compiler/dists/graal-*processor*.jar             $out/jre/lib/graal/
+      cp -vp   $MX_ALT_OUTPUT_ROOT/compiler/dists/jdk1.8/graal-*processor*.jar      $out/jre/lib/graal/
       cp -vp   $MX_ALT_OUTPUT_ROOT/truffle/linux-amd64/truffle-nfi-native/include/* $out/jre/lib/include/
-      cp -vp   $MX_ALT_OUTPUT_ROOT/compiler/dists/graal-management.jar              $out/jre/lib/jvmci/
+      cp -vp   $MX_ALT_OUTPUT_ROOT/compiler/dists/jdk1.8/graal-management.jar       $out/jre/lib/jvmci/
       cp -vdpR $out/jre/lib/svm/clibraries                                          $out/jre/lib/svm/builder/
-      cp -vpR  $MX_ALT_OUTPUT_ROOT/truffle/dists/*                                  $out/jre/lib/truffle/
+      cp -vpR  $MX_ALT_OUTPUT_ROOT/truffle/dists/jdk1.8/*                           $out/jre/lib/truffle/
       cp -vp   $MX_ALT_OUTPUT_ROOT/truffle/linux-amd64/truffle-nfi-native/include/* $out/jre/lib/truffle/include/
       cp -vpLR substratevm/svmbuild/native-image-root/tools/*                       $out/jre/tools/
       cp -vpR  $MX_ALT_OUTPUT_ROOT/tools/dists/chromeinspector*                     $out/jre/tools/chromeinspector/
       cp -vpR  $MX_ALT_OUTPUT_ROOT/tools/dists/truffle-profiler*                    $out/jre/tools/profiler/
       cp -vpR  $MX_ALT_OUTPUT_ROOT/truffle/linux-amd64/truffle-nfi-native/*         $out/jre/tools/truffle/
-      cp -vp   $MX_ALT_OUTPUT_ROOT/truffle/dists/truffle-nfi.jar                    $out/jre/tools/truffle/builder/
+      cp -vp   $MX_ALT_OUTPUT_ROOT/truffle/dists/jdk1.8/truffle-nfi.jar             $out/jre/tools/truffle/builder/
 
       echo "name=GraalVM ${version}"                                              > $out/jre/lib/amd64/server/vm.properties
       echo -n "graal"                                                             > $out/jre/lib/jvmci/compiler-name
diff --git a/pkgs/development/compilers/mentor/default.nix b/pkgs/development/compilers/mentor/default.nix
deleted file mode 100644
index 4f09df7f2ea0..000000000000
--- a/pkgs/development/compilers/mentor/default.nix
+++ /dev/null
@@ -1,80 +0,0 @@
-# Sourcery CodeBench Lite toolchain(s) (GCC) from Mentor Graphics
-
-{ stdenv, fetchurl, patchelf, ncurses }:
-
-let
-
-  buildToolchain =
-    { name, src, description }:
-
-    stdenv.mkDerivation rec {
-      inherit name src;
-
-      nativeBuildInputs = [ patchelf ];
-
-      buildCommand = ''
-        # Unpack tarball
-        mkdir -p "$out"
-        tar --strip-components=1 -xjf "$src" -C "$out"
-
-        # Patch binaries
-        interpreter="$(cat "$NIX_CC"/nix-support/dynamic-linker)"
-        for file in "$out"/bin/* "$out"/libexec/gcc/*/*/* "$out"/*/bin/*; do
-            # Skip non-executable files
-            case "$file" in
-              *README.txt) echo "skipping $file"; continue;;
-              *liblto_plugin.so*) echo "skipping $file"; continue;;
-            esac
-
-            # Skip directories
-            test -d "$file" && continue
-
-            echo "patchelf'ing $file"
-            patchelf --set-interpreter "$interpreter" "$file"
-
-            # GDB needs ncurses
-            case "$file" in
-              *gdb) patchelf --set-rpath "${ncurses.out}/lib" "$file";;
-            esac
-        done
-
-        # Manpages
-        mkdir -p "$out/share/man"
-        ln -s "$out"/share/doc/*/man/man1 "$out/share/man/man1"
-        ln -s "$out"/share/doc/*/man/man7 "$out/share/man/man7"
-      '';
-
-      meta = with stdenv.lib; {
-        inherit description;
-        homepage = https://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/;
-        license = licenses.gpl3;
-        platforms = platforms.linux;
-        maintainers = [ maintainers.bjornfor ];
-      };
-    };
-
-in
-
-{
-
-  armLinuxGnuEabi = let version = "2013.05-24"; in buildToolchain rec {
-    name = "sourcery-codebench-lite-arm-linux-gnueabi-${version}";
-    description = "Sourcery CodeBench Lite toolchain (GCC) for ARM GNU/Linux, from Mentor Graphics";
-    src = fetchurl {
-      url = "http://sourcery.mentor.com/public/gnu_toolchain/arm-none-linux-gnueabi/arm-${version}-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2";
-      sha256 = "1xb075ia61c59cya2jl8zp4fvqpfnwkkc5330shvgdlg9981qprr";
-    };
-  };
-
-  armEabi = let version = "2013.05-23"; in buildToolchain rec {
-    name = "sourcery-codebench-lite-arm-eabi-${version}";
-    description = "Sourcery CodeBench Lite toolchain (GCC) for ARM EABI, from Mentor Graphics";
-    src = fetchurl {
-      url = "http://sourcery.mentor.com/public/gnu_toolchain/arm-none-eabi/arm-${version}-arm-none-eabi-i686-pc-linux-gnu.tar.bz2";
-      sha256 = "0nbvdwj3kcv9scx808gniqp0ncdiy2i7afmdvribgkz1lsfin923";
-    };
-  };
-
-  # TODO: Sourcery CodeBench is also available for MIPS, Power, SuperH,
-  # ColdFire (and more).
-}
diff --git a/pkgs/development/compilers/microscheme/default.nix b/pkgs/development/compilers/microscheme/default.nix
index cfee1b0d8639..f15a76243277 100644
--- a/pkgs/development/compilers/microscheme/default.nix
+++ b/pkgs/development/compilers/microscheme/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip, vim, avrdude, avrbinutils, avrgcc, avrlibc, makeWrapper }:
+{ stdenv, fetchzip, vim, makeWrapper }:
 
 stdenv.mkDerivation rec {
   name = "microscheme-${version}";
@@ -10,15 +10,10 @@ stdenv.mkDerivation rec {
     sha256 = "1r3ng4pw1s9yy1h5rafra1rq19d3vmb5pzbpcz1913wz22qdd976";
   };
 
-  # Just a guess
-  propagatedBuildInputs = [ avrlibc ];
   buildInputs = [ makeWrapper vim ];
 
   installPhase = ''
     make install PREFIX=$out
-
-    wrapProgram $out/bin/microscheme \
-      --prefix PATH : "${stdenv.lib.makeBinPath [ avrdude avrgcc avrbinutils ]}"
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/compilers/mono/4.0.nix b/pkgs/development/compilers/mono/4.0.nix
deleted file mode 100644
index 892ae99abaf5..000000000000
--- a/pkgs/development/compilers/mono/4.0.nix
+++ /dev/null
@@ -1,9 +0,0 @@
-{ callPackage, Foundation, libobjc }:
-callPackage ./generic.nix (rec {
-  inherit Foundation libobjc;
-  version = "4.0.4.1";
-  sha256 = "1ydw9l89apc9p7xr5mdzy0h97g2q6v243g82mxswfc2rrqhfs4gd";
-  meta = {
-    knownVulnerabilities = [ "CVE-2009-0689" ];
-  };
-})
diff --git a/pkgs/development/compilers/mono/4.4.nix b/pkgs/development/compilers/mono/4.4.nix
deleted file mode 100644
index 9a3ccd1fd861..000000000000
--- a/pkgs/development/compilers/mono/4.4.nix
+++ /dev/null
@@ -1,8 +0,0 @@
-{ callPackage, Foundation, libobjc }:
-
-callPackage ./generic.nix (rec {
-  inherit Foundation libobjc;
-  version = "4.4.2.11";
-  sha256 = "0cxnypw1j7s253wr5hy05k42ghgg2s9qibp10kndwnp5bv12q34h";
-  enableParallelBuilding = false; # #32386, https://hydra.nixos.org/build/65565737
-})
diff --git a/pkgs/development/compilers/mono/4.6.nix b/pkgs/development/compilers/mono/4.6.nix
index 2bba660b69cd..5ccdadc28787 100644
--- a/pkgs/development/compilers/mono/4.6.nix
+++ b/pkgs/development/compilers/mono/4.6.nix
@@ -5,4 +5,5 @@ callPackage ./generic.nix (rec {
   version = "4.6.2.16";
   sha256 = "190f7kcrm1y5x61s1xwdmjnwc3czsg50s3mml4xmix7byh3x2rc9";
   enableParallelBuilding = false; # #32386, https://hydra.nixos.org/build/65617511
+  meta.knownVulnerabilities = [ "CVE-2018-1002208" ];
 })
diff --git a/pkgs/development/compilers/nim/default.nix b/pkgs/development/compilers/nim/default.nix
index a4b706d35aa5..ae36041b33eb 100644
--- a/pkgs/development/compilers/nim/default.nix
+++ b/pkgs/development/compilers/nim/default.nix
@@ -1,14 +1,14 @@
 # based on https://github.com/nim-lang/Nim/blob/v0.18.0/.travis.yml
 
-{ stdenv, lib, fetchurl, makeWrapper, nodejs-slim-8_x, openssl, pcre, readline, sqlite, boehmgc, sfml, tzdata, coreutils }:
+{ stdenv, lib, fetchurl, makeWrapper, nodejs-slim-10_x, openssl, pcre, readline, boehmgc, sfml, tzdata, coreutils }:
 
 stdenv.mkDerivation rec {
   name = "nim-${version}";
-  version = "0.18.0";
+  version = "0.19.0";
 
   src = fetchurl {
     url = "https://nim-lang.org/download/${name}.tar.xz";
-    sha256 = "45c74adb35f08dfa9add1112ae17330e5d902ebb4a36e7046caee8b79e6f3bd0";
+    sha256 = "0biwvw1gividp5lkf0daq1wp9v6ms4xy6dkf5zj0sn9w4m3n76d1";
   };
 
   doCheck = !stdenv.isDarwin;
@@ -19,7 +19,6 @@ stdenv.mkDerivation rec {
     "-lcrypto"
     "-lpcre"
     "-lreadline"
-    "-lsqlite3"
     "-lgc"
   ];
 
@@ -28,12 +27,21 @@ stdenv.mkDerivation rec {
   #    used for bootstrapping, but koch insists on moving the nim compiler around
   #    as part of building it, so it cannot be read-only
 
+  nativeBuildInputs = [
+    makeWrapper nodejs-slim-10_x tzdata coreutils
+  ];
+
   buildInputs = [
-    makeWrapper nodejs-slim-8_x tzdata coreutils
-    openssl pcre readline sqlite boehmgc sfml
+    openssl pcre readline boehmgc sfml
   ];
 
+  phases = [ "unpackPhase" "patchPhase" "buildPhase" "installPhase" "checkPhase" ];
+
   buildPhase = ''
+    # use $CC to trigger the linker since calling ld in build.sh causes an error
+    LD=$CC
+    # build.sh wants to write to $HOME/.cache
+    HOME=$TMPDIR
     sh build.sh
     ./bin/nim c koch
     ./koch boot  -d:release \
@@ -51,33 +59,24 @@ stdenv.mkDerivation rec {
       --suffix PATH : ${lib.makeBinPath [ stdenv.cc ]}
   '';
 
-  postPatch =
+  patchPhase =
     let disableTest = ''sed -i '1i discard \"\"\"\n  disabled: true\n\"\"\"\n\n' '';
+        disableStdLibTest = ''sed -i -e '/^when isMainModule/,/^END$/{s/^/#/}' '';
         disableCompile = ''sed -i -e 's/^/#/' '';
     in ''
       substituteInPlace ./tests/async/tioselectors.nim --replace "/bin/sleep" "sleep"
       substituteInPlace ./tests/osproc/tworkingdir.nim --replace "/usr/bin" "${coreutils}/bin"
       substituteInPlace ./tests/stdlib/ttimes.nim --replace "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo"
 
-      # disable supposedly broken tests
-      ${disableTest} ./tests/errmsgs/tproper_stacktrace2.nim
-      ${disableTest} ./tests/vm/trgba.nim
-
       # disable tests requiring network access (not available in the build container)
       ${disableTest} ./tests/stdlib/thttpclient.nim
-      ${disableTest} ./tests/cpp/tasync_cpp.nim
-      ${disableTest} ./tests/niminaction/Chapter7/Tweeter/src/tweeter.nim
-
-      # disable tests requiring un-downloadable dependencies (using nimble, which isn't available in the fetch phase)
-      ${disableCompile} ./tests/manyloc/keineschweine/keineschweine.nim
-      ${disableTest} ./tests/manyloc/keineschweine/keineschweine.nim
-      ${disableCompile} ./tests/manyloc/nake/nakefile.nim
-      ${disableTest} ./tests/manyloc/nake/nakefile.nim
-      ${disableCompile} ./tests/manyloc/named_argument_bug/main.nim
-      ${disableTest} ./tests/manyloc/named_argument_bug/main.nim
+    '' + lib.optionalString stdenv.isAarch64 ''
+      # disable test supposedly broken on aarch64
+      ${disableStdLibTest} ./lib/pure/stats.nim
     '';
 
   checkPhase = ''
+    PATH=$PATH:$out/bin
     ./koch tests
   '';
 
diff --git a/pkgs/development/compilers/ocaml/4.07.nix b/pkgs/development/compilers/ocaml/4.07.nix
index 19b9626f4e8f..c1952f30ba68 100644
--- a/pkgs/development/compilers/ocaml/4.07.nix
+++ b/pkgs/development/compilers/ocaml/4.07.nix
@@ -1,8 +1,8 @@
 import ./generic.nix {
   major_version = "4";
   minor_version = "07";
-  patch_version = "0";
-  sha256 = "03wzkzv6w4rdiiva20g5amz0n4x75swpjl8d80468p6zm8hgfnzl";
+  patch_version = "1";
+  sha256 = "1f07hgj5k45cylj1q3k5mk8yi02cwzx849b1fwnwia8xlcfqpr6z";
 
   # If the executable is stripped it does not work
   dontStrip = true;
diff --git a/pkgs/development/compilers/openjdk/10.nix b/pkgs/development/compilers/openjdk/11.nix
index 1c125fac62f1..e2d89f3ef728 100644
--- a/pkgs/development/compilers/openjdk/10.nix
+++ b/pkgs/development/compilers/openjdk/11.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, bash, cpio, pkgconfig, file, which, unzip, zip, cups, freetype
+{ stdenv, lib, fetchurl, bash, cpio, autoconf, pkgconfig, file, which, unzip, zip, cups, freetype
 , alsaLib, bootjdk, perl, liberation_ttf, fontconfig, zlib, lndir
 , libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama, libXcursor, libXrandr
 , libjpeg, giflib
@@ -10,31 +10,30 @@
 let
 
   /**
-   * The JRE libraries are in directories that depend on the CPU.
+   * The JDK libraries are in directories that depend on the CPU.
    */
   architecture =
     if stdenv.hostPlatform.system == "i686-linux" then
       "i386"
     else "amd64";
 
-  update = "10.0.2";
+  major = "11";
+  update = ".0.1";
   build = "13";
-  repover = "jdk-${update}+${build}";
+  repover = "jdk-${major}${update}+${build}";
   paxflags = if stdenv.isi686 then "msp" else "m";
 
-  openjdk10 = stdenv.mkDerivation {
-    name = "openjdk-${update}-b${build}";
+  openjdk = stdenv.mkDerivation {
+    name = "openjdk-${major}${update}-b${build}";
 
     src = fetchurl {
-      url = "http://hg.openjdk.java.net/jdk-updates/jdk10u/archive/${repover}.tar.gz";
-      sha256 = "0y7hyzgvn6z8gyp3h9xvxwj6zda899y6i629jn6yxqzj96q56jpk";
+      url = "http://hg.openjdk.java.net/jdk-updates/jdk${major}u/archive/${repover}.tar.gz";
+      sha256 = "1ri3fv67rvs9xxhc3ynklbprhxbdsgpwafbw6wqj950xy5crgysm";
     };
 
-    outputs = [ "out" "jre" ];
-
     nativeBuildInputs = [ pkgconfig ];
     buildInputs = [
-      cpio file which unzip zip perl bootjdk zlib cups freetype alsaLib
+      autoconf cpio file which unzip zip perl bootjdk zlib cups freetype alsaLib
       libjpeg giflib libX11 libICE libXext libXrender libXtst libXt libXtst
       libXi libXinerama libXcursor libXrandr lndir fontconfig
     ] ++ lib.optionals (!minimal && enableGnome2) [
@@ -55,12 +54,11 @@ let
 
       configureFlagsArray=(
         "--with-boot-jdk=${bootjdk.home}"
-        "--with-update-version=${update}"
+        "--with-update-version=${major}${update}"
         "--with-build-number=${build}"
         "--with-milestone=fcs"
         "--enable-unlimited-crypto"
         "--disable-debug-symbols"
-        "--disable-freetype-bundling"
         "--with-zlib=system"
         "--with-giflib=system"
         "--with-stdc++lib=dynamic"
@@ -86,7 +84,7 @@ let
     buildFlags = [ "all" ];
 
     installPhase = ''
-      mkdir -p $out/lib/openjdk $out/share $jre/lib/openjdk
+      mkdir -p $out/lib/openjdk $out/share
 
       cp -av build/*/images/jdk/* $out/lib/openjdk
 
@@ -101,57 +99,29 @@ let
       # jni.h expects jni_md.h to be in the header search path.
       ln -s $out/include/linux/*_md.h $out/include/
 
-      # Copy the JRE to a separate output and setup fallback fonts
-      cp -av build/*/images/jre $jre/lib/openjdk/
-      mkdir $out/lib/openjdk/jre
-      ${lib.optionalString (!minimal) ''
-        mkdir -p $jre/lib/openjdk/jre/lib/fonts/fallback
-        lndir ${liberation_ttf}/share/fonts/truetype $jre/lib/openjdk/jre/lib/fonts/fallback
-      ''}
-
       # Remove crap from the installation.
       rm -rf $out/lib/openjdk/demo
       ${lib.optionalString minimal ''
-        for d in $out/lib/openjdk/lib $jre/lib/openjdk/jre/lib; do
-          rm ''${d}/{libjsound,libjsoundalsa,libfontmanager}.so
-        done
+        rm $out/lib/openjdk/lib/{libjsound,libfontmanager}.so
       ''}
 
-      lndir $jre/lib/openjdk/jre $out/lib/openjdk/jre
-
       # Set PaX markings
-      exes=$(file $out/lib/openjdk/bin/* $jre/lib/openjdk/jre/bin/* 2> /dev/null | grep -E 'ELF.*(executable|shared object)' | sed -e 's/: .*$//')
+      exes=$(file $out/lib/openjdk/bin/* 2> /dev/null | grep -E 'ELF.*(executable|shared object)' | sed -e 's/: .*$//')
       echo "to mark: *$exes*"
       for file in $exes; do
         echo "marking *$file*"
         paxmark ${paxflags} "$file"
       done
 
-      # Remove duplicate binaries.
-      for i in $(cd $out/lib/openjdk/bin && echo *); do
-        if [ "$i" = java ]; then continue; fi
-        if cmp -s $out/lib/openjdk/bin/$i $jre/lib/openjdk/jre/bin/$i; then
-          ln -sfn $jre/lib/openjdk/jre/bin/$i $out/lib/openjdk/bin/$i
-        fi
-      done
-
       ln -s $out/lib/openjdk/bin $out/bin
-      ln -s $jre/lib/openjdk/jre/bin $jre/bin
-      ln -s $jre/lib/openjdk/jre $out/jre
     '';
 
-    # FIXME: this is unnecessary once the multiple-outputs branch is merged.
     preFixup = ''
-      prefix=$jre stripDirs "$STRIP" "$stripDebugList" "''${stripDebugFlags:--S}"
-      patchELF $jre
-      propagatedBuildInputs+=" $jre"
-
-      # Propagate the setJavaClassPath setup hook from the JRE so that
-      # any package that depends on the JRE has $CLASSPATH set up
-      # properly.
-      mkdir -p $jre/nix-support
+      # Propagate the setJavaClassPath setup hook so that any package
+      # that depends on the JDK has $CLASSPATH set up properly.
+      mkdir -p $out/nix-support
       #TODO or printWords?  cf https://github.com/NixOS/nixpkgs/pull/27427#issuecomment-317293040
-      echo -n "${setJavaClassPath}" > $jre/nix-support/propagated-build-inputs
+      echo -n "${setJavaClassPath}" > $out/nix-support/propagated-build-inputs
 
       # Set JAVA_HOME automatically.
       mkdir -p $out/nix-support
@@ -196,7 +166,7 @@ let
 
     passthru = {
       inherit architecture;
-      home = "${openjdk10}/lib/openjdk";
+      home = "${openjdk}/lib/openjdk";
     };
   };
-in openjdk10
+in openjdk
diff --git a/pkgs/development/compilers/openjdk/bootstrap.nix b/pkgs/development/compilers/openjdk/bootstrap.nix
index 612f0db05821..1b20ca6cc606 100644
--- a/pkgs/development/compilers/openjdk/bootstrap.nix
+++ b/pkgs/development/compilers/openjdk/bootstrap.nix
@@ -16,12 +16,12 @@ let
   src = if stdenv.hostPlatform.system == "x86_64-linux" then
     (if version == "10"    then fetchboot "10" "x86_64" "08085fsxc1qhqiv3yi38w8lrg3vm7s0m2yvnwr1c92v019806yq2"
     else if version == "8" then fetchboot "8"  "x86_64" "18zqx6jhm3lizn9hh6ryyqc9dz3i96pwaz8f6nxfllk70qi5gvks"
-    else throw "No bootstrap for version")
+    else throw "No bootstrap jdk for version ${version}")
   else if stdenv.hostPlatform.system == "i686-linux" then
     (if version == "10"    then fetchboot "10" "i686" "1blb9gyzp8gfyggxvggqgpcgfcyi00ndnnskipwgdm031qva94p7"
     else if version == "8" then fetchboot "8"  "i686" "1yx04xh8bqz7amg12d13rw5vwa008rav59mxjw1b9s6ynkvfgqq9"
     else throw "No bootstrap for version")
-  else throw "No bootstrap for system";
+  else throw "No bootstrap jdk for system ${stdenv.hostPlatform.system}";
 
   bootstrap = runCommand "openjdk-bootstrap" {
     passthru.home = "${bootstrap}/lib/openjdk";
diff --git a/pkgs/development/compilers/openjdk/darwin/10.nix b/pkgs/development/compilers/openjdk/darwin/11.nix
index 4969c12bff26..61c2d57423e4 100644
--- a/pkgs/development/compilers/openjdk/darwin/10.nix
+++ b/pkgs/development/compilers/openjdk/darwin/11.nix
@@ -6,13 +6,13 @@ let
     sha256 = "0nk7m0lgcbsvldq2wbfni2pzq8h818523z912i7v8hdcij5s48c0";
   };
 
-  jdk = stdenv.mkDerivation {
-    name = "zulu10.3+5-jdk10";
+  jdk = stdenv.mkDerivation rec {
+    name = "zulu11.2.3-jdk11.0.1";
 
     src = fetchurl {
-      url = https://cdn.azul.com/zulu/bin/zulu10.3+5-jdk10.0.2-macosx_x64.zip;
-      sha256 = "05pxfjn8fqw6ddr8m5hzyphwzqgrq8w6b4h3lwc1s7ymh05xmspz";
-      curlOpts = "-H Referer:https://www.azul.com/downloads/zulu/zulu-linux/";
+      url = "https://cdn.azul.com/zulu/bin/${name}-macosx_x64.tar.gz";
+      sha256 = "1jxnxmy79inwf3146ygry1mzv3dj6yrzqll16j7dpr91x1p3dpqy";
+      curlOpts = "-H Referer:https://www.azul.com/downloads/zulu/zulu-mac/";
     };
 
     buildInputs = [ unzip freetype ];
@@ -34,8 +34,8 @@ let
     '';
 
     preFixup = ''
-      # Propagate the setJavaClassPath setup hook from the JRE so that
-      # any package that depends on the JRE has $CLASSPATH set up
+      # Propagate the setJavaClassPath setup hook from the JDK so that
+      # any package that depends on the JDK has $CLASSPATH set up
       # properly.
       mkdir -p $out/nix-support
       printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs
@@ -49,7 +49,6 @@ let
     '';
 
     passthru = {
-      jre = jdk;
       home = jdk;
     };
 
diff --git a/pkgs/development/compilers/oraclejdk/jdk10-linux.nix b/pkgs/development/compilers/oraclejdk/jdk10-linux.nix
deleted file mode 100644
index 23f44331dd89..000000000000
--- a/pkgs/development/compilers/oraclejdk/jdk10-linux.nix
+++ /dev/null
@@ -1,156 +0,0 @@
-{ swingSupport ? true
-, stdenv
-, requireFile
-, makeWrapper
-, file
-, xorg ? null
-, packageType ? "JDK" # JDK, JRE, or ServerJRE
-, glib
-, libxml2
-, ffmpeg_2
-, libxslt
-, libGL
-, freetype
-, fontconfig
-, gtk2
-, pango
-, cairo
-, alsaLib
-, atk
-, gdk_pixbuf
-, zlib
-, elfutils
-, setJavaClassPath
-}:
-
-assert swingSupport -> xorg != null;
-
-let
-  version = "10.0.2";
-
-  downloadUrlBase = http://www.oracle.com/technetwork/java/javase/downloads;
-
-  rSubPaths = [
-    "lib/jli"
-    "lib/server"
-    "lib"
-  ];
-
-in
-
-let result = stdenv.mkDerivation rec {
-  name = if packageType == "JDK"       then "oraclejdk-${version}"
-    else if packageType == "JRE"       then "oraclejre-${version}"
-    else if packageType == "ServerJRE" then "oracleserverjre-${version}"
-    else abort "unknown package Type ${packageType}";
-
-  src =
-    if packageType == "JDK" then
-      requireFile {
-        name = "jdk-${version}_linux-x64_bin.tar.gz";
-        url =  "${downloadUrlBase}/jdk10-downloads-4416644.html";
-        sha256 = "0arpzac64apji1s8d0gzizkvrjz0fbhz7l34af1j0365ac6w4cv6";
-      }
-    else if packageType == "JRE" then
-      requireFile {
-        name = "jre-${version}_linux-x64_bin.tar.gz";
-        url = "${downloadUrlBase}/jre10-downloads-4417026.html";
-        sha256 = "0pc4a0a3fl6874vfaflf6jvpm9da647vp41pj0hihkspjyjhjabx";
-      }
-    else if packageType == "ServerJRE" then
-      requireFile {
-        name = "serverjre-${version}_linux-x64_bin.tar.gz";
-        url = "${downloadUrlBase}/sjre10-downloads-4417025.html";
-        sha256 = "0hbcb4c6ncy0sbz02gyygyqcwkz0xpv4fwrx4sripia6vph9592c";
-      }
-    else abort "unknown package Type ${packageType}";
-
-  nativeBuildInputs = [ file ];
-
-  buildInputs = [ makeWrapper ];
-
-  # See: https://github.com/NixOS/patchelf/issues/10
-  dontStrip = 1;
-
-  installPhase = ''
-    cd ..
-
-    # Set PaX markings
-    exes=$(file $sourceRoot/bin/* 2> /dev/null | grep -E 'ELF.*(executable|shared object)' | sed -e 's/: .*$//')
-    for file in $exes; do
-      paxmark m "$file"
-      # On x86 for heap sizes over 700MB disable SEGMEXEC and PAGEEXEC as well.
-      ${stdenv.lib.optionalString stdenv.isi686 ''paxmark msp "$file"''}
-    done
-
-    mv $sourceRoot $out
-
-    shopt -s extglob
-    for file in $out/*
-    do
-      if test -f $file ; then
-        rm $file
-      fi
-    done
-
-    if test -z "$pluginSupport"; then
-      rm -f $out/bin/javaws
-    fi
-
-    mkdir $out/lib/plugins
-    ln -s $out/lib/libnpjp2.so $out/lib/plugins
-
-    # for backward compatibility
-    ln -s $out $out/jre
-
-    mkdir -p $out/nix-support
-    printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs
-
-    # Set JAVA_HOME automatically.
-    cat <<EOF >> $out/nix-support/setup-hook
-    if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi
-    EOF
-  '';
-
-  postFixup = ''
-    rpath+="''${rpath:+:}${stdenv.lib.concatStringsSep ":" (map (a: "$out/${a}") rSubPaths)}"
-
-    # set all the dynamic linkers
-    find $out -type f -perm -0100 \
-        -exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
-        --set-rpath "$rpath" {} \;
-
-    find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \;
-
-    # Oracle Java Mission Control needs to know where libgtk-x11 and related is
-    if test -x $out/bin/jmc; then
-      wrapProgram "$out/bin/jmc" \
-          --suffix-each LD_LIBRARY_PATH ':' "$rpath"
-    fi
-  '';
-
-  /**
-   * libXt is only needed on amd64
-   */
-  libraries =
-    [stdenv.cc.libc glib libxml2 ffmpeg_2 libxslt libGL xorg.libXxf86vm alsaLib fontconfig freetype pango gtk2 cairo gdk_pixbuf atk zlib elfutils] ++
-    (if swingSupport then [xorg.libX11 xorg.libXext xorg.libXtst xorg.libXi xorg.libXp xorg.libXt xorg.libXrender stdenv.cc.cc] else []);
-
-  rpath = stdenv.lib.strings.makeLibraryPath libraries;
-
-  passthru.mozillaPlugin = "/lib/plugins";
-
-  passthru.jre = result; # FIXME: use multiple outputs or return actual JRE package
-
-  passthru.home = result;
-
-  # for backward compatibility
-  passthru.architecture = "";
-
-  meta = with stdenv.lib; {
-    license = licenses.unfree;
-    platforms = [ "x86_64-linux" ]; # some inherit jre.meta.platforms
-    knownVulnerabilities = [ "Support ended in September 2018.  Use OpenJDK or JDK 8." ];
-  };
-
-}; in result
diff --git a/pkgs/development/compilers/sbcl/default.nix b/pkgs/development/compilers/sbcl/default.nix
index 334ecbb168ba..1ef6dd065705 100644
--- a/pkgs/development/compilers/sbcl/default.nix
+++ b/pkgs/development/compilers/sbcl/default.nix
@@ -5,17 +5,20 @@
   # Note that the created binaries still need `patchelf --set-interpreter ...`
   # to get rid of ${glibc} dependency.
 , purgeNixReferences ? false
+, texinfo
 }:
 
 stdenv.mkDerivation rec {
   name    = "sbcl-${version}";
-  version = "1.4.12";
+  version = "1.4.13";
 
   src = fetchurl {
     url    = "mirror://sourceforge/project/sbcl/sbcl/${version}/${name}-source.tar.bz2";
-    sha256 = "0maa4h5zdykq050hdqk5wd74dhl6k7br3qrhfd4f2387skk8ky7a";
+    sha256 = "120rnnz8367lk7ljqlf8xidm4b0d738xqsib4kq0q5ms5r7fzgvm";
   };
 
+  buildInputs = [texinfo];
+
   patchPhase = ''
     echo '"${version}.nixos"' > version.lisp-expr
     echo "
@@ -46,11 +49,6 @@ stdenv.mkDerivation rec {
       '/date defaulted-source/i(or (and (= 2208988801 (file-write-date defaulted-source-truename)) (= 2208988801 (file-write-date defaulted-fasl-truename)))'
 
     # Fix the tests
-    sed -e '/deftest pwent/inil' -i contrib/sb-posix/posix-tests.lisp
-    sed -e '/deftest grent/inil' -i contrib/sb-posix/posix-tests.lisp
-    sed -e '/deftest .*ent.non-existing/,+5d' -i contrib/sb-posix/posix-tests.lisp
-    sed -e '/deftest \(pw\|gr\)ent/,+3d' -i contrib/sb-posix/posix-tests.lisp
-
     sed -e '5,$d' -i contrib/sb-bsd-sockets/tests.lisp
     sed -e '5,$d' -i contrib/sb-simple-streams/*test*.lisp
 
@@ -83,6 +81,7 @@ stdenv.mkDerivation rec {
 
   buildPhase = ''
     sh make.sh --prefix=$out --xc-host="${sbclBootstrapHost}"
+    (cd doc/manual ; make info)
   '';
 
   installPhase = ''
diff --git a/pkgs/development/compilers/swift/default.nix b/pkgs/development/compilers/swift/default.nix
index 233eb6647c09..bbfa1be8f921 100644
--- a/pkgs/development/compilers/swift/default.nix
+++ b/pkgs/development/compilers/swift/default.nix
@@ -32,11 +32,10 @@
 , makeWrapper
 , gnumake
 , file
-#, systemtap
 }:
 
 let
-  v_base = "4.1.3";
+  v_base = "4.2.1";
   version = "${v_base}-RELEASE";
   version_friendly = "${v_base}";
 
@@ -54,15 +53,15 @@ let
     # For more inforation, see: https://github.com/apple/swift/pull/3594#issuecomment-234169759
     clang = fetch {
       repo = "swift-clang";
-      sha256 = "0j8bi6jv4m4hqiib02q5cvnxd9j6bwiri853x6px86vai3mdff0h";
+      sha256 = "0l6w4xzpl3w2nax9a0b885nfzhfj38p2g99158nb5bzfd4s0man7";
     };
     llvm = fetch {
       repo = "swift-llvm";
-      sha256 = "0q5cv4iydm8c1kcax32573y3q2cbpihwgj5aa8ws1fnpy4jvq934";
+      sha256 = "1664zwxbq0a1cmxr9n5a0vw6vdk6ygr7rpglpdsfc7ki857vpsyv";
     };
     compilerrt = fetch {
       repo = "swift-compiler-rt";
-      sha256 = "1wkymmxi2v759xkwlzfrq9rivndjfvp6ikrzz10mvvrvyvrgwqnl";
+      sha256 = "19s6qxn4i0kxpf39xjp2i7zg427iinbmaxqkbb1p91g616y367sf";
     };
     cmark = fetch {
       repo = "swift-cmark";
@@ -70,32 +69,32 @@ let
     };
     lldb = fetch {
       repo = "swift-lldb";
-      sha256 = "1d0pa7xm289bjb6r52hkkmlngkqkwbwgixnmm30bin2q18mkxk7s";
+      sha256 = "00kz0xhj1p6ckyandj2gs1yfl29kxv84x9pfph00r8crbkd2jz7b";
     };
     llbuild = fetch {
       repo = "swift-llbuild";
-      sha256 = "04y0ihfyam2n671vmpk9gy0gb9lb3ivh6mr19862p5kg5bmrcic1";
+      sha256 = "1mkkhydshhxr28igbldzr0hhqvb6ql43cpf3ba5vglfkbcz6wh6q";
     };
     pm = fetch {
       repo = "swift-package-manager";
-      sha256 = "08d87fc29qq7m92jaxkiczsa7b567pwbibiwwkzdrj6a0gr11qn3";
+      sha256 = "1aqvmgq9g5zs4k2qnkvw3h3mar66d690hqq6g2dmrapsyb321j9l";
     };
     xctest = fetch {
       repo = "swift-corelibs-xctest";
-      sha256 = "1alkgxx8jsr2jjv2kchnjaaddb1byjwim015m1z3qxh6lknqm0k5";
+      sha256 = "1n4w7bfgy73vjzbvbphlwayy0dw73bbrayrpkqq8lbidg0x9lam8";
     };
     foundation = fetch {
       repo = "swift-corelibs-foundation";
-      sha256 = "1bhrag63rmz41bg2g6ap01qrdpq37hislgf5hg6myy2v69q7mahx";
+      sha256 = "1bfnkj8s3v327cy0czkngz0ryzmz7amjzkkxbsg2zyrhf9a9f0f7";
     };
     libdispatch = fetch {
       repo = "swift-corelibs-libdispatch";
-      sha256 = "198vskbajch8s168a649qz5an92i2mxmmmzcjlgxlzh38fgxri0n";
+      sha256 = "0fibrx54nbaawhsgd7cbr356ji9qvf8y8ahd5bdx28fpj6q0cnwc";
       fetchSubmodules = true;
     };
     swift = fetch {
       repo = "swift";
-      sha256 = "1ydx11pkvaasgjbr29lnha0lpnak758gd5l0aqzmp3q6mcyvfm7a";
+      sha256 = "0y277wi0m6zp1yph9s14mmc65m21q5fm6lgzkn2rkrbaz25fdzak";
     };
   };
 
@@ -111,7 +110,6 @@ let
     ncurses
     sqlite
     swig
-    #    systemtap?
   ];
 
   cmakeFlags = [
@@ -215,8 +213,11 @@ stdenv.mkDerivation rec {
 
     substituteInPlace swift/stdlib/public/Platform/CMakeLists.txt \
       --replace '/usr/include' "${stdenv.cc.libc.dev}/include"
+    substituteInPlace swift-corelibs-libdispatch/src/CMakeLists.txt \
+      --replace '/usr/include' "${stdenv.cc.libc.dev}/include"
     substituteInPlace swift/utils/build-script-impl \
       --replace '/usr/include/c++' "${clang.cc.gcc}/include/c++"
+    patch -p1 -d swift -i ${./patches/glibc-arch-headers.patch}
   '' + stdenv.lib.optionalString stdenv.needsPax ''
     patch -p1 -d swift -i ${./patches/build-script-pax.patch}
   '' + ''
@@ -228,24 +229,24 @@ stdenv.mkDerivation rec {
       -e 's/^test-installable-package$/# \0/' \
       -e 's/^test$/# \0/' \
       -e 's/^validation-test$/# \0/' \
-      -e 's/^long-test$/# \0/'
+      -e 's/^long-test$/# \0/' \
+      -e 's/^stress-test$/# \0/' \
+      -e 's/^test-optimized$/# \0/'
 
     # https://bugs.swift.org/browse/SR-5779
     sed -i -e 's|"-latomic"|"-Wl,-rpath,${clang.cc.gcc.lib}/lib" "-L${clang.cc.gcc.lib}/lib" "-latomic"|' swift/cmake/modules/AddSwift.cmake
 
     substituteInPlace clang/lib/Driver/ToolChains/Linux.cpp \
-      --replace '  addPathIfExists(D, SysRoot + "/usr/lib", Paths);' \
-                '  addPathIfExists(D, SysRoot + "/usr/lib", Paths); addPathIfExists(D, "${glibc}/lib", Paths);'
+      --replace 'SysRoot + "/usr/lib' '"${glibc}/lib" "'
+    patch -p1 -d clang -i ${./patches/llvm-include-dirs.patch}
     patch -p1 -d clang -i ${./purity.patch}
 
     # Workaround hardcoded dep on "libcurses" (vs "libncurses"):
     sed -i 's,curses,ncurses,' llbuild/*/*/CMakeLists.txt
 
-    # This test fails on one of my machines, not sure why.
-    # Disabling for now.
-    rm llbuild/tests/Examples/buildsystem-capi.llbuild
-
     PREFIX=''${out/#\/}
+    substituteInPlace swift-corelibs-foundation/build.py \
+      --replace usr/lib "$PREFIX/lib"
     substituteInPlace swift-corelibs-xctest/build_script.py \
       --replace usr "$PREFIX"
     substituteInPlace swiftpm/Utilities/bootstrap \
@@ -263,6 +264,7 @@ stdenv.mkDerivation rec {
     # Extract the generated tarball into the store
     PREFIX=''${out/#\/}
     tar xf $INSTALLABLE_PACKAGE -C $out --strip-components=3 $PREFIX
+    find $out -type d -empty -delete
 
     paxmark pmr $out/bin/swift
     paxmark pmr $out/bin/*
@@ -290,4 +292,3 @@ stdenv.mkDerivation rec {
     broken = stdenv.isAarch64; # 2018-09-04, never built on Hydra
   };
 }
-
diff --git a/pkgs/development/compilers/swift/patches/0001-build-presets-linux-don-t-require-using-Ninja.patch b/pkgs/development/compilers/swift/patches/0001-build-presets-linux-don-t-require-using-Ninja.patch
index 6ef83754a674..f2b30e5dcdb6 100644
--- a/pkgs/development/compilers/swift/patches/0001-build-presets-linux-don-t-require-using-Ninja.patch
+++ b/pkgs/development/compilers/swift/patches/0001-build-presets-linux-don-t-require-using-Ninja.patch
@@ -11,7 +11,7 @@ diff --git a/utils/build-presets.ini b/utils/build-presets.ini
 index 7ee57ad2df..e6b0af3581 100644
 --- a/utils/build-presets.ini
 +++ b/utils/build-presets.ini
-@@ -686,7 +686,7 @@ swiftpm
+@@ -717,7 +717,7 @@ swiftpm
  xctest
  dash-dash
  
diff --git a/pkgs/development/compilers/swift/patches/0002-build-presets-linux-allow-custom-install-prefix.patch b/pkgs/development/compilers/swift/patches/0002-build-presets-linux-allow-custom-install-prefix.patch
index 66723f1cdf39..612b33cdb483 100644
--- a/pkgs/development/compilers/swift/patches/0002-build-presets-linux-allow-custom-install-prefix.patch
+++ b/pkgs/development/compilers/swift/patches/0002-build-presets-linux-allow-custom-install-prefix.patch
@@ -11,7 +11,7 @@ diff --git a/utils/build-presets.ini b/utils/build-presets.ini
 index e6b0af3581..1095cbaab7 100644
 --- a/utils/build-presets.ini
 +++ b/utils/build-presets.ini
-@@ -708,7 +708,7 @@ install-lldb
+@@ -723,7 +723,7 @@ install-lldb
  install-llbuild
  install-swiftpm
  install-xctest
diff --git a/pkgs/development/compilers/swift/patches/0004-build-presets-linux-plumb-extra-cmake-options.patch b/pkgs/development/compilers/swift/patches/0004-build-presets-linux-plumb-extra-cmake-options.patch
index 5493196303cd..e84c7eb2a08a 100644
--- a/pkgs/development/compilers/swift/patches/0004-build-presets-linux-plumb-extra-cmake-options.patch
+++ b/pkgs/development/compilers/swift/patches/0004-build-presets-linux-plumb-extra-cmake-options.patch
@@ -11,7 +11,7 @@ diff --git a/utils/build-presets.ini b/utils/build-presets.ini
 index 1739e91dc2..0608fed9c1 100644
 --- a/utils/build-presets.ini
 +++ b/utils/build-presets.ini
-@@ -708,6 +708,8 @@ install-destdir=%(install_destdir)s
+@@ -740,6 +740,8 @@ install-destdir=%(install_destdir)s
  # Path to the .tar.gz package we would create.
  installable-package=%(installable_package)s
  
diff --git a/pkgs/development/compilers/swift/patches/build-script-pax.patch b/pkgs/development/compilers/swift/patches/build-script-pax.patch
index fa2ccdf9d5c6..1f47bf8ee045 100644
--- a/pkgs/development/compilers/swift/patches/build-script-pax.patch
+++ b/pkgs/development/compilers/swift/patches/build-script-pax.patch
@@ -1,6 +1,6 @@
 --- swift/utils/build-script-impl	2017-01-23 12:47:20.401326309 -0600
 +++ swift-pax/utils/build-script-impl	2017-01-23 13:24:10.339366996 -0600
-@@ -1823,6 +1823,17 @@ function set_lldb_xcodebuild_options() {
+@@ -1837,6 +1837,17 @@ function set_lldb_xcodebuild_options() {
      fi
  }
  
@@ -18,7 +18,7 @@
  #
  # Configure and build each product
  #
-@@ -2624,6 +2634,12 @@ for host in "${ALL_HOSTS[@]}"; do
+@@ -2735,6 +2746,12 @@ for host in "${ALL_HOSTS[@]}"; do
              fi
  
              call "${CMAKE_BUILD[@]}" "${build_dir}" $(cmake_config_opt ${product}) -- "${BUILD_ARGS[@]}" ${build_targets[@]}
diff --git a/pkgs/development/compilers/swift/patches/glibc-arch-headers.patch b/pkgs/development/compilers/swift/patches/glibc-arch-headers.patch
new file mode 100644
index 000000000000..650e1a2429d4
--- /dev/null
+++ b/pkgs/development/compilers/swift/patches/glibc-arch-headers.patch
@@ -0,0 +1,13 @@
+The Nix glibc headers do not use include/x86_64-linux-gnu subdirectories.
+
+--- swift/stdlib/public/Platform/CMakeLists.txt	2018-09-30 17:51:51.581766303 +0200
++++ swift/stdlib/public/Platform/CMakeLists.txt	2018-09-30 18:40:04.118956708 +0200
+@@ -65,7 +65,7 @@
+     endif()
+ 
+     set(GLIBC_INCLUDE_PATH "${GLIBC_SYSROOT_RELATIVE_INCLUDE_PATH}")
+-    set(GLIBC_ARCH_INCLUDE_PATH "${GLIBC_SYSROOT_RELATIVE_ARCH_INCLUDE_PATH}")
++    set(GLIBC_ARCH_INCLUDE_PATH "${GLIBC_SYSROOT_RELATIVE_INCLUDE_PATH}")
+ 
+     if(NOT "${SWIFT_SDK_${sdk}_ARCH_${arch}_PATH}" STREQUAL "/")
+       set(GLIBC_INCLUDE_PATH "${SWIFT_SDK_${sdk}_ARCH_${arch}_PATH}${GLIBC_INCLUDE_PATH}")
diff --git a/pkgs/development/compilers/swift/patches/llvm-include-dirs.patch b/pkgs/development/compilers/swift/patches/llvm-include-dirs.patch
new file mode 100644
index 000000000000..9523943c4801
--- /dev/null
+++ b/pkgs/development/compilers/swift/patches/llvm-include-dirs.patch
@@ -0,0 +1,13 @@
+Only use the Nix include dirs when no sysroot is configured.
+
+--- clang/lib/Driver/ToolChains/Linux.cpp	2018-10-05 18:01:15.731109551 +0200
++++ clang/lib/Driver/ToolChains/Linux.cpp	2018-10-05 18:00:27.959509924 +0200
+@@ -565,7 +565,7 @@
+ 
+   // Check for configure-time C include directories.
+   StringRef CIncludeDirs(C_INCLUDE_DIRS);
+-  if (CIncludeDirs != "") {
++  if (CIncludeDirs != "" && (SysRoot.empty() || SysRoot == "/")) {
+     SmallVector<StringRef, 5> dirs;
+     CIncludeDirs.split(dirs, ":");
+     for (StringRef dir : dirs) {
diff --git a/pkgs/development/compilers/swift/purity.patch b/pkgs/development/compilers/swift/purity.patch
index b30d0d0b5d5b..d10e407260a5 100644
--- a/pkgs/development/compilers/swift/purity.patch
+++ b/pkgs/development/compilers/swift/purity.patch
@@ -11,7 +11,7 @@ diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp
 index fe3c0191bb..c6a482bece 100644
 --- a/lib/Driver/ToolChains/Gnu.cpp
 +++ b/lib/Driver/ToolChains/Gnu.cpp
-@@ -494,13 +494,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
+@@ -398,13 +398,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
    if (!Args.hasArg(options::OPT_static)) {
      if (Args.hasArg(options::OPT_rdynamic))
        CmdArgs.push_back("-export-dynamic");
diff --git a/pkgs/development/compilers/x11basic/default.nix b/pkgs/development/compilers/x11basic/default.nix
new file mode 100644
index 000000000000..a26bc41c5945
--- /dev/null
+++ b/pkgs/development/compilers/x11basic/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, lib, fetchFromGitHub
+, automake, autoconf, readline
+, libX11, bluez, SDL2
+}:
+
+stdenv.mkDerivation rec {
+  pname = "X11basic";
+  version = "1.26";
+  name = pname + "-" + version;
+
+  src = fetchFromGitHub {
+    owner = "kollokollo";
+    repo = pname;
+    rev = version;
+    sha256 = "0rwj9cf496xailply0rgw695bzdladh2dhy7vdqac1pwbkl53nvd";
+  };
+
+  buildInputs = [
+    autoconf automake readline libX11 SDL2 bluez
+  ];
+
+  preConfigure = "cd src;autoconf";
+
+  configureFlags = [
+    "--with-bluetooth"
+    "--with-usb"
+    "--with-readline"
+    "--with-sdl"
+    "--with-x"
+    "--enable-cryptography"
+  ];
+
+  preInstall = ''
+    touch x11basic.{eps,svg}
+    mkdir -p $out/{bin,lib}
+    mkdir -p $out/share/{applications,icons/hicolor/scalable/apps}
+    cp -r ../examples $out/share/.
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://x11-basic.sourceforge.net/;
+    description = "A Basic interpreter and compiler with graphics capabilities.";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ edwtjo ];
+    platforms = platforms.unix;
+  };
+
+}