mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2026-03-04 17:04:21 +00:00
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.
This commit is contained in:
parent
f8fb2556c3
commit
19a9eaa029
47
modules/rosenthal/packages/guile-xyz.scm
Normal file
47
modules/rosenthal/packages/guile-xyz.scm
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
;;; Copyright © 2026 Hilton Chain <hako@ultrarare.space>
|
||||||
|
|
||||||
|
(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+))))
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
From 2f7e3c6f46233f9c9159fac61ca4121fe342107f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Hilton Chain <hako@ultrarare.space>
|
||||||
|
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
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user