unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: raingloom <raingloom@riseup.net>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 43976@debbugs.gnu.org
Subject: [bug#43976] [PATCH] Chicken build system + some example eggs
Date: Tue, 1 Dec 2020 05:14:28 +0100	[thread overview]
Message-ID: <20201201051428.15ac4d84@riseup.net> (raw)
In-Reply-To: <87eekfxj1y.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 2531 bytes --]

On Fri, 27 Nov 2020 10:09:29 +0100
Ludovic Courtès <ludo@gnu.org> wrote:

> Hi raingloom!
> 
> raingloom <raingloom@riseup.net> skribis:
> 
> > From 2ba52705cf909590a428ea598dfdf1c61ada6a8c Mon Sep 17 00:00:00
> > 2001 From: raingloom <raingloom@riseup.net>
> > Date: Mon, 12 Oct 2020 04:11:59 +0200
> > Subject: [PATCH 01/20] gnu: Added search paths for Chicken Scheme.
> >
> > * gnu/packages/chicken.scm (chicken): Added search paths
> >   [native-search-paths]: added CHICKEN_REPOSITORY_PATH and a
> > comment about CHICKEN_INCLUDE_PATH.  
> 
> [...]
> 
> > +    (native-search-paths
> > +     (list (search-path-specification
> > +            (variable "CHICKEN_REPOSITORY_PATH")
> > +            ;; TODO extract binary version into a module level
> > definition.
> > +            (files (list "var/lib/chicken/11")))))
> > +    ;; the use of this variable is unclear. the online docs don't
> > even
> > +    ;; mention it. i'm leaving it in as a comment for now, in case
> > +    ;; something breaks.
> > +    ;; (search-path-specification
> > +    ;;  (variable "CHICKEN_INCLUDE_PATH")
> > +    ;;  (files '("share")))  
> 
> I think you can remove the comment here; presumably we now know that
> CHICKEN_REPOSITORY_PATH is the one that matters.  :-)

I guess I can, since it doesn't looks like it will cause problems. I
left leave the commented path there though.

> Could you please ensure that earlier comments notably at
> <https://issues.guix.gnu.org/43976#1> have been taken into account,
> that the SRFI packages still build and have a layout consistent with
> the var/lib/chicken/11 search path above, and send a v2 of the whole
> series?
> 
> Thanks in advance!
> 
> Ludo’.

Everything builds, tests succeed, and the layouts are the same.
The comments have been taken into account. I listed them in previous
mails so I'll skip them now.
For srfi-14, I hope "non-copyleft" is fine.
Ran guix lint on all packages and it only mentioned archival.

Thanks for the feedback!

ps.: sending the updated original patchset.
i also have these for a later patchset:
0011-gnu-Added-chicken-compile-file.patch
0012-gnu-Added-chicken-srfi-18.patch
0013-gnu-Added-chicken-srfi-13.patch
0014-Added-chicken-check-errors.patch
0015-Added-chicken-defstruct.patch
0016-gnu-Added-chicken-matchable.patch
0017-gnu-Added-chicken-record-variants.patch
0018-gnu-Added-chicken-srfi-41.patch
0019-gnu-Added-chicken-uri-common.patch
0020-gnu-Added-chicken-uri-generic.patch

[-- Attachment #2: 0001-gnu-Added-search-paths-for-Chicken-Scheme.patch --]
[-- Type: text/x-patch, Size: 1297 bytes --]

From 547d738458dc8be2ecebcbb19e3c70cb4df30bdb Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Mon, 12 Oct 2020 04:11:59 +0200
Subject: [PATCH 01/20] gnu: Added search paths for Chicken Scheme.

* gnu/packages/chicken.scm (chicken): Added search paths
  [native-search-paths]: added CHICKEN_REPOSITORY_PATH and a comment about
                         CHICKEN_INCLUDE_PATH.
---
 gnu/packages/chicken.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/chicken.scm b/gnu/packages/chicken.scm
index 729cf25a6c..1067a69b5f 100644
--- a/gnu/packages/chicken.scm
+++ b/gnu/packages/chicken.scm
@@ -59,6 +59,14 @@
 
        ;; Parallel builds are not supported, as noted in README.
        #:parallel-build? #f))
+    (native-search-paths
+     (list (search-path-specification
+            (variable "CHICKEN_REPOSITORY_PATH")
+            ;; TODO extract binary version into a module level definition.
+            (files (list "var/lib/chicken/11")))))
+    ;; (search-path-specification
+    ;;  (variable "CHICKEN_INCLUDE_PATH")
+    ;;  (files '("share")))
     (propagated-inputs `(("gcc-toolchain" ,gcc-toolchain)))
     (home-page "https://www.call-cc.org/")
     (synopsis "R5RS Scheme implementation that compiles native code via C")
-- 
2.29.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-guix-Added-chicken-build-system.patch --]
[-- Type: text/x-patch, Size: 14613 bytes --]

From e973faf042a9af75c1dd568450d13e0a82137e7f Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Tue, 13 Oct 2020 09:26:52 +0200
Subject: [PATCH 02/20] guix: Added chicken-build-system.

* guix/build-system/chicken.scm: New file.
* guix/build/chicken-build-system.scm: New file.
* Makefile.am: Add them.
* doc/guix.texi: Document it.
---
 Makefile.am                         |   2 +
 doc/guix.texi                       |  22 +++++
 guix/build-system/chicken.scm       | 132 +++++++++++++++++++++++++++
 guix/build/chicken-build-system.scm | 133 ++++++++++++++++++++++++++++
 4 files changed, 289 insertions(+)
 create mode 100644 guix/build-system/chicken.scm
 create mode 100644 guix/build/chicken-build-system.scm

diff --git a/Makefile.am b/Makefile.am
index d63f2ae4b7..2313a070b1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -126,6 +126,7 @@ MODULES =					\
   guix/build-system/android-ndk.scm		\
   guix/build-system/ant.scm			\
   guix/build-system/cargo.scm			\
+  guix/build-system/chicken.scm			\
   guix/build-system/clojure.scm			\
   guix/build-system/cmake.scm			\
   guix/build-system/dub.scm			\
@@ -175,6 +176,7 @@ MODULES =					\
   guix/build/download-nar.scm			\
   guix/build/cargo-build-system.scm		\
   guix/build/cargo-utils.scm			\
+  guix/build/chicken-build-system.scm		\
   guix/build/cmake-build-system.scm		\
   guix/build/dub-build-system.scm		\
   guix/build/dune-build-system.scm		\
diff --git a/doc/guix.texi b/doc/guix.texi
index b0126b961d..9c9a3e523a 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -7314,6 +7314,28 @@ parameters available to cargo.  It will also remove an included
 defined by the crate.
 @end defvr
 
+@defvr {Scheme Variable} chicken-build-system
+This variable is exported by @code{(guix build-system chicken)}.
+It builds Chicken Scheme modules (also called ``eggs'' or ``extensions'').
+Chicken generates C source code, which then gets compiled by a C compiler,
+in this case GCC.
+
+It adds @code{chicken} to the package inputs, as well as the packages of
+@code{gnu-build-system}.
+
+The build system can't (yet) deduce the egg's name automatically, so just like
+with @code{go-build-system} and its @code{#:import-path}, you should define
+@code{#:egg-name} in the package's @code{arguments} field.
+
+For example, if you are packaging the srfi-1 egg:
+@lisp
+(arguments '(#:egg-name "srfi-1"))
+@end lisp
+
+Egg dependencies must be defined in @code{propagated-inputs}, not @code{inputs}
+because Chicken doesn't embed absolute references in compiled eggs.
+Test dependecies should go to @code{native-inputs}, as usual.
+@end defvr
 
 @defvr {Scheme Variable} copy-build-system
 This variable is exported by @code{(guix build-system copy)}.  It
diff --git a/guix/build-system/chicken.scm b/guix/build-system/chicken.scm
new file mode 100644
index 0000000000..9abae0431a
--- /dev/null
+++ b/guix/build-system/chicken.scm
@@ -0,0 +1,132 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2020 raingloom <raingloom@riseup.net>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix build-system chicken)
+  #:use-module (guix utils)
+  #:use-module (guix derivations)
+  #:use-module (guix search-paths)
+  #:use-module (guix build-system)
+  #:use-module (guix build-system gnu)
+  #:use-module (guix packages)
+  #:use-module (ice-9 match)
+  #:export (%chicken-build-system-modules
+            chicken-build
+            chicken-build-system))
+
+(define %chicken-build-system-modules
+  ;; Build-side modules imported and used by default.
+  `((guix build chicken-build-system)
+    (guix build union)
+    ,@%gnu-build-system-modules))
+
+(define (default-chicken)
+  ;; Lazily resolve the binding to avoid a circular dependency.
+  ;; TODO is this actually needed in every build system?
+  (let ((chicken (resolve-interface '(gnu packages chicken))))
+      (module-ref chicken 'chicken)))
+
+(define* (lower name
+                #:key source inputs native-inputs outputs system target
+                (chicken (default-chicken))
+                #:allow-other-keys
+                #:rest arguments)
+  "Return a bag for NAME."
+  (define private-keywords
+    '(#:source #:target #:chicken #:inputs #:native-inputs))
+
+  ;; TODO: cross-compilation support
+  (and (not target)
+       (bag
+         (name name)
+         (system system)
+         (host-inputs `(,@(if source
+                              `(("source" ,source))
+                              '())
+                        ,@inputs
+
+                        ;; Keep the standard inputs of 'gnu-build-system', since
+                        ;; Chicken compiles Scheme by using C as an intermediate
+                        ;; language.
+                        ,@(standard-packages)))
+         (build-inputs `(("chicken" ,chicken)
+                         ,@native-inputs))
+         (outputs outputs)
+         (build chicken-build)
+         (arguments (strip-keyword-arguments private-keywords arguments)))))
+
+(define* (chicken-build store name inputs
+                   #:key
+                   (phases '(@ (guix build chicken-build-system)
+                               %standard-phases))
+                   (outputs '("out"))
+                   (search-paths '())
+                   (egg-name "")
+                   (unpack-path "")
+                   (build-flags ''())
+                   (tests? #t)
+                   (system (%current-system))
+                   (guile #f)
+                   (imported-modules %chicken-build-system-modules)
+                   (modules '((guix build chicken-build-system)
+                              (guix build union)
+                              (guix build utils))))
+  (define builder
+    `(begin
+       (use-modules ,@modules)
+       (chicken-build #:name ,name
+                 #:source ,(match (assoc-ref inputs "source")
+                             (((? derivation? source))
+                              (derivation->output-path source))
+                             ((source)
+                              source)
+                             (source
+                              source))
+                 #:system ,system
+                 #:phases ,phases
+                 #:outputs %outputs
+                 #:search-paths ',(map search-path-specification->sexp
+                                       search-paths)
+                 #:egg-name ,egg-name
+                 #:unpack-path ,unpack-path
+                 #:build-flags ,build-flags
+                 #:tests? ,tests?
+                 #:inputs %build-inputs)))
+
+  (define guile-for-build
+    (match guile
+      ((? package?)
+       (package-derivation store guile system #:graft? #f))
+      (#f                                         ; the default
+       (let* ((distro (resolve-interface '(gnu packages commencement)))
+              (guile  (module-ref distro 'guile-final)))
+         (package-derivation store guile system
+                             #:graft? #f)))))
+
+  (build-expression->derivation store name builder
+                                #:inputs inputs
+                                #:system system
+                                #:modules imported-modules
+                                #:outputs outputs
+                                #:guile-for-build guile-for-build))
+
+(define chicken-build-system
+  (build-system
+    (name 'chicken)
+    (description
+     "Build system for Chicken Scheme programs")
+    (lower lower)))
diff --git a/guix/build/chicken-build-system.scm b/guix/build/chicken-build-system.scm
new file mode 100644
index 0000000000..5db9906acf
--- /dev/null
+++ b/guix/build/chicken-build-system.scm
@@ -0,0 +1,133 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2020 raingloom <raingloom@riseup.net>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix build chicken-build-system)
+  #:use-module ((guix build gnu-build-system) #:prefix gnu:)
+  #:use-module (guix build union)
+  #:use-module (guix build utils)
+  #:use-module (ice-9 match)
+  #:use-module (ice-9 ftw)
+  #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-26)
+  #:use-module (rnrs io ports)
+  #:use-module (rnrs bytevectors)
+  #:export (%standard-phases
+            chicken-build))
+
+;; CHICKEN_EGG_CACHE is where sources are fetched and binaries are built
+;; CHICKEN_INSTALL_REPOSITORY is where dependencies are looked up
+;; its first component is also where new eggs are installed.
+
+;; TODO: deduplicate with go-build-system.scm ?
+;; TODO: the binary version should be defined in one of the relevant modules
+;; instead of being hardcoded everywhere. Tried to do that but got undefined
+;; variable errors.
+
+(define (chicken-package? name)
+  (string-prefix? "chicken-" name))
+
+(define* (setup-chicken-environment #:key inputs outputs #:allow-other-keys)
+  (setenv "CHICKEN_INSTALL_REPOSITORY"
+          (string-concatenate
+           ;; see TODO item about binary version above
+           (append (list (assoc-ref outputs "out") "/var/lib/chicken/11/")
+                   (let ((oldenv (getenv "CHICKEN_INSTALL_REPOSITORY")))
+                     (if oldenv
+                         (list  ":" oldenv)
+                         '())))))
+  (setenv "CHICKEN_EGG_CACHE" (getcwd))
+  #t)
+
+;; This is copied from go-build-system.scm so it could probably be simplified.
+;; I used it because the source of the egg needs to be unpacked into a directory
+;; that is named after the egg and I knew that the go build system does that.
+(define* (unpack #:key source egg-name unpack-path #:allow-other-keys)
+  "Relative to $CHICKEN_EGG_CACHE, unpack SOURCE in UNPACK-PATH, or EGG-NAME
+when UNPACK-PATH is unset.  If the SOURCE archive has a single top level
+directory, it is stripped so that the sources appear directly under UNPACK-PATH.
+When SOURCE is a directory, copy its content into UNPACK-PATH instead of
+unpacking."
+  (define (unpack-maybe-strip source dest)
+    (let* ((scratch-dir (string-append (or (getenv "TMPDIR") "/tmp")
+                                       "/scratch-dir"))
+           (out (mkdir-p scratch-dir)))
+      (with-directory-excursion scratch-dir
+        (if (string-suffix? ".zip" source)
+            (invoke "unzip" source)
+            (invoke "tar" "-xvf" source))
+        (let ((top-level-files (remove (lambda (x)
+                                         (member x '("." "..")))
+                                       (scandir "."))))
+          (match top-level-files
+            ((top-level-file)
+             (when (file-is-directory? top-level-file)
+               (copy-recursively top-level-file dest #:keep-mtime? #t)))
+            (_
+             (copy-recursively "." dest #:keep-mtime? #t)))))
+      (delete-file-recursively scratch-dir)))
+
+  (when (string-null? egg-name)
+    (display "WARNING: The egg name is unset.\n"))
+  (when (string-null? unpack-path)
+    (set! unpack-path egg-name))
+  (let ((dest (string-append (getenv "CHICKEN_EGG_CACHE") "/" unpack-path)))
+    (mkdir-p dest)
+    (if (file-is-directory? source)
+        (copy-recursively source dest #:keep-mtime? #t)
+        (unpack-maybe-strip source dest)))
+  #t)
+
+(define* (build #:key egg-name #:allow-other-keys)
+  "Build the Chicken egg named by EGG-NAME"
+  (invoke "chicken-install" "-cached" "-no-install" egg-name))
+
+(define* (install #:key egg-name #:allow-other-keys)
+  "Install the already built egg named by EGG-NAME"
+  (invoke "chicken-install" "-cached" egg-name))
+
+(define* (check #:key egg-name tests? #:allow-other-keys)
+  "Build and run tests for the Chicken egg EGG-NAME"
+  ;; there is no "-test-only" option, but we've already run install
+  ;; so this just runs tests.
+  ;; i think it's a fair assumption that phases won't be reordered.
+  (setenv "CHICKEN_REPOSITORY_PATH"
+          (string-append (getenv "CHICKEN_INSTALL_REPOSITORY")
+                         ":"
+                         (getenv "CHICKEN_REPOSITORY_PATH")))
+  (when tests?
+    (invoke "chicken-install" "-cached" "-test" "-no-install" egg-name)))
+
+;; It doesn't look like Chicken generates any unnecessary references.
+;; So we don't have to remove them either. Nice.
+
+(define %standard-phases
+  (modify-phases gnu:%standard-phases
+    (replace 'unpack unpack)
+    (delete 'bootstrap)
+    (delete 'configure)
+    (delete 'patch-generated-file-shebangs)
+    (add-before 'unpack 'setup-chicken-environment setup-chicken-environment)
+    (replace 'build build)
+    (delete 'check)
+    (replace 'install install)
+    (add-after 'install 'check check)))
+
+(define* (chicken-build #:key inputs (phases %standard-phases)
+                        #:allow-other-keys #:rest args)
+  "Build the given Chicken package, applying all of PHASES in order."
+  (apply gnu:gnu-build #:inputs inputs #:phases phases args))
-- 
2.29.2


[-- Attachment #4: 0003-gnu-Use-qualified-license-names-in-chicken.scm-inste.patch --]
[-- Type: text/x-patch, Size: 1110 bytes --]

From 55c057a0fcb3cea672a8b97bc1d4af6f84aa8b38 Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Tue, 13 Oct 2020 09:49:35 +0200
Subject: [PATCH 03/20] gnu: Use qualified license names in chicken.scm instead
 of selective import.

* gnu/packages/chicken.scm (chicken)[license]: Use qualified name.
---
 gnu/packages/chicken.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/chicken.scm b/gnu/packages/chicken.scm
index 1067a69b5f..3eb5918c5b 100644
--- a/gnu/packages/chicken.scm
+++ b/gnu/packages/chicken.scm
@@ -24,7 +24,7 @@
   #:use-module (guix download)
   #:use-module (gnu packages commencement)
   #:use-module ((guix licenses)
-                #:select (bsd-3)))
+                #:prefix license:))
 
 (define-public chicken
   (package
@@ -74,4 +74,4 @@
      "CHICKEN is a compiler for the Scheme programming language.  CHICKEN
 produces portable and efficient C, supports almost all of the R5RS Scheme
 language standard, and includes many enhancements and extensions.")
-    (license bsd-3)))
+    (license license:bsd-3)))
-- 
2.29.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: 0004-gnu-Added-chicken-test.patch --]
[-- Type: text/x-patch, Size: 2332 bytes --]

From 700ebbd7064feb9df11223ba107ff4be9cc0cc7f Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Tue, 13 Oct 2020 09:55:42 +0200
Subject: [PATCH 04/20] gnu: Added chicken-test.

* gnu/packages/chicken.scm (chicken-test): New variable.
---
 gnu/packages/chicken.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/chicken.scm b/gnu/packages/chicken.scm
index 3eb5918c5b..36bbfdbfa7 100644
--- a/gnu/packages/chicken.scm
+++ b/gnu/packages/chicken.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2020 Ekaitz Zarraga <ekaitz@elenq.tech>
 ;;; Copyright © 2020 Evan Hanson <evhan@foldling.org>
+;;; Copyright © 2020 raingloom <raingloom@riseup.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,8 +21,11 @@
 (define-module (gnu packages chicken)
   #:use-module (gnu packages)
   #:use-module (guix packages)
+  #:use-module (guix build-system chicken)
   #:use-module (guix build-system gnu)
   #:use-module (guix download)
+  #:use-module (guix git-download)
+  #:use-module (guix svn-download)
   #:use-module (gnu packages commencement)
   #:use-module ((guix licenses)
                 #:prefix license:))
@@ -75,3 +79,28 @@
 produces portable and efficient C, supports almost all of the R5RS Scheme
 language standard, and includes many enhancements and extensions.")
     (license license:bsd-3)))
+
+(define-public chicken-test
+  (package
+    (name "chicken-test")
+    (version "1.1")
+    (source
+     (origin
+       (method svn-fetch)
+       (uri (svn-reference
+             (url (string-append "https://code.call-cc.org/svn/chicken-eggs/"
+                                 "release/5/test/tags/" version))
+             (revision 39263)
+             (user-name "anonymous")
+             (password "")))
+       (file-name "test")
+       (sha256
+        (base32
+         "14i91cxsn6hjkx6kqf7i9syck73cw71jik61jmhg87vpxx5kfnzx"))))
+    (build-system chicken-build-system)
+    (arguments '(#:egg-name "test"))
+    (home-page "https://wiki.call-cc.org/eggref/5/test")
+    (synopsis "Yet another testing utility")
+    (description
+     "A simple testing utility for Chicken Scheme")
+    (license license:bsd-3)))
-- 
2.29.2


[-- Attachment #6: 0005-gnu-Added-chicken-srfi-1.patch --]
[-- Type: text/x-patch, Size: 2038 bytes --]

From e35b7f2e0af8cd1c1868f10ceb3e142c6fc5e1b9 Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Tue, 13 Oct 2020 09:51:02 +0200
Subject: [PATCH 05/20] gnu: Added chicken-srfi-1.

* gnu/packages/chicken.scm (chicken-srfi-1): New variable.
---
 gnu/packages/chicken.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/chicken.scm b/gnu/packages/chicken.scm
index 36bbfdbfa7..592cc382bc 100644
--- a/gnu/packages/chicken.scm
+++ b/gnu/packages/chicken.scm
@@ -80,6 +80,37 @@ produces portable and efficient C, supports almost all of the R5RS Scheme
 language standard, and includes many enhancements and extensions.")
     (license license:bsd-3)))
 
+(define-public chicken-srfi-1
+  (package
+    (name "chicken-srfi-1")
+    (version "0.5.1")
+    (source
+     (origin
+       (method svn-fetch)
+       (uri (svn-reference
+             (url (string-append
+                   "https://code.call-cc.org/svn/chicken-eggs/"
+                   "release/5/srfi-1/tags/"
+                   version))
+             (revision 39055)
+             (user-name "anonymous")
+             (password "")))
+       (file-name "srfi-1")
+       (sha256
+        (base32
+         "02940zsjrmn7c34rnp1rllm2nahh9jvszlzrw8ak4pf31q09cmq1"))))
+    (build-system chicken-build-system)
+    (arguments '(#:egg-name "srfi-1"))
+    (native-inputs
+     `(("chicken-test" ,chicken-test)))
+    (home-page "https://wiki.call-cc.org/eggref/5/srfi-1")
+    (synopsis "SRFI-1 list library")
+    (description
+     "The list library defined in SRFI-1 contains a lot of useful list
+processing procedures for construction, examining, destructuring and
+manipulating lists and pairs.")
+    (license license:bsd-3)))
+
 (define-public chicken-test
   (package
     (name "chicken-test")
@@ -104,3 +135,4 @@ language standard, and includes many enhancements and extensions.")
     (description
      "A simple testing utility for Chicken Scheme")
     (license license:bsd-3)))
+
-- 
2.29.2


[-- Attachment #7: 0006-gnu-Added-chicken-srfi-69.patch --]
[-- Type: text/x-patch, Size: 1714 bytes --]

From eaaffee062ec5fac8e4a6f24a8101eb834593abe Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Tue, 13 Oct 2020 09:52:08 +0200
Subject: [PATCH 06/20] gnu: Added chicken-srfi-69

* gnu/packages/chicken.scm (chicken-srfi-69): New variable.
---
 gnu/packages/chicken.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/chicken.scm b/gnu/packages/chicken.scm
index 592cc382bc..49c7e696c5 100644
--- a/gnu/packages/chicken.scm
+++ b/gnu/packages/chicken.scm
@@ -111,6 +111,33 @@ processing procedures for construction, examining, destructuring and
 manipulating lists and pairs.")
     (license license:bsd-3)))
 
+(define-public chicken-srfi-69
+  (package
+    (name "chicken-srfi-69")
+    (version "0.4.1")
+    (source
+     (origin
+       (method svn-fetch)
+       (uri (svn-reference
+             (url (string-append "https://code.call-cc.org/svn/chicken-eggs/"
+                                 "release/5/srfi-69/tags/"
+                                 version))
+             (revision 39057)
+             (user-name "anonymous")
+             (password "")))
+       (file-name "srfi-69")
+       (sha256
+        (base32
+         "1z0m9vmg9bj9z0a941pls6igvg8nmhq4mj5psjjidbp0fac572mp"))))
+    (arguments '(#:egg-name "srfi-69"))
+    (build-system chicken-build-system)
+    (home-page "https://wiki.call-cc.org/eggref/5/srfi-69")
+    (synopsis "Implementation of SRFI 69 with SRFI 90 extensions")
+    (description
+     "Provides hash tables (also known as vlists, similar to alists in srfi-1),
+and binary search.")
+    (license license:bsd-3)))
+
 (define-public chicken-test
   (package
     (name "chicken-test")
-- 
2.29.2


[-- Attachment #8: 0007-gnu-Added-chicken-iset.patch --]
[-- Type: text/x-patch, Size: 1640 bytes --]

From 21ab568f10f89a0db769487784fb0c4deb10fab4 Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Tue, 13 Oct 2020 09:52:54 +0200
Subject: [PATCH 07/20] gnu: Added chicken-iset.

* gnu/packages/chicken.scm (chicken-iset): New variable.
---
 gnu/packages/chicken.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/gnu/packages/chicken.scm b/gnu/packages/chicken.scm
index 49c7e696c5..bc4a6bcdd9 100644
--- a/gnu/packages/chicken.scm
+++ b/gnu/packages/chicken.scm
@@ -138,6 +138,34 @@ manipulating lists and pairs.")
 and binary search.")
     (license license:bsd-3)))
 
+(define-public chicken-iset
+  (package
+    (name "chicken-iset")
+    (version "2.2")
+    (source
+     (origin
+       (method svn-fetch)
+       (uri (svn-reference
+             (url (string-append "https://code.call-cc.org/svn/chicken-eggs/"
+                                 "release/5/iset/tags/" version))
+             (revision 39057)
+             (user-name "anonymous")
+             (password "")))
+       (file-name "iset")
+       (sha256
+        (base32
+         "0gz50n5i561n5sk9prry0lrxz6bfrq9if5bclaq6a0f7lzinhnzb"))))
+    (native-inputs
+     `(("chicken-test" ,chicken-test)))
+    (build-system chicken-build-system)
+    (arguments '(#:egg-name "iset"))
+    (synopsis "Integer set library")
+    (home-page "https://wiki.call-cc.org/eggref/5/iset")
+    (description
+     " Bit-vectors provide an abstract interface to bitwise operations
+typically done with integers")
+    (license license:bsd-3)))
+
 (define-public chicken-test
   (package
     (name "chicken-test")
-- 
2.29.2


[-- Attachment #9: 0008-gnu-Added-chicken-datatype.patch --]
[-- Type: text/x-patch, Size: 1791 bytes --]

From 316d30bebc1e63f851b6ab23a1f42b1470e76b85 Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Tue, 13 Oct 2020 09:53:40 +0200
Subject: [PATCH 08/20] gnu: Added chicken-datatype.

* gnu/packages/chicken.scm (chicken-datatype): New variable.
---
 gnu/packages/chicken.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/chicken.scm b/gnu/packages/chicken.scm
index bc4a6bcdd9..28973eafa8 100644
--- a/gnu/packages/chicken.scm
+++ b/gnu/packages/chicken.scm
@@ -138,6 +138,35 @@ manipulating lists and pairs.")
 and binary search.")
     (license license:bsd-3)))
 
+(define-public chicken-datatype
+  (package
+    (name "chicken-datatype")
+    (version "1.6")
+    (source
+     (origin
+       (method svn-fetch)
+       (uri (svn-reference
+             (url (string-append "https://code.call-cc.org/svn/chicken-eggs/"
+                                 "release/5/datatype/tags/" version))
+             (revision 39266)
+             (user-name "anonymous")
+             (password "")))
+       (file-name "datatype")
+       (sha256
+        (base32
+         "1a58q8ypjkjz6wdv25247wixds4179239d36nnvsfn6gp70s9jfq"))))
+    (build-system chicken-build-system)
+    (arguments '(#:egg-name "datatype"))
+    (native-inputs
+     `(("chicken-srfi-1" ,chicken-srfi-1)
+       ("chicken-test" ,chicken-test)))
+    (home-page "https://wiki.call-cc.org/eggref/5/datatype")
+    (synopsis "Facility for creating and using variant records")
+    (description
+     "A facility for creating and using variant records, as described
+in the book Essentials of Programming Languages by Friedman, Wand and Haynes")
+    (license license:bsd-3)))
+
 (define-public chicken-iset
   (package
     (name "chicken-iset")
-- 
2.29.2


[-- Attachment #10: 0009-gnu-Added-chicken-srfi-14.patch --]
[-- Type: text/x-patch, Size: 1764 bytes --]

From 6a977d5b65082c9022281b5c4cdd767bd65d36c8 Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Tue, 13 Oct 2020 09:24:12 +0200
Subject: [PATCH 09/20] gnu: Added chicken-srfi-14.

* gnu/packages/chicken.scm (chicken-srfi-14): New variable.
---
 gnu/packages/chicken.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/chicken.scm b/gnu/packages/chicken.scm
index 28973eafa8..4f442a51d9 100644
--- a/gnu/packages/chicken.scm
+++ b/gnu/packages/chicken.scm
@@ -111,6 +111,33 @@ processing procedures for construction, examining, destructuring and
 manipulating lists and pairs.")
     (license license:bsd-3)))
 
+(define-public chicken-srfi-14
+  (package
+    (name "chicken-srfi-14")
+    (version "0.2.1")
+    (source
+     (origin
+       (method svn-fetch)
+       (uri (svn-reference
+             (url (string-append "https://code.call-cc.org/svn/chicken-eggs/"
+                                 "release/5/srfi-14/tags/" version))
+             (revision 39057)
+             (user-name "anonymous")
+             (password "")))
+       (file-name "srfi-14")
+       (sha256
+        (base32
+         "0wjsqfwawh9bx6vvii1gwag166bxkflc0ib374fbws14914g2ac1"))))
+    (build-system chicken-build-system)
+    (arguments '(#:egg-name "srfi-14"))
+    (home-page "https://wiki.call-cc.org/eggref/5/srfi-14")
+    (synopsis "Character set library")
+    (description
+     "Character sets can be created, extended, tested for the membership of
+a characters and be compared to other character sets")
+    (license (license:non-copyleft
+              "http://wiki.call-cc.org/eggref/5/srfi-14#license"))))
+
 (define-public chicken-srfi-69
   (package
     (name "chicken-srfi-69")
-- 
2.29.2


[-- Attachment #11: 0010-gnu-Added-chicken-agrep.patch --]
[-- Type: text/x-patch, Size: 1907 bytes --]

From 869b56d5eba824024a50d9de28d2265955526146 Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Tue, 13 Oct 2020 09:54:39 +0200
Subject: [PATCH 10/20] gnu: Added chicken-agrep.

* gnu/packages/chicken.scm (chicken-agrep): New variable.
---
 gnu/packages/chicken.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/chicken.scm b/gnu/packages/chicken.scm
index 4f442a51d9..b700b21d29 100644
--- a/gnu/packages/chicken.scm
+++ b/gnu/packages/chicken.scm
@@ -165,6 +165,38 @@ a characters and be compared to other character sets")
 and binary search.")
     (license license:bsd-3)))
 
+(define-public chicken-agrep
+  (package
+    (name "chicken-agrep")
+    (version "1.7")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/iraikov/chicken-agrep")
+             (commit version)))
+       (file-name "agrep")
+       (sha256
+        (base32
+         "0z05x7f154n9bgmainrsmncf5i6dil43r9ymr3rdgwbg4wnxmz4s"))))
+    ;; TODO do we really have to make these propagated?
+    ;; I don't know Chicken's module system well enough to tell
+    (propagated-inputs
+     `(("chicken-datatype" ,chicken-datatype)
+       ("chicken-srfi-1" ,chicken-srfi-1)
+       ("chicken-srfi-14" ,chicken-srfi-14)))
+    (native-inputs
+     `(("chicken-test" ,chicken-test)))
+    (build-system chicken-build-system)
+    (arguments '(#:egg-name "agrep"))
+    (synopsis "Approximate string matching library")
+    (home-page "https://wiki.call-cc.org/eggref/5/agrep")
+    (description
+     "This library implements the Wu-Manber algorithm for approximate string
+searching with errors, popularized by the agrep Unix command and the glimpse
+file indexing tool.")
+    (license license:gpl3+)))
+
 (define-public chicken-datatype
   (package
     (name "chicken-datatype")
-- 
2.29.2


  reply	other threads:[~2020-12-01  4:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-13  8:52 [bug#43976] [PATCH] Chicken build system + some example eggs raingloom
2020-10-18 16:10 ` Ludovic Courtès
2020-11-20  4:51   ` raingloom
2020-11-21 11:23     ` Ludovic Courtès
2020-11-21 20:45     ` raingloom
2020-11-21 20:58       ` Efraim Flashner
2020-11-21 22:13         ` raingloom
2020-11-22 23:12       ` raingloom
2020-11-24 20:22         ` raingloom
2020-11-27  9:09           ` Ludovic Courtès
2020-12-01  4:14             ` raingloom [this message]
2020-12-03 16:04               ` bug#43976: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201201051428.15ac4d84@riseup.net \
    --to=raingloom@riseup.net \
    --cc=43976@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).