guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#53878] [PATCH v2 13/15] gnu: chez-mit: Support chez-scheme-for-rack


From: Philip McGrath
Subject: [bug#53878] [PATCH v2 13/15] gnu: chez-mit: Support chez-scheme-for-racket.
Date: Thu, 17 Feb 2022 15:50:46 -0500

Racket's variant of Chez Scheme defines 'string->uninterned-symbol',
which conflicts with the definition from '(chez mit)'. See discussion at
<https://github.com/racket/racket/issues/4151>.

* gnu/packages/chez.scm (chez-mit)[origin]<snippet>: Add workaround for
chez-scheme-for-racket.
---
 gnu/packages/chez.scm | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm
index 54bbee7923..be251798c3 100644
--- a/gnu/packages/chez.scm
+++ b/gnu/packages/chez.scm
@@ -355,7 +355,29 @@ (define-public chez-mit
              (commit (string-append "v" version))))
        (sha256
         (base32 "0c7i3b6i90xk96nmxn1pc9272a4yal4v40dm1a4ybdi87x53zkk0"))
-       (file-name (git-file-name name version))))
+       (file-name (git-file-name name version))
+       (snippet
+        ;; Workaround for chez-scheme-for-racket.
+        ;; See: https://github.com/racket/racket/issues/4151
+        #~(begin
+            (use-modules (guix build utils))
+            (substitute* "mit/core.sls"
+              (("[(]import ")
+               "(import (only (chezscheme) import)\n")
+              (("[(]define string->uninterned-symbol gensym[)]")
+               (format #f "~s"
+                       '(begin
+                          (import (only (chezscheme)
+                                        meta-cond
+                                        library-exports))
+                          (meta-cond
+                           ((memq 'string->uninterned-symbol
+                                  (library-exports '(chezscheme)))
+                            (import (only (chezscheme)
+                                          string->uninterned-symbol)))
+                           (else
+                            (define string->uninterned-symbol
+                              gensym)))))))))))
     (build-system gnu-build-system)
     (inputs
      (list chez-srfi))       ; for tests
-- 
2.32.0






reply via email to

[Prev in Thread] Current Thread [Next in Thread]