clisp: control build options and fix non x86* architectures
This commit is contained in:
parent
f6807dba60
commit
106d0f6b51
@ -1,6 +1,27 @@
|
|||||||
|
# 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
|
||||||
{ stdenv, fetchurl, libsigsegv, gettext, ncurses, readline, libX11
|
{ stdenv, fetchurl, libsigsegv, gettext, ncurses, readline, libX11
|
||||||
, libXau, libXt, pcre, zlib, libXpm, xproto, libXext, xextproto
|
, libXau, libXt, pcre, zlib, libXpm, xproto, libXext, xextproto
|
||||||
, libffi, libffcall, coreutils}:
|
, 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);
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
v = "2.49";
|
v = "2.49";
|
||||||
@ -13,11 +34,17 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
inherit libsigsegv gettext coreutils;
|
inherit libsigsegv gettext coreutils;
|
||||||
|
|
||||||
buildInputs =
|
buildInputs = [libsigsegv]
|
||||||
[ libsigsegv gettext ncurses readline libX11 libXau
|
++ stdenv.lib.optional (gettext != null) gettext
|
||||||
libXt pcre zlib libXpm xproto libXext xextproto libffi
|
++ stdenv.lib.optional (ncurses != null) ncurses
|
||||||
libffcall
|
++ 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
|
||||||
|
];
|
||||||
|
|
||||||
patches = [ ./bits_ipctypes_to_sys_ipc.patch ]; # from Gentoo
|
patches = [ ./bits_ipctypes_to_sys_ipc.patch ]; # from Gentoo
|
||||||
|
|
||||||
@ -34,24 +61,23 @@ stdenv.mkDerivation rec {
|
|||||||
substituteInPlace modules/bindings/glibc/linux.lisp --replace "(def-c-type __swblk_t)" ""
|
substituteInPlace modules/bindings/glibc/linux.lisp --replace "(def-c-type __swblk_t)" ""
|
||||||
'';
|
'';
|
||||||
|
|
||||||
configureFlags =
|
configureFlags = "builddir"
|
||||||
''
|
+ stdenv.lib.optionalString (!dllSupport) " --without-dynamic-modules"
|
||||||
--with-readline builddir --with-dynamic-ffi --with-ffcall
|
+ stdenv.lib.optionalString (readline != null) " --with-readline"
|
||||||
--with-module=clx/new-clx --with-module=i18n --with-module=bindings/glibc
|
+ stdenv.lib.optionalString (libffi != null) " --with-dynamic-ffi"
|
||||||
--with-module=pcre --with-module=rawsock --with-module=readline
|
+ stdenv.lib.optionalString (libffcall != null) " --with-ffcall"
|
||||||
--with-module=syscalls --with-module=wildcard --with-module=zlib
|
+ stdenv.lib.concatMapStrings (x: " --with-module=" + x) withModules
|
||||||
--with-threads=POSIX_THREADS
|
+ stdenv.lib.optionalString threadSupport " --with-threads=POSIX_THREADS";
|
||||||
'';
|
|
||||||
|
|
||||||
preBuild = ''
|
preBuild = ''
|
||||||
sed -e '/avcall.h/a\#include "config.h"' -i src/foreign.d
|
sed -e '/avcall.h/a\#include "config.h"' -i src/foreign.d
|
||||||
cd builddir
|
cd builddir
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall = ''
|
postInstall =
|
||||||
./clisp-link add "$out"/lib/clisp*/base "$(dirname "$out"/lib/clisp*/base)"/full \
|
stdenv.lib.optionalString (withModules != [])
|
||||||
clx/new-clx bindings/glibc pcre rawsock wildcard zlib
|
(''./clisp-link add "$out"/lib/clisp*/base "$(dirname "$out"/lib/clisp*/base)"/full''
|
||||||
'';
|
+ stdenv.lib.concatMapStrings (x: " " + x) withModules);
|
||||||
|
|
||||||
NIX_CFLAGS_COMPILE = "-O0 ${stdenv.lib.optionalString (!stdenv.is64bit) "-falign-functions=4"}";
|
NIX_CFLAGS_COMPILE = "-O0 ${stdenv.lib.optionalString (!stdenv.is64bit) "-falign-functions=4"}";
|
||||||
|
|
||||||
@ -61,8 +87,7 @@ stdenv.mkDerivation rec {
|
|||||||
meta = {
|
meta = {
|
||||||
description = "ANSI Common Lisp Implementation";
|
description = "ANSI Common Lisp Implementation";
|
||||||
homepage = http://clisp.cons.org;
|
homepage = http://clisp.cons.org;
|
||||||
maintainers = [stdenv.lib.maintainers.raskin];
|
maintainers = with stdenv.lib.maintainers; [raskin tohl];
|
||||||
platforms = stdenv.lib.platforms.linux;
|
platforms = stdenv.lib.platforms.linux;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user