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