sbcl: use bootstrap binary on darwin
This commit is contained in:
parent
13162e8cdb
commit
b08031ffec
31
pkgs/development/compilers/sbcl/bootstrap.nix
Normal file
31
pkgs/development/compilers/sbcl/bootstrap.nix
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
{ stdenv, fetchurl }:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name = "sbcl-bootstrap-${version}";
|
||||||
|
version = "1.1.8";
|
||||||
|
|
||||||
|
src = if stdenv.isDarwin
|
||||||
|
then fetchurl {
|
||||||
|
url = mirror://sourceforge/project/sbcl/sbcl/1.1.8/sbcl-1.1.8-x86-64-darwin-binary.tar.bz2;
|
||||||
|
sha256 = "006pr88053wclvbjfjdypnbiw8wymbzdzi7a6kbkpdfn4zf5943j";
|
||||||
|
}
|
||||||
|
else fetchurl {
|
||||||
|
url = mirror://sourceforge/project/sbcl/sbcl/1.1.8/sbcl-1.1.8-x86-64-linux-binary.tar.bz2;
|
||||||
|
sha256 = "0lh1jglxlfwk4cm6sgwk1jnb6ikhbrkx7p5aha2nbmkd6zl96prx";
|
||||||
|
};
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
ensureDir $out/bin
|
||||||
|
cp -p src/runtime/sbcl $out/bin
|
||||||
|
ensureDir $out/share/sbcl
|
||||||
|
cp -p output/sbcl.core $out/share/sbcl
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Lisp compiler";
|
||||||
|
homepage = "http://www.sbcl.org";
|
||||||
|
license = "bsd";
|
||||||
|
maintainers = [stdenv.lib.maintainers.raskin];
|
||||||
|
platforms = stdenv.lib.platforms.unix;
|
||||||
|
};
|
||||||
|
}
|
@ -1,36 +1,18 @@
|
|||||||
a :
|
{ stdenv, fetchurl, sbclBootstrap, clisp}:
|
||||||
let
|
|
||||||
fetchurl = a.fetchurl;
|
stdenv.mkDerivation rec {
|
||||||
s= # Generated upstream information
|
name = "sbcl-${version}";
|
||||||
rec {
|
|
||||||
baseName="sbcl";
|
|
||||||
version = "1.2.0";
|
version = "1.2.0";
|
||||||
name="${baseName}-${version}";
|
|
||||||
hash="13k20sys1v4lvgis8cnbczww6zs93rw176vz07g4jx06418k53x2";
|
src = fetchurl {
|
||||||
url="mirror://sourceforge/project/sbcl/sbcl/1.2.0/sbcl-1.2.0-source.tar.bz2";
|
url = mirror://sourceforge/project/sbcl/sbcl/1.2.0/sbcl-1.2.0-source.tar.bz2;
|
||||||
sha256 = "13k20sys1v4lvgis8cnbczww6zs93rw176vz07g4jx06418k53x2";
|
sha256 = "13k20sys1v4lvgis8cnbczww6zs93rw176vz07g4jx06418k53x2";
|
||||||
};
|
};
|
||||||
buildInputs = with a; [
|
|
||||||
clisp makeWrapper
|
|
||||||
];
|
|
||||||
in
|
|
||||||
rec {
|
|
||||||
src = a.fetchUrlFromSrcInfo s;
|
|
||||||
|
|
||||||
inherit buildInputs;
|
buildInputs = [ sbclBootstrap ] ++ stdenv.lib.optional stdenv.isLinux clisp;
|
||||||
configureFlags = [];
|
|
||||||
|
|
||||||
/* doConfigure should be removed if not needed */
|
patchPhase = ''
|
||||||
phaseNames = ["setVars" "doFixNewer" "doFixTests" "setVersion" "doPatch" "doBuild" "doInstall" "doWrap"];
|
echo '"${version}.nixos"' > version.lisp-expr
|
||||||
|
|
||||||
setVars = a.fullDepEntry (''
|
|
||||||
export INSTALL_ROOT=$out
|
|
||||||
mkdir test-home
|
|
||||||
export HOME=$PWD/test-home
|
|
||||||
'') ["minInit"];
|
|
||||||
|
|
||||||
setVersion = a.fullDepEntry (''
|
|
||||||
echo '"${s.version}.nixos"' > version.lisp-expr
|
|
||||||
echo "
|
echo "
|
||||||
(lambda (features)
|
(lambda (features)
|
||||||
(flet ((enable (x)
|
(flet ((enable (x)
|
||||||
@ -38,14 +20,11 @@ rec {
|
|||||||
(disable (x)
|
(disable (x)
|
||||||
(setf features (remove x features))))
|
(setf features (remove x features))))
|
||||||
(enable :sb-thread))) " > customize-target-features.lisp
|
(enable :sb-thread))) " > customize-target-features.lisp
|
||||||
'') ["minInit" "doUnpack"];
|
|
||||||
|
|
||||||
/* SBCL checks whether files are up-to-date in many places.. Unfortunately, same timestamp
|
|
||||||
is not good enought
|
|
||||||
*/
|
|
||||||
doFixNewer = a.fullDepEntry(''
|
|
||||||
pwd
|
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 's@> x y@>= x y@' -i contrib/sb-aclrepl/repl.lisp
|
||||||
sed -e '/(date)/i((= date 2208988801) 2208988800)' -i contrib/asdf/asdf.lisp
|
sed -e '/(date)/i((= date 2208988801) 2208988800)' -i contrib/asdf/asdf.lisp
|
||||||
sed -i src/cold/slam.lisp -e \
|
sed -i src/cold/slam.lisp -e \
|
||||||
@ -56,13 +35,8 @@ rec {
|
|||||||
'/date defaulted-fasl/a)'
|
'/date defaulted-fasl/a)'
|
||||||
sed -i src/code/target-load.lisp -e \
|
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)))'
|
'/date defaulted-source/i(or (and (= 2208988801 (file-write-date defaulted-source-truename)) (= 2208988801 (file-write-date defaulted-fasl-truename)))'
|
||||||
'') ["minInit" "doUnpack"];
|
|
||||||
|
|
||||||
doWrap = a.fullDepEntry (''
|
# Fix the tests
|
||||||
wrapProgram "$out/bin/sbcl" --set "SBCL_HOME" "$out/lib/sbcl"
|
|
||||||
'') ["minInit" "addInputs"];
|
|
||||||
|
|
||||||
doFixTests = a.fullDepEntry (''
|
|
||||||
sed -e '/deftest pwent/inil' -i contrib/sb-posix/posix-tests.lisp
|
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 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 .*ent.non-existing/,+5d' -i contrib/sb-posix/posix-tests.lisp
|
||||||
@ -70,24 +44,31 @@ rec {
|
|||||||
|
|
||||||
sed -e '5,$d' -i contrib/sb-bsd-sockets/tests.lisp
|
sed -e '5,$d' -i contrib/sb-bsd-sockets/tests.lisp
|
||||||
sed -e '5,$d' -i contrib/sb-simple-streams/*test*.lisp
|
sed -e '5,$d' -i contrib/sb-simple-streams/*test*.lisp
|
||||||
'') ["minInit" "doUnpack"];
|
'';
|
||||||
|
|
||||||
doBuild = a.fullDepEntry (''
|
preBuild = ''
|
||||||
sh make.sh clisp
|
export INSTALL_ROOT=$out
|
||||||
'') ["minInit" "doUnpack" "addInputs"];
|
ensureDir test-home
|
||||||
|
export HOME=$PWD/test-home
|
||||||
|
'';
|
||||||
|
|
||||||
doInstall = a.fullDepEntry (''
|
buildPhase = if stdenv.isLinux
|
||||||
sh install.sh
|
then ''
|
||||||
'') ["doBuild" "minInit" "addInputs"];
|
sh make.sh clisp --prefix=$out
|
||||||
|
''
|
||||||
|
else ''
|
||||||
|
sh make.sh --prefix=$out --xc-host='${sbclBootstrap}/bin/sbcl --core ${sbclBootstrap}/share/sbcl/sbcl.core --disable-debugger --no-userinit --no-sysinit'
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
INSTALL_ROOT=$out sh install.sh
|
||||||
|
'';
|
||||||
|
|
||||||
inherit(s) name;
|
|
||||||
inherit(s) version;
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Lisp compiler";
|
description = "Lisp compiler";
|
||||||
homepage = "http://www.sbcl.org";
|
homepage = http://www.sbcl.org;
|
||||||
license = "bsd";
|
license = stdenv.lib.licenses.bsd3;
|
||||||
maintainers = [a.lib.maintainers.raskin];
|
maintainers = [stdenv.lib.maintainers.raskin];
|
||||||
platforms = with a.lib.platforms; all;
|
platforms = stdenv.lib.platforms.all;
|
||||||
inherit(s) version;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -3291,8 +3291,8 @@ let
|
|||||||
|
|
||||||
rust = callPackage ../development/compilers/rust {};
|
rust = callPackage ../development/compilers/rust {};
|
||||||
|
|
||||||
sbcl = builderDefsPackage (import ../development/compilers/sbcl) {
|
sbclBootstrap = callPackage ../development/compilers/sbcl/bootstrap.nix {};
|
||||||
inherit makeWrapper;
|
sbcl = callPackage ../development/compilers/sbcl {
|
||||||
clisp = clisp_2_44_1;
|
clisp = clisp_2_44_1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user