From 526f6f63c7de7a13957d563a2e61a7587019e805 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sun, 31 May 2009 06:07:25 +0000 Subject: [PATCH] Updating CLisp and adding SBCL. SBCL currently has to be symlinked to a writable directory (I am investigating a fix). CLisp 2.47 is somewhat incompatible with lots of software, so I added 2.44.1 as preserved version svn path=/nixpkgs/trunk/; revision=15806 --- pkgs/development/compilers/sbcl/default.nix | 46 +++++++++++++++++++ .../development/interpreters/clisp/2.44.1.nix | 44 ++++++++++++++++++ .../interpreters/clisp/default.nix | 14 ++++-- .../libraries/libffcall/default.nix | 38 +++++++++++++++ pkgs/top-level/all-packages.nix | 23 +++++++++- 5 files changed, 158 insertions(+), 7 deletions(-) create mode 100644 pkgs/development/compilers/sbcl/default.nix create mode 100644 pkgs/development/interpreters/clisp/2.44.1.nix create mode 100644 pkgs/development/libraries/libffcall/default.nix diff --git a/pkgs/development/compilers/sbcl/default.nix b/pkgs/development/compilers/sbcl/default.nix new file mode 100644 index 000000000000..4cc9feb37e39 --- /dev/null +++ b/pkgs/development/compilers/sbcl/default.nix @@ -0,0 +1,46 @@ +a : +let + fetchurl = a.fetchurl; + + version = a.lib.attrByPath ["version"] "1.0.28" a; + buildInputs = with a; [ + clisp makeWrapper + ]; +in +rec { + src = fetchurl { + url = "http://prdownloads.sourceforge.net/sbcl/sbcl-${version}-source.tar.bz2"; + sha256 = "0jzi6zw73pll44fjllamiwvq5dihig2dcw3hl9h5a37948wnn0h4"; + }; + + inherit buildInputs; + configureFlags = []; + + /* doConfigure should be removed if not needed */ + phaseNames = ["setVars" "doFixTests" "doBuild" "doInstall" "doWrap"]; + + setVars = a.fullDepEntry ('' + export INSTALL_ROOT=$out + '') ["minInit"]; + + doWrap = a.fullDepEntry ('' + wrapProgram "$out/bin/sbcl" --set "SBCL_HOME" "$out/lib/sbcl" + '') ["minInit" "addInputs"]; + + doFixTests = a.fullDepEntry ('' + sed -e 's/"sys"/"wheel"/' -i contrib/sb-posix/posix-tests.lisp + '') ["minInit" "doUnpack"]; + + doBuild = a.fullDepEntry ('' + sh make.sh clisp + '') ["minInit" "doUnpack" "addInputs"]; + + doInstall = a.fullDepEntry ('' + sh install.sh + '') ["doBuild" "minInit" "addInputs"]; + + name = "sbcl-" + version; + meta = { + description = "Lisp compiler"; + }; +} diff --git a/pkgs/development/interpreters/clisp/2.44.1.nix b/pkgs/development/interpreters/clisp/2.44.1.nix new file mode 100644 index 000000000000..9ce38a6ed485 --- /dev/null +++ b/pkgs/development/interpreters/clisp/2.44.1.nix @@ -0,0 +1,44 @@ +args: with args; +stdenv.mkDerivation rec { + v = "2.44.1"; + name = "clisp-${v}"; + src = + fetchurl { + url = "mirror://gnu/clisp/release/${v}/${name}.tar.gz"; + sha256 = "0rkp6j6rih4s5d9acifh7pi4b9xfgcspif512l269dqy9qgyy4j1"; + }; + + inherit libsigsegv gettext coreutils; + buildInputs = [libsigsegv gettext ncurses readline libX11 libXau + libXt pcre zlib libXpm xproto libXext xextproto libffi + libffcall]; + + # First, replace port 9090 (rather low, can be used) + # with 64237 (much higher, IANA private area, not + # anything rememberable). + patchPhase = '' + sed -e 's@9090@64237@g' -i tests/socket.tst + sed -i 's@/bin/pwd@${coreutils}&@' src/clisp-link.in + find . -type f | xargs sed -e 's/-lICE/-lXau &/' -i + ''; + + configureFlags = "--with-readline builddir --with-dynamic-ffi + --with-module=clx/new-clx --with-module=i18n --with-module=bindings/glibc + --with-module=pcre --with-module=rawsock --with-module=readline + --with-module=syscalls --with-module=wildcard --with-module=zlib"; + + preBuild = '' + sed -e '/avcall.h/a\#include "config.h"' -i src/foreign.d + cd builddir + ''; + + NIX_CFLAGS_COMPILE="-O0"; + + # TODO : make mod-check fails + doCheck = 1; + + meta = { + description = "ANSI Common Lisp Implementation"; + homepage = http://clisp.cons.org; + }; +} diff --git a/pkgs/development/interpreters/clisp/default.nix b/pkgs/development/interpreters/clisp/default.nix index c20ba9b128f9..bd074138c4a8 100644 --- a/pkgs/development/interpreters/clisp/default.nix +++ b/pkgs/development/interpreters/clisp/default.nix @@ -1,16 +1,17 @@ args: with args; stdenv.mkDerivation rec { - v = "2.43"; + v = "2.47"; name = "clisp-${v}"; src = fetchurl { - url = "mirror://gnu/clisp/release/${v}/${name}.tar.bz2"; - sha256 = "10qyn6wccnayf1cyvrcanay6c6laar6z1r608w7ijp6nb763q8dm"; + url = "mirror://gnu/clisp/release/${v}/${name}.tar.gz"; + sha256 = "0slfx519pk75y5rf7wfna7jgyhkr4qp29z9zd1rcnnrhps11bpn7"; }; inherit libsigsegv gettext coreutils; buildInputs = [libsigsegv gettext ncurses readline libX11 libXau - libXt pcre zlib libXpm xproto libXext xextproto]; + libXt pcre zlib libXpm xproto libXext xextproto libffi + libffcall]; # First, replace port 9090 (rather low, can be used) # with 64237 (much higher, IANA private area, not @@ -26,7 +27,10 @@ stdenv.mkDerivation rec { --with-module=pcre --with-module=rawsock --with-module=readline --with-module=syscalls --with-module=wildcard --with-module=zlib"; - preBuild = "cd builddir"; + preBuild = '' + sed -e '/avcall.h/a\#include "config.h"' -i src/foreign.d + cd builddir + ''; NIX_CFLAGS_COMPILE="-O0"; diff --git a/pkgs/development/libraries/libffcall/default.nix b/pkgs/development/libraries/libffcall/default.nix new file mode 100644 index 000000000000..2a3ad8995f55 --- /dev/null +++ b/pkgs/development/libraries/libffcall/default.nix @@ -0,0 +1,38 @@ +a : +let + fetchurl = a.fetchurl; + + version = a.lib.attrByPath ["version"] "2009-05-27" a; + buildInputs = with a; [ + + ]; +in +rec { + src = a.fetchcvs { + cvsRoot = ":pserver:anonymous@cvs.savannah.gnu.org:/sources/libffcall"; + module = "ffcall"; + date = version; + sha256 = "91bcb5a20c85a9ccab45886aae8fdbbcf1f20f995ef898e8bdd2964448daf724"; + }; + + inherit buildInputs; + configureFlags = []; + + /* doConfigure should be removed if not needed */ + phaseNames = ["doConfigure" "doMakeInstall"]; + + doConfigure = a.fullDepEntry ('' + for i in ./configure */configure; do + cwd="$PWD" + cd "$(dirname "$i")"; + ( test -f Makefile && make distclean ) || true + ./configure --prefix=$out + cd "$cwd" + done + '') a.doConfigure.deps; + + name = "libffcall-" + version; + meta = { + description = "Foreign fuction call library"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 04cb80174d3c..9c133240ba6e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2041,6 +2041,11 @@ let inherit mysql libxml2 fcgi; }; + sbcl = builderDefsPackage (import ../development/compilers/sbcl) { + inherit makeWrapper; + clisp = clisp_2_44_1; + }; + scala = import ../development/compilers/scala { inherit stdenv fetchurl; }; @@ -2117,7 +2122,16 @@ let clisp = import ../development/interpreters/clisp { inherit fetchurl stdenv libsigsegv gettext - readline ncurses coreutils pcre zlib; + readline ncurses coreutils pcre zlib libffi libffcall; + inherit (xlibs) libX11 libXau libXt xproto + libXpm libXext xextproto; + }; + + # compatibility issues in 2.47 - at list 2.44.1 is known good + # for sbcl bootstrap + clisp_2_44_1 = import ../development/interpreters/clisp/2.44.1.nix { + inherit fetchurl stdenv libsigsegv gettext + readline ncurses coreutils pcre zlib libffi libffcall; inherit (xlibs) libX11 libXau libXt xproto libXpm libXext xextproto; }; @@ -3434,6 +3448,10 @@ let inherit fetchurl stdenv builderDefs zlib; }; + libffcall = builderDefsPackage (import ../development/libraries/libffcall) { + inherit fetchcvs; + }; + libffi = import ../development/libraries/libffi { inherit fetchurl stdenv; }; @@ -6798,7 +6816,8 @@ let }; stumpwm = builderDefsPackage (import ../applications/window-managers/stumpwm) { - inherit clisp texinfo; + inherit texinfo; + clisp = clisp_2_44_1; }; subversion = subversion16;