mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-03 19:26:36 +02:00
Merge pull request #1033 from Retropikzel/snow-chibi-racket
Add support for Racket to snow-chibi
This commit is contained in:
commit
6a15fffe4b
3 changed files with 47 additions and 0 deletions
|
@ -1665,6 +1665,7 @@ installed. The following are currently supported:
|
|||
\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{larceny - version 0.98; you need to add "lib/Snow" to the paths in startup.sch}
|
||||
\item{racket - version >= 8.16 with the \scheme{r7rs} pkg}
|
||||
\item{sagittarius - version >= 0.98}
|
||||
\item{stklos - version > 2.10}
|
||||
]
|
||||
|
|
|
@ -1411,6 +1411,11 @@
|
|||
(list (make-path
|
||||
(process->string
|
||||
'(stklos -e "(display (install-path #:libdir))")))))
|
||||
((racket)
|
||||
(list
|
||||
(make-path
|
||||
(process->string
|
||||
'(racket -I racket/base -e "(display (find-system-path 'collects-dir))")))))
|
||||
(else
|
||||
(list (make-path (or (conf-get cfg 'install-prefix) "/usr/local")
|
||||
"share/snow"
|
||||
|
@ -1499,6 +1504,10 @@
|
|||
`(larceny -r7rs -path ,(string-append install-dir ":" lib-path)
|
||||
-program ,file)
|
||||
`(larceny -r7rs -path ,install-dir -program ,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)
|
||||
(if lib-path
|
||||
`(stklos -A ,install-dir -A ,lib-path ,file)
|
||||
|
@ -1704,6 +1713,7 @@
|
|||
((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 'racket) (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-prefix)
|
||||
|
@ -1715,6 +1725,7 @@
|
|||
((eq? impl 'chicken) (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 'racket) (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-prefix)
|
||||
|
@ -1737,6 +1748,8 @@
|
|||
(car (get-install-dirs impl cfg)))
|
||||
((eq? impl 'guile)
|
||||
(get-guile-site-ccache-dir))
|
||||
((eq? impl 'racket)
|
||||
(car (get-install-dirs impl cfg)))
|
||||
((eq? impl 'stklos)
|
||||
(car (get-install-dirs impl cfg)))
|
||||
((conf-get cfg 'install-prefix)
|
||||
|
@ -1942,12 +1955,39 @@
|
|||
(library-shared-include-files
|
||||
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
|
||||
(define (lookup-installer installer)
|
||||
(case installer
|
||||
((chicken) chicken-installer)
|
||||
((cyclone) cyclone-installer)
|
||||
((guile) guile-installer)
|
||||
((racket) racket-installer)
|
||||
(else default-installer)))
|
||||
|
||||
(define (installer-for-implementation impl cfg)
|
||||
|
@ -1955,6 +1995,7 @@
|
|||
((chicken) 'chicken)
|
||||
((cyclone) 'cyclone)
|
||||
((guile) 'guile)
|
||||
((racket) 'racket)
|
||||
(else 'default)))
|
||||
|
||||
(define (install-library impl cfg library dir)
|
||||
|
|
|
@ -41,6 +41,10 @@
|
|||
'(kawa -e "(write (features))"))))
|
||||
(larceny "larceny" (larceny --version) "v0.98"
|
||||
,(delay '()))
|
||||
(racket "racket" (racket --version) #f
|
||||
,(delay
|
||||
(process->sexp
|
||||
'(racket -I r7rs -e "(import (scheme base) (scheme write)) (display (features))"))))
|
||||
(sagittarius "sagittarius" #f #f
|
||||
,(delay
|
||||
(process->sexp
|
||||
|
@ -66,6 +70,7 @@
|
|||
(case impl
|
||||
((chibi) (cond-expand (chibi #t) (else #f)))
|
||||
((gauche) (cond-expand (gauche #t) (else #f)))
|
||||
((racket) (cond-expand (racket #t) (else #f)))
|
||||
((sagittarius) (cond-expand (sagittarius #t) (else #f)))
|
||||
((stklos) (cond-expand (stklos #t) (else #f)))
|
||||
(else #f)))
|
||||
|
|
Loading…
Add table
Reference in a new issue