Skip to content

Commit

Permalink
Merge pull request NixOS#236927 from tobim/pkgs/clisp-update
Browse files Browse the repository at this point in the history
clisp: 2.49 -> 2.50pre2023-01-12; 2.50pre20171114 -> remove
  • Loading branch information
7c6f434c authored Sep 26, 2023
2 parents 07d7df7 + 7c68117 commit 81aa88d
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 167 deletions.
12 changes: 0 additions & 12 deletions pkgs/development/interpreters/clisp/bits_ipctypes_to_sys_ipc.patch

This file was deleted.

82 changes: 49 additions & 33 deletions pkgs/development/interpreters/clisp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,26 @@
# - base (default): contains readline and i18n, regexp and syscalls modules
# by default
# - full: contains base plus modules in withModules
{ lib, stdenv, fetchurl, libsigsegv, gettext, ncurses, readline, libX11
, libXau, libXt, pcre, zlib, libXpm, xorgproto, libXext
{ lib
, stdenv
, fetchFromGitLab
, autoconf269
, automake
, libtool
, libsigsegv
, gettext
, ncurses
, pcre
, zlib
, readline
, libffi
, libffcall
, libX11
, libXau
, libXt
, libXpm
, libXext
, xorgproto
, coreutils
# build options
, threadSupport ? stdenv.hostPlatform.isx86
Expand All @@ -16,26 +32,30 @@
"pcre"
"rawsock"
]
++ lib.optionals stdenv.isLinux [ "bindings/glibc" "zlib" "wildcard" ]
++ lib.optionals stdenv.isLinux [ "bindings/glibc" "zlib" ]
++ lib.optional x11Support "clx/new-clx"
}:

assert x11Support -> (libX11 != null && libXau != null && libXt != null
&& libXpm != null && xorgproto != null && libXext != null);

