Adding the Gerbil scheme language, build system and two packages

  • Open
  • quality assurance status badge
Details
2 participants
  • Edouard Klein
  • Ludovic Courtès
Owner
unassigned
Submitted by
Edouard Klein
Severity
normal
E
E
Edouard Klein wrote on 19 Jun 2020 15:14
(address . guix-patches@gnu.org)
875zbn2o5i.fsf@alice.lan
Dear Guix,

The patches I'm about to send add the Gerbil scheme programming language
(https://cons.io), which could be described as Gambit, but with
batteries included.

The authors are friendly to Nix (they edited the source to make it
Nix-compatible) so I expect the addition to Guix to be welcomed there.

I've added the gerbil packages, which will allow one to start hacking in
Gerbil in no time, as well as the gerbil build system, as deployment
of software coded in gerbil is not easy. In theory static binaries are
possible, in practice it was easier to add gerbil to guix and use guix
pack ;)

Two packages are provided, to seed the addition of further packages to
the ecosystem, and to check that the build system works.

I'd be more than happy to apply the changes that will probably be
necessary (it's my first time working so deep in guix).

Cheers,

Edouard.
E
E
Edouard Klein wrote on 19 Jun 2020 15:35
[PATCH 1/5] gnu: Add gerbil
(address . 41949@debbugs.gnu.org)
87366r2n6n.fsf@alice.lan
* gnu/packages/scheme.scm: (gerbil): New variable.
---
gnu/packages/scheme.scm | 108 +++++++++++++++++++++++++++++++++++++++-
1 file changed, 107 insertions(+), 1 deletion(-)

Toggle diff (139 lines)
diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm
index 4551e57d4a..4ceabb1996 100644
--- a/gnu/packages/scheme.scm
+++ b/gnu/packages/scheme.scm
@@ -12,6 +12,7 @@
;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
;;; Copyright © 2018 Gabriel Hondet <gabrielhondet@gmail.com>
;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
+;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -31,7 +32,7 @@
(define-module (gnu packages scheme)
#:use-module (gnu packages)
#:use-module ((guix licenses)
- #:select (gpl2+ lgpl2.0+ lgpl2.1+ lgpl3+ asl2.0 bsd-3
+ #:select (gpl2+ lgpl2.0+ lgpl2.1 lgpl2.1+ lgpl3+ asl2.0 bsd-3
cc-by-sa4.0 non-copyleft expat))
#:use-module (guix packages)
#:use-module (guix download)
@@ -70,6 +71,7 @@
#:use-module (gnu packages tls)
#:use-module (gnu packages gl)
#:use-module (gnu packages libedit)
+ #:use-module (gnu packages linux)
#:use-module (srfi srfi-1)
#:use-module (ice-9 match))
@@ -1076,3 +1078,107 @@ multilingual support are some of the goals. Gauche comes with a package
manager/installer @code{gauche-package} which can download, compile, install
and list gauche extension packages.")
(license bsd-3)))
+
+(define-public gerbil
+ (package
+ (name "gerbil")
+ (version "0.16")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/vyzo/gerbil.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0vng0kxpnwsg8jbjdpyn4sdww36jz7zfpfbzayg9sdpz6bjxjy0f"))))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (delete 'bootstrap)
+ (add-before 'configure 'chdir
+ (lambda _
+ (chdir "src")
+ #t))
+ (replace 'configure
+ (lambda* (#:key outputs inputs #:allow-other-keys)
+ (invoke "chmod" "755" "-R" ".")
+ ;; Otherwise fails when editing an r--r--r-- file.
+ (invoke "gsi-script" "configure"
+ "--prefix" (assoc-ref outputs "out")
+ "--with-gambit" (assoc-ref inputs "gambit-c"))))
+ (add-before 'patch-generated-file-shebangs 'fix-gxi-shebangs
+ (lambda _
+ ;; Some .ss files refer to gxi using /usr/bin/env gxi
+ ;; and 'patch-generated-file-shebangs can't fix that
+ ;; because gxi has not been compiled yet.
+ ;; We know where gxi is going to end up so we
+ ;; Doctor Who our fix here before the problem
+ ;; happens towards the end of the build.sh script.
+ (let ((abs-srcdir (getcwd)))
+ (for-each
+ (lambda (f)
+ (substitute* f
+ (("#!/usr/bin/env gxi")
+ (string-append "#!" abs-srcdir "/../bin/gxi"))))
+ '("./gerbil/gxc"
+ "./lang/build.ss"
+ "./misc/http-perf/build.ss"
+ "./misc/rpc-perf/build.ss"
+ "./misc/scripts/docsnarf.ss"
+ "./misc/scripts/docstub.ss"
+ "./misc/scripts/docsyms.ss"
+ "./r7rs-large/build.ss"
+ "./release.ss"
+ "./std/build.ss"
+ "./std/run-tests.ss"
+ "./std/web/fastcgi-test.ss"
+ "./std/web/rack-test.ss"
+ "./tools/build.ss"
+ "./tutorial/httpd/build.ss"
+ "./tutorial/kvstore/build.ss"
+ "./tutorial/lang/build.ss"
+ "./tutorial/proxy/build-static.ss"
+ "./tutorial/proxy/build.ss")))
+ #t))
+ (replace
+ 'build
+ (lambda*
+ (#:key inputs #:allow-other-keys)
+ (setenv "HOME" (getcwd))
+ (invoke
+ ;; The build script needs a tty or it'll crash on an ioctl
+ ;; trying to find the width of the terminal it's running on.
+ ;; Calling in script prevents that.
+ "script"
+ "-qefc"
+ "./build.sh")))
+ (delete 'check)
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin (string-append out "/bin"))
+ (lib (string-append out "/lib")))
+ (mkdir-p bin)
+ (mkdir-p lib)
+ (copy-recursively "../bin" bin)
+ (copy-recursively "../lib" lib)))))))
+ (native-inputs
+ `(("coreutils" ,coreutils)
+ ("util-linux" ,util-linux)))
+ (propagated-inputs
+ `(("gambit-c" ,gambit-c)
+ ("zlib" ,zlib)
+ ("openssl" ,openssl)
+ ("sqlite" ,sqlite)))
+ (build-system gnu-build-system)
+ (synopsis "Meta-dialect of Scheme with post-modern features")
+ (description "Gerbil is an opinionated dialect of Scheme designed for Systems
+Programming, with a state of the art macro and module system on top of the Gambit
+runtime. The macro system is based on quote-syntax, and provides the full meta-syntactic
+tower with a native implementation of syntax-case. It also provides a full-blown module
+system, similar to PLT Scheme's (sorry, Racket) modules. The main difference from Racket
+is that Gerbil modules are single instantiation, supporting high performance ahead of
+time compilation and compiled macros.")
+ (home-page "https://cons.io")
+ (license `(,lgpl2.1 ,asl2.0))))
--
2.26.2
E
E
Edouard Klein wrote on 19 Jun 2020 15:36
[PATCH 2/5] gnu: Add xlsxio
(address . 41949@debbugs.gnu.org)
87zh8z18lb.fsf@alice.lan
* gnu/packages/xml.scm: (xlsxio): New variable.
---
gnu/packages/xml.scm | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)

Toggle diff (65 lines)
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index 90181a1773..2246a5fab2 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -23,6 +23,7 @@
;;; Copyright © 2018 Jack Hill <jackhill@jackhill.us>
;;; Copyright © 2019 Giacomo Leidi <goodoldpaul@autistici.org>
;;; Copyright © 2020 Paul Garlick <pgarlick@tourbillion-technology.com>
+;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -41,6 +42,7 @@
(define-module (gnu packages xml)
#:use-module (gnu packages)
+ #:use-module (gnu packages base)
#:use-module (gnu packages autotools)
#:use-module (gnu packages check)
#:use-module (gnu packages compression)
@@ -1312,6 +1314,42 @@ generating, manipulating, and validating XML documents using the DOM, SAX, and
SAX2 APIs.")
(license license:asl2.0)))
+(define-public xlsxio
+ (package
+ (name "xlsxio")
+ (version "0.2.26")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/brechtsanders/xlsxio.git")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0j8jral3yc2aib2ykp527lyb62a1d9p7qmfbszy7iy3s65pkma9b"))))
+ (native-inputs
+ `(("expat" ,expat)
+ ("make" ,gnu-make)
+ ("minizip" ,minizip)
+ ("which" ,which)))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (delete 'check)
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (invoke "make" "install"
+ (string-append
+ "PREFIX=" (assoc-ref outputs "out"))))))))
+ (synopsis "C library for reading and writing .xlsx files")
+ (description "XLSX I/O aims to provide a C library for reading and writing
+.xlsx files. The .xlsx file format is the native format used by Microsoft(R)
+Excel(TM) since version 2007.")
+ (home-page "https://github.com/brechtsanders/xlsxio")
+ (license license:expat)))
+
(define-public java-simple-xml
(package
(name "java-simple-xml")
--
2.26.2
E
E
Edouard Klein wrote on 19 Jun 2020 15:36
[PATCH 3/5] guix: Add gerbil-build-system
(address . 41949@debbugs.gnu.org)
87wo4318kn.fsf@alice.lan
* guix/build-system/gerbil.scm: New file.
(%gerbil-build-system-modules): New variable.
(gerbil-build): New variable
(gerbil-build-system): New variable

* guix/build/gerbil-build-system.scm: New file.
(%standard-phases): New variable.
(gerbil-build): New variable.
---
guix/build-system/gerbil.scm | 119 +++++++++++++++++++++++++++++
guix/build/gerbil-build-system.scm | 102 +++++++++++++++++++++++++
2 files changed, 221 insertions(+)
create mode 100644 guix/build-system/gerbil.scm
create mode 100644 guix/build/gerbil-build-system.scm

Toggle diff (235 lines)
diff --git a/guix/build-system/gerbil.scm b/guix/build-system/gerbil.scm
new file mode 100644
index 0000000000..eea0261b2a
--- /dev/null
+++ b/guix/build-system/gerbil.scm
@@ -0,0 +1,119 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
+;;;
+;;; 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 gerbil)
+ #:use-module (guix store)
+ #: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 (%gerbil-build-system-modules
+ gerbil-build
+ gerbil-build-system))
+
+(define %gerbil-build-system-modules
+ ;; Build-side modules imported by default.
+ `((guix build gerbil-build-system)
+ ,@%gnu-build-system-modules))
+
+(define (default-gerbil)
+ "Return the default Gerbil package."
+ ;; Do not use `@' to avoid introducing circular dependencies.
+ (let ((module (resolve-interface '(gnu packages scheme))))
+ (module-ref module 'gerbil)))
+
+(define* (lower name
+ #:key source inputs native-inputs outputs system target
+ (gerbil (default-gerbil))
+ #:allow-other-keys
+ #:rest arguments)
+ "Return a bag for NAME."
+ (define private-keywords
+ '(#:source #:target #:inputs #:native-inputs))
+ (bag
+ (name name)
+ (system system)
+ (target target)
+ (host-inputs `(,@(if source
+ `(("source" ,source))
+ '())
+ ,@inputs
+ ;; Keep the standard inputs of 'gnu-build-system'.
+ ,@(standard-packages)))
+ (build-inputs `(("gerbil" ,gerbil)
+ ,@native-inputs))
+ (outputs outputs)
+ (build gerbil-build)
+ (arguments (strip-keyword-arguments private-keywords arguments))))
+
+(define* (gerbil-build store name inputs
+ #:key
+ (phases '(@ (guix build gerbil-build-system)
+ %standard-phases))
+ (outputs '("out"))
+ (search-paths '())
+ (system (%current-system))
+ (guile #f)
+ (imported-modules %gerbil-build-system-modules)
+ (modules '((guix build gerbil-build-system)
+ (guix build utils))))
+ "Build SOURCE using GERBIL and with INPUTS."
+ (define builder
+ `(begin
+ (use-modules ,@modules)
+ (gerbil-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)
+ #: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 gerbil-build-system
+ (build-system
+ (name 'gerbil)
+ (description "The standard Gerbil build system")
+ (lower lower)))
+
+;;; gerbil.scm ends here
diff --git a/guix/build/gerbil-build-system.scm b/guix/build/gerbil-build-system.scm
new file mode 100644
index 0000000000..e6763b841a
--- /dev/null
+++ b/guix/build/gerbil-build-system.scm
@@ -0,0 +1,102 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
+;;;
+;;; 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 gerbil-build-system)
+ #:use-module ((guix build gnu-build-system) #:prefix gnu:)
+ #: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)
+ #:export (%standard-phases
+ gerbil-build))
+
+;; Gerbil's build system and package management is documented at
+;; https://cons.io/guide/package-manager.html
+;; https://cons.io/guide/build.html
+;; https://cons.io/guide/env-vars.html
+;;
+;; The compiler is writing its output in the directory
+;; pointed to by GERBIL_PATH (or ~/.gerbil by default).
+;;
+;; Every package is supposed to have a build.ss script
+;; whose default action (when called with no argument)
+;; is to compile the package.
+;;
+;; The GERBIL_LOADPATH env variable tells gerbil's runtime
+;; where it can find its loadable code.
+;;
+;; GERBIL_HOME tells gerbil where to find its runtime
+;; and standard library
+;;
+;; This build system therefore just
+;; - makes GERBIL_PATH point to the output directory in the store,
+;; - makes GERBIL_LOADPATH point to the lib subdir
+;; of all the gerbil inputs,
+;; - calls ./build.ss,
+;; - wrap any executable with GERBIL_LOADPATH set the the lib
+;; subdir of all the gerbil inputs plus the lib subdir
+;; of the current package's output, and with GERBIL_HOME
+;; set to the lib directory of the 'gerbil' input
+
+(define (loadpath inputs)
+ (string-join (map (match-lambda
+ ((_ . path)
+ (string-append path "/lib")))
+ ;; Restrict to inputs beginning with "gerbil-".
+ (filter (match-lambda
+ ((name . _)
+ (string-prefix? "gerbil-" name)))
+ inputs))
+ ":"))
+
+(define (gerbil-home inputs)
+ (assoc-ref inputs "gerbil"))
+
+(define* (install #:key inputs outputs #:allow-other-keys)
+ "Install a given Gerbil package."
+ (let ((out (assoc-ref outputs "out"))
+ (in (loadpath inputs)))
+ (setenv "GERBIL_PATH" out)
+ (setenv "GERBIL_LOADPATH" in)
+ (invoke "./build.ss"))
+ #t)
+
+(define* (wrap #:key inputs outputs #:allow-other-keys)
+ "Wrap any executable with a proper GERBIL_LOADPATH and GERBIL_HOME"
+ (let* ((out (assoc-ref outputs "out"))
+ (in (loadpath inputs))
+ (gerbil-loadpath (string-append out "/lib:" in)))
+ (for-each (cut wrap-program <>
+ `("GERBIL_LOADPATH" = (,gerbil-loadpath))
+ `("GERBIL_HOME" = (,(gerbil-home inputs))))
+ (find-files (string-append out "/bin")))))
+
+(define %standard-phases
+ (modify-phases gnu:%standard-phases
+ (delete 'bootstrap)
+ (delete 'configure) ;not needed
+ (delete 'build) ;build.ss does both build and install
+ (delete 'check) ;no standard way of testing
+ (replace 'install install)
+ (add-after 'install 'wrap wrap)))
+
+(define* (gerbil-build #:key inputs (phases %standard-phases)
+ #:allow-other-keys #:rest args)
+ "Build the given Gerbil package, applying all of PHASES in order."
+ (apply gnu:gnu-build #:inputs inputs #:phases phases args))
--
2.26.2
E
E
Edouard Klein wrote on 19 Jun 2020 15:36
[PATCH 4/5] gnu: Add gerbil-srfi-54
(address . 41949@debbugs.gnu.org)
87tuz718jz.fsf@alice.lan
* gnu/packages/scheme-xyz.scm: New File
(gerbil-srfi-54): New variable.
---
gnu/packages/scheme-xyz.scm | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
create mode 100644 gnu/packages/scheme-xyz.scm

Toggle diff (36 lines)
diff --git a/gnu/packages/scheme-xyz.scm b/gnu/packages/scheme-xyz.scm
new file mode 100644
index 0000000000..8b553848ee
--- /dev/null
+++ b/gnu/packages/scheme-xyz.scm
@@ -0,0 +1,28 @@
+(define-module (gnu packages scheme-xyz)
+ #:use-module (guix packages)
+ #:use-module (guix build-system gerbil)
+ #:use-module (gnu packages scheme)
+ #:use-module (gnu packages xml)
+ #:use-module (guix git-download)
+ #:use-module ((guix licenses) #:prefix license:))
+
+(define-public gerbil-srfi-54
+ (package
+ (name "gerbil-srfi-54")
+ (version "git")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/hckiang/srfi-54")
+ (commit "master")))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0k1ddfhvbmf9njxm1ybs61n9kpzjvha2j63mf756r7b3x5rk51b0"))))
+ (build-system gerbil-build-system)
+ (synopsis "SRFI-54 for Gerbil Scheme")
+ (description "This SRFI introduces the CAT procedure that converts any object
+to a string. It takes one object as the first argument and accepts a variable
+number of optional arguments, unlike the procedure called FORMAT.")
+ (home-page "https://github.com/hckiang/srfi-54")
+ (license license:lgpl3)))
--
2.26.2
E
E
Edouard Klein wrote on 19 Jun 2020 15:37
[PATCH 5/5] gnu: Add gerbil-denatting
(address . 41949@debbugs.gnu.org)
87r1ub18iu.fsf@alice.lan
* gnu/packages/scheme-xyz.scm: (gerbil-denatting): New variable.
---
gnu/packages/scheme-xyz.scm | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)

Toggle diff (44 lines)
diff --git a/gnu/packages/scheme-xyz.scm b/gnu/packages/scheme-xyz.scm
index 8b553848ee..39991c5807 100644
--- a/gnu/packages/scheme-xyz.scm
+++ b/gnu/packages/scheme-xyz.scm
@@ -26,3 +26,37 @@ to a string. It takes one object as the first argument and accepts a variable
number of optional arguments, unlike the procedure called FORMAT.")
(home-page "https://github.com/hckiang/srfi-54")
(license license:lgpl3)))
+
+(define-public gerbil-denatting
+ (package
+ (name "gerbil-denatting")
+ (version "0.0.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.com/edouardklein/denatting.git")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0m8nlqjs1bqhs7cqdf9ddj9hnm9xfmngzd5iawc0fz3qamsw1wyp"))))
+ (propagated-inputs
+ `(("gerbil" ,gerbil)
+ ("xlsxio" ,xlsxio)
+ ("gerbil-srfi-54" ,gerbil-srfi-54)))
+ (build-system gerbil-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'wrap 'rewrap ;Allow denat to find xlsxio's shared object
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((denat (string-append (assoc-ref outputs "out") "/bin/denat"))
+ (xlsxio (string-append (assoc-ref inputs "xlsxio") "/lib")))
+ (wrap-program denat `("LD_LIBRARY_PATH" = (,xlsxio)))))))))
+ (synopsis "Find who is hiding behind a mobile IPv4")
+ (description "Denatting is a Europol-backed project whose goal is to allow
+investigators in participating countries to discover which Internet Service Provider
+(ISP) client is responsible for a set of network events as reported by content
+providers within the legal framework of a judicial investigation.")
+ (home-page "https://gitlab.com/edouardklein/denatting")
+ (license license:agpl3+)))
--
2.26.2
E
Re: bug#41949: Acknowledgement (Adding the Gerbil scheme language, build system and two packages)
(address . 41949@debbugs.gnu.org)
878sf8pyx7.fsf@rdklein.fr
Dear Guix Community,

May I please get a go/no-go on these patches ?

I understand more work may be needed, but I need to know if there is a
chance they will ever make it into master, because I'm switching jobs at
the end of August and I won't have any free time left to hack on Guix,
so If they're not merged by then, they never will.

Thanks in advance, and my apologies if this seems pushy, it's just that
I'm running out or time.

Cheers,

Edouard.


GNU bug Tracking System writes:

Toggle quote (16 lines)
> Thank you for filing a new bug report with debbugs.gnu.org.
>
> This is an automatically generated reply to let you know your message
> has been received.
>
> Your message is being forwarded to the package maintainers and other
> interested parties for their attention; they will reply in due course.
>
> Your message has been sent to the package maintainer(s):
> guix-patches@gnu.org
>
> If you wish to submit further information on this problem, please
> send it to 41949@debbugs.gnu.org.
>
> Please do not send mail to help-debbugs@gnu.org unless you wish
> to report a problem with the Bug-tracking system.
L
L
Ludovic Courtès wrote on 2 Sep 2020 17:03
Re: [bug#41949] Acknowledgement (Adding the Gerbil scheme language, build system and two packages)
(address . edk@beaver-labs.com)(address . 41949@debbugs.gnu.org)
87blio5igm.fsf@gnu.org
Hi!

edk@beaver-labs.com skribis:

Toggle quote (2 lines)
> May I please get a go/no-go on these patches ?

I’m looking into it!

Toggle quote (8 lines)
> I understand more work may be needed, but I need to know if there is a
> chance they will ever make it into master, because I'm switching jobs at
> the end of August and I won't have any free time left to hack on Guix,
> so If they're not merged by then, they never will.
>
> Thanks in advance, and my apologies if this seems pushy, it's just that
> I'm running out or time.

Understood, and apologies it took so long. I guess many of us took some
time off over the last couple of months, and then your patch set was
already at the bottom of the list when everybody came back. Sorry!

Anyway, patches pushed & feedback coming soon!

Ludo’.
L
L
Ludovic Courtès wrote on 2 Sep 2020 17:04
Re: [bug#41949] [PATCH 1/5] gnu: Add gerbil
(name . Edouard Klein)(address . edk@beaver-labs.com)(address . 41949@debbugs.gnu.org)
874kog5iew.fsf@gnu.org
Edouard Klein <edk@beaver-labs.com> skribis:

Toggle quote (2 lines)
> * gnu/packages/scheme.scm: (gerbil): New variable.

Another Scheme, yay! :-)

Applied!
L
L
Ludovic Courtès wrote on 2 Sep 2020 17:04
Re: [bug#41949] [PATCH 2/5] gnu: Add xlsxio
(name . Edouard Klein)(address . edk@beaver-labs.com)(address . 41949@debbugs.gnu.org)
87zh6843u1.fsf@gnu.org
Edouard Klein <edk@beaver-labs.com> skribis:

Toggle quote (2 lines)
> * gnu/packages/xml.scm: (xlsxio): New variable.

Applied, thanks!
L
L
Ludovic Courtès wrote on 2 Sep 2020 17:10
Re: [bug#41949] [PATCH 3/5] guix: Add gerbil-build-system
(name . Edouard Klein)(address . edk@beaver-labs.com)(address . 41949@debbugs.gnu.org)
87tuwg43la.fsf@gnu.org
Edouard Klein <edk@beaver-labs.com> skribis:

Toggle quote (9 lines)
> * guix/build-system/gerbil.scm: New file.
> (%gerbil-build-system-modules): New variable.
> (gerbil-build): New variable
> (gerbil-build-system): New variable
>
> * guix/build/gerbil-build-system.scm: New file.
> (%standard-phases): New variable.
> (gerbil-build): New variable.

[...]

Toggle quote (39 lines)
> +;; Gerbil's build system and package management is documented at
> +;; https://cons.io/guide/package-manager.html
> +;; https://cons.io/guide/build.html
> +;; https://cons.io/guide/env-vars.html
> +;;
> +;; The compiler is writing its output in the directory
> +;; pointed to by GERBIL_PATH (or ~/.gerbil by default).
> +;;
> +;; Every package is supposed to have a build.ss script
> +;; whose default action (when called with no argument)
> +;; is to compile the package.
> +;;
> +;; The GERBIL_LOADPATH env variable tells gerbil's runtime
> +;; where it can find its loadable code.
> +;;
> +;; GERBIL_HOME tells gerbil where to find its runtime
> +;; and standard library
> +;;
> +;; This build system therefore just
> +;; - makes GERBIL_PATH point to the output directory in the store,
> +;; - makes GERBIL_LOADPATH point to the lib subdir
> +;; of all the gerbil inputs,
> +;; - calls ./build.ss,
> +;; - wrap any executable with GERBIL_LOADPATH set the the lib
> +;; subdir of all the gerbil inputs plus the lib subdir
> +;; of the current package's output, and with GERBIL_HOME
> +;; set to the lib directory of the 'gerbil' input
> +
> +(define (loadpath inputs)
> + (string-join (map (match-lambda
> + ((_ . path)
> + (string-append path "/lib")))
> + ;; Restrict to inputs beginning with "gerbil-".
> + (filter (match-lambda
> + ((name . _)
> + (string-prefix? "gerbil-" name)))
> + inputs))
> + ":"))

Shouldn’t ‘GERBIL_LOADPATH’ be in ‘native-search-paths’ of Gerbil, just
like ‘GUILE_LOAD_PATH’ for Guile?

In that case, you wouldn’t need this procedure. Perhaps, you’d need to
adjust the convention, though, so that libraries are installed to
lib/gerbil/ instead of lib/gerbil-* (not strictly necessary because the
search path mechanism accepts regexps, as used for XML_CATALOG_FILES,
but somewhat “nicer” IMO).

Thoughts?

We’d also need an item in doc/guix.texi under “Build Systems”.

Please let us know if you cannot work on it in the foreseeable future.
I might be able to make these changes if they make sense to you.

Thanks,
Ludo’.
E
Re: [bug#41949] Acknowledgement (Adding the Gerbil scheme language, build system and two packages)
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 41949@debbugs.gnu.org)
87wo15zivt.fsf@rdklein.fr
Thanks for pushing the first patches :)

I completely understand about the big pile of stuff when coming back
from vacation, I'm happy to see the patch merged :)

Ludovic Courtès writes:

Toggle quote (23 lines)
> Hi!
>
> edk@beaver-labs.com skribis:
>
>> May I please get a go/no-go on these patches ?
>
> I’m looking into it!
>
>> I understand more work may be needed, but I need to know if there is a
>> chance they will ever make it into master, because I'm switching jobs at
>> the end of August and I won't have any free time left to hack on Guix,
>> so If they're not merged by then, they never will.
>>
>> Thanks in advance, and my apologies if this seems pushy, it's just that
>> I'm running out or time.
>
> Understood, and apologies it took so long. I guess many of us took some
> time off over the last couple of months, and then your patch set was
> already at the bottom of the list when everybody came back. Sorry!
>
> Anyway, patches pushed & feedback coming soon!
>
> Ludo’.
E
Re: [bug#41949] [PATCH 3/5] guix: Add gerbil-build-system
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 41949@debbugs.gnu.org)
87tuw9zino.fsf@rdklein.fr
Ludovic Courtès writes:

Toggle quote (63 lines)
> Edouard Klein <edk@beaver-labs.com> skribis:
>
>> * guix/build-system/gerbil.scm: New file.
>> (%gerbil-build-system-modules): New variable.
>> (gerbil-build): New variable
>> (gerbil-build-system): New variable
>>
>> * guix/build/gerbil-build-system.scm: New file.
>> (%standard-phases): New variable.
>> (gerbil-build): New variable.
>
> [...]
>
>> +;; Gerbil's build system and package management is documented at
>> +;; https://cons.io/guide/package-manager.html
>> +;; https://cons.io/guide/build.html
>> +;; https://cons.io/guide/env-vars.html
>> +;;
>> +;; The compiler is writing its output in the directory
>> +;; pointed to by GERBIL_PATH (or ~/.gerbil by default).
>> +;;
>> +;; Every package is supposed to have a build.ss script
>> +;; whose default action (when called with no argument)
>> +;; is to compile the package.
>> +;;
>> +;; The GERBIL_LOADPATH env variable tells gerbil's runtime
>> +;; where it can find its loadable code.
>> +;;
>> +;; GERBIL_HOME tells gerbil where to find its runtime
>> +;; and standard library
>> +;;
>> +;; This build system therefore just
>> +;; - makes GERBIL_PATH point to the output directory in the store,
>> +;; - makes GERBIL_LOADPATH point to the lib subdir
>> +;; of all the gerbil inputs,
>> +;; - calls ./build.ss,
>> +;; - wrap any executable with GERBIL_LOADPATH set the the lib
>> +;; subdir of all the gerbil inputs plus the lib subdir
>> +;; of the current package's output, and with GERBIL_HOME
>> +;; set to the lib directory of the 'gerbil' input
>> +
>> +(define (loadpath inputs)
>> + (string-join (map (match-lambda
>> + ((_ . path)
>> + (string-append path "/lib")))
>> + ;; Restrict to inputs beginning with "gerbil-".
>> + (filter (match-lambda
>> + ((name . _)
>> + (string-prefix? "gerbil-" name)))
>> + inputs))
>> + ":"))
>
> Shouldn’t ‘GERBIL_LOADPATH’ be in ‘native-search-paths’ of Gerbil, just
> like ‘GUILE_LOAD_PATH’ for Guile?
>
> In that case, you wouldn’t need this procedure. Perhaps, you’d need to
> adjust the convention, though, so that libraries are installed to
> lib/gerbil/ instead of lib/gerbil-* (not strictly necessary because the
> search path mechanism accepts regexps, as used for XML_CATALOG_FILES,
> but somewhat “nicer” IMO).
>
> Thoughts?

I saw native-search-paths in the sources but did not understand its use
and instead copied the python and golang build systems with which I was
more familiar. What you're proposing sounds better than what I've done.

Toggle quote (3 lines)
>
> We’d also need an item in doc/guix.texi under “Build Systems”.

Of course.

Toggle quote (4 lines)
>
> Please let us know if you cannot work on it in the foreseeable future.
> I might be able to make these changes if they make sense to you.

I'd like to try, but it may take a while :)

Toggle quote (4 lines)
>
> Thanks,
> Ludo’.

Thank you for reviewing the patches :) I'll send an update ASAP, maybe
around october.

Cheers,
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 41949@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 41949
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch