gnu: Deprecate ungoogled-chromium.
[jackhill/guix/guix.git] / gnu / packages / serialization.scm
CommitLineData
0149354d 1;;; GNU Guix --- Functional package management for GNU
42ef29c8 2;;; Copyright © 2015, 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
d1ef573d 3;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
f50f4ae4 4;;; Copyright © 2016 David Craven <david@craven.ch>
cdc07e68 5;;; Copyright © 2016, 2019 Marius Bakke <mbakke@fastmail.com>
f20cfa06 6;;; Copyright © 2016, 2018, 2019 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>
47956fa0 10;;; Copyright © 2017 ng0 <ng0@n0.is>
d7885bbf 11;;; Copyright © 2017, 2018, 2019 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)
42ef29c8 33 #:use-module (guix git-download)
8e664e7e 34 #:use-module (guix utils)
0149354d 35 #:use-module (guix build-system cmake)
d1ef573d 36 #:use-module (guix build-system gnu)
9f1c0e03 37 #:use-module (guix build-system python)
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)
8d4f34d6 43 #:use-module (gnu packages databases)
d1ef573d 44 #:use-module (gnu packages documentation)
af632c6b 45 #:use-module (gnu packages gcc)
8e664e7e 46 #:use-module (gnu packages lua)
f47dc8dd 47 #:use-module (gnu packages pkg-config)
9d625512 48 #:use-module (gnu packages python)
44d10b1f 49 #:use-module (gnu packages python-xyz)
60a166c6 50 #:use-module (gnu packages perl))
0149354d
RW
51
52(define-public cereal
53 (package
54 (name "cereal")
43593f5b 55 (version "1.2.1")
0300085c
TGR
56 (source
57 (origin
58 (method git-fetch)
59 (uri (git-reference
60 (url "https://github.com/USCiLab/cereal.git")
61 (commit (string-append "v" version))))
62 (file-name (git-file-name name version))
63 (sha256
64 (base32 "1vxkrsnxkiblzi1z61vfix167c184fy868sgwj2dxxgbgjcq2nrh"))))
0149354d
RW
65 (build-system cmake-build-system)
66 (arguments
67 `(;; The only included tests are portability tests requiring
68 ;; cross-compilation and boost. Since we are building cereal on more
69 ;; platforms anyway, there is no compelling reason to build the tests.
70 #:tests? #f
71 #:out-of-source? #f
72 #:phases
73 (modify-phases %standard-phases
74 (delete 'configure)
75 (replace 'build
76 (lambda _
77 (substitute* "doc/doxygen.in"
78 (("@CMAKE_CURRENT_SOURCE_DIR@") "."))
35929375
TGR
79 (invoke "doxygen" "doc/doxygen.in")
80 #t))
0149354d
RW
81 ;; There is no "install" target, so we have to provide our own
82 ;; "install" phase.
83 (replace 'install
84 (lambda* (#:key outputs #:allow-other-keys)
85 (let* ((out (assoc-ref outputs "out"))
86 (doc (string-append out "/share/cereal/docs"))
87 (include (string-append out "/include/cereal")))
88 (mkdir-p doc)
89 (mkdir-p include)
90 (copy-recursively "include/cereal" include)
91 (copy-recursively "doc/html" doc))
92 #t)))))
93 (native-inputs
94 `(("doxygen" ,doxygen)))
95 (home-page "http://uscilab.github.io/cereal/")
96 (synopsis "C++11 library for serialization")
97 (description
98 "Cereal is a header-only C++11 serialization library. Cereal takes
99arbitrary data types and reversibly turns them into different representations,
100such as compact binary encodings, XML, or JSON.")
101 (license license:bsd-3)))
d1ef573d 102
d1ef573d
LG
103(define-public msgpack
104 (package
105 (name "msgpack")
cdc07e68 106 (version "3.2.0")
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")))
6cbee49d
MW
116 (display
117 (string-append "Requires: " "zlib" "\n") p)
118 (close-output-port p)
119 #t))
d1ef573d
LG
120 (sha256
121 (base32
cdc07e68
MB
122 "1zhsap7d9zqdm9h1qnpaw78v1sh3rx2if7gk4dszs5m3cg1jiapv"))))
123 (build-system cmake-build-system)
d1ef573d
LG
124 (native-inputs
125 `(("googletest" ,googletest)
d1ef573d
LG
126 ("pkg-config" ,pkg-config)))
127 (propagated-inputs
128 `(("zlib" ,zlib))) ;; Msgpack installs two headers (zbuffer.h,
129 ;; zbuffer.hpp) which #include <zlib.h>. However, 'guix gc --references'
130 ;; does not detect a store reference to zlib since these headers are not
131 ;; compiled.
fe0523d4 132 (home-page "https://www.msgpack.org")
d1ef573d
LG
133 (synopsis "Binary serialization library")
134 (description "Msgpack is a library for C/C++ that implements binary
135serialization.")
136 (license license:boost1.0)))
f50f4ae4 137
c57e5fd0
RW
138(define-public libmpack
139 (package
140 (name "libmpack")
b5236121 141 (version "1.0.5")
d7885bbf
TGR
142 (source
143 (origin
144 (method git-fetch)
145 (uri (git-reference
146 (url "https://github.com/tarruda/libmpack.git")
147 (commit version)))
148 (file-name (git-file-name name version))
149 (sha256
150 (base32 "0rai5djdkjz7bsn025k5489in7r1amagw1pib0z4qns6b52kiar2"))))
c57e5fd0
RW
151 (build-system gnu-build-system)
152 (arguments
153 `(#:test-target "test"
154 #:make-flags
155 (list "CC=gcc"
156 (string-append "PREFIX=" (assoc-ref %outputs "out")))
157 #:phases
158 (modify-phases %standard-phases
159 (delete 'configure))))
160 (native-inputs
161 `(("libtool" ,libtool)))
162 (home-page "https://github.com/tarruda/libmpack")
163 (synopsis "Small binary serialization library")
164 (description "Libmpack is a small binary serialization and RPC library
165that implements both the msgpack and msgpack-rpc specifications.")
166 (license license:expat)))
167
8e664e7e
RW
168(define-public lua-libmpack
169 (package (inherit libmpack)
170 (name "lua-libmpack")
adad147b 171 (version "1.0.8")
9fde2268
TGR
172 (source
173 (origin
174 (method git-fetch)
175 (uri (git-reference
176 (url "https://github.com/libmpack/libmpack-lua.git")
3acd85ac
TGR
177 (commit version)))
178 (file-name (git-file-name name version))
9fde2268 179 (sha256
3acd85ac 180 (base32 "1ijvzgq5hvib03w5rghv31wi7byamwg7qdx5pawvhvnflaii8ivw"))))
8e664e7e
RW
181 (build-system gnu-build-system)
182 (arguments
183 `(;; FIXME: tests require "busted", which is not yet available in Guix.
184 #:tests? #f
185 #:test-target "test"
186 #:make-flags
187 (let* ((lua-version ,(package-version lua))
188 (lua-major+minor ,(version-major+minor (package-version lua))))
189 (list "CC=gcc"
7ec309af
RW
190 "FETCH=echo" ; don't fetch anything from the web
191 "UNTGZ=echo" ; and don't try to unpack it
8e664e7e 192 "USE_SYSTEM_LUA=yes"
7ec309af
RW
193 (string-append "MPACK_LUA_VERSION=" lua-version)
194 (string-append "MPACK_LUA_VERSION_NOPATCH=" lua-major+minor)
8e664e7e
RW
195 (string-append "PREFIX="
196 (assoc-ref %outputs "out"))
197 (string-append "LUA_CMOD_INSTALLDIR="
198 (assoc-ref %outputs "out")
7ec309af 199 "/lib/lua/" lua-major+minor)))
8e664e7e
RW
200 #:phases
201 (modify-phases %standard-phases
202 (delete 'configure)
7ec309af
RW
203 (add-after 'unpack 'unpack-mpack-sources
204 (lambda* (#:key inputs #:allow-other-keys)
205 ;; This is broken because mpack-src is not a file, but all
206 ;; prerequisites are added to the inputs of the gcc invocation.
207 (substitute* "Makefile"
208 (("\\$\\(MPACK\\): mpack-src") "$(MPACK): "))
d7885bbf
TGR
209 (copy-recursively (assoc-ref inputs "libmpack")
210 "mpack-src")
211 #t)))))
8e664e7e
RW
212 (inputs
213 `(("lua" ,lua)))
214 (native-inputs
7ec309af
RW
215 `(("pkg-config" ,pkg-config)
216 ("libmpack" ,(package-source libmpack))))
217 (home-page "https://github.com/libmpack/libmpack-lua")
8e664e7e
RW
218 (synopsis "Lua bindings for the libmpack binary serialization library")))
219
01a0a0c4
H
220(define-public lua5.1-libmpack
221 (package (inherit lua-libmpack)
222 (name "lua5.1-libmpack")
223 (arguments
224 (substitute-keyword-arguments (package-arguments lua-libmpack)
225 ((#:make-flags flags)
226 `(let* ((lua-version ,(package-version lua-5.1))
227 (lua-major+minor ,(version-major+minor (package-version lua-5.1))))
228 (list "CC=gcc"
229 "USE_SYSTEM_LUA=yes"
230 (string-append "MPACK_LUA_VERSION=" lua-version)
231 (string-append "MPACK_LUA_VERSION_NOPATCH=" lua-major+minor)
232 (string-append "PREFIX="
233 (assoc-ref %outputs "out"))
234 (string-append "LUA_CMOD_INSTALLDIR="
235 (assoc-ref %outputs "out")
236 "/lib/lua/" lua-major+minor))))))
237 (inputs
238 `(("lua" ,lua-5.1)))))
239
369ee96b
RW
240(define-public lua5.2-libmpack
241 (package (inherit lua-libmpack)
242 (name "lua5.2-libmpack")
243 (arguments
244 (substitute-keyword-arguments (package-arguments lua-libmpack)
245 ((#:make-flags flags)
246 `(let* ((lua-version ,(package-version lua-5.2))
247 (lua-major+minor ,(version-major+minor (package-version lua-5.2))))
248 (list "CC=gcc"
249 "USE_SYSTEM_LUA=yes"
0cdc3343
RW
250 (string-append "MPACK_LUA_VERSION=" lua-version)
251 (string-append "MPACK_LUA_VERSION_NOPATCH=" lua-major+minor)
369ee96b
RW
252 (string-append "PREFIX="
253 (assoc-ref %outputs "out"))
254 (string-append "LUA_CMOD_INSTALLDIR="
255 (assoc-ref %outputs "out")
256 "/lib/lua/" lua-major+minor))))))
257 (inputs
258 `(("lua" ,lua-5.2)))))
259
f50f4ae4
DC
260(define-public yaml-cpp
261 (package
262 (name "yaml-cpp")
942cf159 263 (version "0.6.2")
f50f4ae4
DC
264 (source (origin
265 (method url-fetch)
266 (uri (string-append
267 "https://github.com/jbeder/yaml-cpp/archive/"
268 "yaml-cpp-" version ".tar.gz"))
269 (sha256
270 (base32
942cf159 271 "01gxn7kc8pzyh4aadjxxzq8cignmbwmm9rfrsmgqfg9w2q75dn74"))))
f50f4ae4 272 (build-system cmake-build-system)
0577a3fd 273 (arguments
9a1ef44e
EF
274 '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")
275 #:phases
276 (modify-phases %standard-phases
277 (add-after 'install 'dont-install-gtest-libraries
278 (lambda* (#:key outputs #:allow-other-keys)
279 (let ((out (assoc-ref outputs "out")))
280 (with-directory-excursion
281 (string-append out "/include")
282 (delete-file-recursively "gtest")
283 (delete-file-recursively "gmock"))
284 (with-directory-excursion
285 (string-append out "/lib")
286 (for-each (lambda (file)
287 (delete-file file))
288 '("libgmock.so" "libgmock_main.so"
289 "libgtest.so" "libgtest_main.so"))))
290 #t)))))
f50f4ae4
DC
291 (native-inputs
292 `(("python" ,python)))
293 (home-page "https://github.com/jbeder/yaml-cpp")
294 (synopsis "YAML parser and emitter in C++")
295 (description "YAML parser and emitter in C++ matching the YAML 1.2 spec.")
296 (license license:bsd-3)))
cd131a76
DC
297
298(define-public jsoncpp
299 (package
300 (name "jsoncpp")
293e4f9f 301 (version "1.9.1")
f1818f96 302 (home-page "https://github.com/open-source-parsers/jsoncpp")
cd131a76 303 (source (origin
f1818f96
MB
304 (method git-fetch)
305 (uri (git-reference (url home-page) (commit version)))
306 (file-name (git-file-name name version))
cd131a76
DC
307 (sha256
308 (base32
293e4f9f 309 "00g356iv3kcp0gadj7gbyzf9jn9avvx9vxbxc7c2i5nnry8z72wj"))))
cd131a76 310 (build-system cmake-build-system)
996f5ece
EB
311 (arguments
312 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES")))
cd131a76
DC
313 (synopsis "C++ library for interacting with JSON")
314 (description "JsonCpp is a C++ library that allows manipulating JSON values,
315including serialization and deserialization to and from strings. It can also
316preserve existing comment in unserialization/serialization steps, making
317it a convenient format to store user input files.")
318 (license license:expat)))
557d3328 319
42ef29c8
RW
320;; Tensorflow does not build with jsoncpp 1.8.x. It is built with commit
321;; 4356d9bba191e1e16ce7a92073cbf3e63564e973, which lies between version 1.7.2
322;; and 1.7.3.
323(define-public jsoncpp-for-tensorflow
324 (package (inherit jsoncpp)
325 (name "jsoncpp")
326 (version "1.7.3")
327 (source (origin
328 (method git-fetch)
329 (uri (git-reference
330 (url "https://github.com/open-source-parsers/jsoncpp.git")
331 (commit version)))
332 (file-name (git-file-name name version))
333 (sha256
334 (base32
335 "1180ln8blrb0mwzpcf78k49hlki6di65q77rsvglf83kfcyh4d7z"))))))
336
557d3328
MB
337(define-public capnproto
338 (package
339 (name "capnproto")
9c5f4b82 340 (version "0.7.0")
557d3328
MB
341 (source (origin
342 (method url-fetch)
343 (uri (string-append
344 "https://capnproto.org/capnproto-c++-"
345 version ".tar.gz"))
346 (sha256
347 (base32
9c5f4b82 348 "0hfdnhlbskagzgvby8wy6lrxj53zfzpfqimbhga68c0ji2yw1969"))))
557d3328
MB
349 (build-system gnu-build-system)
350 (arguments
351 `(#:phases
352 (modify-phases %standard-phases
353 (add-before 'check 'do-not-require-/etc/services
354 (lambda _
355 ;; Workaround for test that tries to resolve port name from
356 ;; /etc/services, which is not present in build environment.
357 (substitute* "src/kj/async-io-test.c++" ((":http") ":80"))
9c5f4b82
CB
358 #t))
359 (add-before 'check 'use-tmp-for-tempory-files
360 (lambda _
361 ;; Use /tmp for tempory files, as the default /var/tmp directory
362 ;; doesn't exist.
363 (substitute* "src/kj/filesystem-disk-test.c++"
364 (("VAR\\_TMP \"/var/tmp\"")
365 "VAR_TMP \"/tmp\""))
557d3328
MB
366 #t)))))
367 (home-page "https://capnproto.org")
368 (synopsis "Capability-based RPC and serialization system")
369 (description
370 "Cap'n Proto is a very fast data interchange format and capability-based
371RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster.")
372 (license license:expat)))
9d625512
CB
373
374(define-public libbson
375 (package
376 (name "libbson")
377 (version "1.6.2")
378 (source
379 (origin
380 (method url-fetch)
381 (uri (string-append "https://github.com/mongodb/libbson/releases/"
382 "download/" version "/libbson-" version ".tar.gz"))
383 (sha256
384 (base32
385 "1fj4554msq0rrz14snbj908dzqj46gh7jg9w9j0akn2b7q911m5a"))))
386 (build-system gnu-build-system)
387 (native-inputs `(("perl" ,perl)))
388 (home-page "http://mongoc.org/libbson/current/index.html")
389 (synopsis "C BSON library")
390 (description "Libbson can create and parse BSON documents. It can also
391convert JSON documents to BSON and the opposite. BSON stands for Binary JSON,
392it is comparable to protobuf.")
393 (license license:asl2.0)))
bf7c3699
GG
394
395(define-public nlohmann-json-cpp
396 (package
397 (name "nlohmann-json-cpp")
af632c6b
LC
398 (version "3.7.0")
399 (source (origin
400 (method git-fetch)
401 (uri (git-reference
402 (url "https://github.com/nlohmann/json.git")
403 (commit (string-append "v" version))))
404 (file-name (git-file-name name version))
405 (sha256
406 (base32
407 "0v7xih4zjixxxfvkfbs7a8j9qcvpwlsv4vrkbyns3hc7b44nb8ap"))))
bf7c3699 408 (build-system cmake-build-system)
af632c6b
LC
409 (native-inputs
410 ;; Integer overflow tests like those from
411 ;; <https://github.com/nlohmann/json/issues/1447> fail when building with
412 ;; gcc@5. Thus, build with a newer GCC.
413 `(("gcc" ,gcc-9)))
414 (arguments
415 '(#:phases (modify-phases %standard-phases
416 (add-before 'build 'unset-path-variables
417 (lambda _
418 (unsetenv "C_INCLUDE_PATH")
419 (unsetenv "CPLUS_INCLUDE_PATH")
420 #t)))))
bf7c3699
GG
421 (home-page "https://nlohmann.github.io/json/")
422 (synopsis "JSON library for C++")
423 (description
424 "JSON library for C++ trying to accomplish “Intuitive syntax”,
425“Trivial integration”, and “Serious testing”.
426However, “Memory efficiency” and “Speed” have not been primary goals.")
427 (license license:expat)))
f38d54f0
MFM
428
429(define-public python-ruamel.yaml
430 (package
431 (name "python-ruamel.yaml")
f20cfa06 432 (version "0.15.83")
f38d54f0
MFM
433 (source
434 (origin
435 (method url-fetch)
436 (uri (pypi-uri "ruamel.yaml" version))
437 (sha256
438 (base32
f20cfa06 439 "0p4i8ad28cbbbjja8b9274irkhnphhvhap3aym6yb8xfp1d72kpw"))))
f38d54f0
MFM
440 (build-system python-build-system)
441 (native-inputs
442 `(("python-pytest" ,python-pytest)))
443 (arguments
444 `(;; TODO: Tests require packaging "ruamel.std.pathlib".
445 #:tests? #f))
446 (home-page "https://bitbucket.org/ruamel/yaml")
447 (synopsis "YAML 1.2 parser/emitter")
448 (description
449 "This package provides YAML parser/emitter that supports roundtrip
450preservation of comments, seq/map flow style, and map key order. It
451is a derivative of Kirill Simonov’s PyYAML 3.11. It supports YAML 1.2
452and has round-trip loaders and dumpers. It supports comments. Block
453style and key ordering are kept, so you can diff the source.")
454 (license license:expat)))
455
456(define-public python2-ruamel.yaml
457 (package-with-python2 python-ruamel.yaml))
7ae282fb 458
459(define-public python-cbor
460 (package
461 (name "python-cbor")
462 (version "1.0.0")
463 (source
464 (origin
465 (method url-fetch)
466 (uri (pypi-uri "cbor" version))
467 (sha256
468 (base32
469 "1dmv163cnslyqccrybkxn0c9s1jk1mmafmgxv75iamnz5lk5l8hk"))))
470 (build-system python-build-system)
471 (home-page "https://bitbucket.org/bodhisnarkva/cbor")
472 (synopsis "Implementation of the Concise Binary Object Representation")
473 (description
474 "Python-cbor provides an implementation of the Concise Binary Object
31af847b
TGR
475Representation (@dfn{CBOR}). CBOR is comparable to JSON, has a superset of
476JSON's ability, but serializes to a binary format which is smaller and faster
477to generate and parse. The two primary functions are @code{cbor.loads} and
7ae282fb 478@code{cbor.dumps}.")
479 (license license:asl2.0)))
04953dca
LF
480
481(define-public flatbuffers
482 (package
483 (name "flatbuffers")
429a332b 484 (version "1.10.0")
04953dca
LF
485 (source
486 (origin
487 (method url-fetch)
488 (uri (string-append "https://github.com/google/flatbuffers/archive/v"
489 version ".tar.gz"))
f5d4c46c 490 (file-name (string-append name "-" version ".tar.gz"))
04953dca
LF
491 (sha256
492 (base32
429a332b 493 "0z4swldxs0s31hnkqdhsbfmc8vx3p7zsvmqaw4l31r2iikdy651p"))))
04953dca
LF
494 (build-system cmake-build-system)
495 (arguments
3def739d
TGR
496 '(#:build-type "Release"
497 #:configure-flags
04953dca 498 (list (string-append "-DCMAKE_INSTALL_LIBDIR="
3def739d 499 (assoc-ref %outputs "out") "/lib"))))
04953dca
LF
500 (home-page "https://google.github.io/flatbuffers/")
501 (synopsis "Memory-efficient serialization library")
a8b12397 502 (description "FlatBuffers is a cross-platform serialization library for C++,
04953dca
LF
503C#, C, Go, Java, JavaScript, PHP, and Python. It was originally created for
504game development and other performance-critical applications.")
505 (license license:asl2.0)))
9f1c0e03 506
8d4f34d6
LF
507(define-public python-feather-format
508 (package
509 (name "python-feather-format")
510 (version "0.4.0")
511 (source
512 (origin
513 (method url-fetch)
514 (uri (pypi-uri "feather-format" version))
515 (sha256
516 (base32
517 "1adivm5w5ji4qv7hq7942vqlk8l2wgw87bdlsia771z14z3zp857"))))
518 (build-system python-build-system)
519 (propagated-inputs
520 `(("python-pandas" ,python-pandas)
521 ("python-pyarrow" ,python-pyarrow)))
522 (home-page "https://github.com/wesm/feather")
523 (synopsis "Python wrapper to the Feather file format")
524 (description "This package provides a Python wrapper library to the
525Apache Arrow-based Feather binary columnar serialization data frame format.")
526 (license license:asl2.0)))