From 7cecc3c028cc81a8f5020a35e36c2ce6d57aa621 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Fri, 16 Jul 2021 21:24:30 -0600 Subject: [PATCH] Update to latest git snapshot for autoconf + glib updates. - Drop upstreamed -setkey patch. - Use forge macros. - Use default HyperSpec URLs. --- .gitignore | 1 + clhs.el | 136 +++++++++++++++++++++++++++++++++++++++++++++ clisp-db.patch | 26 ++++----- clisp-setkey.patch | 34 ------------ clisp-test.patch | 11 ++++ clisp.spec | 82 +++++++++++++++------------ sources | 2 +- 7 files changed, 208 insertions(+), 84 deletions(-) create mode 100644 clhs.el delete mode 100644 clisp-setkey.patch create mode 100644 clisp-test.patch diff --git a/.gitignore b/.gitignore index f1217b7..063c566 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /clisp-*.tar.?z +/clisp-*.tar.bz2 diff --git a/clhs.el b/clhs.el new file mode 100644 index 0000000..0628082 --- /dev/null +++ b/clhs.el @@ -0,0 +1,136 @@ +;;; clhs.el --- Access the Common Lisp HyperSpec (CLHS) -*- lexical-binding: t -*- +;; Version: 2 +;; Homepage: https://gitlab.com/sam-s/clhs +;; Maintainer: Sam Steingold + +;;; This works with both +;;; * the "long file name" version released by Harlequin and available +;;; at the MIT web site as +;;; http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/FrontMatter/ +;;; * the "8.3 file name" version released later by Xanalys/LispWorks and +;;; available at http://www.lispworks.com/documentation/common-lisp.html +;;; This is accomplished by not hard-wiring the symbol->file table +;;; but reading the Data/ file instead. + +;;; Copyright (C) 2002-2008, 2017, 2019, 2021 Sam Steingold +;;; Keywords: lisp, common lisp, emacs, ANSI CL, hyperspec +;;; released under the GNU GPL +;;; as a part of GNU CLISP + +;;; Usage: + +;; (autoload 'clhs-doc "clhs" "Get doc on ANSI CL" t) +;; (define-key help-map "\C-l" 'clhs-doc) +;; (custom-set-variables +;; '(tags-apropos-additional-actions '(("Common Lisp" clhs-doc clhs-symbols)))) + +;;; Commentary: + +;; Kent Pitman and the Harlequin Group (later Xanalys) have made the +;; text of the "American National Standard for Information Technology -- +;; Programming Language -- Common Lisp", ANSI X3.226-1994 available on +;; the WWW, in the form of the Common Lisp HyperSpec. This package +;; makes it convenient to peruse this documentation from within Emacs. + +;; This is inspired by the Erik Naggum's version of 1997. + +;;; Code: + +(require 'browse-url) +(require 'thingatpt) +(require 'url) + +(defvar clhs-symbols nil) + +(defcustom clhs-root "http://clhs.lisp.se/" + ;; "http://www.lispworks.com/documentation/HyperSpec/" + ;; "http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/html/hyperspec/HyperSpec/" + ;; "http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/" + "*The root of the Common Lisp HyperSpec URL. +If you copy the HyperSpec to your local system, set this variable to +something like \"file:/usr/local/doc/HyperSpec/\"." + :group 'lisp + :set (lambda (s v) + (setq clhs-symbols nil) + (set-default s v)) + :type 'string) + +(defvar clhs-history nil + "History of symbols looked up in the Common Lisp HyperSpec so far.") + +(defun clhs-table-buffer (&optional root) + "Create a buffer containing the CLHS symbol table. +Optional argument ROOT specifies the CLHS root location + and defaults to `clhs-root'." + (unless root (setq root clhs-root)) + (if (string-match "^file:/" root) + (with-current-buffer (get-buffer-create " *clhs-tmp-buf*") + (insert-file-contents-literally + (let* ((d (concat (substring root 6) "/Data/")) + (f (concat d "Map_Sym.txt"))) + (if (file-exists-p f) f + (setq f (concat d "Symbol-Table.text")) + (if (file-exists-p f) f + (error "No symbol table at %s" root)))) + nil nil nil t) + (goto-char 0) + (current-buffer)) + (let* ((d (concat root "/Data/")) + (f (concat d "Map_Sym.txt"))) + (set-buffer (url-retrieve-synchronously f)) + (goto-char 0) + (unless (looking-at "^HTTP/.*200 *OK$") + (kill-buffer (current-buffer)) + (setq f (concat d "Symbol-Table.text")) + (set-buffer (url-retrieve-synchronously f)) + (goto-char 0) + (unless (looking-at "^HTTP/.*200 *OK$") + (kill-buffer (current-buffer)) + (error "No symbol table at %s" root))) + ;; skip to the first symbol + (search-forward "\n\n") + (current-buffer)))) + +(defun clhs-read-symbols () + "Read variable `clhs-symbols' from the current position in the current buffer." + (while (not (eobp)) + (puthash (buffer-substring-no-properties ; symbol + (line-beginning-position) (line-end-position)) + (progn (forward-line 1) ; file name + (buffer-substring-no-properties ; strip "../" + (+ 3 (line-beginning-position)) (line-end-position))) + clhs-symbols) + (forward-line 1))) + +(defun clhs-symbols () + "Get variable `clhs-symbols' from `clhs-root'." + (if (and clhs-symbols (not (= 0 (hash-table-count clhs-symbols)))) + clhs-symbols + (with-current-buffer (clhs-table-buffer) + (unless clhs-symbols + (setq clhs-symbols (make-hash-table :test 'equal :size 1031))) + (clhs-read-symbols) + (kill-buffer (current-buffer)) + clhs-symbols))) + +;;;###autoload +(defun clhs-doc (symbol-name &optional kill) + "Browse the Common Lisp HyperSpec documentation for SYMBOL-NAME. +Finds the HyperSpec at `clhs-root'. +With prefix arg KILL, save the URL in the `kill-ring' instead." + (interactive (list (let ((sym (thing-at-point 'symbol t)) + (completion-ignore-case t)) + (completing-read + "Look-up symbol in the Common Lisp HyperSpec: " + (clhs-symbols) nil t sym 'clhs-history)) + current-prefix-arg)) + (unless (= ?/ (aref clhs-root (1- (length clhs-root)))) + (setq clhs-root (concat clhs-root "/"))) + (let ((url (concat clhs-root (gethash (upcase symbol-name) (clhs-symbols))))) + (if kill + (kill-new url) + (browse-url url)))) + +(provide 'clhs) + +;;; clhs.el ends here diff --git a/clisp-db.patch b/clisp-db.patch index e30179d..aced4e2 100644 --- a/clisp-db.patch +++ b/clisp-db.patch @@ -1,5 +1,16 @@ ---- modules/berkeley-db/configure.in.orig 2018-04-23 07:44:21.000000000 -0600 -+++ modules/berkeley-db/configure.in 2018-06-21 20:30:56.502368686 -0600 +--- modules/berkeley-db/configure.orig 2021-06-28 14:32:42.000000000 -0600 ++++ modules/berkeley-db/configure 2021-07-16 15:35:19.789568797 -0600 +@@ -6376,7 +6376,7 @@ then : + else $as_nop + + CFLAGS_save="$CFLAGS" +-CFLAGS="$CFLAGS -Werror" ++CFLAGS="$CFLAGS -Wno-uninitialized -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include +--- modules/berkeley-db/configure.in.orig 2021-06-28 14:32:42.000000000 -0600 ++++ modules/berkeley-db/configure.in 2021-07-16 15:35:19.786568792 -0600 @@ -48,7 +48,7 @@ dnl set_errcall() accepts DBE], ac_cv_dbe_set_errcall_accept_dbe,[ @@ -9,14 +20,3 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include void my_callback (const DB_ENV* dbe, const char *errpfx, const char *msg) {}], [[DB_ENV dbe; dbe.set_errcall(&dbe,&my_callback);]])], ---- modules/berkeley-db/configure.orig 2018-04-23 07:44:21.000000000 -0600 -+++ modules/berkeley-db/configure 2018-06-21 20:30:56.504368682 -0600 -@@ -5814,7 +5814,7 @@ if ${ac_cv_dbe_set_errcall_accept_dbe+:} - else - - CFLAGS_save="$CFLAGS" --CFLAGS="$CFLAGS -Werror" -+CFLAGS="$CFLAGS -Wno-uninitialized -Werror" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include diff --git a/clisp-setkey.patch b/clisp-setkey.patch deleted file mode 100644 index 75e11cb..0000000 --- a/clisp-setkey.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- modules/syscalls/posix.lisp.orig 2018-07-18 17:50:36.000000000 -0600 -+++ modules/syscalls/posix.lisp 2018-08-01 15:54:47.410580519 -0600 -@@ -72,7 +72,7 @@ - (addrtype 2 :type fixnum :read-only t)) - - ;;; ============================================================ --#+unix (export '(crypt encrypt setkey)) -+#+unix (export '(crypt)) - - #+unix - (defstruct (user-info (:constructor ---- modules/syscalls/test.tst.orig 2018-07-18 17:50:36.000000000 -0600 -+++ modules/syscalls/test.tst 2018-08-01 15:55:58.241645520 -0600 -@@ -14,20 +14,6 @@ T - (> (length (show (os:service) :pretty t)) (length (os:service nil "tcp"))) T - (equalp (os:service "www" "tcp") (os:service "http" "tcp")) T - --#+unix ;; (encrypt (encrypt X t) nil) == X --(handler-case -- (let* ((v (make-array 8 :element-type '(unsigned-byte 8))) (u (copy-seq v))) -- (loop :repeat 10 :do -- (dotimes (i 8) (setf (aref v i) (setf (aref u i) (random 256)))) -- (os:setkey v) (show (os:encrypt v nil)) (show (os:encrypt v t)) -- :never (if (equalp v u) nil (list v u)))) -- (ext:os-error (err) -- ;; Solaris (sf cf x86-solaris1 & sparc-solaris1) encrypt fails with -- ;; "UNIX error 89 (ENOSYS): Function not implemented" -- (format t "~S: ~A" 'os:encrypt err) -- T)) --#+unix T -- - #+unix (crypt "foo" "bar") #+unix "ba4TuD1iozTxw" - - ;; same as "%F %T" on GNU, but more portable diff --git a/clisp-test.patch b/clisp-test.patch new file mode 100644 index 0000000..ba89ae1 --- /dev/null +++ b/clisp-test.patch @@ -0,0 +1,11 @@ +--- tests/streams.tst.orig 2021-06-28 14:32:42.000000000 -0600 ++++ tests/streams.tst 2021-07-16 16:59:50.530422810 -0600 +@@ -1290,7 +1290,7 @@ T + (write-line "foo" s) "foo" + (let ((*reopen-open-file* nil)) ; stdout can be a file, it will be detected! + (with-open-file (copy s :direction :output) (streamp copy))) +-#.(if (member (ext:operating-system-type) '("AIX" "Haiku" "HP-UX" "Minix" "Windows") :test #'equal) 'ERROR 'T) ++#.(if (member (ext:operating-system-type) '("AIX" "Haiku" "HP-UX" "Linux" "Minix" "Windows") :test #'equal) 'ERROR 'T) + + #+clisp + (progn diff --git a/clisp.spec b/clisp.spec index bebe849..0977c6c 100644 --- a/clisp.spec +++ b/clisp.spec @@ -1,5 +1,8 @@ -%global commit d9cbf22d18680f9b9c84579be6bc363e4bd1090c -%global shortcommit %(c=%{commit}; echo ${c:0:7}) +# Upstream has not made a new release since 2010 +%global srcname clisp +%global commit de01f0f47bb44d3a0f9e842464cf2520b238f356 +%global date 20210628 +%global forgeurl https://gitlab.com/gnu-clisp/clisp # There is a plus on the end for unreleased versions, not for released versions %global instdir %{name}-%{version}+ @@ -7,20 +10,24 @@ Name: clisp Summary: ANSI Common Lisp implementation Version: 2.49.93 -Release: 20.%{shortcommit}git%{?dist} + +%forgemeta + +Release: 21%{?dist} License: GPLv2+ URL: http://www.clisp.org/ -# The source for this package was pulled from upstream's git repository. -Source0: https://gitlab.com/gnu-clisp/%{name}/repository/archive.tar.gz?ref=%{commit}#/%{name}-%{shortcommit}.tar.gz +Source0: %{forgesource} +# Upstream dropped this file from the distribution +Source1: https://gitlab.com/sam-s/clhs/-/raw/master/clhs.el # Updated translations -Source1: http://translationproject.org/latest/clisp/sv.po -Source2: http://translationproject.org/latest/clisp/de.po +Source2: http://translationproject.org/latest/clisp/sv.po +Source3: http://translationproject.org/latest/clisp/de.po # https://sourceforge.net/p/clisp/patches/35/ Patch0: %{name}-db.patch # https://sourceforge.net/p/clisp/patches/32/ Patch1: %{name}-format.patch -# The encrypt and setkey functions are no longer available from glibc -Patch2: %{name}-setkey.patch +# Work around for a test that fails with permission denied +Patch2: %{name}-test.patch # Adapt to changes in pari 2.11.0 Patch3: %{name}-pari.patch # The combination of register and volatile is nonsensical @@ -97,18 +104,10 @@ Files necessary for linking CLISP programs. %prep -%autosetup -p0 -n %{name}-%{commit}-%{commit} - -# Change URLs not affected by the --hyperspec argument to configure -sed -i.orig 's|lisp.org/HyperSpec/Body/chap-7.html|lispworks.com/documentation/HyperSpec/Body/07_.htm|' \ - src/clos-package.lisp -touch -r src/clos-package.lisp.orig src/clos-package.lisp -rm -f src/clos-package.lisp.orig -for f in src/_README.*; do - sed -i.orig 's|lisp.org/HyperSpec/FrontMatter|lispworks.com/documentation/HyperSpec/Front|' $f - touch -r ${f}.orig $f - rm -f ${f}.orig -done +%forgesetup +%autopatch -p0 +cp -p %{SOURCE1} emacs +cp -p %{SOURCE2} %{SOURCE3} src/po # We only link against libraries in system directories, so we need -L dir in # place of -Wl,-rpath -Wl,dir @@ -118,6 +117,9 @@ sed -i -e 's/${wl}-rpath ${wl}/-L/g' src/build-aux/config.rpath # Fix modules that need access to symbols in libgnu.a sed -i 's/\(${GLLIB_A}\) \(${LIBS}\)/-Wl,--whole-archive \1 -Wl,--no-whole-archive \2 -ldl/' src/makemake.in +# When building modules, put -Wl,--as-needed before the libraries to link +sed -i "s/CC='\${CC}'/CC='\${CC} -Wl,--as-needed'/" src/makemake.in + # Enable firefox to be the default browser for displaying documentation sed -i 's/;; \((setq \*browser\* .*)\)/\1/' src/cfgunix.lisp @@ -126,9 +128,6 @@ tar -C modules/clx -xzf modules/clx/clx-manual.tar.gz chmod -R go+r modules/clx/clx-manual chmod a-x modules/clx/clx-manual/html/doc-index.cgi -# Update the translations -cp -p %{SOURCE1} %{SOURCE2} src/po - # On some koji builders, something is already listening on port 9090, which # causes a spurious test failure. Change to port 9096 for the test. sed -i 's/9090/9096/g' tests/socket.tst @@ -150,7 +149,6 @@ export LC_ALL=C.UTF-8 --infodir=%{_infodir} \ --docdir=%{_pkgdocdir} \ --fsstnd=redhat \ - --hyperspec=http://www.lispworks.com/documentation/HyperSpec/ \ --with-module=asdf \ --with-module=berkeley-db \ --with-module=bindings/glibc \ @@ -167,12 +165,18 @@ export LC_ALL=C.UTF-8 --with-module=zlib \ --with-libreadline-prefix=$PWD/readline \ --with-ffcall \ - --cbcx \ + --config \ build \ CPPFLAGS="-I/usr/include/libsvm" \ CFLAGS="%{optflags} -Wa,--noexecstack" \ LDFLAGS="-Wl,--as-needed -Wl,-z,relro -Wl,-z,noexecstack" +cd build +# Workaround libtool reordering -Wl,--as-needed after all the libraries. +sed -i 's|CC="\(.*g..\)"|CC="\1 -Wl,--as-needed"|' libtool +make +cd - + %install make -C build DESTDIR=%{buildroot} install cp -a build/full %{buildroot}%{_libdir}/%{instdir} @@ -192,13 +196,12 @@ pushd %{buildroot}%{_datadir}/emacs/site-lisp %{_emacs_bytecompile} *.el popd -# Put back the original config.rpath, and fix executable bits +# Put back the original config.rpath cp -p config.rpath.orig %{buildroot}%{_libdir}/%{instdir}/build-aux/config.rpath -chmod a+x \ - %{buildroot}%{_libdir}/%{instdir}/build-aux/config.guess \ - %{buildroot}%{_libdir}/%{instdir}/build-aux/config.sub \ - %{buildroot}%{_libdir}/%{instdir}/build-aux/depcomp \ - %{buildroot}%{_libdir}/%{instdir}/build-aux/install-sh \ + +# Fix a missing executable bit +chmod a+x %{buildroot}%{_libdir}/%{instdir}/build-aux/depcomp + # Fix paths in the Makefiles for mk in $(find %{buildroot}%{_libdir} -name Makefile); do sed -e "s,$PWD/modules,%{_libdir}/%{instdir}," \ @@ -220,10 +223,6 @@ cp -p build/config.h %{buildroot}%{_libdir}/%{instdir} cp -p build/clx/new-clx/config.h \ %{buildroot}%{_libdir}/%{instdir}/clx/new-clx -# Fix permissions -chmod 0755 %{buildroot}%{_bindir}/%{name} -chmod 0755 %{buildroot}%{_libdir}/%{instdir}/full/lisp.run - # Fix broken symlinks in the full set pushd %{buildroot}%{_libdir}/%{instdir}/full for obj in calls gettext readline regexi; do @@ -270,6 +269,11 @@ popd ln -s ../../src/modules.c build/base/modules.c ln -s ../../src/modules.c build/full/modules.c +%check +make -C build check +make -C build extracheck +make -C build base-mod-check + %files -f %{name}.lang %license COPYRIGHT GNU-GPL %{_bindir}/clisp @@ -412,6 +416,12 @@ ln -s ../../src/modules.c build/full/modules.c %changelog +* Fri Jul 16 2021 Jerry James - 2.49.93-21.20210628gitde01f0f +- Update to latest git snapshot for autoconf + glib updates +- Drop upstreamed -setkey patch +- Use forge macros +- Use default HyperSpec URLs + * Thu Jun 17 2021 Jerry James - 2.49.93-20.d9cbf22git - Rebuild for ffcall 2.4 and multithreaded pari diff --git a/sources b/sources index 8fe623f..188f8e2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (clisp-d9cbf22.tar.gz) = 80260a22f999c5af26bfec5a69fce1dfd639855feb18e079fea80b8e43cb2dae2ad5ed75db9031e9452470e7b741c3a7868c2aee15dfd716a710d9938f4978d0 +SHA512 (clisp-de01f0f47bb44d3a0f9e842464cf2520b238f356.tar.bz2) = d135248d22233194c0cb087053c02b72bd24c0bb2c6b23f6ff9a931ef7b09446a55f061626bfa5da55531a11665c615dae0c2a651df5114a019c5188b67e8b5a