summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2017-01-04 01:42:10 +0100
committerDaiderd Jordan <daiderd@gmail.com>2017-01-04 01:42:26 +0100
commit27660cfdc01c9a7481b4646285ab155cca784c38 (patch)
tree3bfb5e18da3df6f88fd42ea7ad6e950aed68ac42 /pkgs/development/compilers
parent293551a16286f2e1134707babdb013a29bf778ce (diff)
parent61d125b8425da501f07765197186ed7351a55f48 (diff)
downloadnixlib-27660cfdc01c9a7481b4646285ab155cca784c38.tar
nixlib-27660cfdc01c9a7481b4646285ab155cca784c38.tar.gz
nixlib-27660cfdc01c9a7481b4646285ab155cca784c38.tar.bz2
nixlib-27660cfdc01c9a7481b4646285ab155cca784c38.tar.lz
nixlib-27660cfdc01c9a7481b4646285ab155cca784c38.tar.xz
nixlib-27660cfdc01c9a7481b4646285ab155cca784c38.tar.zst
nixlib-27660cfdc01c9a7481b4646285ab155cca784c38.zip
Merge branch 'master' into staging
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/ecl/16.1.2.nix59
-rw-r--r--pkgs/development/compilers/ecl/default.nix8
-rw-r--r--pkgs/development/compilers/emscripten-fastcomp/default.nix48
-rw-r--r--pkgs/development/compilers/emscripten/default.nix8
-rw-r--r--pkgs/development/compilers/gcl/2.6.13-pre.nix46
-rw-r--r--pkgs/development/compilers/ghc/head.nix21
-rw-r--r--pkgs/development/compilers/ghc/nokinds.nix83
-rw-r--r--pkgs/development/compilers/llvm/3.7/default.nix4
-rw-r--r--pkgs/development/compilers/rust/nightlyBin.nix38
-rw-r--r--pkgs/development/compilers/sbcl/1.3.12.nix104
-rw-r--r--pkgs/development/compilers/sbcl/default.nix4
11 files changed, 295 insertions, 128 deletions
diff --git a/pkgs/development/compilers/ecl/16.1.2.nix b/pkgs/development/compilers/ecl/16.1.2.nix
new file mode 100644
index 000000000000..30fee77321f5
--- /dev/null
+++ b/pkgs/development/compilers/ecl/16.1.2.nix
@@ -0,0 +1,59 @@
+{stdenv, fetchurl
+, libtool, autoconf, automake
+, gmp, mpfr, libffi, makeWrapper
+, noUnicode ? false
+, gcc
+, threadSupport ? true
+}:
+let
+  s = # Generated upstream information
+  rec {
+    baseName="ecl";
+    version="16.1.2";
+    name="${baseName}-${version}";
+    url="https://common-lisp.net/project/ecl/static/files/release/ecl-16.1.2.tgz";
+    sha256="16ab8qs3awvdxy8xs8jy82v8r04x4wr70l9l2j45vgag18d2nj1d";
+  };
+  buildInputs = [
+    libtool autoconf automake makeWrapper
+  ];
+  propagatedBuildInputs = [
+    libffi gmp mpfr gcc
+  ];
+in
+stdenv.mkDerivation {
+  inherit (s) name version;
+  inherit buildInputs propagatedBuildInputs;
+
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
+
+  configureFlags = [
+    (if threadSupport then "--enable-threads" else "--disable-threads")
+    "--with-gmp-prefix=${gmp.dev}"
+    "--with-libffi-prefix=${libffi.dev}"
+    ]
+    ++
+    (stdenv.lib.optional (! noUnicode)
+      "--enable-unicode")
+    ;
+
+  hardeningDisable = [ "format" ];
+
+  postInstall = ''
+    sed -e 's/@[-a-zA-Z_]*@//g' -i $out/bin/ecl-config
+    wrapProgram "$out/bin/ecl" \
+      --prefix PATH ':' "${gcc}/bin" \
+      --prefix NIX_LDFLAGS ' ' "-L${gmp.lib or gmp.out or gmp}/lib" \
+      --prefix NIX_LDFLAGS ' ' "-L${libffi.lib or libffi.out or libffi}/lib"
+  '';
+
+  meta = {
+    inherit (s) version;
+    description = "Lisp implementation aiming to be small, fast and easy to embed";
+    license = stdenv.lib.licenses.mit ;
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/compilers/ecl/default.nix b/pkgs/development/compilers/ecl/default.nix
index 60293fa2ec18..e506e3aace1f 100644
--- a/pkgs/development/compilers/ecl/default.nix
+++ b/pkgs/development/compilers/ecl/default.nix
@@ -9,11 +9,11 @@ let
   s = # Generated upstream information
   rec {
     baseName="ecl";
-    version="16.1.2";
+    version="16.1.3";
     name="${baseName}-${version}";
-    hash="16ab8qs3awvdxy8xs8jy82v8r04x4wr70l9l2j45vgag18d2nj1d";
-    url="https://common-lisp.net/project/ecl/static/files/release/ecl-16.1.2.tgz";
-    sha256="16ab8qs3awvdxy8xs8jy82v8r04x4wr70l9l2j45vgag18d2nj1d";
+    hash="0m0j24w5d5a9dwwqyrg0d35c0nys16ijb4r0nyk87yp82v38b9bn";
+    url="https://common-lisp.net/project/ecl/static/files/release/ecl-16.1.3.tgz";
+    sha256="0m0j24w5d5a9dwwqyrg0d35c0nys16ijb4r0nyk87yp82v38b9bn";
   };
   buildInputs = [
     libtool autoconf automake makeWrapper
diff --git a/pkgs/development/compilers/emscripten-fastcomp/default.nix b/pkgs/development/compilers/emscripten-fastcomp/default.nix
index 5403c29baab4..c457ae158389 100644
--- a/pkgs/development/compilers/emscripten-fastcomp/default.nix
+++ b/pkgs/development/compilers/emscripten-fastcomp/default.nix
@@ -1,44 +1,52 @@
-{ stdenv, fetchFromGitHub, python }:
+{ stdenv, fetchFromGitHub, cmake, python, ... }:
 
 let
-  rev = "1.36.4";
+  rev = "1.37.1";
+  gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
 in
-
 stdenv.mkDerivation rec {
   name = "emscripten-fastcomp-${rev}";
 
-  srcFC = fetchFromGitHub {
+  src = fetchFromGitHub {
     owner = "kripken";
     repo = "emscripten-fastcomp";
-    sha256 = "0838rl0n9hyq5dd0gmj5rvigbmk5mhrhzyjk0zd8mjs2mk8z510l";
+    sha256 = "08jci6h73j4pcd6iq5r4zn8c6qpd6qxc7xivxh3iama9hghmxyk9";
     inherit rev;
   };
 
   srcFL = fetchFromGitHub {
     owner = "kripken";
     repo = "emscripten-fastcomp-clang";
-    sha256 = "169hfabamv3jmf88flhl4scwaxdh24196gwpz3sdb26lzcns519q";
+    sha256 = "053svm8vnsma61jzzr8n1224brmjw4pzvklh572bm1p7yg32chaw";
     inherit rev;
   };
 
-  buildInputs = [ python ];
-  buildCommand = ''
-    cp -as ${srcFC} $TMPDIR/src
-    chmod +w $TMPDIR/src/tools
-    cp -as ${srcFL} $TMPDIR/src/tools/clang
-
-    chmod +w $TMPDIR/src
-    mkdir $TMPDIR/src/build
-    cd $TMPDIR/src/build
-
-    ../configure --enable-optimized --disable-assertions --enable-targets=host,js
-    make
-    cp -a Release/bin $out
+  nativeBuildInputs = [ cmake python ];
+  preConfigure = ''
+    cp -Lr ${srcFL} tools/clang
+    chmod +w -R tools/clang
   '';
+  cmakeFlags = [
+    "-DCMAKE_BUILD_TYPE=Release"
+    "-DLLVM_TARGETS_TO_BUILD='X86;JSBackend'"
+    "-DLLVM_INCLUDE_EXAMPLES=OFF"
+    "-DLLVM_INCLUDE_TESTS=OFF"
+    # "-DCLANG_INCLUDE_EXAMPLES=OFF"
+    "-DCLANG_INCLUDE_TESTS=OFF"
+  ] ++ (stdenv.lib.optional stdenv.isLinux
+    # necessary for clang to find crtend.o
+    "-DGCC_INSTALL_PREFIX=${gcc}"
+  );
+  enableParallelBuilding = true;
+
+  passthru = {
+    isClang = true;
+    inherit gcc;
+  };
 
   meta = with stdenv.lib; {
     homepage = https://github.com/kripken/emscripten-fastcomp;
-    description = "Emscripten llvm";
+    description = "Emscripten LLVM";
     platforms = platforms.all;
     maintainers = with maintainers; [ qknight matthewbauer ];
     license = stdenv.lib.licenses.ncsa;
diff --git a/pkgs/development/compilers/emscripten/default.nix b/pkgs/development/compilers/emscripten/default.nix
index c78808b81bce..f94e826defbb 100644
--- a/pkgs/development/compilers/emscripten/default.nix
+++ b/pkgs/development/compilers/emscripten/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchFromGitHub, emscriptenfastcomp, python, nodejs, closurecompiler, jre }:
 
 let
-  rev = "1.36.4";
+  rev = "1.37.1";
   appdir = "share/emscripten";
 in
 
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
   src = fetchFromGitHub {
     owner = "kripken";
     repo = "emscripten";
-    sha256 = "1c9592i891z1v9rp4a4lnsp14nwiqfxnh37g6xwwjd1bqx7x4hn7";
+    sha256 = "0xl8lv0ihxsnwnhma3i34pkbz0v1yyc93ac6mdqmzv6fx2wczm04";
     inherit rev;
   };
 
@@ -23,11 +23,13 @@ stdenv.mkDerivation {
     sed -i -e "s,EM_CONFIG = '~/.emscripten',EM_CONFIG = '$out/${appdir}/config'," $out/${appdir}/tools/shared.py
     sed -i -e 's,^.*did not see a source tree above the LLVM.*$,      return True,' $out/${appdir}/tools/shared.py
     sed -i -e 's,def check_sanity(force=False):,def check_sanity(force=False):\n  return,' $out/${appdir}/tools/shared.py
+    # fixes cmake support
+    sed -i -e "s/print \('emcc (Emscript.*\)/sys.stderr.write(\1); sys.stderr.flush()/g" $out/${appdir}/emcc.py
     mkdir $out/bin
     ln -s $out/${appdir}/{em++,em-config,emar,embuilder.py,emcc,emcmake,emconfigure,emlink.py,emmake,emranlib,emrun,emscons} $out/bin
 
     echo "EMSCRIPTEN_ROOT = '$out/${appdir}'" > $out/${appdir}/config
-    echo "LLVM_ROOT = '${emscriptenfastcomp}'" >> $out/${appdir}/config
+    echo "LLVM_ROOT = '${emscriptenfastcomp}/bin'" >> $out/${appdir}/config
     echo "PYTHON = '${python}/bin/python'" >> $out/${appdir}/config
     echo "NODE_JS = '${nodejs}/bin/node'" >> $out/${appdir}/config
     echo "JS_ENGINES = [NODE_JS]" >> $out/${appdir}/config
diff --git a/pkgs/development/compilers/gcl/2.6.13-pre.nix b/pkgs/development/compilers/gcl/2.6.13-pre.nix
new file mode 100644
index 000000000000..2a80eccfb403
--- /dev/null
+++ b/pkgs/development/compilers/gcl/2.6.13-pre.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchgit, mpfr, m4, binutils, fetchcvs, emacs, zlib, which
+, texinfo, libX11, xproto, inputproto, libXi, gmp, readline, strace
+, libXext, xextproto, libXt, libXaw, libXmu } :
+
+assert stdenv ? cc ;
+assert stdenv.cc.isGNU ;
+assert stdenv.cc ? libc ;
+assert stdenv.cc.libc != null ;
+
+stdenv.mkDerivation rec {
+  name = "gcl-${version}";
+  version = "2.6.13pre50";
+
+  src = fetchgit {
+    sha256 = "0vpxb6z5g9fjavrgx8gz8fsjvskfz64f63qibh5s00fvvndlwi88";
+    url = "http://git.savannah.gnu.org/r/gcl.git";
+    rev = "refs/tags/Version_2_6_13pre50";
+  };
+
+  postPatch = ''
+    sed -e 's/<= obj-date/<= (if (= 0 obj-date) 1 obj-date)/' -i lsp/make.lisp
+  '';
+
+  sourceRoot = "gcl/gcl";
+
+  patches = [];
+
+  buildInputs = [
+    mpfr m4 binutils emacs gmp
+    libX11 xproto inputproto libXi
+    libXext xextproto libXt libXaw libXmu
+    zlib which texinfo readline strace
+  ];
+
+  configureFlags = [
+    "--enable-ansi"
+  ];
+
+  hardeningDisable = [ "pic" "bindnow" ];
+
+  meta = {
+    description = "GNU Common Lisp compiler working via GCC";
+    maintainers = [ stdenv.lib.maintainers.raskin ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix
index 7573451695c3..0581038d18df 100644
--- a/pkgs/development/compilers/ghc/head.nix
+++ b/pkgs/development/compilers/ghc/head.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchgit, bootPkgs, perl, gmp, ncurses, libiconv, binutils, coreutils
-, autoconf, automake, happy, alex, crossSystem, selfPkgs, cross ? null
+, autoconf, automake, happy, alex, python3, crossSystem, selfPkgs, cross ? null
 }:
 
 let
   inherit (bootPkgs) ghc;
 
-  commonBuildInputs = [ ghc perl autoconf automake happy alex ];
+  commonBuildInputs = [ ghc perl autoconf automake happy alex python3 ];
 
-  version = "8.1.20161115";
+  version = "8.1.20161224";
 
   commonPreConfigure =  ''
     sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
@@ -19,27 +19,26 @@ let
 in stdenv.mkDerivation (rec {
   inherit version;
   name = "ghc-${version}";
-  rev = "017d11e0a36866b05ace32ece1af11adf652a619";
+  rev = "2689a1692636521777f007861a484e7064b2d696";
 
   src = fetchgit {
     url = "git://git.haskell.org/ghc.git";
     inherit rev;
-    sha256 = "1ryggmz961qd0fl50rkjjvi6g9azwla2vx9310a9nzjaj5x6ib4y";
+    sha256 = "0rk6xy7kgxx849nprq1ji459p88nyy93236g841m5p6mdh7mmrcr";
   };
 
-  postPatch = ''
+  postPatch = "patchShebangs .";
+
+  preConfigure = ''
     echo ${version} >VERSION
     echo ${rev} >GIT_COMMIT_ID
-    patchShebangs .
     ./boot
-  '';
+  '' + commonPreConfigure ;
 
   buildInputs = commonBuildInputs;
 
   enableParallelBuilding = true;
 
-  preConfigure = commonPreConfigure;
-
   configureFlags = [
     "CC=${stdenv.cc}/bin/cc"
     "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
@@ -52,6 +51,8 @@ in stdenv.mkDerivation (rec {
   # that in turn causes GHCi to abort
   stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
 
+  checkTarget = "test";
+
   postInstall = ''
     paxmark m $out/lib/${name}/bin/{ghc,haddock}
 
diff --git a/pkgs/development/compilers/ghc/nokinds.nix b/pkgs/development/compilers/ghc/nokinds.nix
deleted file mode 100644
index a041ff02f936..000000000000
--- a/pkgs/development/compilers/ghc/nokinds.nix
+++ /dev/null
@@ -1,83 +0,0 @@
-{ stdenv, fetchgit, bootPkgs, perl, gmp, ncurses, libiconv, autoconf, automake, happy, alex }:
-
-let
-  inherit (bootPkgs) ghc;
-
-  buildMK = ''
-    libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib"
-    libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include"
-    libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses.dev}/include"
-    libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses.out}/lib"
-    DYNAMIC_BY_DEFAULT = NO
-    SRC_HC_OPTS        = -H64m -O -fasm
-    GhcLibHcOpts       = -O -dcore-lint
-    GhcStage1HcOpts    = -Rghc-timing -O -fasm
-    GhcStage2HcOpts    = -Rghc-timing -O0 -DDEBUG
-    SplitObjs          = NO
-    HADDOCK_DOCS       = NO
-    BUILD_DOCBOOK_HTML = NO
-    BUILD_DOCBOOK_PS   = NO
-    BUILD_DOCBOOK_PDF  = NO
-    LAX_DEPENDENCIES   = YES
-    ${stdenv.lib.optionalString stdenv.isDarwin ''
-      libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-includes="${libiconv}/include"
-      libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="${libiconv}/lib"
-    ''}
-  '';
-
-in
-
-stdenv.mkDerivation rec {
-  version = "7.11.20150826";
-  name = "ghc-${version}"; # We cannot add a "nokinds" tag here; see git comment for details.
-  rev = "5f7f64b7fc879b5ecfd6987ec5565bd90f7c0179";
-
-  src = fetchgit {
-    url = "https://github.com/goldfirere/ghc.git";
-    inherit rev;
-    sha256 = "183l4v6aw52r3ydwl8bxg1lh3cwfakb35rpy6mjg23dqmqsynmcn";
-  };
-
-  patches = [ ./relocation.patch ];
-
-  postUnpack = ''
-    pushd ghc-${builtins.substring 0 7 rev}
-    echo ${version} >VERSION
-    echo ${rev} >GIT_COMMIT_ID
-    patchShebangs .
-    ./boot
-    popd
-  '';
-
-  buildInputs = [ ghc perl autoconf automake happy alex ];
-
-  preConfigure = ''
-    echo >mk/build.mk "${buildMK}"
-    sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
-  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
-    export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}"
-  '';
-
-  configureFlags = [
-    "--with-gcc=${stdenv.cc}/bin/cc"
-    "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
-  ];
-
-  enableParallelBuilding = true;
-
-  # required, because otherwise all symbols from HSffi.o are stripped, and
-  # that in turn causes GHCi to abort
-  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
-
-  passthru = {
-    inherit bootPkgs;
-  };
-
-  meta = {
-    homepage = "http://haskell.org/ghc";
-    description = "The dependently-typed 'nokinds' branch of the Glasgow Haskell Compiler by Richard Eisenberg";
-    maintainers = with stdenv.lib.maintainers; [ deepfire ];
-    inherit (ghc.meta) license platforms;
-  };
-
-}
diff --git a/pkgs/development/compilers/llvm/3.7/default.nix b/pkgs/development/compilers/llvm/3.7/default.nix
index 3df20086f79b..b7155defb437 100644
--- a/pkgs/development/compilers/llvm/3.7/default.nix
+++ b/pkgs/development/compilers/llvm/3.7/default.nix
@@ -1,6 +1,6 @@
-{ newScope, stdenv, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun }:
+{ newScope, stdenv, cmake, libxml2, python2, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun }:
 let
-  callPackage = newScope (self // { inherit stdenv isl version fetch; });
+  callPackage = newScope (self // { inherit stdenv cmake libxml2 python2 isl version fetch; });
 
   version = "3.7.1";
 
diff --git a/pkgs/development/compilers/rust/nightlyBin.nix b/pkgs/development/compilers/rust/nightlyBin.nix
index a60d17fb7cbe..6f7cca9aff22 100644
--- a/pkgs/development/compilers/rust/nightlyBin.nix
+++ b/pkgs/development/compilers/rust/nightlyBin.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchurl, makeWrapper, cacert, zlib }:
+{ stdenv, fetchurl, makeWrapper, cacert, zlib, buildRustPackage }:
 
 let
   inherit (stdenv.lib) optionalString;
 
-  platform = if stdenv.system == "x86_64-linux" 
+  platform = if stdenv.system == "x86_64-linux"
     then "x86_64-unknown-linux-gnu"
     else abort "missing boostrap url for platform ${stdenv.system}";
 
   bootstrapHash =
     if stdenv.system == "x86_64-linux"
-    then "1afsqaavhwiaxm38zr08cbq0985c7lrb1jzdcmq0jh6y8rb8ikff"
+    then "05bppmc6hqgv2g4x76rj95xf40x2aikqmcnql5li27rqwliyxznj"
     else throw "missing boostrap hash for platform ${stdenv.system}";
 
   needsPatchelf = stdenv.isLinux;
@@ -19,10 +19,12 @@ let
      sha256 = bootstrapHash;
   };
 
-  version = "2016-12-05";
+  version = "2016-12-29";
 in
 
 rec {
+  inherit buildRustPackage;
+
   rustc = stdenv.mkDerivation rec {
     name = "rustc-nightly-${version}";
 
@@ -49,5 +51,33 @@ rec {
           "$out/bin/rustc"
       ''}
     '';
+
+  };
+  cargo = stdenv.mkDerivation rec {
+    name = "cargo-nightly-${version}";
+
+    inherit version;
+    inherit src;
+
+    meta = with stdenv.lib; {
+      homepage = http://www.rust-lang.org/;
+      description = "A safe, concurrent, practical language";
+      maintainers = with maintainers; [ qknight ];
+      license = [ licenses.mit licenses.asl20 ];
+    };
+
+    buildInputs = [ makeWrapper ];
+    phases = ["unpackPhase" "installPhase"];
+
+    installPhase = ''
+      ./install.sh --prefix=$out \
+        --components=cargo
+
+      ${optionalString needsPatchelf ''
+        patchelf \
+          --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
+          "$out/bin/cargo"
+      ''}
+    '';
   };
 }
diff --git a/pkgs/development/compilers/sbcl/1.3.12.nix b/pkgs/development/compilers/sbcl/1.3.12.nix
new file mode 100644
index 000000000000..8fa4741a4a14
--- /dev/null
+++ b/pkgs/development/compilers/sbcl/1.3.12.nix
@@ -0,0 +1,104 @@
+{ stdenv, fetchurl, writeText, sbclBootstrap
+, sbclBootstrapHost ? "${sbclBootstrap}/bin/sbcl --disable-debugger --no-userinit --no-sysinit"
+, threadSupport ? (stdenv.isi686 || stdenv.isx86_64)
+  # Meant for sbcl used for creating binaries portable to non-NixOS via save-lisp-and-die.
+  # Note that the created binaries still need `patchelf --set-interpreter ...`
+  # to get rid of ${glibc} dependency.
+, purgeNixReferences ? false
+}:
+
+stdenv.mkDerivation rec {
+  name    = "sbcl-${version}";
+  version = "1.3.12";
+
+  src = fetchurl {
+    url    = "mirror://sourceforge/project/sbcl/sbcl/${version}/${name}-source.tar.bz2";
+    sha256 = "1hjr2xqazy4j0m58y4na6fz8ii3xflqairxy7vpd7ajbs00yqfc0";
+  };
+
+  patchPhase = ''
+    echo '"${version}.nixos"' > version.lisp-expr
+    echo "
+    (lambda (features)
+      (flet ((enable (x)
+               (pushnew x features))
+             (disable (x)
+               (setf features (remove x features))))
+    ''
+    + (if threadSupport then "(enable :sb-thread)" else "(disable :sb-thread)")
+    + stdenv.lib.optionalString stdenv.isArm "(enable :arm)"
+    + ''
+      )) " > customize-target-features.lisp
+
+    pwd
+
+    # SBCL checks whether files are up-to-date in many places..
+    # Unfortunately, same timestamp is not good enough
+    sed -e 's@> x y@>= x y@' -i contrib/sb-aclrepl/repl.lisp
+    sed -e '/(date)/i((= date 2208988801) 2208988800)' -i contrib/asdf/asdf.lisp
+    sed -i src/cold/slam.lisp -e \
+      '/file-write-date input/a)'
+    sed -i src/cold/slam.lisp -e \
+      '/file-write-date output/i(or (and (= 2208988801 (file-write-date output)) (= 2208988801 (file-write-date input)))'
+    sed -i src/code/target-load.lisp -e \
+      '/date defaulted-fasl/a)'
+    sed -i src/code/target-load.lisp -e \
+      '/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
+
+    # Use whatever `cc` the stdenv provides
+    substituteInPlace src/runtime/Config.x86-64-darwin --replace gcc cc
+
+    substituteInPlace src/runtime/Config.x86-64-darwin \
+      --replace mmacosx-version-min=10.4 mmacosx-version-min=10.5
+  ''
+  + (if purgeNixReferences
+    then
+      # This is the default location to look for the core; by default in $out/lib/sbcl
+      ''
+        sed 's@^\(#define SBCL_HOME\) .*$@\1 "/no-such-path"@' \
+          -i src/runtime/runtime.c
+      ''
+    else
+      # Fix software version retrieval
+      ''
+        sed -e "s@/bin/uname@$(command -v uname)@g" -i src/code/*-os.lisp
+      ''
+    );
+
+
+  preBuild = ''
+    export INSTALL_ROOT=$out
+    mkdir -p test-home
+    export HOME=$PWD/test-home
+  '';
+
+  buildPhase = ''
+    sh make.sh --prefix=$out --xc-host="${sbclBootstrapHost}"
+  '';
+
+  installPhase = ''
+    INSTALL_ROOT=$out sh install.sh
+  '';
+
+  # Specifying $SBCL_HOME is only truly needed with `purgeNixReferences = true`.
+  setupHook = writeText "setupHook.sh" ''
+    envHooks+=(_setSbclHome)
+    _setSbclHome() {
+      export SBCL_HOME='@out@/lib/sbcl/'
+    }
+  '';
+
+  meta = sbclBootstrap.meta // {
+    inherit version;
+    updateWalker = true;
+  };
+}
diff --git a/pkgs/development/compilers/sbcl/default.nix b/pkgs/development/compilers/sbcl/default.nix
index 8fa4741a4a14..85c558c92e8e 100644
--- a/pkgs/development/compilers/sbcl/default.nix
+++ b/pkgs/development/compilers/sbcl/default.nix
@@ -9,11 +9,11 @@
 
 stdenv.mkDerivation rec {
   name    = "sbcl-${version}";
-  version = "1.3.12";
+  version = "1.3.13";
 
   src = fetchurl {
     url    = "mirror://sourceforge/project/sbcl/sbcl/${version}/${name}-source.tar.bz2";
-    sha256 = "1hjr2xqazy4j0m58y4na6fz8ii3xflqairxy7vpd7ajbs00yqfc0";
+    sha256 = "1k3nij1pchkard02p51mbbsn4rrj116v1apjjpd3f9h2m7j3asac";
   };
 
   patchPhase = ''