feat: add guile-srfi-171 to (radix packages guile-xyz) module.

pull/1/head
anemofilia 2023-09-16 19:58:25 -03:00
parent 8dd2495f1a
commit debab7068a
No known key found for this signature in database
GPG Key ID: 5A8F3D62C87A2B33
1 changed files with 117 additions and 57 deletions

View File

@ -7,67 +7,127 @@
#:use-module (guix build-system trivial)
#:use-module ((guix licenses) #:prefix license:))
;; This srfi was originally packaged by Nikita Domnitskii on
;; This srfi was originally packaged by Nikita Domnitskii on
;; https://git.sr.ht/~krevedkokun/dotfiles/tree/master/item/channel/packages/guile.scm
(define-public guile-srfi-197
(let ((commit "78ced23a1af519ee2969939138b3ffff442f339a")
(revision "0"))
(package
(name "guile-srfi-197")
(version (git-version "0.0.0" revision commit))
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/ar-nelson/srfi-197")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(base32 "19kh6zwad6bmhj0wabgbsbkk8l48s6lrgn701afjaab2w0gb30qg"))
(snippet
#~(begin
(use-modules (ice-9 rdelim)
(ice-9 pretty-print)
(guix build utils))
(call-with-input-file "srfi-197-syntax-case.scm"
(lambda (input-port)
(with-output-to-file "tmp.scm"
(lambda ()
(pretty-print
'(define-module (srfi srfi-197)
#:use-module (rnrs base)
#:use-module (rnrs io ports)
#:use-module (rnrs syntax-case)
#:export (chain
chain-when
chain-and
chain-lambda
nest
nest-reverse)))
(newline)
(let loop ()
(let ((line (read-line input-port)))
(unless (eof-object? line)
(write-line line)
(loop))))))))
(mkdir "srfi")
(rename-file "tmp.scm" "srfi/srfi-197.scm")
(for-each delete-file
'("srfi-197-syntax-case.scm"
"srfi-197.scm"
"srfi-197.sld"
"srfi-64-minimal.scm"
"test-kawa.scm"
"test-r6rs.scm"
"test-r7rs.scm"
"test.scm"))))))
(build-system guile-build-system)
(inputs
(list guile-3.0))
(home-page "https://github.com/ar-nelson/srfi-197")
(synopsis "SRFI 197 pipeline operators port for Guile")
(description
"This package provides an implementation of SRFI 197 for Guile.
(name "guile-srfi-197")
(version (git-version "0.0.0" revision commit))
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/ar-nelson/srfi-197")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(base32 "19kh6zwad6bmhj0wabgbsbkk8l48s6lrgn701afjaab2w0gb30qg"))
(snippet
#~(begin
(use-modules (ice-9 rdelim)
(ice-9 pretty-print)
(guix build utils))
(call-with-input-file "srfi-197-syntax-case.scm"
(lambda (input-port)
(with-output-to-file "tmp.scm"
(lambda ()
(pretty-print
'(define-module (srfi srfi-197)
#:use-module (rnrs base)
#:use-module (rnrs io ports)
#:use-module (rnrs syntax-case)
#:export (chain
chain-when
chain-and
chain-lambda
nest
nest-reverse)))
(newline)
(let loop ()
(let ((line (read-line input-port)))
(unless (eof-object? line)
(write-line line)
(loop))))))))
(mkdir "srfi")
(rename-file "tmp.scm" "srfi/srfi-197.scm")
(for-each delete-file
'("srfi-197-syntax-case.scm"
"srfi-197.scm"
"srfi-197.sld"
"srfi-64-minimal.scm"
"test-kawa.scm"
"test-r6rs.scm"
"test-r7rs.scm"
"test.scm"))))))
(build-system guile-build-system)
(inputs
(list guile-3.0))
(home-page "https://github.com/ar-nelson/srfi-197")
(synopsis "SRFI 197 pipeline operators port for Guile")
(description
"This package provides an implementation of SRFI 197 for Guile.
SRFI 197 defines a large set of clojure-like threading macros for
representing nested data structures and code in a more readable way.")
(license license:expat))))
(license license:expat))))
(define-public guile-srfi-171
(let ((commit "40eb284ae54e510013054453890052df603a3a7f")
(revision "0"))
(package
(name "guile-srfi-171")
(version (git-version "0.0.0" revision commit))
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/scheme-requests-for-implementation/srfi-171")
(commit commit)))
(file-name (git-file-name name version))
(sha256 (base32 "1w2x5mwvzb2xrp6j2drigay885ni5dag8y2iiak4s96v863wyh5l"))
(snippet
#~(begin
(use-modules (ice-9 rdelim)
(ice-9 pretty-print)
(guix build utils))
(with-output-to-file "tmp.scm"
(lambda ()
(call-with-input-file "srfi/srfi-171.scm"
(lambda (input-port)
(let loop ((i 0))
(let ((line (read-line input-port)))
(unless (equal? line "(include \"171-impl.scm\")")
(unless (< i 13) (write-line line))
(loop (1+ i)))))))
(call-with-input-file "srfi/171-impl.scm"
(lambda (input-port)
(let loop ((i 0))
(let ((line (read-line input-port)))
(unless (eof-object? line)
(unless (< i 13) (write-line line))
(loop (1+ i)))))))))
(delete-file-recursively "srfi")
(mkdir "srfi")
(rename-file "tmp.scm" "srfi/srfi-171.scm")
(for-each delete-file
'("compose.scm"
"srfi-171.html"
"transducers.md"
"README.org"
"index.html"
"tests-guile.scm"
"tests-r7rs.scm"
"tests.scm"))))))
(build-system guile-build-system)
(inputs
(list guile-3.0))
(home-page
"https://github.com/scheme-requests-for-implementation/srfi-171")
(synopsis "SRFI 171 transducers implementation for Guile")
(description
"This package provides an implementation of SRFI 171 for Guile.
SRFI 171 defines transducers that generalize common list operations like
map, filter, take and so on for other types. The traditional Scheme
approach of having collection-specific procedures is not changed. ")
(license license:expat))))