1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

Merge pull request #236927 from tobim/pkgs/clisp-update

clisp: 2.49 -> 2.50pre2023-01-12; 2.50pre20171114 -> remove
This commit is contained in:
7c6f434c 2023-09-26 15:33:48 +00:00 committed by GitHub
commit 81aa88d4c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 63 additions and 167 deletions

View file

@ -1,12 +0,0 @@
diff -ru a/modules/bindings/glibc/linux.lisp b/modules/bindings/glibc/linux.lisp
--- a/modules/bindings/glibc/linux.lisp 2008-10-10 16:15:49.000000000 +0300
+++ b/modules/bindings/glibc/linux.lisp 2012-12-04 01:01:35.000000000 +0200
@@ -86,7 +86,7 @@
(def-c-type __key_t) ; int
-(c-lines "#include <bits/ipctypes.h>~%")
+(c-lines "#include <sys/ipc.h>~%")
(def-c-type __ipc_pid_t) ; ushort
; --------------------------- <sys/types.h> -----------------------------------

View file

@ -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
@ -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
@ -49,24 +69,28 @@ 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"
@ -74,35 +98,27 @@ stdenv.mkDerivation rec {
++ 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;
};
}

View file

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

View file

@ -1,98 +0,0 @@
# 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
{ lib, stdenv, fetchhg, libsigsegv, gettext, ncurses, readline, libX11
, libXau, libXt, pcre, zlib, libXpm, xorgproto, libXext
, libffi, libffcall, automake
, coreutils
# build options
, threadSupport ? stdenv.hostPlatform.isx86
, x11Support ? stdenv.hostPlatform.isx86
, dllSupport ? true
, withModules ? [
"pcre"
"rawsock"
]
++ 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.50pre20171114";
pname = "clisp";
src = fetchhg {
url = "http://hg.code.sf.net/p/clisp/clisp";
rev = "36df6dc59b8f";
sha256 = "1pidiv1m55lvc4ln8vx0ylnnhlj95y6hrfdq96nrj14f4v8fkvmr";
};
inherit libsigsegv gettext coreutils;
ffcallAvailable = stdenv.isLinux && (libffcall != null);
nativeBuildInputs = [ automake ]; # sometimes fails otherwise
buildInputs = [libsigsegv]
++ lib.optional (gettext != null) gettext
++ lib.optional (ncurses != null) ncurses
++ lib.optional (pcre != null) pcre
++ lib.optional (zlib != null) zlib
++ lib.optional (readline != null) readline
++ lib.optional (ffcallAvailable && (libffi != null)) libffi
++ lib.optional ffcallAvailable libffcall
++ lib.optionals x11Support [
libX11 libXau libXt libXpm xorgproto libXext
];
# 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)" ""
'';
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
++ 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
'';
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;
meta = {
description = "ANSI Common Lisp Implementation";
homepage = "http://clisp.cons.org";
maintainers = lib.teams.lisp.members;
# problems on Darwin: https://github.com/NixOS/nixpkgs/issues/20062
platforms = lib.platforms.linux;
};
}

View file

@ -1,12 +0,0 @@
diff --git a/modules/bindings/glibc/linux.lisp b/modules/bindings/glibc/linux.lisp
index c40b4f8..1c8edca 100644
--- a/modules/bindings/glibc/linux.lisp
+++ b/modules/bindings/glibc/linux.lisp
@@ -648,7 +648,6 @@
(def-call-out calloc (:arguments (nmemb size_t) (size size_t))
(:return-type c-pointer))
(def-call-out free (:arguments (ptr c-pointer)) (:return-type nil))
-(def-call-out cfree (:arguments (ptr c-pointer)) (:return-type nil))
(def-call-out valloc (:arguments (size size_t)) (:return-type c-pointer))
(def-call-out abort (:arguments) (:return-type nil))

View file

@ -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"];
};