Merge pull request #1026 from Retropikzel/generic
Some checks are pending
CI / macos-latest (push) Waiting to run
CI / ubuntu-latest (push) Waiting to run

Add generic implementation into snow-chibi
This commit is contained in:
Alex Shinn 2025-06-25 15:58:37 +09:00 committed by GitHub
commit 8e2e1bb80e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 20 additions and 25 deletions

View file

@ -415,12 +415,7 @@ install-base: all
$(INSTALL) -m0644 doc/chibi-doc.1 $(DESTDIR)$(MANDIR)/ $(INSTALL) -m0644 doc/chibi-doc.1 $(DESTDIR)$(MANDIR)/
-if type $(LDCONFIG) >/dev/null 2>/dev/null; then $(LDCONFIG) >/dev/null 2>/dev/null; fi -if type $(LDCONFIG) >/dev/null 2>/dev/null; then $(LDCONFIG) >/dev/null 2>/dev/null; fi
install-bash-completion: install: install-base
if [ -d "/etc/bash_completion.d" ]; then \
cp tools/snow-chibi-completion.bash /etc/bash_completion.d/snow-chibi; \
fi
install: install-base install-bash-completion
ifneq "$(IMAGE_FILES)" "" ifneq "$(IMAGE_FILES)" ""
echo "Generating images" echo "Generating images"
-[ -z "$(DESTDIR)" ] && LD_LIBRARY_PATH="$(SOLIBDIR):$(LD_LIBRARY_PATH)" DYLD_LIBRARY_PATH="$(SOLIBDIR):$(DYLD_LIBRARY_PATH)" CHIBI_MODULE_PATH="$(MODDIR):$(BINMODDIR)" $(BINDIR)/chibi-scheme$(EXE) -mchibi.repl -d $(MODDIR)/chibi.img -[ -z "$(DESTDIR)" ] && LD_LIBRARY_PATH="$(SOLIBDIR):$(LD_LIBRARY_PATH)" DYLD_LIBRARY_PATH="$(SOLIBDIR):$(DYLD_LIBRARY_PATH)" CHIBI_MODULE_PATH="$(MODDIR):$(BINMODDIR)" $(BINDIR)/chibi-scheme$(EXE) -mchibi.repl -d $(MODDIR)/chibi.img
@ -502,7 +497,6 @@ uninstall:
-$(RMDIR) $(DESTDIR)$(MODDIR) $(DESTDIR)$(BINMODDIR) -$(RMDIR) $(DESTDIR)$(MODDIR) $(DESTDIR)$(BINMODDIR)
-$(RM) $(DESTDIR)$(MANDIR)/chibi-scheme.1 $(DESTDIR)$(MANDIR)/chibi-ffi.1 $(DESTDIR)$(MANDIR)/chibi-doc.1 -$(RM) $(DESTDIR)$(MANDIR)/chibi-scheme.1 $(DESTDIR)$(MANDIR)/chibi-ffi.1 $(DESTDIR)$(MANDIR)/chibi-doc.1
-$(RM) $(DESTDIR)$(PKGCONFDIR)/chibi-scheme.pc -$(RM) $(DESTDIR)$(PKGCONFDIR)/chibi-scheme.pc
-$(RM) /etc/bash_completion.d/snow-chibi
dist: distclean dist: distclean
$(RM) chibi-scheme-$(CHIBI_VERSION).tgz $(RM) chibi-scheme-$(CHIBI_VERSION).tgz

View file

