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