@@ -5,18 +5,18 @@
55# - full: contains base plus modules in withModules
66{ stdenv, fetchurl, libsigsegv, gettext, ncurses, readline, libX11
77, libXau, libXt, pcre, zlib, libXpm, xproto, libXext, xextproto
8−, libffi, libffcall, coreutils
8+, libffi
9+, libffcall
10+, coreutils
911# build options
1012, threadSupport ? (stdenv.isi686 || stdenv.isx86_64)
1113, x11Support ? (stdenv.isi686 || stdenv.isx86_64)
1214, dllSupport ? true
1315, withModules ? [
14− "bindings/glibc"
1516 "pcre"
1617 "rawsock"
17− "wildcard"
18− "zlib"
1918 ]
19+ ++ stdenv.lib.optionals stdenv.isLinux [ "bindings/glibc" "zlib" "wildcard" ]
2020 ++ stdenv.lib.optional x11Support "clx/new-clx"
2121}:
2222
@@ -33,15 +33,17 @@ stdenv.mkDerivation rec {
3333 };
3434
3535 inherit libsigsegv gettext coreutils;
36−
36+
37+ ffcallAvailable = stdenv.isLinux && (libffcall != null);
38+
3739 buildInputs = [libsigsegv]
3840 ++ stdenv.lib.optional (gettext != null) gettext
3941 ++ stdenv.lib.optional (ncurses != null) ncurses
4042 ++ stdenv.lib.optional (pcre != null) pcre
4143 ++ stdenv.lib.optional (zlib != null) zlib
4244 ++ stdenv.lib.optional (readline != null) readline
43− ++ stdenv.lib.optional (libffi != null) libffi
44− ++ stdenv.lib.optional (libffcall != null) libffcall
45+ ++ stdenv.lib.optional (ffcallAvailable && (libffi != null)) libffi
46+ ++ stdenv.lib.optional ffcallAvailable libffcall
4547 ++ stdenv.lib.optionals x11Support [
4648 libX11 libXau libXt libXpm xproto libXext xextproto
4749 ];
@@ -64,8 +66,10 @@ stdenv.mkDerivation rec {
6466 configureFlags = "builddir"
6567 + stdenv.lib.optionalString (!dllSupport) " --without-dynamic-modules"
6668 + stdenv.lib.optionalString (readline != null) " --with-readline"
67− + stdenv.lib.optionalString (libffi != null) " --with-dynamic-ffi"
68− + stdenv.lib.optionalString (libffcall != null) " --with-ffcall"
69+ # --with-dynamic-ffi can only exist with --with-ffcall - foreign.d does not compile otherwise
70+ + stdenv.lib.optionalString (ffcallAvailable && (libffi != null)) " --with-dynamic-ffi"
71+ + stdenv.lib.optionalString ffcallAvailable " --with-ffcall"
72+ + stdenv.lib.optionalString (!ffcallAvailable) " --without-ffcall"
6973 + stdenv.lib.concatMapStrings (x: " --with-module=" + x) withModules
7074 + stdenv.lib.optionalString threadSupport " --with-threads=POSIX_THREADS";
7175
@@ -88,6 +92,6 @@ stdenv.mkDerivation rec {
8892 description = "ANSI Common Lisp Implementation";
8993 homepage = http://clisp.cons.org;
9094 maintainers = with stdenv.lib.maintainers; [raskin tohl];
91− platforms = stdenv.lib.platforms.linux;
95+ platforms = stdenv.lib.platforms.unix;
9296 };
9397}