Hi,

Attached is a patch to make chicken-home consider CHICKEN_INSTALL_PREFIX.

Currently spock's tests fail when spock is tested by salmonella.  That's
because spock installs files in chicken-home, which maps to
C_INSTALL_SHARE_HOME (i.e., the "host's" chicken-home, not salmonella's
test directory).

This change should fix the issue related to spock and to eggs that use
chicken-home.

All the best.
Mario
-- 
http://parenteses.org/mario
>From 33f797de9276e9899d41b468f8905f63df944319 Mon Sep 17 00:00:00 2001
From: Mario Domenech Goulart <ma...@parenteses.org>
Date: Sun, 26 May 2019 18:29:33 +0200
Subject: [PATCH] Make chicken-home consider CHICKEN_INSTALL_PREFIX

Some eggs (e.g., spock) may rely on chicken-home to install files and
load code.

This change makes chicken-home take CHICKEN_INSTALL_PREFIX into
account, so that eggs get properly installed and executed by
salmonella.
---
 library.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/library.scm b/library.scm
index 3716fe52..48b56867 100644
--- a/library.scm
+++ b/library.scm
@@ -6417,7 +6417,12 @@ static C_word C_fcall C_setenv(C_word x, C_word y) {
 (define-foreign-variable installation-home c-string "C_INSTALL_SHARE_HOME")
 (define-foreign-variable install-egg-home c-string "C_INSTALL_EGG_HOME")
 
-(define (chicken-home) installation-home)
+(define (chicken-home)
+  (or (and-let* ((prefix (get-environment-variable "CHICKEN_INSTALL_PREFIX")))
+        (string-append prefix
+		       (if ##sys#windows-platform "\\" "/")
+		       "share"))
+      installation-home))
 
 (define path-list-separator
   (if ##sys#windows-platform #\; #\:))
-- 
2.11.0

_______________________________________________
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to