gnu: r-gviz: Update to 1.24.0.
[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")
942cf159 251 (version "0.6.2")
f50f4ae4
DC
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
942cf159 259 "01gxn7kc8pzyh4aadjxxzq8cignmbwmm9rfrsmgqfg9w2q75dn74"))))
f50f4ae4 260 (build-system cmake-build-system)
0577a3fd
CB
261 (arguments
262 '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
f50f4ae4
DC
263 (native-inputs
264 `(("python" ,python)))
265 (home-page "https://github.com/jbeder/yaml-cpp")
266 (synopsis "YAML parser and emitter in C++")
267 (description "YAML parser and emitter in C++ matching the YAML 1.2 spec.")
268 (license license:bsd-3)))
cd131a76
DC
269
270(define-public jsoncpp
271 (package
272 (name "jsoncpp")
e1c08dcc 273 (version "1.8.4")
cd131a76
DC
274 (source (origin
275 (method url-fetch)
276 (uri (string-append
277 "https://github.com/open-source-parsers/jsoncpp/archive/"
278 version ".tar.gz"))
279 (file-name (string-append name "-" version ".tar.gz"))
280 (sha256
281 (base32
e1c08dcc 282 "1dpxk8hkni5dq4mdw8qbaj40jmid3a31d1gh8iqcnfwkw34ym7f4"))))
cd131a76
DC
283 (build-system cmake-build-system)
284 (home-page "https://github.com/open-source-parsers/jsoncpp")
996f5ece
EB
285 (arguments
286 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES")))
cd131a76
DC
287 (synopsis "C++ library for interacting with JSON")
288 (description "JsonCpp is a C++ library that allows manipulating JSON values,
289including serialization and deserialization to and from strings. It can also
290preserve existing comment in unserialization/serialization steps, making
291it a convenient format to store user input files.")
292 (license license:expat)))
557d3328
MB
293
294(define-public capnproto
295 (package
296 (name "capnproto")
0866dd46 297 (version "0.6.1")
557d3328
MB
298 (source (origin
299 (method url-fetch)
300 (uri (string-append
301 "https://capnproto.org/capnproto-c++-"
302 version ".tar.gz"))
303 (sha256
304 (base32
0866dd46 305 "010s9yhq4531wvdfrdf2477zswhck6cjfby79w73rff3v06090l0"))))
557d3328
MB
306 (build-system gnu-build-system)
307 (arguments
308 `(#:phases
309 (modify-phases %standard-phases
310 (add-before 'check 'do-not-require-/etc/services
311 (lambda _
312 ;; Workaround for test that tries to resolve port name from
313 ;; /etc/services, which is not present in build environment.
314 (substitute* "src/kj/async-io-test.c++" ((":http") ":80"))
315 #t)))))
316 (home-page "https://capnproto.org")
317 (synopsis "Capability-based RPC and serialization system")
318 (description
319 "Cap'n Proto is a very fast data interchange format and capability-based
320RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster.")
321 (license license:expat)))
9d625512
CB
322
323(define-public libbson
324 (package
325 (name "libbson")
326 (version "1.6.2")
327 (source
328 (origin
329 (method url-fetch)
330 (uri (string-append "https://github.com/mongodb/libbson/releases/"
331 "download/" version "/libbson-" version ".tar.gz"))
332 (sha256
333 (base32
334 "1fj4554msq0rrz14snbj908dzqj46gh7jg9w9j0akn2b7q911m5a"))))
335 (build-system gnu-build-system)
336 (native-inputs `(("perl" ,perl)))
337 (home-page "http://mongoc.org/libbson/current/index.html")
338 (synopsis "C BSON library")
339 (description "Libbson can create and parse BSON documents. It can also
340convert JSON documents to BSON and the opposite. BSON stands for Binary JSON,
341it is comparable to protobuf.")
342 (license license:asl2.0)))
bf7c3699
GG
343
344(define-public nlohmann-json-cpp
345 (package
346 (name "nlohmann-json-cpp")
347 (version "2.1.1")
348 (source
349 (origin
350 (method url-fetch)
351 (uri (string-append "https://github.com/nlohmann/json/"
352 "archive/v" version ".tar.gz"))
353 (file-name (string-append name "-" version ".tar.gz"))
354 (sha256
355 (base32
356 "0lrh6cjd643c7kmvmwafbgq7dqj3b778483gjhjbvp6rc6z5xf2r"))))
357 (build-system cmake-build-system)
358 (home-page "https://nlohmann.github.io/json/")
359 (synopsis "JSON library for C++")
360 (description
361 "JSON library for C++ trying to accomplish “Intuitive syntax”,
362“Trivial integration”, and “Serious testing”.
363However, “Memory efficiency” and “Speed” have not been primary goals.")
364 (license license:expat)))
f38d54f0
MFM
365
366(define-public python-ruamel.yaml
367 (package
368 (name "python-ruamel.yaml")
95e5aed0 369 (version "0.15.37")
f38d54f0
MFM
370 (source
371 (origin
372 (method url-fetch)
373 (uri (pypi-uri "ruamel.yaml" version))
374 (sha256
375 (base32
95e5aed0 376 "0629xzlwbddfwp8lkjz3mpvxhml9kx17cfs8aydzg55idzcl562h"))))
f38d54f0
MFM
377 (build-system python-build-system)
378 (native-inputs
379 `(("python-pytest" ,python-pytest)))
380 (arguments
381 `(;; TODO: Tests require packaging "ruamel.std.pathlib".
382 #:tests? #f))
383 (home-page "https://bitbucket.org/ruamel/yaml")
384 (synopsis "YAML 1.2 parser/emitter")
385 (description
386 "This package provides YAML parser/emitter that supports roundtrip
387preservation of comments, seq/map flow style, and map key order. It
388is a derivative of Kirill Simonov’s PyYAML 3.11. It supports YAML 1.2
389and has round-trip loaders and dumpers. It supports comments. Block
390style and key ordering are kept, so you can diff the source.")
391 (license license:expat)))
392
393(define-public python2-ruamel.yaml
394 (package-with-python2 python-ruamel.yaml))
7ae282fb 395
396(define-public python-cbor
397 (package
398 (name "python-cbor")
399 (version "1.0.0")
400 (source
401 (origin
402 (method url-fetch)
403 (uri (pypi-uri "cbor" version))
404 (sha256
405 (base32
406 "1dmv163cnslyqccrybkxn0c9s1jk1mmafmgxv75iamnz5lk5l8hk"))))
407 (build-system python-build-system)
408 (home-page "https://bitbucket.org/bodhisnarkva/cbor")
409 (synopsis "Implementation of the Concise Binary Object Representation")
410 (description
411 "Python-cbor provides an implementation of the Concise Binary Object
31af847b
TGR
412Representation (@dfn{CBOR}). CBOR is comparable to JSON, has a superset of
413JSON's ability, but serializes to a binary format which is smaller and faster
414to generate and parse. The two primary functions are @code{cbor.loads} and
7ae282fb 415@code{cbor.dumps}.")
416 (license license:asl2.0)))
04953dca
LF
417
418(define-public flatbuffers
419 (package
420 (name "flatbuffers")
87abf4a8 421 (version "1.9.0")
04953dca
LF
422 (source
423 (origin
424 (method url-fetch)
425 (uri (string-append "https://github.com/google/flatbuffers/archive/v"
426 version ".tar.gz"))
427 (sha256
428 (base32
87abf4a8 429 "1qs7sa9q4q6hs12yp875lvrv6393178qcmqs1ziwmjk088g4k9aw"))))
04953dca
LF
430 (build-system cmake-build-system)
431 (arguments
3def739d
TGR
432 '(#:build-type "Release"
433 #:configure-flags
04953dca 434 (list (string-append "-DCMAKE_INSTALL_LIBDIR="
3def739d 435 (assoc-ref %outputs "out") "/lib"))))
04953dca
LF
436 (home-page "https://google.github.io/flatbuffers/")
437 (synopsis "Memory-efficient serialization library")
438 (description "FlatBuffers is a cross platform serialization library for C++,
439C#, C, Go, Java, JavaScript, PHP, and Python. It was originally created for
440game development and other performance-critical applications.")
441 (license license:asl2.0)))
9f1c0e03
LF
442
443(define-public r-feather
444 (package
445 (name "r-feather")
446 (version "0.3.1")
447 (source
448 (origin
449 (method url-fetch)
450 (uri (cran-uri "feather" version))
451 (sha256
452 (base32
453 "1q6dbkfnkpnabq8lb6bm9ma44cfcghx2lm23pyk3vg7943wrn1pi"))))
454 (build-system r-build-system)
455 (propagated-inputs
456 `(("r-hms" ,r-hms)
457 ("r-rcpp" ,r-rcpp)
458 ("r-tibble" ,r-tibble)))
459 (home-page "https://github.com/wesm/feather")
460 (synopsis "R Bindings to the Feather API")
461 (description "Read and write feather files, a lightweight binary columnar
462daa store designed for maximum speed.")
463 (license license:asl2.0)))
8d4f34d6
LF
464
465(define-public python-feather-format
466 (package
467 (name "python-feather-format")
468 (version "0.4.0")
469 (source
470 (origin
471 (method url-fetch)
472 (uri (pypi-uri "feather-format" version))
473 (sha256
474 (base32
475 "1adivm5w5ji4qv7hq7942vqlk8l2wgw87bdlsia771z14z3zp857"))))
476 (build-system python-build-system)
477 (propagated-inputs
478 `(("python-pandas" ,python-pandas)
479 ("python-pyarrow" ,python-pyarrow)))
480 (home-page "https://github.com/wesm/feather")
481 (synopsis "Python wrapper to the Feather file format")
482 (description "This package provides a Python wrapper library to the
483Apache Arrow-based Feather binary columnar serialization data frame format.")
484 (license license:asl2.0)))
485
486(define-public python2-feather-format
487 (package-with-python2 python-feather-format))