2016-04-04 22:22:30 +02:00
|
|
|
# there are the following linking sets:
|
|
|
|
# - boot (not installed): without modules, only used when building clisp
|
|
|
|
# - base (default): contains readline and i18n, regexp and syscalls modules
|
|
|
|
# by default
|
|
|
|
# - full: contains base plus modules in withModules
|
2010-07-28 17:35:01 +02:00
|
|
|
{ stdenv, fetchurl, libsigsegv, gettext, ncurses, readline, libX11
|
|
|
|
, libXau, libXt, pcre, zlib, libXpm, xproto, libXext, xextproto
|
2016-04-04 22:22:30 +02:00
|
|
|
, libffi, libffcall, coreutils
|
|
|
|
# build options
|
|
|
|
, threadSupport ? (stdenv.isi686 || stdenv.isx86_64)
|
|
|
|
, x11Support ? (stdenv.isi686 || stdenv.isx86_64)
|
|
|
|
, dllSupport ? true
|
|
|
|
, withModules ? [
|
|
|
|
"bindings/glibc"
|
|
|
|
"pcre"
|
|
|
|
"rawsock"
|
|
|
|
"wildcard"
|
|
|
|
"zlib"
|
|
|
|
]
|
|
|
|
++ stdenv.lib.optional x11Support "clx/new-clx"
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert x11Support -> (libX11 != null && libXau != null && libXt != null
|
|
|
|
&& libXpm != null && xproto != null && libXext != null && xextproto != null);
|
2010-07-28 17:35:01 +02:00
|
|
|
|
2008-01-28 20:50:39 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2010-11-10 18:55:43 +01:00
|
|
|
v = "2.49";
|
2008-01-28 20:50:39 +01:00
|
|
|
name = "clisp-${v}";
|
2010-07-28 17:35:01 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://gnu/clisp/release/${v}/${name}.tar.bz2";
|
2010-11-10 18:55:43 +01:00
|
|
|
sha256 = "8132ff353afaa70e6b19367a25ae3d5a43627279c25647c220641fed00f8e890";
|
2010-07-28 17:35:01 +02:00
|
|
|
};
|
2004-08-23 12:44:21 +02:00
|
|
|
|
2008-01-28 20:34:55 +01:00
|
|
|
inherit libsigsegv gettext coreutils;
|
2010-07-28 17:35:01 +02:00
|
|
|
|
2016-04-04 22:22:30 +02:00
|
|
|
buildInputs = [libsigsegv]
|
|
|
|
++ stdenv.lib.optional (gettext != null) gettext
|
|
|
|
++ stdenv.lib.optional (ncurses != null) ncurses
|
|
|
|
++ stdenv.lib.optional (pcre != null) pcre
|
|
|
|
++ stdenv.lib.optional (zlib != null) zlib
|
|
|
|
++ stdenv.lib.optional (readline != null) readline
|
|
|
|
++ stdenv.lib.optional (libffi != null) libffi
|
|
|
|
++ stdenv.lib.optional (libffcall != null) libffcall
|
|
|
|
++ stdenv.lib.optionals x11Support [
|
|
|
|
libX11 libXau libXt libXpm xproto libXext xextproto
|
|
|
|
];
|
2013-02-05 15:23:09 +01:00
|
|
|
|
|
|
|
patches = [ ./bits_ipctypes_to_sys_ipc.patch ]; # from Gentoo
|
|
|
|
|
2008-03-11 21:58:29 +01:00
|
|
|
# First, replace port 9090 (rather low, can be used)
|
|
|
|
# with 64237 (much higher, IANA private area, not
|
|
|
|
# anything rememberable).
|
2013-02-05 15:23:09 +01:00
|
|
|
# Also remove reference to a type that disappeared from recent glibc
|
|
|
|
# (seems the correct thing to do, found no reference to any solution)
|
|
|
|
postPatch = ''
|
2010-07-28 17:35:01 +02:00
|
|
|
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
|
2013-02-05 15:23:09 +01:00
|
|
|
|
|
|
|
substituteInPlace modules/bindings/glibc/linux.lisp --replace "(def-c-type __swblk_t)" ""
|
2008-01-28 20:50:39 +01:00
|
|
|
'';
|
|
|
|
|
2016-04-04 22:22:30 +02:00
|
|
|
configureFlags = "builddir"
|
|
|
|
+ stdenv.lib.optionalString (!dllSupport) " --without-dynamic-modules"
|
|
|
|
+ stdenv.lib.optionalString (readline != null) " --with-readline"
|
|
|
|
+ stdenv.lib.optionalString (libffi != null) " --with-dynamic-ffi"
|
|
|
|
+ stdenv.lib.optionalString (libffcall != null) " --with-ffcall"
|
|
|
|
+ stdenv.lib.concatMapStrings (x: " --with-module=" + x) withModules
|
|
|
|
+ stdenv.lib.optionalString threadSupport " --with-threads=POSIX_THREADS";
|
2008-01-28 20:50:39 +01:00
|
|
|
|
2009-05-31 08:07:25 +02:00
|
|
|
preBuild = ''
|
|
|
|
sed -e '/avcall.h/a\#include "config.h"' -i src/foreign.d
|
|
|
|
cd builddir
|
|
|
|
'';
|
2008-01-28 20:50:39 +01:00
|
|
|
|
2016-04-04 22:22:30 +02:00
|
|
|
postInstall =
|
|
|
|
stdenv.lib.optionalString (withModules != [])
|
|
|
|
(''./clisp-link add "$out"/lib/clisp*/base "$(dirname "$out"/lib/clisp*/base)"/full''
|
|
|
|
+ stdenv.lib.concatMapStrings (x: " " + x) withModules);
|
2013-10-13 08:34:22 +02:00
|
|
|
|
2016-03-23 13:54:58 +01:00
|
|
|
NIX_CFLAGS_COMPILE = "-O0 ${stdenv.lib.optionalString (!stdenv.is64bit) "-falign-functions=4"}";
|
2008-01-28 20:50:39 +01:00
|
|
|
|
|
|
|
# TODO : make mod-check fails
|
2010-02-17 07:43:49 +01:00
|
|
|
doCheck = false;
|
2008-01-28 20:50:39 +01:00
|
|
|
|
|
|
|
meta = {
|
2010-07-28 17:35:01 +02:00
|
|
|
description = "ANSI Common Lisp Implementation";
|
|
|
|
homepage = http://clisp.cons.org;
|
2016-04-04 22:22:30 +02:00
|
|
|
maintainers = with stdenv.lib.maintainers; [raskin tohl];
|
2010-07-28 17:35:01 +02:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2008-01-28 20:50:39 +01:00
|
|
|
};
|
2004-08-23 12:44:21 +02:00
|
|
|
}
|