@ -1635,15 +1635,16 @@ conventions, you can thus simply run \scheme{snow-chibi package
\subsubsection{Other Implementations} \subsubsection{Other Implementations}
Although the command is called \scheme{snow-chibi}, it supports Although the command is called \scheme{snow-chibi}, it supports
several other R7RS implementations. The \scheme{implementations} several other R7RS implementations and generic installation of libraries.
command tells you which you currently have installed. The following The \scheme{implementations} command tells you which you currently have
are currently supported: installed. The following are currently supported:
\itemlist[ \itemlist[
\item{chibi - version >= 0.7.3} \item{chibi - version >= 0.7.3}
\item{chicken - version >= 4.9.0 with the \scheme{r7rs} egg} \item{chicken - version >= 4.9.0 with the \scheme{r7rs} egg}
\item{cyclone - version >= 0.5.3} \item{cyclone - version >= 0.5.3}
\item{foment - version >= 0.4} \item{foment - version >= 0.4}
\item{generic; By default libraries are installed into /usr/local/lib/snow or %LOCALAPPDATA%/lib/snow on windows}
\item{gauche - version >= 0.9.4} \item{gauche - version >= 0.9.4}
\item{kawa - version >= 2.0; you need to add the install dir to the search path, e.g. \scheme{-Dkawa.import.path=/usr/local/share/kawa}} \item{kawa - version >= 2.0; you need to add the install dir to the search path, e.g. \scheme{-Dkawa.import.path=/usr/local/share/kawa}}
\item{larceny - version 0.98; you need to add "lib/Snow" to the paths in startup.sch} \item{larceny - version 0.98; you need to add "lib/Snow" to the paths in startup.sch}

View file

@ -24,9 +24,10 @@
(else (else
(warn msg) (warn msg)
#f)))))) #f))))))
(and confirm? (or (equal? (car spec) 'generic)
(yes-or-no? cfg "Implementation " (car spec) " does not " (and confirm?
" seem to be available, install anyway?")))) (yes-or-no? cfg "Implementation " (car spec) " does not "
" seem to be available, install anyway?")))))
(define (conf-selected-implementations cfg) (define (conf-selected-implementations cfg)
(let ((requested (conf-get-list cfg 'implementations '(chibi)))) (let ((requested (conf-get-list cfg 'implementations '(chibi))))
@ -1373,6 +1374,11 @@
(string-trim (process->string '(icyc -p "(Cyc-installation-dir 'sld)")) (string-trim (process->string '(icyc -p "(Cyc-installation-dir 'sld)"))
char-whitespace?))))) char-whitespace?)))))
(list (or dir "/usr/local/share/cyclone/")))) (list (or dir "/usr/local/share/cyclone/"))))
((generic)
(list (make-path (or (conf-get cfg 'install-prefix)
(cond-expand (windows (get-environment-variable "LOCALAPPDATA"))
(else "/usr/local"))
"/lib/snow"))))
((gauche) ((gauche)
(list (list
(let ((dir (string-trim (let ((dir (string-trim
@ -1696,6 +1702,7 @@
(cond (cond
((eq? impl 'chicken) (get-install-library-dir impl cfg)) ((eq? impl 'chicken) (get-install-library-dir impl cfg))
((eq? impl 'cyclone) (get-install-library-dir impl cfg)) ((eq? impl 'cyclone) (get-install-library-dir impl cfg))
((eq? impl 'generic) (get-install-library-dir impl cfg))
((eq? impl 'guile) (get-guile-site-dir)) ((eq? impl 'guile) (get-guile-site-dir))
((eq? impl 'stklos) (get-install-library-dir impl cfg)) ((eq? impl 'stklos) (get-install-library-dir impl cfg))
((conf-get cfg 'install-source-dir)) ((conf-get cfg 'install-source-dir))
@ -1707,6 +1714,7 @@
(cond (cond
((eq? impl 'chicken) (get-install-library-dir impl cfg)) ((eq? impl 'chicken) (get-install-library-dir impl cfg))
((eq? impl 'cyclone) (get-install-library-dir impl cfg)) ((eq? impl 'cyclone) (get-install-library-dir impl cfg))
((eq? impl 'generic) (get-install-library-dir impl cfg))
((eq? impl 'stklos) (get-install-library-dir impl cfg)) ((eq? impl 'stklos) (get-install-library-dir impl cfg))
((conf-get cfg 'install-data-dir)) ((conf-get cfg 'install-data-dir))
((conf-get cfg 'install-prefix) ((conf-get cfg 'install-prefix)
@ -1723,6 +1731,8 @@
(get-chicken-binary-version cfg)))) (get-chicken-binary-version cfg))))
(else (else
(car (get-install-dirs impl cfg))))) (car (get-install-dirs impl cfg)))))
((eq? impl 'generic)
(car (get-install-dirs impl cfg)))
((eq? impl 'cyclone) ((eq? impl 'cyclone)
(car (get-install-dirs impl cfg))) (car (get-install-dirs impl cfg)))
((eq? impl 'guile) ((eq? impl 'guile)

View file

@ -25,6 +25,8 @@
,(delay ,(delay
(process->sexp (process->sexp
'(foment -e "(write (features))")))) '(foment -e "(write (features))"))))
(generic "generic" #f #f
,(delay (write-string "generic\n")))
(gauche "gosh" (gosh -E "print (gauche-version)") "0.9.4" (gauche "gosh" (gosh -E "print (gauche-version)") "0.9.4"
,(delay ,(delay
(process->sexp (process->sexp

View file

@ -1,12 +0,0 @@
#/usr/bin/env bash
_snow_chibi_completions() {
if [ "${#COMP_WORDS[@]}" -gt "2" ]
then
COMPREPLY=($(compgen -f -- "${COMP_WORDS[COMP_CWORD]}"))
else
COMPREPLY=($(compgen -W "search show install upgrade remove status package gen-key reg-key sign verify upload index update implementations help" "${COMP_WORDS[COMP_CWORD]}"))
fi
}
complete -o bashdefault -F _snow_chibi_completions snow-chibi