gnu: googletest: Update to 1.10.0.
[jackhill/guix/guix.git] / gnu / packages / serialization.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
4 ;;; Copyright © 2016 David Craven <david@craven.ch>
5 ;;; Copyright © 2016, 2019 Marius Bakke <mbakke@fastmail.com>
6 ;;; Copyright © 2016, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2017 Corentin Bocquillon <corentin@nybble.fr>
8 ;;; Copyright © 2017 Gregor Giesen <giesen@zaehlwerk.net>
9 ;;; Copyright © 2017 Frederick M. Muriithi <fredmanglis@gmail.com>
10 ;;; Copyright © 2017 ng0 <ng0@n0.is>
11 ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
12 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
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)
33 #:use-module (guix git-download)
34 #:use-module (guix utils)
35 #:use-module (guix build-system cmake)
36 #:use-module (guix build-system gnu)
37 #:use-module (guix build-system python)
38 #:use-module (gnu packages)
39 #:use-module (gnu packages autotools)
40 #:use-module (gnu packages boost)
41 #:use-module (gnu packages check)
42 #:use-module (gnu packages compression)
43 #:use-module (gnu packages cpp)
44 #:use-module (gnu packages databases)
45 #:use-module (gnu packages documentation)
46 #:use-module (gnu packages gcc)
47 #:use-module (gnu packages lua)
48 #:use-module (gnu packages pkg-config)
49 #:use-module (gnu packages python)
50 #:use-module (gnu packages python-science)
51 #:use-module (gnu packages python-xyz)
52 #:use-module (gnu packages perl))
53
54 (define-public cereal
55 (package
56 (name "cereal")
57 (version "1.2.1")
58 (source
59 (origin
60 (method git-fetch)
61 (uri (git-reference
62 (url "https://github.com/USCiLab/cereal.git")
63 (commit (string-append "v" version))))
64 (file-name (git-file-name name version))
65 (sha256
66 (base32 "1vxkrsnxkiblzi1z61vfix167c184fy868sgwj2dxxgbgjcq2nrh"))))
67 (build-system cmake-build-system)
68 (arguments
69 `(;; The only included tests are portability tests requiring
70 ;; cross-compilation and boost. Since we are building cereal on more
71 ;; platforms anyway, there is no compelling reason to build the tests.
72 #:tests? #f
73 #:out-of-source? #f
74 #:phases
75 (modify-phases %standard-phases
76 (delete 'configure)
77 (replace 'build
78 (lambda _
79 (substitute* "doc/doxygen.in"
80 (("@CMAKE_CURRENT_SOURCE_DIR@") "."))
81 (invoke "doxygen" "doc/doxygen.in")
82 #t))
83 ;; There is no "install" target, so we have to provide our own
84 ;; "install" phase.
85 (replace 'install
86 (lambda* (#:key outputs #:allow-other-keys)
87 (let* ((out (assoc-ref outputs "out"))
88 (doc (string-append out "/share/cereal/docs"))
89 (include (string-append out "/include/cereal")))
90 (mkdir-p doc)
91 (mkdir-p include)
92 (copy-recursively "include/cereal" include)
93 (copy-recursively "doc/html" doc))
94 #t)))))
95 (native-inputs
96 `(("doxygen" ,doxygen)))
97 (home-page "http://uscilab.github.io/cereal/")
98 (synopsis "C++11 library for serialization")
99 (description
100 "Cereal is a header-only C++11 serialization library. Cereal takes
101 arbitrary data types and reversibly turns them into different representations,
102 such as compact binary encodings, XML, or JSON.")
103 (license license:bsd-3)))
104
105 (define-public msgpack
106 (package
107 (name "msgpack")
108 (version "3.2.1")
109 (source
110 (origin
111 (method url-fetch)
112 (uri
113 (string-append
114 "https://github.com/msgpack/msgpack-c/releases/download/"
115 "cpp-" version "/msgpack-" version ".tar.gz"))
116 (snippet
117 '(let ((p (open-file "msgpack.pc.in" "a")))
118 (display
119 (string-append "Requires: " "zlib" "\n") p)
120 (close-output-port p)
121 #t))
122 (sha256
123 (base32 "1ljqmgscdb0f8w8kx2lnswnisyxchcmijbjbmswkv0g187bvqg23"))))
124 (build-system cmake-build-system)
125 (native-inputs
126 `(("googletest" ,googletest-1.8)
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.
133 (home-page "https://www.msgpack.org")
134 (synopsis "Binary serialization library")
135 (description "Msgpack is a library for C/C++ that implements binary
136 serialization.")
137 (license license:boost1.0)))
138
139 (define-public libmpack
140 (package
141 (name "libmpack")
142 (version "1.0.5")
143 (source
144 (origin
145 (method git-fetch)
146 (uri (git-reference
147 (url "https://github.com/tarruda/libmpack.git")
148 (commit version)))
149 (file-name (git-file-name name version))
150 (sha256
151 (base32 "0rai5djdkjz7bsn025k5489in7r1amagw1pib0z4qns6b52kiar2"))))
152 (build-system gnu-build-system)
153 (arguments
154 `(#:test-target "test"
155 #:make-flags
156 (list "CC=gcc"
157 (string-append "PREFIX=" (assoc-ref %outputs "out")))
158 #:phases
159 (modify-phases %standard-phases
160 (delete 'configure))))
161 (native-inputs
162 `(("libtool" ,libtool)))
163 (home-page "https://github.com/tarruda/libmpack")
164 (synopsis "Small binary serialization library")
165 (description "Libmpack is a small binary serialization and RPC library
166 that implements both the msgpack and msgpack-rpc specifications.")
167 (license license:expat)))
168
169 (define-public lua-libmpack
170 (package (inherit libmpack)
171 (name "lua-libmpack")
172 (version "1.0.8")
173 (source
174 (origin
175 (method git-fetch)
176 (uri (git-reference
177 (url "https://github.com/libmpack/libmpack-lua.git")
178 (commit version)))
179 (file-name (git-file-name name version))
180 (sha256
181 (base32 "1ijvzgq5hvib03w5rghv31wi7byamwg7qdx5pawvhvnflaii8ivw"))))
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"
191 "FETCH=echo" ; don't fetch anything from the web
192 "UNTGZ=echo" ; and don't try to unpack it
193 "USE_SYSTEM_LUA=yes"
194 (string-append "MPACK_LUA_VERSION=" lua-version)
195 (string-append "MPACK_LUA_VERSION_NOPATCH=" lua-major+minor)
196 (string-append "PREFIX="
197 (assoc-ref %outputs "out"))
198 (string-append "LUA_CMOD_INSTALLDIR="
199 (assoc-ref %outputs "out")
200 "/lib/lua/" lua-major+minor)))
201 #:phases
202 (modify-phases %standard-phases
203 (delete 'configure)
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): "))
210 (copy-recursively (assoc-ref inputs "libmpack")
211 "mpack-src")
212 #t)))))
213 (inputs
214 `(("lua" ,lua)))
215 (native-inputs
216 `(("pkg-config" ,pkg-config)
217 ("libmpack" ,(package-source libmpack))))
218 (home-page "https://github.com/libmpack/libmpack-lua")
219 (synopsis "Lua bindings for the libmpack binary serialization library")))
220
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
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"
251 (string-append "MPACK_LUA_VERSION=" lua-version)
252 (string-append "MPACK_LUA_VERSION_NOPATCH=" lua-major+minor)
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
261 (define-public yaml-cpp
262 (package
263 (name "yaml-cpp")
264 (version "0.6.3")
265 (source
266 (origin
267 (method git-fetch)
268 (uri (git-reference
269 (url "https://github.com/jbeder/yaml-cpp.git")
270 (commit (string-append "yaml-cpp-" version))))
271 (file-name (git-file-name name version))
272 (sha256
273 (base32 "0ykkxzxcwwiv8l8r697gyqh1nl582krpvi7m7l6b40ijnk4pw30s"))))
274 (build-system cmake-build-system)
275 (arguments
276 '(#:configure-flags '("-DYAML_BUILD_SHARED_LIBS=ON")))
277 (native-inputs
278 `(("python" ,python)))
279 (home-page "https://github.com/jbeder/yaml-cpp")
280 (synopsis "YAML parser and emitter in C++")
281 (description "YAML parser and emitter in C++ matching the YAML 1.2 spec.")
282 (license license:bsd-3)))
283
284 (define-public jsoncpp
285 (package
286 (name "jsoncpp")
287 (version "1.9.2")
288 (home-page "https://github.com/open-source-parsers/jsoncpp")
289 (source (origin
290 (method git-fetch)
291 (uri (git-reference (url home-page) (commit version)))
292 (file-name (git-file-name name version))
293 (sha256
294 (base32
295 "037d1b1qdmn3rksmn1j71j26bv4hkjv7sn7da261k853xb5899sg"))))
296 (build-system cmake-build-system)
297 (arguments
298 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES")))
299 (synopsis "C++ library for interacting with JSON")
300 (description "JsonCpp is a C++ library that allows manipulating JSON values,
301 including serialization and deserialization to and from strings. It can also
302 preserve existing comment in unserialization/serialization steps, making
303 it a convenient format to store user input files.")
304 (license license:expat)))
305
306 ;; Tensorflow does not build with jsoncpp 1.8.x. It is built with commit
307 ;; 4356d9bba191e1e16ce7a92073cbf3e63564e973, which lies between version 1.7.2
308 ;; and 1.7.3.
309 (define-public jsoncpp-for-tensorflow
310 (package (inherit jsoncpp)
311 (name "jsoncpp")
312 (version "1.7.3")
313 (source (origin
314 (method git-fetch)
315 (uri (git-reference
316 (url "https://github.com/open-source-parsers/jsoncpp.git")
317 (commit version)))
318 (file-name (git-file-name name version))
319 (sha256
320 (base32
321 "1180ln8blrb0mwzpcf78k49hlki6di65q77rsvglf83kfcyh4d7z"))))))
322
323 (define-public capnproto
324 (package
325 (name "capnproto")
326 (version "0.7.0")
327 (source (origin
328 (method url-fetch)
329 (uri (string-append
330 "https://capnproto.org/capnproto-c++-"
331 version ".tar.gz"))
332 (sha256
333 (base32
334 "0hfdnhlbskagzgvby8wy6lrxj53zfzpfqimbhga68c0ji2yw1969"))))
335 (build-system gnu-build-system)
336 (arguments
337 `(#:phases
338 (modify-phases %standard-phases
339 (add-before 'check 'do-not-require-/etc/services
340 (lambda _
341 ;; Workaround for test that tries to resolve port name from
342 ;; /etc/services, which is not present in build environment.
343 (substitute* "src/kj/async-io-test.c++" ((":http") ":80"))
344 #t))
345 (add-before 'check 'use-tmp-for-tempory-files
346 (lambda _
347 ;; Use /tmp for tempory files, as the default /var/tmp directory
348 ;; doesn't exist.
349 (substitute* "src/kj/filesystem-disk-test.c++"
350 (("VAR\\_TMP \"/var/tmp\"")
351 "VAR_TMP \"/tmp\""))
352 #t)))))
353 (home-page "https://capnproto.org")
354 (synopsis "Capability-based RPC and serialization system")
355 (description
356 "Cap'n Proto is a very fast data interchange format and capability-based
357 RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster.")
358 (license license:expat)))
359
360 (define-public libbson
361 (package
362 (name "libbson")
363 (version "1.6.2")
364 (source
365 (origin
366 (method url-fetch)
367 (uri (string-append "https://github.com/mongodb/libbson/releases/"
368 "download/" version "/libbson-" version ".tar.gz"))
369 (sha256
370 (base32
371 "1fj4554msq0rrz14snbj908dzqj46gh7jg9w9j0akn2b7q911m5a"))))
372 (build-system gnu-build-system)
373 (native-inputs `(("perl" ,perl)))
374 (home-page "http://mongoc.org/libbson/current/index.html")
375 (synopsis "C BSON library")
376 (description "Libbson can create and parse BSON documents. It can also
377 convert JSON documents to BSON and the opposite. BSON stands for Binary JSON,
378 it is comparable to protobuf.")
379 (license license:asl2.0)))
380
381 (define-public python-ruamel.yaml
382 (package
383 (name "python-ruamel.yaml")
384 (version "0.15.83")
385 (source
386 (origin
387 (method url-fetch)
388 (uri (pypi-uri "ruamel.yaml" version))
389 (sha256
390 (base32
391 "0p4i8ad28cbbbjja8b9274irkhnphhvhap3aym6yb8xfp1d72kpw"))))
392 (build-system python-build-system)
393 (native-inputs
394 `(("python-pytest" ,python-pytest)))
395 (arguments
396 `(;; TODO: Tests require packaging "ruamel.std.pathlib".
397 #:tests? #f))
398 (home-page "https://bitbucket.org/ruamel/yaml")
399 (synopsis "YAML 1.2 parser/emitter")
400 (description
401 "This package provides YAML parser/emitter that supports roundtrip
402 preservation of comments, seq/map flow style, and map key order. It
403 is a derivative of Kirill Simonov’s PyYAML 3.11. It supports YAML 1.2
404 and has round-trip loaders and dumpers. It supports comments. Block
405 style and key ordering are kept, so you can diff the source.")
406 (license license:expat)))
407
408 (define-public python2-ruamel.yaml
409 (package-with-python2 python-ruamel.yaml))
410
411 (define-public python-cbor
412 (package
413 (name "python-cbor")
414 (version "1.0.0")
415 (source
416 (origin
417 (method url-fetch)
418 (uri (pypi-uri "cbor" version))
419 (sha256
420 (base32
421 "1dmv163cnslyqccrybkxn0c9s1jk1mmafmgxv75iamnz5lk5l8hk"))))
422 (build-system python-build-system)
423 (home-page "https://bitbucket.org/bodhisnarkva/cbor")
424 (synopsis "Implementation of the Concise Binary Object Representation")
425 (description
426 "Python-cbor provides an implementation of the Concise Binary Object
427 Representation (@dfn{CBOR}). CBOR is comparable to JSON, has a superset of
428 JSON's ability, but serializes to a binary format which is smaller and faster
429 to generate and parse. The two primary functions are @code{cbor.loads} and
430 @code{cbor.dumps}.")
431 (license license:asl2.0)))
432
433 (define-public flatbuffers
434 (package
435 (name "flatbuffers")
436 (version "1.10.0")
437 (source
438 (origin
439 (method url-fetch)
440 (uri (string-append "https://github.com/google/flatbuffers/archive/v"
441 version ".tar.gz"))
442 (file-name (string-append name "-" version ".tar.gz"))
443 (sha256
444 (base32
445 "0z4swldxs0s31hnkqdhsbfmc8vx3p7zsvmqaw4l31r2iikdy651p"))))
446 (build-system cmake-build-system)
447 (arguments
448 '(#:build-type "Release"
449 #:configure-flags
450 (list (string-append "-DCMAKE_INSTALL_LIBDIR="
451 (assoc-ref %outputs "out") "/lib"))))
452 (home-page "https://google.github.io/flatbuffers/")
453 (synopsis "Memory-efficient serialization library")
454 (description "FlatBuffers is a cross-platform serialization library for C++,
455 C#, C, Go, Java, JavaScript, PHP, and Python. It was originally created for
456 game development and other performance-critical applications.")
457 (license license:asl2.0)))
458
459 (define-public python-feather-format
460 (package
461 (name "python-feather-format")
462 (version "0.4.0")
463 (source
464 (origin
465 (method url-fetch)
466 (uri (pypi-uri "feather-format" version))
467 (sha256
468 (base32
469 "1adivm5w5ji4qv7hq7942vqlk8l2wgw87bdlsia771z14z3zp857"))))
470 (build-system python-build-system)
471 (propagated-inputs
472 `(("python-pandas" ,python-pandas)
473 ("python-pyarrow" ,python-pyarrow)))
474 (home-page "https://github.com/wesm/feather")
475 (synopsis "Python wrapper to the Feather file format")
476 (description "This package provides a Python wrapper library to the
477 Apache Arrow-based Feather binary columnar serialization data frame format.")
478 (license license:asl2.0)))