summaryrefslogtreecommitdiff
path: root/gnu/packages/guile-xyz.scm
diff options
context:
space:
mode:
authorMartin Becze <mjbecze@riseup.net>2020-09-08 10:59:43 -0500
committerMathieu Othacehe <othacehe@gnu.org>2020-09-10 09:26:16 +0200
commita684e6e269757f3ae5092bd2d9c4d5b6664e89c3 (patch)
treeccad2c5fdf6635c238adc9d2caa75f022732315c /gnu/packages/guile-xyz.scm
parent7090159c23d6345992ab976d71fefeb1583cfcdf (diff)
downloadguix-patches-a684e6e269757f3ae5092bd2d9c4d5b6664e89c3.tar
guix-patches-a684e6e269757f3ae5092bd2d9c4d5b6664e89c3.tar.gz
gnu: Add guile-struct-pack.
* gnu/packages/guile-xyz.scm (guile-struct-pack): New variable. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
Diffstat (limited to 'gnu/packages/guile-xyz.scm')
-rw-r--r--gnu/packages/guile-xyz.scm44
1 files changed, 44 insertions, 0 deletions
diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 80f792672c..4bfc86a073 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -3867,3 +3867,47 @@ between data, in a way that is very similar to WikiData or RDF for instance.
An object can have relations (in the form of an IRI) that relates it to one or
more objects or strings, represented by a Json object or an IRI.")
(license license:gpl3+)))
+
+(define-public guile-struct-pack
+ (package
+ (name "guile-struct-pack")
+ (version "1.1.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/weinholt/struct-pack")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0hd72m821pahjphzyjn26i55542v8makr55xzjll2cycja4wsbc1"))))
+ (build-system guile-build-system)
+ (arguments
+ `(#:compile-flags '("--r6rs" "-Wunbound-variable" "-Warity-mismatch")
+ #:modules ((guix build guile-build-system)
+ (guix build utils)
+ (srfi srfi-26)
+ (ice-9 ftw))
+ #:phases (modify-phases %standard-phases
+ (add-before 'build 'move-sls-files
+ (lambda _
+ ;; Move files under a struct/ directory to reflect the
+ ;; module hierarchy.
+ (define dst-folder "struct")
+ (define (target file)
+ (string-append dst-folder "/" file))
+ (define files
+ (scandir "." (negate (cut member <> '("." "..")))))
+ (mkdir dst-folder)
+ (for-each (lambda (file)
+ (rename-file file (target file)))
+ files)
+ #t)))))
+ (native-inputs
+ `(("guile" ,guile-3.0)))
+ (home-page "https://github.com/weinholt/struct-pack")
+ (synopsis "R6RS library for working with packed byte structures")
+ (description
+ "This is an R6RS library for working with packed byte structures. It is
+similar to struct in Python or pack and unpack in Perl.")
+ (license license:expat)))