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