From 7c6811713c08fbea4d9eae067a1a5087d1af23e9 Mon Sep 17 00:00:00 2001 From: Tobias Mayer Date: Fri, 9 Jun 2023 08:49:41 +0200 Subject: clisp: 2.49 -> 2.50pre2023-01-12 --- .../clisp/bits_ipctypes_to_sys_ipc.patch | 12 --- pkgs/development/interpreters/clisp/default.nix | 82 ++++++++++-------- .../interpreters/clisp/gnulib_aarch64.patch | 13 +++ pkgs/development/interpreters/clisp/hg.nix | 98 ---------------------- .../interpreters/clisp/remove-cfree-binding.patch | 12 --- pkgs/top-level/all-packages.nix | 13 +-- 6 files changed, 63 insertions(+), 167 deletions(-) delete mode 100644 pkgs/development/interpreters/clisp/bits_ipctypes_to_sys_ipc.patch create mode 100644 pkgs/development/interpreters/clisp/gnulib_aarch64.patch delete mode 100644 pkgs/development/interpreters/clisp/hg.nix delete mode 100644 pkgs/development/interpreters/clisp/remove-cfree-binding.patch diff --git a/pkgs/development/interpreters/clisp/bits_ipctypes_to_sys_ipc.patch b/pkgs/development/interpreters/clisp/bits_ipctypes_to_sys_ipc.patch deleted file mode 100644 index d6163022830da..0000000000000 --- a/pkgs/development/interpreters/clisp/bits_ipctypes_to_sys_ipc.patch +++ /dev/null @@ -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 ~%") -+(c-lines "#include ~%") - (def-c-type __ipc_pid_t) ; ushort - - ; --------------------------- ----------------------------------- diff --git a/pkgs/development/interpreters/clisp/default.nix b/pkgs/development/interpreters/clisp/default.nix index 58dd5b4570ddb..cb0e547331c0f 100644 --- a/pkgs/development/interpreters/clisp/default.nix +++ b/pkgs/development/interpreters/clisp/default.nix @@ -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; }; } diff --git a/pkgs/development/interpreters/clisp/gnulib_aarch64.patch b/pkgs/development/interpreters/clisp/gnulib_aarch64.patch new file mode 100644 index 0000000000000..a0095835706a5 --- /dev/null +++ b/pkgs/development/interpreters/clisp/gnulib_aarch64.patch @@ -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; + diff --git a/pkgs/development/interpreters/clisp/hg.nix b/pkgs/development/interpreters/clisp/hg.nix deleted file mode 100644 index 91602ad93786a..0000000000000 --- a/pkgs/development/interpreters/clisp/hg.nix +++ /dev/null @@ -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; - }; -} diff --git a/pkgs/development/interpreters/clisp/remove-cfree-binding.patch b/pkgs/development/interpreters/clisp/remove-cfree-binding.patch deleted file mode 100644 index 4b570c3a46724..0000000000000 --- a/pkgs/development/interpreters/clisp/remove-cfree-binding.patch +++ /dev/null @@ -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)) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 38b4dd9d00775..c1ed5d973ca49 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26167,18 +26167,7 @@ with pkgs; # CLISP clisp = wrapLisp { - pkg = callPackage ../development/interpreters/clisp { - # On newer readline8 fails as: - # # - # 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"]; }; -- cgit 1.4.1