From 19a9eaa0299acb12916e5fdc0bc2c1d8e383a9ed Mon Sep 17 00:00:00 2001 From: Hilton Chain Date: Thu, 26 Feb 2026 09:28:59 +0800 Subject: [PATCH] rosenthal: Add guile-toml. * modules/rosenthal/packages/patches/guile-toml-support-boolean.patch: New file. * modules/rosenthal/packages/guile-xyz.scm (guile-toml): New variable. --- modules/rosenthal/packages/guile-xyz.scm | 47 +++++++++++++++++++ .../patches/guile-toml-support-boolean.patch | 37 +++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 modules/rosenthal/packages/guile-xyz.scm create mode 100644 modules/rosenthal/packages/patches/guile-toml-support-boolean.patch diff --git a/modules/rosenthal/packages/guile-xyz.scm b/modules/rosenthal/packages/guile-xyz.scm new file mode 100644 index 0000000..5e352a0 --- /dev/null +++ b/modules/rosenthal/packages/guile-xyz.scm @@ -0,0 +1,47 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later +;;; Copyright © 2026 Hilton Chain + +(define-module (rosenthal packages guile-xyz) + ;; Utilities + #:use-module (guix gexp) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (rosenthal utils packages) + ;; Guix origin methods + #:use-module (guix git-download) + ;; Guix build systems + #:use-module (guix build-system guile) + ;; Guix packages + #:use-module (gnu packages guile) + #:use-module (gnu packages guile-xyz)) + +(define-public guile-toml + (let ((commit "ecb24deb407ef76ef7cf7e9f0115060c98366a6b") + (revision "0")) + (package + (name "guile-toml") + (version (git-version "0.0.0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/hylophile/guile-toml") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1iqxivxcb0dcjbd5ba3c0g3mj71b32qjxfdmljyv9r297yykfd02")) + (patches + (rosenthal-patches "guile-toml-support-boolean.patch")))) + (build-system guile-build-system) + (arguments + (list #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'avoid-test-installation + (lambda _ + (delete-file-recursively "test")))))) + (native-inputs (list guile-3.0)) + (propagated-inputs (list guile-json-4)) + (home-page "https://github.com/hylophile/guile-toml") + (synopsis "TOML module for GNU Guile") + (description "") + (license license:gpl3+)))) diff --git a/modules/rosenthal/packages/patches/guile-toml-support-boolean.patch b/modules/rosenthal/packages/patches/guile-toml-support-boolean.patch new file mode 100644 index 0000000..5689d30 --- /dev/null +++ b/modules/rosenthal/packages/patches/guile-toml-support-boolean.patch @@ -0,0 +1,37 @@ +From 2f7e3c6f46233f9c9159fac61ca4121fe342107f Mon Sep 17 00:00:00 2001 +From: Hilton Chain +Date: Thu, 26 Feb 2026 09:57:51 +0800 +Subject: [PATCH] builder: Support boolean value. + +* toml/builder.scm (toml-build-boolean): New procedure. +(toml-build-value): Use it. +--- + toml/builder.scm | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/toml/builder.scm b/toml/builder.scm +index f6bdcea..3531c6f 100644 +--- a/toml/builder.scm ++++ b/toml/builder.scm +@@ -74,6 +74,9 @@ + (else (string c)))) + (string->list s)))) + ++(define (toml-build-boolean b port) ++ (put-string port (if b "true" "false"))) ++ + (define (toml-build-string s port) + (define quote-type (if (or + (string-contains s "\\") +@@ -198,7 +201,7 @@ + (scm port #:key (newline? #t) (inline? #f)) + (cond + ;; ((eq? scm null) (toml-build-null port)) +- ;; ((boolean? scm) (toml-build-boolean scm port)) ++ ((boolean? scm) (toml-build-boolean scm port)) + ;; ((symbol? scm) (toml-build-string (symbol->string scm) port)) + + ;; TODO float (nan, inf) +-- +2.52.0 +