2016-04-04 20:22:30 +00: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
|
2021-01-23 13:15:07 +00:00
|
|
|
{ lib, stdenv, fetchurl, libsigsegv, gettext, ncurses, readline, libX11
|
2018-12-31 03:40:47 +00:00
|
|
|
, libXau, libXt, pcre, zlib, libXpm, xorgproto, libXext
|
2016-10-23 14:10:31 +00:00
|
|
|
, libffi
|
|
|
|
, libffcall
|
|
|
|
, coreutils
|
2016-04-04 20:22:30 +00:00
|
|
|
# build options
|
2021-11-21 01:50:41 +00:00
|
|
|
, threadSupport ? stdenv.hostPlatform.isx86
|
|
|
|
, x11Support ? stdenv.hostPlatform.isx86
|
2016-04-04 20:22:30 +00:00
|
|
|
, dllSupport ? true
|
|
|
|
, withModules ? [
|
|
|
|
"pcre"
|
|
|
|
"rawsock"
|
|
|
|
]
|
2021-01-23 13:15:07 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ "bindings/glibc" "zlib" "wildcard" ]
|
|
|
|
++ lib.optional x11Support "clx/new-clx"
|
2016-04-04 20:22:30 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert x11Support -> (libX11 != null && libXau != null && libXt != null
|
2018-12-31 03:40:47 +00:00
|
|
|
&& libXpm != null && xorgproto != null && libXext != null);
|
2010-07-28 15:35:01 +00:00
|
|
|
|
2008-01-28 19:50:39 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-03-01 11:00:54 +00:00
|
|
|
version = "2.49";
|
|
|
|
pname = "clisp";
|
2016-12-04 08:58:18 +00:00
|
|
|
|
2010-07-28 15:35:01 +00:00
|
|
|
src = fetchurl {
|
2022-03-01 11:00:54 +00:00
|
|
|
url = "mirror://gnu/clisp/release/${version}/clisp-${version}.tar.bz2";
|
2010-11-10 17:55:43 +00:00
|
|
|
sha256 = "8132ff353afaa70e6b19367a25ae3d5a43627279c25647c220641fed00f8e890";
|
2010-07-28 15:35:01 +00:00
|
|
|
};
|
2004-08-23 10:44:21 +00:00
|
|
|
|
2008-01-28 19:34:55 +00:00
|
|
|
inherit libsigsegv gettext coreutils;
|
2016-10-23 14:10:31 +00:00
|
|
|
|
|
|
|
ffcallAvailable = stdenv.isLinux && (libffcall != null);
|
|
|
|
|
2016-04-04 20:22:30 +00:00
|
|
|
buildInputs = [libsigsegv]
|
2021-01-23 13:15:07 +00:00
|
|
|
++ lib.optional (gettext != null) gettext
|
|
|
|
++ lib.optional (ncurses != null) ncurses
|
|
|
|
++ lib.optional (pcre != null) pcre
|
|
|
|
++ lib.optional (zlib != null) zlib
|
|
|
|
++ lib.optional (readline != null) readline
|
|
|
|
++ lib.optional (ffcallAvailable && (libffi != null)) libffi
|
|
|
|
++ lib.optional ffcallAvailable libffcall
|
|
|
|
++ lib.optionals x11Support [
|
2018-12-31 03:40:47 +00:00
|
|
|
libX11 libXau libXt libXpm xorgproto libXext
|
2016-04-04 20:22:30 +00:00
|
|
|
];
|
2013-02-05 14:23:09 +00:00
|
|
|
|
2017-11-08 14:21:09 +00:00
|
|
|
patches = [
|
|
|
|
./bits_ipctypes_to_sys_ipc.patch # from Gentoo
|
|
|
|
# The cfree alias no longer exists since glibc 2.26
|
|
|
|
./remove-cfree-binding.patch
|
|
|
|
];
|
2013-02-05 14:23:09 +00:00
|
|
|
|
2008-03-11 20:58:29 +00:00
|
|
|
# First, replace port 9090 (rather low, can be used)
|
|
|
|
# with 64237 (much higher, IANA private area, not
|
|
|
|
# anything rememberable).
|
2013-02-05 14:23:09 +00: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 15:35:01 +00: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 14:23:09 +00:00
|
|
|
|
|
|
|
substituteInPlace modules/bindings/glibc/linux.lisp --replace "(def-c-type __swblk_t)" ""
|
2008-01-28 19:50:39 +00:00
|
|
|
'';
|
|
|
|
|
2018-07-25 21:44:21 +00:00
|
|
|
configureFlags = [ "builddir" ]
|
2021-01-23 13:15:07 +00:00
|
|
|
++ lib.optional (!dllSupport) "--without-dynamic-modules"
|
|
|
|
++ lib.optional (readline != null) "--with-readline"
|
2016-10-23 14:10:31 +00:00
|
|
|
# --with-dynamic-ffi can only exist with --with-ffcall - foreign.d does not compile otherwise
|
2021-01-23 13:15:07 +00:00
|
|
|
++ lib.optional (ffcallAvailable && (libffi != null)) "--with-dynamic-ffi"
|
|
|
|
++ lib.optional ffcallAvailable "--with-ffcall"
|
|
|
|
++ lib.optional (!ffcallAvailable) "--without-ffcall"
|
2018-07-25 21:44:21 +00:00
|
|
|
++ builtins.map (x: "--with-module=" + x) withModules
|
2021-01-23 13:15:07 +00:00
|
|
|
++ lib.optional threadSupport "--with-threads=POSIX_THREADS";
|
2008-01-28 19:50:39 +00:00
|
|
|
|
2009-05-31 06:07:25 +00:00
|
|
|
preBuild = ''
|
|
|
|
sed -e '/avcall.h/a\#include "config.h"' -i src/foreign.d
|
|
|
|
cd builddir
|
|
|
|
'';
|
2008-01-28 19:50:39 +00:00
|
|
|
|
2021-11-07 12:14:04 +00:00
|
|
|
# Fails to build in parallel due to missing gnulib header dependency used in charstrg.d:
|
|
|
|
# ../src/charstrg.d:319:10: fatal error: uniwidth.h: No such file or directory
|
|
|
|
enableParallelBuilding = false;
|
|
|
|
|
2016-04-04 20:22:30 +00:00
|
|
|
postInstall =
|
2021-01-23 13:15:07 +00:00
|
|
|
lib.optionalString (withModules != [])
|
2016-04-04 20:22:30 +00:00
|
|
|
(''./clisp-link add "$out"/lib/clisp*/base "$(dirname "$out"/lib/clisp*/base)"/full''
|
2021-01-23 13:15:07 +00:00
|
|
|
+ lib.concatMapStrings (x: " " + x) withModules);
|
2013-10-13 06:34:22 +00:00
|
|
|
|
2021-01-23 13:15:07 +00:00
|
|
|
NIX_CFLAGS_COMPILE = "-O0 ${lib.optionalString (!stdenv.is64bit) "-falign-functions=4"}";
|
2008-01-28 19:50:39 +00:00
|
|
|
|
|
|
|
# TODO : make mod-check fails
|
2010-02-17 06:43:49 +00:00
|
|
|
doCheck = false;
|
2008-01-28 19:50:39 +00:00
|
|
|
|
|
|
|
meta = {
|
2010-07-28 15:35:01 +00:00
|
|
|
description = "ANSI Common Lisp Implementation";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://clisp.cons.org";
|
2021-01-23 13:15:07 +00:00
|
|
|
maintainers = with lib.maintainers; [raskin tohl];
|
|
|
|
platforms = lib.platforms.unix;
|
2016-12-04 08:58:18 +00:00
|
|
|
# problems on Darwin: https://github.com/NixOS/nixpkgs/issues/20062
|
2018-10-14 12:41:40 +00:00
|
|
|
broken = stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isAarch64;
|
2021-01-23 13:15:07 +00:00
|
|
|
license = lib.licenses.gpl2;
|
2008-01-28 19:50:39 +00:00
|
|
|
};
|
2004-08-23 10:44:21 +00:00
|
|
|
}
|