From 3bf1c67afa5eb16dbc60fe4288bf2d72231eda20 Mon Sep 17 00:00:00 2001 From: retropikzel Date: Sat, 31 Jan 2026 07:44:22 +0200 Subject: [PATCH 1/4] Improve Kawa library path finding --- lib/chibi/snow/commands.scm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/chibi/snow/commands.scm b/lib/chibi/snow/commands.scm index 279cfddf..a2aea859 100644 --- a/lib/chibi/snow/commands.scm +++ b/lib/chibi/snow/commands.scm @@ -1550,7 +1550,22 @@ path "/usr/local/share/guile/")))) ((kawa) - (list "/usr/local/share/kawa/lib")) + (make-path + (if (conf-get cfg 'install-prefix) (conf-get cfg 'install-prefix) "") + (path-directory + (car + (string-split + (call-with-temp-file + "snow-kawa.scm" + (lambda (tmp-path out preserve) + (with-output-to-file + tmp-path + (lambda () + (display "(import (scheme base) (scheme write) (scheme process-context))") + (newline) + (display "(display (get-environment-variable \"CLASSPATH\"))"))) + (process->string `(kawa ,tmp-path)))) + #\:))))) ((loko) (list "/usr/local/share/r6rs")) ((mit-scheme) From 972cfd28a3eb3598740d79cbc82b903d99e65799 Mon Sep 17 00:00:00 2001 From: retropikzel Date: Sat, 31 Jan 2026 07:51:03 +0200 Subject: [PATCH 2/4] Forgot to return as list --- lib/chibi/snow/commands.scm | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/lib/chibi/snow/commands.scm b/lib/chibi/snow/commands.scm index a2aea859..7b5e42b1 100644 --- a/lib/chibi/snow/commands.scm +++ b/lib/chibi/snow/commands.scm @@ -1550,22 +1550,23 @@ path "/usr/local/share/guile/")))) ((kawa) - (make-path - (if (conf-get cfg 'install-prefix) (conf-get cfg 'install-prefix) "") - (path-directory - (car - (string-split - (call-with-temp-file - "snow-kawa.scm" - (lambda (tmp-path out preserve) - (with-output-to-file - tmp-path - (lambda () - (display "(import (scheme base) (scheme write) (scheme process-context))") - (newline) - (display "(display (get-environment-variable \"CLASSPATH\"))"))) - (process->string `(kawa ,tmp-path)))) - #\:))))) + (list + (make-path + (if (conf-get cfg 'install-prefix) (conf-get cfg 'install-prefix) "") + (path-directory + (car + (string-split + (call-with-temp-file + "snow-kawa.scm" + (lambda (tmp-path out preserve) + (with-output-to-file + tmp-path + (lambda () + (display "(import (scheme base) (scheme write) (scheme process-context))") + (newline) + (display "(display (get-environment-variable \"CLASSPATH\"))"))) + (process->string `(kawa ,tmp-path)))) + #\:)))))) ((loko) (list "/usr/local/share/r6rs")) ((mit-scheme) From 38a2fa1f327cf314319099e23579ef9682cc9db7 Mon Sep 17 00:00:00 2001 From: retropikzel Date: Fri, 6 Feb 2026 07:25:32 +0200 Subject: [PATCH 3/4] Add Kawa default path. Improve classpath checking. --- lib/chibi/snow/commands.scm | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/lib/chibi/snow/commands.scm b/lib/chibi/snow/commands.scm index 7b5e42b1..33262468 100644 --- a/lib/chibi/snow/commands.scm +++ b/lib/chibi/snow/commands.scm @@ -1553,20 +1553,17 @@ (list (make-path (if (conf-get cfg 'install-prefix) (conf-get cfg 'install-prefix) "") - (path-directory - (car - (string-split - (call-with-temp-file - "snow-kawa.scm" - (lambda (tmp-path out preserve) - (with-output-to-file - tmp-path - (lambda () - (display "(import (scheme base) (scheme write) (scheme process-context))") - (newline) - (display "(display (get-environment-variable \"CLASSPATH\"))"))) - (process->string `(kawa ,tmp-path)))) - #\:)))))) + (let ((kawa-classpath + (string-split + (process->string + `(kawa -e "(display (get-environment-variable \"CLASSPATH\"))")) + #\.))) + (if (or (null? kawa-classpath) + (not (string-suffix? "kawa" (car kawa-classpath)))) + "/usr/local/share/kawa/lib" + (string-copy (car kawa-classpath) + 0 + (- (string-length (car kawa-classpath)) 4))))))) ((loko) (list "/usr/local/share/r6rs")) ((mit-scheme) From ff3253d2cfcb6bb3a21008d93d54c6f373386bf0 Mon Sep 17 00:00:00 2001 From: retropikzel Date: Sat, 7 Feb 2026 06:20:06 +0200 Subject: [PATCH 4/4] Split the path by : --- lib/chibi/snow/commands.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/chibi/snow/commands.scm b/lib/chibi/snow/commands.scm index 33262468..9d3c9285 100644 --- a/lib/chibi/snow/commands.scm +++ b/lib/chibi/snow/commands.scm @@ -1557,13 +1557,13 @@ (string-split (process->string `(kawa -e "(display (get-environment-variable \"CLASSPATH\"))")) - #\.))) + #\:))) (if (or (null? kawa-classpath) - (not (string-suffix? "kawa" (car kawa-classpath)))) + (not (string-suffix? "kawa.jar" (car kawa-classpath)))) "/usr/local/share/kawa/lib" (string-copy (car kawa-classpath) 0 - (- (string-length (car kawa-classpath)) 4))))))) + (- (string-length (car kawa-classpath)) 8))))))) ((loko) (list "/usr/local/share/r6rs")) ((mit-scheme)