Hi Simon,

> Should we apply a patch like the one below to gnulib?

The existing code follows the recommendation from the CLISP documentation
https://clisp.sourceforge.io/impnotes.html#quickstart-unix
  "The recommended path is /usr/local/bin/clisp, and if CLISP is actually
   installed elsewhere, making /usr/local/bin/clisp be a symbolic link to
   the real CLISP."

However, that documentation is outdated, focusing on platforms that are
less relevant today.

Debian's patch, to hardcode /usr/bin/clisp, is not good either, since
it doesn't work on Guix, nor Solaris, nor distros which don't package CLISP.
(Who is surprised that patches from Debian are Debian-specific?)

The solution is to use /usr/bin/env for a PATH lookup. So that it works
on Guix as well. Unfortunately, that requires using a non-POSIX option,
in order to avoid an error

  $ lib/uniname/gen-uninames.lisp UnicodeData.txt NameAliases.txt uninames.h
  /usr/bin/env: ‘clisp -C’: No such file or directory
  /usr/bin/env: use -[v]S to pass options in shebang lines


2024-07-02  Bruno Haible  <br...@clisp.org>

        uniname/uniname: Modernize gen-uninames.lisp.
        Reported by Simon Josefsson in
        <https://lists.gnu.org/archive/html/bug-gnulib/2024-07/msg00011.html>.
        * lib/uniname/gen-uninames.lisp: Swap second and third parameter. Look
        up clisp in $PATH.
        * lib/gen-uni-tables.c: Update invocation.

diff --git a/lib/uniname/gen-uninames.lisp b/lib/uniname/gen-uninames.lisp
index 1b0c60cf04..30191f2e8e 100755
--- a/lib/uniname/gen-uninames.lisp
+++ b/lib/uniname/gen-uninames.lisp
@@ -1,6 +1,7 @@
-#!/usr/local/bin/clisp -C
+#!/usr/bin/env -S clisp -C
 
-;;; Creation of gnulib's uninames.h from the UnicodeData.txt table.
+;;; Creation of gnulib's uninames.h from the UnicodeData.txt and 
NameAliases.txt
+;;; tables.
 
 ;;; Copyright (C) 2000-2024 Free Software Foundation, Inc.
 ;;; Written by Bruno Haible <br...@clisp.org>, 2000-12-28.
@@ -48,8 +49,8 @@
   length                        ; number of words
 )
 
-(defun main (inputfile outputfile aliasfile)
-  (declare (type string inputfile outputfile aliasfile))
+(defun main (inputfile aliasfile outputfile)
+  (declare (type string inputfile aliasfile outputfile))
   #+UNICODE (setq *default-file-encoding* charset:utf-8)
   (let ((all-chars '())
         (all-chars-hashed (make-hash-table :test #'equal))
diff --git a/lib/gen-uni-tables.c b/lib/gen-uni-tables.c
index 3ebcd833ff..b4f16da560 100644
--- a/lib/gen-uni-tables.c
+++ b/lib/gen-uni-tables.c
@@ -12075,8 +12075,8 @@ main (int argc, char * argv[])
  *   && diff uniwbrk/wbrkprop_org.txt uniwbrk/wbrkprop.txt              \\
  *   && clisp -C uniname/gen-uninames.lisp                              \\
  *            
/media/nas/bruno/www-archive/software/i18n/unicode/ftp.unicode.org/ArchiveVersions/15.1.0/ucd/UnicodeData.txt
 \\
- *            uniname/uninames.h                                        \\
  *            
/media/nas/bruno/www-archive/software/i18n/unicode/ftp.unicode.org/ArchiveVersions/15.1.0/ucd/NameAliases.txt
 \\
+ *            uniname/uninames.h                                        \\
  *   && { sed -e 's/^/# /' -e 's/ $//' < 
/media/nas/bruno/www-archive/software/i18n/unicode/ftp.unicode.org/ArchiveVersions/license.txt;
 \\
  *        echo; \\
  *        cat 
/media/nas/bruno/www-archive/software/i18n/unicode/ftp.unicode.org/ArchiveVersions/15.1.0/ucd/NameAliases.txt;
 } \\




Reply via email to