Merge branch 'master' into snow-chibi-sagittarius

This commit is contained in:
Alex Shinn 2025-06-29 13:34:01 +09:00 committed by GitHub
commit bac3f32e55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 47 additions and 0 deletions

View file

@ -1666,5 +1666,7 @@ installed. The following are currently supported:
\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}
\item{sagittarius - version >= 0.9.13} \item{sagittarius - version >= 0.9.13}
\item{racket - version >= 8.16 with the \scheme{r7rs} pkg}
\item{sagittarius - version >= 0.98}
\item{stklos - version > 2.10} \item{stklos - version > 2.10}
] ]

View file

@ -1415,6 +1415,11 @@
(list (make-path (list (make-path
(process->string (process->string
'(stklos -e "(display (install-path #:libdir))"))))) '(stklos -e "(display (install-path #:libdir))")))))
((racket)
(list
(make-path
(process->string
'(racket -I racket/base -e "(display (find-system-path 'collects-dir))")))))
(else (else
(list (make-path (or (conf-get cfg 'install-prefix) "/usr/local") (list (make-path (or (conf-get cfg 'install-prefix) "/usr/local")
"share/snow" "share/snow"
@ -1507,6 +1512,10 @@
(if lib-path (if lib-path
`(sagittarius -A ,install-dir -A ,lib-path ,file) `(sagittarius -A ,install-dir -A ,lib-path ,file)
`(sagittarius -A ,install-dir ,file))) `(sagittarius -A ,install-dir ,file)))
((racket)
(if lib-path
`(racket -I r7rs -S ,install-dir -S ,lib-path --script ,file)
`(racket -I r7rs -S ,install-dir --script ,file)))
((stklos) ((stklos)
(if lib-path (if lib-path
`(stklos -A ,install-dir -A ,lib-path ,file) `(stklos -A ,install-dir -A ,lib-path ,file)
@ -1718,6 +1727,7 @@
((eq? impl 'generic) (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 'sagittarius) (get-install-library-dir impl cfg)) ((eq? impl 'sagittarius) (get-install-library-dir impl cfg))
((eq? impl 'racket) (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-source-dir)) ((conf-get cfg 'install-source-dir))
((conf-get cfg 'install-prefix) ((conf-get cfg 'install-prefix)
@ -1730,6 +1740,7 @@
((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 'generic) (get-install-library-dir impl cfg))
((eq? impl 'sagittarius) (get-install-library-dir impl cfg)) ((eq? impl 'sagittarius) (get-install-library-dir impl cfg))
((eq? impl 'racket) (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)
@ -1753,6 +1764,7 @@
((eq? impl 'guile) ((eq? impl 'guile)
(get-guile-site-ccache-dir)) (get-guile-site-ccache-dir))
((eq? impl 'sagittarius) ((eq? impl 'sagittarius)
((eq? impl 'racket)
(car (get-install-dirs impl cfg))) (car (get-install-dirs impl cfg)))
((eq? impl 'stklos) ((eq? impl 'stklos)
(car (get-install-dirs impl cfg))) (car (get-install-dirs impl cfg)))
@ -1961,12 +1973,39 @@
(library-shared-include-files (library-shared-include-files
impl cfg (make-path dir source-scm-file)))))))) impl cfg (make-path dir source-scm-file))))))))
;; Racket can only load files with .rkt suffix. So for each library we create
;; a file that sets language to r7rs and includes the .sld file
(define (racket-installer impl cfg library dir)
(let* ((source-rkt-file
(make-path dir
(string-append (path-strip-extension (get-library-file cfg library))
".rkt")))
(install-dir (get-install-source-dir impl cfg))
(dest-rkt-file
(make-path install-dir
(string-append (library->path cfg library) ".rkt")))
(path (make-path install-dir dest-rkt-file))
(include-filename (string-append
(path-strip-directory (path-strip-extension path))
".sld"))
(installed-files (default-installer impl cfg library dir)))
(with-output-to-file
source-rkt-file
(lambda ()
(map display
(list "#lang r7rs" #\newline
"(import (scheme base))" #\newline
"(include \"" include-filename "\")" #\newline))))
(install-file cfg source-rkt-file dest-rkt-file)
(cons dest-rkt-file installed-files)))
;; installers should return the list of installed files ;; installers should return the list of installed files
(define (lookup-installer installer) (define (lookup-installer installer)
(case installer (case installer
((chicken) chicken-installer) ((chicken) chicken-installer)
((cyclone) cyclone-installer) ((cyclone) cyclone-installer)
((guile) guile-installer) ((guile) guile-installer)
((racket) racket-installer)
(else default-installer))) (else default-installer)))
(define (installer-for-implementation impl cfg) (define (installer-for-implementation impl cfg)
@ -1974,6 +2013,7 @@
((chicken) 'chicken) ((chicken) 'chicken)
((cyclone) 'cyclone) ((cyclone) 'cyclone)
((guile) 'guile) ((guile) 'guile)
((racket) 'racket)
(else 'default))) (else 'default)))
(define (install-library impl cfg library dir) (define (install-library impl cfg library dir)

View file

@ -41,6 +41,10 @@
'(kawa -e "(write (features))")))) '(kawa -e "(write (features))"))))
(larceny "larceny" (larceny --version) "v0.98" (larceny "larceny" (larceny --version) "v0.98"
,(delay '())) ,(delay '()))
(racket "racket" (racket --version) #f
,(delay
(process->sexp
'(racket -I r7rs -e "(import (scheme base) (scheme write)) (display (features))"))))
(sagittarius "sagittarius" (sagittarius --version) #f (sagittarius "sagittarius" (sagittarius --version) #f
,(delay ,(delay
(process->sexp (process->sexp
@ -66,6 +70,7 @@
(case impl (case impl
((chibi) (cond-expand (chibi #t) (else #f))) ((chibi) (cond-expand (chibi #t) (else #f)))
((gauche) (cond-expand (gauche #t) (else #f))) ((gauche) (cond-expand (gauche #t) (else #f)))
((racket) (cond-expand (racket #t) (else #f)))
((sagittarius) (cond-expand (sagittarius #t) (else #f))) ((sagittarius) (cond-expand (sagittarius #t) (else #f)))
((stklos) (cond-expand (stklos #t) (else #f))) ((stklos) (cond-expand (stklos #t) (else #f)))
(else #f))) (else #f)))