Correct name and Email for ng0.
[jackhill/guix/guix.git] / gnu / packages / serialization.scm
CommitLineData
0149354d 1;;; GNU Guix --- Functional package management for GNU
c57e5fd0 2;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@elephly.net>
d1ef573d 3;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
f50f4ae4 4;;; Copyright © 2016 David Craven <david@craven.ch>
557d3328 5;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
43593f5b 6;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
9d625512 7;;; Copyright © 2017 Corentin Bocquillon <corentin@nybble.fr>
bf7c3699 8;;; Copyright © 2017 Gregor Giesen <giesen@zaehlwerk.net>
f38d54f0 9;;; Copyright © 2017 Frederick M. Muriithi <fredmanglis@gmail.com>
4a78fd46 10;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
3def739d 11;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
04953dca 12;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
0149354d
RW
13;;;
14;;; This file is part of GNU Guix.
15;;;
16;;; GNU Guix is free software; you can redistribute it and/or modify it
17;;; under the terms of the GNU General Public License as published by
18;;; the Free Software Foundation; either version 3 of the License, or (at
19;;; your option) any later version.
20;;;
21;;; GNU Guix is distributed in the hope that it will be useful, but
22;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24;;; GNU General Public License for more details.
25;;;
26;;; You should have received a copy of the GNU General Public License
27;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28
29(define-module (gnu packages serialization)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix packages)
32 #:use-module (guix download)
8e664e7e 33 #:use-module (guix utils)
0149354d 34 #:use-module (guix build-system cmake)
d1ef573d 35 #:use-module (guix build-system gnu)
9f1c0e03
LF
36 #:use-module (guix build-system python)
37 #:use-module (guix build-system r)
0149354d 38 #:use-module (gnu packages)
d1ef573d 39 #:use-module (gnu packages autotools)
f50f4ae4 40 #:use-module (gnu packages boost)
d1ef573d
LG
41 #:use-module (gnu packages check)
42 #:use-module (gnu packages compression)
9f1c0e03 43 #:use-module (gnu packages cran)
8d4f34d6 44 #:use-module (gnu packages databases)
d1ef573d 45 #:use-module (gnu packages documentation)
8e664e7e 46 #:use-module (gnu packages lua)
f47dc8dd 47 #:use-module (gnu packages pkg-config)
9d625512 48 #:use-module (gnu packages python)
f38d54f0 49 #:use-module (gnu packages perl)
9f1c0e03 50 #:use-module (gnu packages statistics))
0149354d
RW
51
52(define-public cereal
53 (package
54 (name "cereal")
43593f5b 55 (version "1.2.1")
0149354d
RW
56 (source (origin
57 (method url-fetch)
58 (uri (string-append "https://github.com/USCiLab/cereal/archive/v"
59 version ".tar.gz"))
60 (file-name (string-append name "-" version ".tar.gz"))
61 (sha256
62 (base32
43593f5b 63 "0kj32h3j2128anig0g9gzw82kfyd5xqfkwq6vdyv900jx8i1qckx"))))
0149354d
RW
64 (build-system cmake-build-system)
65 (arguments
66 `(;; The only included tests are portability tests requiring
67 ;; cross-compilation and boost. Since we are building cereal on more
68 ;; platforms anyway, there is no compelling reason to build the tests.
69 #:tests? #f
70 #:out-of-source? #f
71 #:phases
72 (modify-phases %standard-phases
73 (delete 'configure)
74 (replace 'build
75 (lambda _
76 (substitute* "doc/doxygen.in"
77 (("@CMAKE_CURRENT_SOURCE_DIR@") "."))
35929375
TGR
78 (invoke "doxygen" "doc/doxygen.in")
79 #t))
0149354d
RW
80 ;; There is no "install" target, so we have to provide our own
81 ;; "install" phase.
82 (replace 'install
83 (lambda* (#:key outputs #:allow-other-keys)
84 (let* ((out (assoc-ref outputs "out"))
85 (doc (string-append out "/share/cereal/docs"))
86 (include (string-append out "/include/cereal")))
87 (mkdir-p doc)
88 (mkdir-p include)
89 (copy-recursively "include/cereal" include)
90 (copy-recursively "doc/html" doc))
91 #t)))))
92 (native-inputs
93 `(("doxygen" ,doxygen)))
94 (home-page "http://uscilab.github.io/cereal/")
95 (synopsis "C++11 library for serialization")
96 (description
97 "Cereal is a header-only C++11 serialization library. Cereal takes
98arbitrary data types and reversibly turns them into different representations,
99such as compact binary encodings, XML, or JSON.")
100 (license license:bsd-3)))
d1ef573d
LG
101
102
103(define-public msgpack
104 (package
105 (name "msgpack")
e54ae862 106 (version "1.4.2")
d1ef573d
LG
107 (source
108 (origin
109 (method url-fetch)
110 (uri
111 (string-append
112 "https://github.com/msgpack/msgpack-c/releases/download/"
113 "cpp-" version "/msgpack-" version ".tar.gz"))
114 (snippet
115 '(let ((p (open-file "msgpack.pc.in" "a")))
116 (begin
117 (display
118 (string-append "Requires: " "zlib" "\n") p)
119 (close-output-port p))))
120 (sha256
121 (base32
e54ae862 122 "18hzmyfg3mvnp7ab03nqdzzvqagkl42gygjpi4zv4i7aca2dmwf0"))))
d1ef573d
LG
123 (build-system gnu-build-system)
124 (native-inputs
125 `(("googletest" ,googletest)
126 ("autoconf" ,autoconf)
127 ("automake" ,automake)
128 ("libtool" ,libtool)
129 ("pkg-config" ,pkg-config)))
130 (propagated-inputs
131 `(("zlib" ,zlib))) ;; Msgpack installs two headers (zbuffer.h,
132 ;; zbuffer.hpp) which #include <zlib.h>. However, 'guix gc --references'
133 ;; does not detect a store reference to zlib since these headers are not
134 ;; compiled.
135 (arguments
136 `(#:phases
137 (modify-phases %standard-phases
d10092b8 138 (add-after 'unpack 'autoconf
d1ef573d 139 (lambda _
778fb47b
TGR
140 (invoke "autoreconf" "-vfi")
141 #t)))))
fe0523d4 142 (home-page "https://www.msgpack.org")
d1ef573d
LG
143 (synopsis "Binary serialization library")
144 (description "Msgpack is a library for C/C++ that implements binary
145serialization.")
146 (license license:boost1.0)))
f50f4ae4 147
c57e5fd0
RW
148(define-public libmpack
149 (package
150 (name "libmpack")
b5236121 151 (version "1.0.5")
c57e5fd0
RW
152 (source (origin
153 (method url-fetch)
154 (uri (string-append "https://github.com/tarruda/libmpack/"
155 "archive/" version ".tar.gz"))
156 (file-name (string-append name "-" version ".tar.gz"))
157 (sha256
b5236121
LF
158 (base32
159 "0ml922gv8y99lbldqb9ykpjndla0hlprdjyl79yskkhwv2ai7sac"))))
c57e5fd0
RW
160 (build-system gnu-build-system)
161 (arguments
162 `(#:test-target "test"
163 #:make-flags
164 (list "CC=gcc"
165 (string-append "PREFIX=" (assoc-ref %outputs "out")))
166 #:phases
167 (modify-phases %standard-phases
168 (delete 'configure))))
169 (native-inputs
170 `(("libtool" ,libtool)))
171 (home-page "https://github.com/tarruda/libmpack")
172 (synopsis "Small binary serialization library")
173 (description "Libmpack is a small binary serialization and RPC library
174that implements both the msgpack and msgpack-rpc specifications.")
175 (license license:expat)))
176
8e664e7e
RW
177(define-public lua-libmpack
178 (package (inherit libmpack)
179 (name "lua-libmpack")
7ec309af
RW
180 (source (origin
181 (method url-fetch)
182 (uri (string-append "https://github.com/libmpack/libmpack-lua/"
183 "archive/" (package-version libmpack) ".tar.gz"))
184 (file-name (string-append name "-" (package-version libmpack) ".tar.gz"))
185 (sha256
186 (base32
187 "153zrrbyxhf71dgzjjhrk56rfwk3nisslpgcqyg44v8fnz1xpk6i"))))
8e664e7e
RW
188 (build-system gnu-build-system)
189 (arguments
190 `(;; FIXME: tests require "busted", which is not yet available in Guix.
191 #:tests? #f
192 #:test-target "test"
193 #:make-flags
194 (let* ((lua-version ,(package-version lua))
195 (lua-major+minor ,(version-major+minor (package-version lua))))
196 (list "CC=gcc"
7ec309af
RW
197 "FETCH=echo" ; don't fetch anything from the web
198 "UNTGZ=echo" ; and don't try to unpack it
8e664e7e 199 "USE_SYSTEM_LUA=yes"
7ec309af
RW
200 (string-append "MPACK_LUA_VERSION=" lua-version)
201 (string-append "MPACK_LUA_VERSION_NOPATCH=" lua-major+minor)
8e664e7e
RW
202 (string-append "PREFIX="
203 (assoc-ref %outputs "out"))
204 (string-append "LUA_CMOD_INSTALLDIR="
205 (assoc-ref %outputs "out")
7ec309af 206 "/lib/lua/" lua-major+minor)))
8e664e7e
RW
207 #:phases
208 (modify-phases %standard-phases
209 (delete 'configure)
7ec309af
RW
210 (add-after 'unpack 'unpack-mpack-sources
211 (lambda* (#:key inputs #:allow-other-keys)
212 ;; This is broken because mpack-src is not a file, but all
213 ;; prerequisites are added to the inputs of the gcc invocation.
214 (substitute* "Makefile"
215 (("\\$\\(MPACK\\): mpack-src") "$(MPACK): "))
216 (mkdir-p "mpack-src")
217 (zero? (system* "tar" "-C" "mpack-src"
218 "--strip-components=1"
219 "-xvf" (assoc-ref inputs "libmpack"))))))))
8e664e7e
RW
220 (inputs
221 `(("lua" ,lua)))
222 (native-inputs
7ec309af
RW
223 `(("pkg-config" ,pkg-config)
224 ("libmpack" ,(package-source libmpack))))
225 (home-page "https://github.com/libmpack/libmpack-lua")
8e664e7e
RW
226 (synopsis "Lua bindings for the libmpack binary serialization library")))
227
369ee96b
RW
228(define-public lua5.2-libmpack
229 (package (inherit lua-libmpack)
230 (name "lua5.2-libmpack")
231 (arguments
232 (substitute-keyword-arguments (package-arguments lua-libmpack)
233 ((#:make-flags flags)
234 `(let* ((lua-version ,(package-version lua-5.2))
235 (lua-major+minor ,(version-major+minor (package-version lua-5.2))))
236 (list "CC=gcc"
237 "USE_SYSTEM_LUA=yes"
0cdc3343
RW
238 (string-append "MPACK_LUA_VERSION=" lua-version)
239 (string-append "MPACK_LUA_VERSION_NOPATCH=" lua-major+minor)
369ee96b
RW
240 (string-append "PREFIX="
241 (assoc-ref %outputs "out"))
242 (string-append "LUA_CMOD_INSTALLDIR="
243 (assoc-ref %outputs "out")
244 "/lib/lua/" lua-major+minor))))))
245 (inputs
246 `(("lua" ,lua-5.2)))))
247
f50f4ae4
DC
248(define-public yaml-cpp
249 (package
250 (name "yaml-cpp")
251 (version "0.5.3")
252 (source (origin
253 (method url-fetch)
254 (uri (string-append
255 "https://github.com/jbeder/yaml-cpp/archive/"
256 "yaml-cpp-" version ".tar.gz"))
257 (sha256
258 (base32
fd75eb6c 259 "1ck7jk0wjfigrf4cgcjqsir4yp1s6vamhhxhpsgfvs46pgm5pk6y"))))
f50f4ae4 260 (build-system cmake-build-system)
0577a3fd
CB
261 (arguments
262 '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
f50f4ae4
DC
263 (inputs
264 `(("boost" ,boost)))
265 (native-inputs
266 `(("python" ,python)))
267 (home-page "https://github.com/jbeder/yaml-cpp")
268 (synopsis "YAML parser and emitter in C++")
269 (description "YAML parser and emitter in C++ matching the YAML 1.2 spec.")
270 (license license:bsd-3)))
cd131a76
DC
271
272(define-public jsoncpp
273 (package
274 (name "jsoncpp")
e1c08dcc 275 (version "1.8.4")
cd131a76
DC
276 (source (origin
277 (method url-fetch)
278 (uri (string-append
279 "https://github.com/open-source-parsers/jsoncpp/archive/"
280 version ".tar.gz"))
281 (file-name (string-append name "-" version ".tar.gz"))
282 (sha256
283 (base32
e1c08dcc 284 "1dpxk8hkni5dq4mdw8qbaj40jmid3a31d1gh8iqcnfwkw34ym7f4"))))
cd131a76
DC
285 (build-system cmake-build-system)
286 (home-page "https://github.com/open-source-parsers/jsoncpp")
996f5ece
EB
287 (arguments
288 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES")))
cd131a76
DC
289 (synopsis "C++ library for interacting with JSON")
290 (description "JsonCpp is a C++ library that allows manipulating JSON values,
291including serialization and deserialization to and from strings. It can also
292preserve existing comment in unserialization/serialization steps, making
293it a convenient format to store user input files.")
294 (license license:expat)))
557d3328
MB
295
296(define-public capnproto
297 (package
298 (name "capnproto")
0866dd46 299 (version "0.6.1")
557d3328
MB
300 (source (origin
301 (method url-fetch)
302 (uri (string-append
303 "https://capnproto.org/capnproto-c++-"
304 version ".tar.gz"))
305 (sha256
306 (base32
0866dd46 307 "010s9yhq4531wvdfrdf2477zswhck6cjfby79w73rff3v06090l0"))))
557d3328
MB
308 (build-system gnu-build-system)
309 (arguments
310 `(#:phases
311 (modify-phases %standard-phases
312 (add-before 'check 'do-not-require-/etc/services
313 (lambda _
314 ;; Workaround for test that tries to resolve port name from
315 ;; /etc/services, which is not present in build environment.
316 (substitute* "src/kj/async-io-test.c++" ((":http") ":80"))
317 #t)))))
318 (home-page "https://capnproto.org")
319 (synopsis "Capability-based RPC and serialization system")
320 (description
321 "Cap'n Proto is a very fast data interchange format and capability-based
322RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster.")
323 (license license:expat)))
9d625512
CB
324
325(define-public libbson
326 (package
327 (name "libbson")
328 (version "1.6.2")
329 (source
330 (origin
331 (method url-fetch)
332 (uri (string-append "https://github.com/mongodb/libbson/releases/"
333 "download/" version "/libbson-" version ".tar.gz"))
334 (sha256
335 (base32
336 "1fj4554msq0rrz14snbj908dzqj46gh7jg9w9j0akn2b7q911m5a"))))
337 (build-system gnu-build-system)
338 (native-inputs `(("perl" ,perl)))
339 (home-page "http://mongoc.org/libbson/current/index.html")
340 (synopsis "C BSON library")
341 (description "Libbson can create and parse BSON documents. It can also
342convert JSON documents to BSON and the opposite. BSON stands for Binary JSON,
343it is comparable to protobuf.")
344 (license license:asl2.0)))
bf7c3699
GG
345
346(define-public nlohmann-json-cpp
347 (package
348 (name "nlohmann-json-cpp")
349 (version "2.1.1")
350 (source
351 (origin
352 (method url-fetch)
353 (uri (string-append "https://github.com/nlohmann/json/"
354 "archive/v" version ".tar.gz"))
355 (file-name (string-append name "-" version ".tar.gz"))
356 (sha256
357 (base32
358 "0lrh6cjd643c7kmvmwafbgq7dqj3b778483gjhjbvp6rc6z5xf2r"))))
359 (build-system cmake-build-system)
360 (home-page "https://nlohmann.github.io/json/")
361 (synopsis "JSON library for C++")
362 (description
363 "JSON library for C++ trying to accomplish “Intuitive syntax”,
364“Trivial integration”, and “Serious testing”.
365However, “Memory efficiency” and “Speed” have not been primary goals.")
366 (license license:expat)))
f38d54f0
MFM
367
368(define-public python-ruamel.yaml
369 (package
370 (name "python-ruamel.yaml")
becee9e3 371 (version "0.15.35")
f38d54f0
MFM
372 (source
373 (origin
374 (method url-fetch)
375 (uri (pypi-uri "ruamel.yaml" version))
376 (sha256
377 (base32
becee9e3 378 "0xggyfaj6vprggahf7cq8kp9j79rb7hn8ndk3bxj2sxvwhhliiwd"))))
f38d54f0
MFM
379 (build-system python-build-system)
380 (native-inputs
381 `(("python-pytest" ,python-pytest)))
382 (arguments
383 `(;; TODO: Tests require packaging "ruamel.std.pathlib".
384 #:tests? #f))
385 (home-page "https://bitbucket.org/ruamel/yaml")
386 (synopsis "YAML 1.2 parser/emitter")
387 (description
388 "This package provides YAML parser/emitter that supports roundtrip
389preservation of comments, seq/map flow style, and map key order. It
390is a derivative of Kirill Simonov’s PyYAML 3.11. It supports YAML 1.2
391and has round-trip loaders and dumpers. It supports comments. Block
392style and key ordering are kept, so you can diff the source.")
393 (license license:expat)))
394
395(define-public python2-ruamel.yaml
396 (package-with-python2 python-ruamel.yaml))
7ae282fb 397
398(define-public python-cbor
399 (package
400 (name "python-cbor")
401 (version "1.0.0")
402 (source
403 (origin
404 (method url-fetch)
405 (uri (pypi-uri "cbor" version))
406 (sha256
407 (base32
408 "1dmv163cnslyqccrybkxn0c9s1jk1mmafmgxv75iamnz5lk5l8hk"))))
409 (build-system python-build-system)
410 (home-page "https://bitbucket.org/bodhisnarkva/cbor")
411 (synopsis "Implementation of the Concise Binary Object Representation")
412 (description
413 "Python-cbor provides an implementation of the Concise Binary Object
31af847b
TGR
414Representation (@dfn{CBOR}). CBOR is comparable to JSON, has a superset of
415JSON's ability, but serializes to a binary format which is smaller and faster
416to generate and parse. The two primary functions are @code{cbor.loads} and
7ae282fb 417@code{cbor.dumps}.")
418 (license license:asl2.0)))
04953dca
LF
419
420(define-public flatbuffers
421 (package
422 (name "flatbuffers")
423 (version "1.8.0")
424 (source
425 (origin
426 (method url-fetch)
427 (uri (string-append "https://github.com/google/flatbuffers/archive/v"
428 version ".tar.gz"))
429 (sha256
430 (base32
431 "0blc978wc5h91662vai24xj92c3bx56y6hzid90qva7il302jl64"))))
432 (build-system cmake-build-system)
433 (arguments
3def739d
TGR
434 '(#:build-type "Release"
435 #:configure-flags
04953dca 436 (list (string-append "-DCMAKE_INSTALL_LIBDIR="
3def739d 437 (assoc-ref %outputs "out") "/lib"))))
04953dca
LF
438 (home-page "https://google.github.io/flatbuffers/")
439 (synopsis "Memory-efficient serialization library")
440 (description "FlatBuffers is a cross platform serialization library for C++,
441C#, C, Go, Java, JavaScript, PHP, and Python. It was originally created for
442game development and other performance-critical applications.")
443 (license license:asl2.0)))
9f1c0e03
LF
444
445(define-public r-feather
446 (package
447 (name "r-feather")
448 (version "0.3.1")
449 (source
450 (origin
451 (method url-fetch)
452 (uri (cran-uri "feather" version))
453 (sha256
454 (base32
455 "1q6dbkfnkpnabq8lb6bm9ma44cfcghx2lm23pyk3vg7943wrn1pi"))))
456 (build-system r-build-system)
457 (propagated-inputs
458 `(("r-hms" ,r-hms)
459 ("r-rcpp" ,r-rcpp)
460 ("r-tibble" ,r-tibble)))
461 (home-page "https://github.com/wesm/feather")
462 (synopsis "R Bindings to the Feather API")
463 (description "Read and write feather files, a lightweight binary columnar
464daa store designed for maximum speed.")
465 (license license:asl2.0)))
8d4f34d6
LF
466
467(define-public python-feather-format
468 (package
469 (name "python-feather-format")
470 (version "0.4.0")
471 (source
472 (origin
473 (method url-fetch)
474 (uri (pypi-uri "feather-format" version))
475 (sha256
476 (base32
477 "1adivm5w5ji4qv7hq7942vqlk8l2wgw87bdlsia771z14z3zp857"))))
478 (build-system python-build-system)
479 (propagated-inputs
480 `(("python-pandas" ,python-pandas)
481 ("python-pyarrow" ,python-pyarrow)))
482 (home-page "https://github.com/wesm/feather")
483 (synopsis "Python wrapper to the Feather file format")
484 (description "This package provides a Python wrapper library to the
485Apache Arrow-based Feather binary columnar serialization data frame format.")
486 (license license:asl2.0)))
487
488(define-public python2-feather-format
489 (package-with-python2 python-feather-format))