all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Attila Lendvai <attila@lendvai.name>
To: Maxime Devos <maximedevos@telenet.be>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: using an SRFI that is not available in Guile
Date: Thu, 13 Jan 2022 09:55:43 +0000	[thread overview]
Message-ID: <016ZZkL98oO5WENHC8_wYbCvQ45U44f9DsGA17V-MbMl3tz7I69UZlCB53g9SMyAXjzuRdPztbLr6XgmLwOOxeFeeliCM9KiGj2KFgRb4tc=@lendvai.name> (raw)
In-Reply-To: <94d412c429288b265a22aedd8eff3b3aa35b32e8.camel@telenet.be>

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

thank you Maxime!

with your guidance, i have managed to add guile-srfi-189 next to the other guile-srfi-NNN packages in guile-xyz.scm (a slightly tested diff is attached).

but when i grep for how these guile-srfi-NNN packages are actually used within guix, then i don't see any hits unfortunately.

i tried the following to do a quick test of my new package:

$ ./pre-inst-env guix shell guile-srfi-189
$ ./pre-inst-env guix repl
scheme@(guix-user)> ,use (srfi srfi-189)
While executing meta-command:
no code for module (srfi srfi-189)

how do i introduce it into the guix codebase, without breaking e.g. bootstrappability?

i guess i need to add it as an input and a propagated-input to the guix package in package-management.scm? and then progress a kind of bootstrap stage/step, so that i can then `#:use-module (srfi srfi-189)` it in configuration.scm?

probably by recording the new input as a commit, and then guix pull'ing it into my user's profile? and only after that can i start using it within the guix codebase?

if that is the case, then is there a simpler/shorter way to test my new guile-srfi-189 package before i go through all this dance?

pointers to readings are also welcome.

or alternatively, if it's really this complicated, then i'd welcome if someone more experienced "documented" the process in the form of git commits... ;)

--
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“Lenin was certainly right. There is no subtler, no surer means of overturning the existing basis of society than to debauch the currency. The process engages all the hidden forces of economic law on the side of destruction, and does it in a manner which not one man in a million is able to diagnose.”
	— John Maynard Keynes (1883–1946), 'The Economic Consequences of the Peace' (1919)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-guile-srfi-189.patch --]
[-- Type: text/x-patch; name=0001-Add-guile-srfi-189.patch, Size: 2667 bytes --]

From 6960b5ef6de9a90726c9aa0c13d9e864cc83cd6d Mon Sep 17 00:00:00 2001
From: Attila Lendvai <attila@lendvai.name>
Date: Wed, 12 Jan 2022 19:57:32 +0100
Subject: [PATCH] Add guile-srfi-189.

* gnu/packages/guile-xyz.scm (guile-srfi-189): New variable.
---
 gnu/packages/guile-xyz.scm | 46 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 74567830e6..9568055af6 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -3173,6 +3173,52 @@ (define-public guile-srfi-180
 API.")
       (license license:expat))))
 
+(define-public guile-srfi-189
+  (let ((commit "a0e3786702956c9e510d92746474ac988c2010ec")
+        (revision "0"))
+    (package
+      (name "guile-srfi-189")
+      (version (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               ;; This is a fork of:
+               ;; (url "https://github.com/scheme-requests-for-implementation/srfi-189")
+               ;; Upstream merge requested at:
+               ;; https://github.com/scheme-requests-for-implementation/srfi-189/pull/21
+               ;; TODO switch over to the official repo when the PR gets merged
+               (url "https://github.com/attila-lendvai-patches/srfi-189")
+               (commit commit)))
+         (sha256
+          (base32
+           "0iqv4sjwbp4k87r9l9abzbs5yjcljm69m91kb1ypb03b0rx7napy"))
+         (modules '((guix build utils)))
+         (snippet
+          '(begin
+             (delete-file "test-syntax.scm")
+             (delete-file "test.scm")
+             #t))
+         (file-name (git-file-name name version))))
+      (build-system guile-build-system)
+      (arguments
+       '(#:not-compiled-file-regexp "srfi/189\\.scm$"))
+      (native-inputs
+       (list guile-3.0))
+      (propagated-inputs
+       (list guile-srfi-145))
+      (home-page "https://srfi.schemers.org/srfi-189/")
+      (synopsis "Scheme SRFI implementation of Maybe and Either")
+      (description
+       "This SRFI defines two disjoint immutable container types known as
+Maybe and Either, both of which can contain objects collectively known
+as their payload.  A Maybe object is either a Just object or the unique
+object Nothing (which has no payload); an Either object is either a Right
+object or a Left object.  Maybe represents the concept of optional values;
+Either represents the concept of values which are either correct (Right)
+or errors (Left).")
+      (license license:expat))))
+
 (define-public emacsy
   (package
     (name "emacsy")
-- 
2.34.0


  reply	other threads:[~2022-01-13  9:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-12 16:46 using an SRFI that is not available in Guile Attila Lendvai
2022-01-12 17:01 ` Attila Lendvai
2022-01-12 17:09 ` Maxime Devos
2022-01-13  9:55   ` Attila Lendvai [this message]
2022-01-13 10:49     ` Maxime Devos
2022-01-13 18:20       ` Attila Lendvai
2022-01-13 20:48         ` Attila Lendvai
2022-01-14 12:02         ` Maxime Devos
2022-01-17 13:45           ` Attila Lendvai
2022-01-13 10:53     ` Maxime Devos
2022-01-13 10:56       ` Maxime Devos
2022-01-18 15:09 ` Ludovic Courtès
2022-01-18 17:06   ` Attila Lendvai
2022-01-19 10:34     ` Ludovic Courtès
2022-01-21 13:59       ` Attila Lendvai
2022-01-24 15:41         ` Ludovic Courtès
2022-01-24 23:02           ` Attila Lendvai
2022-02-05 11:13             ` 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

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

  git send-email \
    --in-reply-to='016ZZkL98oO5WENHC8_wYbCvQ45U44f9DsGA17V-MbMl3tz7I69UZlCB53g9SMyAXjzuRdPztbLr6XgmLwOOxeFeeliCM9KiGj2KFgRb4tc=@lendvai.name' \
    --to=attila@lendvai.name \
    --cc=guix-devel@gnu.org \
    --cc=maximedevos@telenet.be \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.