Subject: [PATCH] gnu: chicken: chicken-srfi-18 with dependencies

From: Kristian Lein-Mathisen <[email-masked]>
Date: Sun, 23 Apr 2023 17:30:36 +0200

Hi,

Here is a small patch that adds the quite common "srfi-18" egg  [1]. It
adds  multithreading support for CHICKEN Scheme. Please consider it for
inclusion.

Thanks,
Kristian

[1]: https://srfi.schemers.org/srfi-18/srfi-18.html
From 4043b4a67ef65577ee5de73e831007f6140e569f Mon Sep 17 00:00:00 2001
From: Kristian Lein-Mathisen <[email-masked]>
Date: Sun, 23 Apr 2023 17:16:38 +0200
Subject: [PATCH] gnu: chicken: add 2 eggs

The srfi-18 egg is a quite common dependency in the CHICKCEN ecosystem. Here
it is, along with its chicken-compile-file dependency.

* gnu/packages/chicken.scm (chicken-srfi-18): add variables
---
 gnu/packages/chicken.scm | 42 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/gnu/packages/chicken.scm b/gnu/packages/chicken.scm
index b87b8118f1..fe067fe687 100644
--- a/gnu/packages/chicken.scm
+++ b/gnu/packages/chicken.scm
@@ -77,6 +77,24 @@ (define-public chicken
 language standard, and includes many enhancements and extensions.")
     (license license:bsd-3)))
 
+(define-public chicken-compile-file
+  (package
+    (name "chicken-compile-file")
+    (version "1.3")
+    (source (origin
+              (method url-fetch)
+              (uri (egg-uri "compile-file" version))
+              (sha256
+               (base32
+                "1029i5ifr48vb3clvl8n50iq23rzc42szdcsl9320qmj1ksg9y93"))))
+    (build-system chicken-build-system)
+    (arguments `(#:egg-name "compile-file"))
+    (home-page "https://wiki.call-cc.org/egg/compile-file")
+    (synopsis "Programmatic compiler invocation")
+    (description "This egg provides a way to do on-the-fly compilation of
+source code and load it into the running process.")
+    (license license:bsd-3)))
+
 (define-public chicken-srfi-1
   (package
     (name "chicken-srfi-1")
@@ -156,6 +174,30 @@ (define-public chicken-srfi-14
     (license (license:non-copyleft
               "http://wiki.call-cc.org/eggref/5/srfi-14#license"))))
 
+(define-public chicken-srfi-18
+  (package
+    (name "chicken-srfi-18")
+    (version "0.1.6")
+    (source (origin
+              (method url-fetch)
+              (uri (egg-uri "srfi-18" version))
+              (sha256
+               (base32
+                "0v2pkdck0ji1wiqgg8sg4z6rbkj2qw4vy4b9lx0w0pmhlxqpg1xd"))))
+    (build-system chicken-build-system)
+    (arguments
+     `(#:egg-name "srfi-18"))
+    (native-inputs (list chicken-compile-file))
+    (home-page "https://wiki.call-cc.org/egg/srfi-18")
+    (synopsis "A multithreading package, largely following SRFI-18")
+    (description "The threads implemented in CHICKEN are so called \"green\"
+threads, based on first-class continuations. Native threads that map directly
+to the threads provided by the operating system are not supported. The
+advantage of this is that threads are very lightweight and somewhat larger
+degree of determinism. The disadvantage is that execution of Scheme code on
+multiple processor cores is not available.")
+    (license license:bsd-3)))
+
 (define-public chicken-srfi-69
   (package
     (name "chicken-srfi-69")

base-commit: 5885e671646549d895ad26669deb3ac268cf9577
-- 
2.39.2