Merge pull request #14456 from tohl/master

sbcl and clisp improvements, clisp now runs on arm and can be used to build sbcl
This commit is contained in:
Michael Raskin 2016-04-05 09:38:41 +00:00
commit 15434be579
2 changed files with 53 additions and 26 deletions

View File

@ -1,5 +1,6 @@
{ stdenv, fetchurl, writeText, sbclBootstrap
, sbclBootstrapHost ? "${sbclBootstrap}/bin/sbcl --disable-debugger --no-userinit --no-sysinit"
, threadSupport ? (stdenv.isi686 || stdenv.isx86_64)
# Meant for sbcl used for creating binaries portable to non-NixOS via save-lisp-and-die.
# Note that the created binaries still need `patchelf --set-interpreter ...`
# to get rid of ${glibc} dependency.
@ -8,11 +9,11 @@
stdenv.mkDerivation rec {
name = "sbcl-${version}";
version = "1.3.3";
version = "1.3.4";
src = fetchurl {
url = "mirror://sourceforge/project/sbcl/sbcl/${version}/${name}-source.tar.bz2";
sha256 = "0kzvwzz196ws9z20l8fm15m5gckhmkkc6lxvdib12mfvy80gcf6v";
sha256 = "0zx6z43xfnw1b6v5d3bpjrwgqs14wxlji22nl0lr4wmzbfbzvqli";
};
patchPhase = ''
@ -23,10 +24,11 @@ stdenv.mkDerivation rec {
(pushnew x features))
(disable (x)
(setf features (remove x features))))
#-arm
(enable :sb-thread)
#+arm
(enable :arm))) " > customize-target-features.lisp
''
+ stdenv.lib.optionalString threadSupport "(enable :sb-thread)"
+ stdenv.lib.optionalString stdenv.isArm "(enable :arm)"
+ ''
)) " > customize-target-features.lisp
pwd

View File

@ -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
, 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 {
v = "2.49";
@ -13,11 +34,17 @@ stdenv.mkDerivation rec {
inherit libsigsegv gettext coreutils;
buildInputs =
[ libsigsegv gettext ncurses readline libX11 libXau
libXt pcre zlib libXpm xproto libXext xextproto libffi
libffcall
];
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
];
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)" ""
'';
configureFlags =
''
--with-readline builddir --with-dynamic-ffi --with-ffcall
--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
--with-threads=POSIX_THREADS
'';
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";
preBuild = ''
sed -e '/avcall.h/a\#include "config.h"' -i src/foreign.d
cd builddir
'';
postInstall = ''
./clisp-link add "$out"/lib/clisp*/base "$(dirname "$out"/lib/clisp*/base)"/full \
clx/new-clx bindings/glibc pcre rawsock wildcard zlib
'';
postInstall =
stdenv.lib.optionalString (withModules != [])
(''./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"}";
@ -61,8 +87,7 @@ stdenv.mkDerivation rec {
meta = {
description = "ANSI Common Lisp Implementation";
homepage = http://clisp.cons.org;
maintainers = [stdenv.lib.maintainers.raskin];
maintainers = with stdenv.lib.maintainers; [raskin tohl];
platforms = stdenv.lib.platforms.linux;
};
}