summaryrefslogtreecommitdiff
path: root/gnu/packages/serialization.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/serialization.scm')
-rw-r--r--gnu/packages/serialization.scm143
1 files changed, 128 insertions, 15 deletions
diff --git a/gnu/packages/serialization.scm b/gnu/packages/serialization.scm
index 7fd083f93d..c8dcf65905 100644
--- a/gnu/packages/serialization.scm
+++ b/gnu/packages/serialization.scm
@@ -1,9 +1,9 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2015, 2017, 2019, 2021 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2015, 2017, 2019, 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
;;; Copyright © 2016 David Craven <david@craven.ch>
;;; Copyright © 2016, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
-;;; Copyright © 2016, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016, 2018, 2019, 2021 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2017 Corentin Bocquillon <corentin@nybble.fr>
;;; Copyright © 2017 Gregor Giesen <giesen@zaehlwerk.net>
;;; Copyright © 2017 Frederick M. Muriithi <fredmanglis@gmail.com>
@@ -11,6 +11,7 @@
;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
+;;; Copyright © 2020 Alexandros Theodotou <alex@zrythm.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -31,6 +32,7 @@
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix download)
+ #:use-module (guix hg-download)
#:use-module (guix git-download)
#:use-module (guix utils)
#:use-module (guix build-system cmake)
@@ -333,6 +335,74 @@ that implements both the msgpack and msgpack-rpc specifications.")
(inputs
`(("lua" ,lua-5.2)))))
+(define-public libyaml
+ (package
+ (name "libyaml")
+ (version "0.2.5")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://pyyaml.org/download/libyaml/yaml-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1x4fcw13r3lqy8ndydr3ili87wicplw2awbcv6r21qgyfndswhn6"))))
+ (build-system gnu-build-system)
+ (arguments
+ '(#:configure-flags '("--disable-static")))
+ (home-page "https://pyyaml.org/wiki/LibYAML")
+ (synopsis "YAML 1.1 parser and emitter written in C")
+ (description
+ "LibYAML is a YAML 1.1 parser and emitter written in C.")
+ (license license:expat)))
+
+(define-public libyaml+static
+ (package
+ (inherit libyaml)
+ (name "libyaml+static")
+ (arguments
+ '(#:configure-flags '("--enable-static")))))
+
+(define-public libcyaml
+ (package
+ (name "libcyaml")
+ (version "1.1.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/tlsa/libcyaml")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (patches (search-patches "libcyaml-libyaml-compat.patch"))
+ (sha256
+ (base32 "0428p0rwq71nhh5nzcbapsbrjxa0x5l6h6ns32nxv7j624f0zd93"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:make-flags
+ (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
+ (string-append "CC=gcc"))
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure) ; no configure script
+ (replace 'check
+ (lambda _
+ (setenv "CC" "gcc")
+ (invoke "make" "test"))))))
+ (inputs
+ `(("libyaml" ,libyaml)))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (synopsis "C library for reading and writing YAML")
+ (description
+ "LibCYAML is a C library written in ISO C11 for reading and writing
+structured YAML documents. The fundamental idea behind CYAML is to allow
+applications to construct schemas which describe both the permissible
+structure of the YAML documents to read/write, and the C data structure(s)
+in which the loaded data is arranged in memory.")
+ (home-page "https://github.com/tlsa/libcyaml")
+ (license license:isc)))
+
(define-public yaml-cpp
(package
(name "yaml-cpp")
@@ -462,21 +532,23 @@ it is comparable to protobuf.")
(define-public python-ruamel.yaml
(package
(name "python-ruamel.yaml")
- (version "0.15.83")
+ (version "0.16.13")
(source
(origin
(method url-fetch)
(uri (pypi-uri "ruamel.yaml" version))
(sha256
(base32
- "0p4i8ad28cbbbjja8b9274irkhnphhvhap3aym6yb8xfp1d72kpw"))))
+ "0hm9yg785f46bkrgqknd6fdvmkby9dpzjnm0b63qf0i748acaj5v"))))
(build-system python-build-system)
(native-inputs
`(("python-pytest" ,python-pytest)))
+ (propagated-inputs
+ `(("python-ruamel.yaml.clib" ,python-ruamel.yaml.clib)))
(arguments
`(;; TODO: Tests require packaging "ruamel.std.pathlib".
#:tests? #f))
- (home-page "https://bitbucket.org/ruamel/yaml")
+ (home-page "https://sourceforge.net/projects/ruamel-yaml/")
(synopsis "YAML 1.2 parser/emitter")
(description
"This package provides YAML parser/emitter that supports roundtrip
@@ -486,8 +558,43 @@ and has round-trip loaders and dumpers. It supports comments. Block
style and key ordering are kept, so you can diff the source.")
(license license:expat)))
-(define-public python2-ruamel.yaml
- (package-with-python2 python-ruamel.yaml))
+(define-public python-ruamel.yaml.clib
+ (package
+ (name "python-ruamel.yaml.clib")
+ (version "0.2.6")
+ (source
+ (origin
+ ;; pypi release code has cythonized code without corresponding source.
+ (method hg-fetch)
+ (uri (hg-reference
+ (url "http://hg.code.sf.net/p/ruamel-yaml-clib/code")
+ (changeset version)))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32
+ "05m3y7pjfbaarqbbgw1k6gs6cnnmxnwadjipxvw1aaaqk3s236cs"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ (delete-file "_ruamel_yaml.c")))))
+ (build-system python-build-system)
+ (arguments
+ `(#:tests? #f ; This package is split from python-ruamel.yaml and
+ ; depends on modules from it for the test suite.
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'sanity-check) ; Depends on python-ruamel.yaml
+ (add-after 'unpack 'cythonize-code
+ (lambda _
+ (invoke "cython" "_ruamel_yaml.pyx"))))))
+ (native-inputs
+ `(("python-cython" ,python-cython)))
+ (home-page "https://sourceforge.net/p/ruamel-yaml-clib/code/ci/default/tree")
+ (synopsis "C version of reader, parser and emitter for ruamel.yaml")
+ (description
+ "This package provides a C version of the reader, parser and emitter for
+@code{ruamel.yaml} derived from libyaml.")
+ (license license:expat)))
(define-public python-cbor
(package
@@ -514,22 +621,28 @@ to generate and parse. The two primary functions are @code{cbor.loads} and
(define-public flatbuffers
(package
(name "flatbuffers")
- (version "1.10.0")
+ (version "2.0.0")
(source
(origin
- (method url-fetch)
- (uri (string-append "https://github.com/google/flatbuffers/archive/v"
- version ".tar.gz"))
- (file-name (string-append name "-" version ".tar.gz"))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/google/flatbuffers")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
(sha256
(base32
- "0z4swldxs0s31hnkqdhsbfmc8vx3p7zsvmqaw4l31r2iikdy651p"))))
+ "1zbf6bdpps8369r1ql00irxrp58jnalycc8jcapb8iqg654vlfz8"))))
(build-system cmake-build-system)
(arguments
'(#:build-type "Release"
#:configure-flags
- (list (string-append "-DCMAKE_INSTALL_LIBDIR="
- (assoc-ref %outputs "out") "/lib"))))
+ (list "-DFLATBUFFERS_BUILD_SHAREDLIB=ON"
+ (string-append "-DCMAKE_INSTALL_LIBDIR="
+ (assoc-ref %outputs "out") "/lib"))
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'make-writable
+ (lambda _ (for-each make-file-writable (find-files ".")))))))
(home-page "https://google.github.io/flatbuffers/")
(synopsis "Memory-efficient serialization library")
(description "FlatBuffers is a cross-platform serialization library for C++,