gnu: perl-html-form: Update to 6.05.
[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>
557d3328 5;;; Copyright © 2016 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")
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 101
d1ef573d
LG
102(define-public msgpack
103 (package
104 (name "msgpack")
e54ae862 105 (version "1.4.2")
d1ef573d
LG
106 (source
107 (origin
108 (method url-fetch)
109 (uri
110 (string-append
111 "https://github.com/msgpack/msgpack-c/releases/download/"
112 "cpp-" version "/msgpack-" version ".tar.gz"))
113 (snippet
114 '(let ((p (open-file "msgpack.pc.in" "a")))
6cbee49d
MW
115 (display
116 (string-append "Requires: " "zlib" "\n") p)
117 (close-output-port p)
118 #t))
d1ef573d
LG
119 (sha256
120 (base32
e54ae862 121 "18hzmyfg3mvnp7ab03nqdzzvqagkl42gygjpi4zv4i7aca2dmwf0"))))
d1ef573d
LG
122 (build-system gnu-build-system)
123 (native-inputs
124 `(("googletest" ,googletest)
125 ("autoconf" ,autoconf)
126 ("automake" ,automake)
127 ("libtool" ,libtool)
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
148 (url "https://github.com/tarruda/libmpack.git")
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")
9fde2268
TGR
173 (source
174 (origin
175 (method git-fetch)
176 (uri (git-reference
177 (url "https://github.com/libmpack/libmpack-lua.git")
178 (commit (package-version libmpack))))
179 (file-name (git-file-name name (package-version libmpack)))
180 (sha256
181 (base32 "10zx4biyi9gmk90aa6674vvqsrz74jy74fxqlcrx66c8sl8yxr92"))))
8e664e7e
RW
182 (build-system gnu-build-system)
183 (arguments
184 `(;; FIXME: tests require "busted", which is not yet available in Guix.
185 #:tests? #f
186 #:test-target "test"
187 #:make-flags
188 (let* ((lua-version ,(package-version lua))
189 (lua-major+minor ,(version-major+minor (package-version lua))))
190 (list "CC=gcc"
7ec309af
RW
191 "FETCH=echo" ; don't fetch anything from the web
192 "UNTGZ=echo" ; and don't try to unpack it
8e664e7e 193 "USE_SYSTEM_LUA=yes"
7ec309af
RW
194 (string-append "MPACK_LUA_VERSION=" lua-version)
195 (string-append "MPACK_LUA_VERSION_NOPATCH=" lua-major+minor)
8e664e7e
RW
196 (string-append "PREFIX="
197 (assoc-ref %outputs "out"))
198 (string-append "LUA_CMOD_INSTALLDIR="
199 (assoc-ref %outputs "out")
7ec309af 200 "/lib/lua/" lua-major+minor)))
8e664e7e
RW
201 #:phases
202 (modify-phases %standard-phases
203 (delete 'configure)
7ec309af
RW
204 (add-after 'unpack 'unpack-mpack-sources
205 (lambda* (#:key inputs #:allow-other-keys)
206 ;; This is broken because mpack-src is not a file, but all
207 ;; prerequisites are added to the inputs of the gcc invocation.
208 (substitute* "Makefile"
209 (("\\$\\(MPACK\\): mpack-src") "$(MPACK): "))
d7885bbf
TGR
210 (copy-recursively (assoc-ref inputs "libmpack")
211 "mpack-src")
212 #t)))))
8e664e7e
RW
213 (inputs
214 `(("lua" ,lua)))
215 (native-inputs
7ec309af
RW
216 `(("pkg-config" ,pkg-config)
217 ("libmpack" ,(package-source libmpack))))
218 (home-page "https://github.com/libmpack/libmpack-lua")
8e664e7e
RW
219 (synopsis "Lua bindings for the libmpack binary serialization library")))
220
01a0a0c4
H
221(define-public lua5.1-libmpack
222 (package (inherit lua-libmpack)
223 (name "lua5.1-libmpack")
224 (arguments
225 (substitute-keyword-arguments (package-arguments lua-libmpack)
226 ((#:make-flags flags)
227 `(let* ((lua-version ,(package-version lua-5.1))
228 (lua-major+minor ,(version-major+minor (package-version lua-5.1))))
229 (list "CC=gcc"
230 "USE_SYSTEM_LUA=yes"
231 (string-append "MPACK_LUA_VERSION=" lua-version)
232 (string-append "MPACK_LUA_VERSION_NOPATCH=" lua-major+minor)
233 (string-append "PREFIX="
234 (assoc-ref %outputs "out"))
235 (string-append "LUA_CMOD_INSTALLDIR="
236 (assoc-ref %outputs "out")
237 "/lib/lua/" lua-major+minor))))))
238 (inputs
239 `(("lua" ,lua-5.1)))))
240
369ee96b
RW
241(define-public lua5.2-libmpack
242 (package (inherit lua-libmpack)
243 (name "lua5.2-libmpack")
244 (arguments
245 (substitute-keyword-arguments (package-arguments lua-libmpack)
246 ((#:make-flags flags)
247 `(let* ((lua-version ,(package-version lua-5.2))
248 (lua-major+minor ,(version-major+minor (package-version lua-5.2))))
249 (list "CC=gcc"
250 "USE_SYSTEM_LUA=yes"
0cdc3343
RW
251 (string-append "MPACK_LUA_VERSION=" lua-version)
252 (string-append "MPACK_LUA_VERSION_NOPATCH=" lua-major+minor)
369ee96b
RW
253 (string-append "PREFIX="
254 (assoc-ref %outputs "out"))
255 (string-append "LUA_CMOD_INSTALLDIR="
256 (assoc-ref %outputs "out")
257 "/lib/lua/" lua-major+minor))))))
258 (inputs
259 `(("lua" ,lua-5.2)))))
260
f50f4ae4
DC
261(define-public yaml-cpp
262 (package
263 (name "yaml-cpp")
942cf159 264 (version "0.6.2")
f50f4ae4
DC
265 (source (origin
266 (method url-fetch)
267 (uri (string-append
268 "https://github.com/jbeder/yaml-cpp/archive/"
269 "yaml-cpp-" version ".tar.gz"))
270 (sha256
271 (base32
942cf159 272 "01gxn7kc8pzyh4aadjxxzq8cignmbwmm9rfrsmgqfg9w2q75dn74"))))
f50f4ae4 273 (build-system cmake-build-system)
0577a3fd 274 (arguments
9a1ef44e
EF
275 '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")
276 #:phases
277 (modify-phases %standard-phases
278 (add-after 'install 'dont-install-gtest-libraries
279 (lambda* (#:key outputs #:allow-other-keys)
280 (let ((out (assoc-ref outputs "out")))
281 (with-directory-excursion
282 (string-append out "/include")
283 (delete-file-recursively "gtest")
284 (delete-file-recursively "gmock"))
285 (with-directory-excursion
286 (string-append out "/lib")
287 (for-each (lambda (file)
288 (delete-file file))
289 '("libgmock.so" "libgmock_main.so"
290 "libgtest.so" "libgtest_main.so"))))
291 #t)))))
f50f4ae4
DC
292 (native-inputs
293 `(("python" ,python)))
294 (home-page "https://github.com/jbeder/yaml-cpp")
295 (synopsis "YAML parser and emitter in C++")
296 (description "YAML parser and emitter in C++ matching the YAML 1.2 spec.")
297 (license license:bsd-3)))
cd131a76
DC
298
299(define-public jsoncpp
300 (package
301 (name "jsoncpp")
293e4f9f 302 (version "1.9.1")
f1818f96 303 (home-page "https://github.com/open-source-parsers/jsoncpp")
cd131a76 304 (source (origin
f1818f96
MB
305 (method git-fetch)
306 (uri (git-reference (url home-page) (commit version)))
307 (file-name (git-file-name name version))
cd131a76
DC
308 (sha256
309 (base32
293e4f9f 310 "00g356iv3kcp0gadj7gbyzf9jn9avvx9vxbxc7c2i5nnry8z72wj"))))
cd131a76 311 (build-system cmake-build-system)
996f5ece
EB
312 (arguments
313 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES")))
cd131a76
DC
314 (synopsis "C++ library for interacting with JSON")
315 (description "JsonCpp is a C++ library that allows manipulating JSON values,
316including serialization and deserialization to and from strings. It can also
317preserve existing comment in unserialization/serialization steps, making
318it a convenient format to store user input files.")
319 (license license:expat)))
557d3328 320
42ef29c8
RW
321;; Tensorflow does not build with jsoncpp 1.8.x. It is built with commit
322;; 4356d9bba191e1e16ce7a92073cbf3e63564e973, which lies between version 1.7.2
323;; and 1.7.3.
324(define-public jsoncpp-for-tensorflow
325 (package (inherit jsoncpp)
326 (name "jsoncpp")
327 (version "1.7.3")
328 (source (origin
329 (method git-fetch)
330 (uri (git-reference
331 (url "https://github.com/open-source-parsers/jsoncpp.git")
332 (commit version)))
333 (file-name (git-file-name name version))
334 (sha256
335 (base32
336 "1180ln8blrb0mwzpcf78k49hlki6di65q77rsvglf83kfcyh4d7z"))))))
337
557d3328
MB
338(define-public capnproto
339 (package
340 (name "capnproto")
9c5f4b82 341 (version "0.7.0")
557d3328
MB
342 (source (origin
343 (method url-fetch)
344 (uri (string-append
345 "https://capnproto.org/capnproto-c++-"
346 version ".tar.gz"))
347 (sha256
348 (base32
9c5f4b82 349 "0hfdnhlbskagzgvby8wy6lrxj53zfzpfqimbhga68c0ji2yw1969"))))
557d3328
MB
350 (build-system gnu-build-system)
351 (arguments
352 `(#:phases
353 (modify-phases %standard-phases
354 (add-before 'check 'do-not-require-/etc/services
355 (lambda _
356 ;; Workaround for test that tries to resolve port name from
357 ;; /etc/services, which is not present in build environment.
358 (substitute* "src/kj/async-io-test.c++" ((":http") ":80"))
9c5f4b82
CB
359 #t))
360 (add-before 'check 'use-tmp-for-tempory-files
361 (lambda _
362 ;; Use /tmp for tempory files, as the default /var/tmp directory
363 ;; doesn't exist.
364 (substitute* "src/kj/filesystem-disk-test.c++"
365 (("VAR\\_TMP \"/var/tmp\"")
366 "VAR_TMP \"/tmp\""))
557d3328
MB
367 #t)))))
368 (home-page "https://capnproto.org")
369 (synopsis "Capability-based RPC and serialization system")
370 (description
371 "Cap'n Proto is a very fast data interchange format and capability-based
372RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster.")
373 (license license:expat)))
9d625512
CB
374
375(define-public libbson
376 (package
377 (name "libbson")
378 (version "1.6.2")
379 (source
380 (origin
381 (method url-fetch)
382 (uri (string-append "https://github.com/mongodb/libbson/releases/"
383 "download/" version "/libbson-" version ".tar.gz"))
384 (sha256
385 (base32
386 "1fj4554msq0rrz14snbj908dzqj46gh7jg9w9j0akn2b7q911m5a"))))
387 (build-system gnu-build-system)
388 (native-inputs `(("perl" ,perl)))
389 (home-page "http://mongoc.org/libbson/current/index.html")
390 (synopsis "C BSON library")
391 (description "Libbson can create and parse BSON documents. It can also
392convert JSON documents to BSON and the opposite. BSON stands for Binary JSON,
393it is comparable to protobuf.")
394 (license license:asl2.0)))
bf7c3699
GG
395
396(define-public nlohmann-json-cpp
397 (package
398 (name "nlohmann-json-cpp")
af632c6b
LC
399 (version "3.7.0")
400 (source (origin
401 (method git-fetch)
402 (uri (git-reference
403 (url "https://github.com/nlohmann/json.git")
404 (commit (string-append "v" version))))
405 (file-name (git-file-name name version))
406 (sha256
407 (base32
408 "0v7xih4zjixxxfvkfbs7a8j9qcvpwlsv4vrkbyns3hc7b44nb8ap"))))
bf7c3699 409 (build-system cmake-build-system)
af632c6b
LC
410 (native-inputs
411 ;; Integer overflow tests like those from
412 ;; <https://github.com/nlohmann/json/issues/1447> fail when building with
413 ;; gcc@5. Thus, build with a newer GCC.
414 `(("gcc" ,gcc-9)))
415 (arguments
416 '(#:phases (modify-phases %standard-phases
417 (add-before 'build 'unset-path-variables
418 (lambda _
419 (unsetenv "C_INCLUDE_PATH")
420 (unsetenv "CPLUS_INCLUDE_PATH")
421 #t)))))
bf7c3699
GG
422 (home-page "https://nlohmann.github.io/json/")
423 (synopsis "JSON library for C++")
424 (description
425 "JSON library for C++ trying to accomplish “Intuitive syntax”,
426“Trivial integration”, and “Serious testing”.
427However, “Memory efficiency” and “Speed” have not been primary goals.")
428 (license license:expat)))
f38d54f0
MFM
429
430(define-public python-ruamel.yaml
431 (package
432 (name "python-ruamel.yaml")
f20cfa06 433 (version "0.15.83")
f38d54f0
MFM
434 (source
435 (origin
436 (method url-fetch)
437 (uri (pypi-uri "ruamel.yaml" version))
438 (sha256
439 (base32
f20cfa06 440 "0p4i8ad28cbbbjja8b9274irkhnphhvhap3aym6yb8xfp1d72kpw"))))
f38d54f0
MFM
441 (build-system python-build-system)
442 (native-inputs
443 `(("python-pytest" ,python-pytest)))
444 (arguments
445 `(;; TODO: Tests require packaging "ruamel.std.pathlib".
446 #:tests? #f))
447 (home-page "https://bitbucket.org/ruamel/yaml")
448 (synopsis "YAML 1.2 parser/emitter")
449 (description
450 "This package provides YAML parser/emitter that supports roundtrip
451preservation of comments, seq/map flow style, and map key order. It
452is a derivative of Kirill Simonov’s PyYAML 3.11. It supports YAML 1.2
453and has round-trip loaders and dumpers. It supports comments. Block
454style and key ordering are kept, so you can diff the source.")
455 (license license:expat)))
456
457(define-public python2-ruamel.yaml
458 (package-with-python2 python-ruamel.yaml))
7ae282fb 459
460(define-public python-cbor
461 (package
462 (name "python-cbor")
463 (version "1.0.0")
464 (source
465 (origin
466 (method url-fetch)
467 (uri (pypi-uri "cbor" version))
468 (sha256
469 (base32
470 "1dmv163cnslyqccrybkxn0c9s1jk1mmafmgxv75iamnz5lk5l8hk"))))
471 (build-system python-build-system)
472 (home-page "https://bitbucket.org/bodhisnarkva/cbor")
473 (synopsis "Implementation of the Concise Binary Object Representation")
474 (description
475 "Python-cbor provides an implementation of the Concise Binary Object
31af847b
TGR
476Representation (@dfn{CBOR}). CBOR is comparable to JSON, has a superset of
477JSON's ability, but serializes to a binary format which is smaller and faster
478to generate and parse. The two primary functions are @code{cbor.loads} and
7ae282fb 479@code{cbor.dumps}.")
480 (license license:asl2.0)))
04953dca
LF
481
482(define-public flatbuffers
483 (package
484 (name "flatbuffers")
429a332b 485 (version "1.10.0")
04953dca
LF
486 (source
487 (origin
488 (method url-fetch)
489 (uri (string-append "https://github.com/google/flatbuffers/archive/v"
490 version ".tar.gz"))
f5d4c46c 491 (file-name (string-append name "-" version ".tar.gz"))
04953dca
LF
492 (sha256
493 (base32
429a332b 494 "0z4swldxs0s31hnkqdhsbfmc8vx3p7zsvmqaw4l31r2iikdy651p"))))
04953dca
LF
495 (build-system cmake-build-system)
496 (arguments
3def739d
TGR
497 '(#:build-type "Release"
498 #:configure-flags
04953dca 499 (list (string-append "-DCMAKE_INSTALL_LIBDIR="
3def739d 500 (assoc-ref %outputs "out") "/lib"))))
04953dca
LF
501 (home-page "https://google.github.io/flatbuffers/")
502 (synopsis "Memory-efficient serialization library")
a8b12397 503 (description "FlatBuffers is a cross-platform serialization library for C++,
04953dca
LF
504C#, C, Go, Java, JavaScript, PHP, and Python. It was originally created for
505game development and other performance-critical applications.")
506 (license license:asl2.0)))
9f1c0e03 507
8d4f34d6
LF
508(define-public python-feather-format
509 (package
510 (name "python-feather-format")
511 (version "0.4.0")
512 (source
513 (origin
514 (method url-fetch)
515 (uri (pypi-uri "feather-format" version))
516 (sha256
517 (base32
518 "1adivm5w5ji4qv7hq7942vqlk8l2wgw87bdlsia771z14z3zp857"))))
519 (build-system python-build-system)
520 (propagated-inputs
521 `(("python-pandas" ,python-pandas)
522 ("python-pyarrow" ,python-pyarrow)))
523 (home-page "https://github.com/wesm/feather")
524 (synopsis "Python wrapper to the Feather file format")
525 (description "This package provides a Python wrapper library to the
526Apache Arrow-based Feather binary columnar serialization data frame format.")
527 (license license:asl2.0)))
528
529(define-public python2-feather-format
530 (package-with-python2 python-feather-format))