about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2016-04-05 09:38:41 +0000
committerMichael Raskin <7c6f434c@mail.ru>2016-04-05 09:38:41 +0000
commit15434be579bb5257944b9e632422e73cfffa7551 (patch)
tree95be4187b9029a1a2a49a73160013a363225755a /pkgs
parentab2855b97556051aac466547fbe56bd66c041f50 (diff)
parent106d0f6b513b4e54f94d347bf3b103f1433dcb56 (diff)
downloadnixlib-15434be579bb5257944b9e632422e73cfffa7551.tar
nixlib-15434be579bb5257944b9e632422e73cfffa7551.tar.gz
nixlib-15434be579bb5257944b9e632422e73cfffa7551.tar.bz2
nixlib-15434be579bb5257944b9e632422e73cfffa7551.tar.lz
nixlib-15434be579bb5257944b9e632422e73cfffa7551.tar.xz
nixlib-15434be579bb5257944b9e632422e73cfffa7551.tar.zst
nixlib-15434be579bb5257944b9e632422e73cfffa7551.zip
Merge pull request #14456 from tohl/master
sbcl and clisp improvements, clisp now runs on arm and can be used to build sbcl
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/compilers/sbcl/default.nix14
-rw-r--r--pkgs/development/interpreters/clisp/default.nix65
2 files changed, 53 insertions, 26 deletions
diff --git a/pkgs/development/compilers/sbcl/default.nix b/pkgs/development/compilers/sbcl/default.nix
index ab8e8e08b1a5..946205011f2b 100644
--- a/pkgs/development/compilers/sbcl/default.nix
+++ b/pkgs/development/compilers/sbcl/default.nix
@@ -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
 
diff --git a/pkgs/development/interpreters/clisp/default.nix b/pkgs/development/interpreters/clisp/default.nix
index 919c3771bc5d..c3d289d2a8d4 100644
--- a/pkgs/development/interpreters/clisp/default.nix
+++ b/pkgs/development/interpreters/clisp/default.nix
@@ -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;
   };
 }
-