stdenv.mkDerivation rec {
version = "2.49";
let
ffcallAvailable = stdenv.isLinux && (libffcall != null);
in

stdenv.mkDerivation {
version = "2.50pre20230112";
pname = "clisp";

src = fetchurl {
url = "mirror://gnu/clisp/release/${version}/clisp-${version}.tar.bz2";
sha256 = "8132ff353afaa70e6b19367a25ae3d5a43627279c25647c220641fed00f8e890";
src = fetchFromGitLab {
owner = "gnu-clisp";
repo = "clisp";
rev = "bf72805c4dace982a6d3399ff4e7f7d5e77ab99a";
hash = "sha256-sQoN2FUg9BPaCgvCF91lFsU/zLja1NrgWsEIr2cPiqo=";
};

inherit libsigsegv gettext coreutils;

ffcallAvailable = stdenv.isLinux && (libffcall != null);

strictDeps = true;
nativeBuildInputs = lib.optionals stdenv.isDarwin [ autoconf269 automake libtool ];
buildInputs = [libsigsegv]
++ lib.optional (gettext != null) gettext
++ lib.optional (ncurses != null) ncurses
Expand All @@ -49,60 +69,56 @@ stdenv.mkDerivation rec {
];

patches = [
./bits_ipctypes_to_sys_ipc.patch # from Gentoo
# The cfree alias no longer exists since glibc 2.26
./remove-cfree-binding.patch
./gnulib_aarch64.patch
];

# First, replace port 9090 (rather low, can be used)
# with 64237 (much higher, IANA private area, not
# anything rememberable).
# Also remove reference to a type that disappeared from recent glibc
# (seems the correct thing to do, found no reference to any solution)
postPatch = ''
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
substituteInPlace modules/bindings/glibc/linux.lisp --replace "(def-c-type __swblk_t)" ""
'';

preConfigure = lib.optionalString stdenv.isDarwin (''
cd src
autoreconf -f -i -I m4 -I glm4
cd -
'' + lib.concatMapStrings (x: ''
cd modules/${x}
autoreconf -f -i -I ../../src -I ../../src/m4 -I ../../src/glm4
cd -
'') withModules);

configureFlags = [ "builddir" ]
++ lib.optional (!dllSupport) "--without-dynamic-modules"
++ lib.optional (readline != null) "--with-readline"
# --with-dynamic-ffi can only exist with --with-ffcall - foreign.d does not compile otherwise
++ lib.optional (ffcallAvailable && (libffi != null)) "--with-dynamic-ffi"
++ lib.optional ffcallAvailable "--with-ffcall"
++ lib.optional (!ffcallAvailable) "--without-ffcall"
++ builtins.map (x: "--with-module=" + x) withModules
++ builtins.map (x: " --with-module=" + x) withModules
++ lib.optional threadSupport "--with-threads=POSIX_THREADS";

preBuild = ''
sed -e '/avcall.h/a\#include "config.h"' -i src/foreign.d
sed -i -re '/ cfree /d' -i modules/bindings/glibc/linux.lisp
cd builddir
'';

# 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;

postInstall =
lib.optionalString (withModules != [])
(''./clisp-link add "$out"/lib/clisp*/base "$(dirname "$out"/lib/clisp*/base)"/full''
+ lib.concatMapStrings (x: " " + x) withModules);

env.NIX_CFLAGS_COMPILE = "-O0 ${lib.optionalString (!stdenv.is64bit) "-falign-functions=4"}";

# TODO : make mod-check fails
doCheck = false;
env.NIX_CFLAGS_COMPILE = "-O0 -falign-functions=${if stdenv.is64bit then "8" else "4"}";

meta = {
description = "ANSI Common Lisp Implementation";
homepage = "http://clisp.cons.org";
homepage = "http://clisp.org";
maintainers = lib.teams.lisp.members;
platforms = lib.platforms.unix;
# problems on Darwin: https://github.com/NixOS/nixpkgs/issues/20062
broken = stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isAarch64;
license = lib.licenses.gpl2;
license = lib.licenses.gpl2Plus;
platforms = with lib.platforms; linux ++ darwin;
};
}
13 changes: 13 additions & 0 deletions pkgs/development/interpreters/clisp/gnulib_aarch64.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/gllib/vma-iter.c b/src/gllib/vma-iter.c
index 6045f21d7..d50a3a398 100644
--- a/src/gllib/vma-iter.c
+++ b/src/gllib/vma-iter.c
@@ -1327,7 +1327,7 @@ vma_iterate (vma_iterate_callback_fn callback, void *data)
In 64-bit processes, we could use vm_region_64 or mach_vm_region.
I choose vm_region_64 because it uses the same types as vm_region,
resulting in less conditional code. */
-# if defined __ppc64__ || defined __x86_64__
+# if defined __aarch64__ || defined __ppc64__ || defined __x86_64__
struct vm_region_basic_info_64 info;
mach_msg_type_number_t info_count = VM_REGION_BASIC_INFO_COUNT_64;

98 changes: 0 additions & 98 deletions pkgs/development/interpreters/clisp/hg.nix

This file was deleted.

12 changes: 0 additions & 12 deletions pkgs/development/interpreters/clisp/remove-cfree-binding.patch

This file was deleted.

13 changes: 1 addition & 12 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26169,18 +26169,7 @@ with pkgs;

# CLISP
clisp = wrapLisp {
pkg = callPackage ../development/interpreters/clisp {
# On newer readline8 fails as:
# #<FOREIGN-VARIABLE "rl_readline_state" #x...>
# does not have the required size or alignment
readline = readline63;
};
faslExt = "fas";
flags = ["-E" "UTF-8"];
};

clisp-tip = wrapLisp {
pkg = callPackage ../development/interpreters/clisp/hg.nix { };
pkg = callPackage ../development/interpreters/clisp { };
faslExt = "fas";
flags = ["-E" "UTF-8"];
};
Expand Down

0 comments on commit 81aa88d

Please sign in to comment.