gnu: emacs-sly: Update to 20200228.
[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 "https://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 (patches (search-patches "jsoncpp-fix-inverted-case.patch"))
294 (sha256
295 (base32
296 "037d1b1qdmn3rksmn1j71j26bv4hkjv7sn7da261k853xb5899sg"))))
297 (build-system cmake-build-system)
298 (arguments
299 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES")))
300 (synopsis "C++ library for interacting with JSON")
301 (description "JsonCpp is a C++ library that allows manipulating JSON values,
302 including serialization and deserialization to and from strings. It can also
303 preserve existing comment in unserialization/serialization steps, making
304 it a convenient format to store user input files.")
305 (license license:expat)))
306
307 ;; Tensorflow does not build with jsoncpp 1.8.x. It is built with commit
308 ;; 4356d9bba191e1e16ce7a92073cbf3e63564e973, which lies between version 1.7.2
309 ;; and 1.7.3.
310 (define-public jsoncpp-for-tensorflow
311 (package (inherit jsoncpp)
312 (name "jsoncpp")
313 (version "1.7.3")
314 (source (origin
315 (method git-fetch)
316 (uri (git-reference
317 (url "https://github.com/open-source-parsers/jsoncpp.git")
318 (commit version)))
319 (file-name (git-file-name name version))
320 (sha256
321 (base32
322 "1180ln8blrb0mwzpcf78k49hlki6di65q77rsvglf83kfcyh4d7z"))))))
323
324 (define-public capnproto
325 (package
326 (name "capnproto")
327 (version "0.7.0")
328 (source (origin
329 (method url-fetch)
330 (uri (string-append
331 "https://capnproto.org/capnproto-c++-"
332 version ".tar.gz"))
333 (sha256
334 (base32
335 "0hfdnhlbskagzgvby8wy6lrxj53zfzpfqimbhga68c0ji2yw1969"))))
336 (build-system gnu-build-system)
337 (arguments
338 `(#:phases
339 (modify-phases %standard-phases
340 (add-before 'check 'do-not-require-/etc/services
341 (lambda _
342 ;; Workaround for test that tries to resolve port name from
343 ;; /etc/services, which is not present in build environment.
344 (substitute* "src/kj/async-io-test.c++" ((":http") ":80"))
345 #t))
346 (add-before 'check 'use-tmp-for-tempory-files
347 (lambda _
348 ;; Use /tmp for tempory files, as the default /var/tmp directory
349 ;; doesn't exist.
350 (substitute* "src/kj/filesystem-disk-test.c++"
351 (("VAR\\_TMP \"/var/tmp\"")
352 "VAR_TMP \"/tmp\""))
353 #t)))))
354 (home-page "https://capnproto.org")
355 (synopsis "Capability-based RPC and serialization system")
356 (description
357 "Cap'n Proto is a very fast data interchange format and capability-based
358 RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster.")
359 (license license:expat)))
360
361 (define-public libbson
362 (package
363 (name "libbson")
364 (version "1.6.2")
365 (source
366 (origin
367 (method url-fetch)
368 (uri (string-append "https://github.com/mongodb/libbson/releases/"
369 "download/" version "/libbson-" version ".tar.gz"))
370 (sha256
371 (base32
372 "1fj4554msq0rrz14snbj908dzqj46gh7jg9w9j0akn2b7q911m5a"))))
373 (build-system gnu-build-system)
374 (native-inputs `(("perl" ,perl)))
375 (home-page "http://mongoc.org/libbson/current/index.html")
376 (synopsis "C BSON library")
377 (description "Libbson can create and parse BSON documents. It can also
378 convert JSON documents to BSON and the opposite. BSON stands for Binary JSON,
379 it is comparable to protobuf.")
380 (license license:asl2.0)))
381
382 (define-public python-ruamel.yaml
383 (package
384 (name "python-ruamel.yaml")
385 (version "0.15.83")
386 (source
387 (origin
388 (method url-fetch)
389 (uri (pypi-uri "ruamel.yaml" version))
390 (sha256
391 (base32
392 "0p4i8ad28cbbbjja8b9274irkhnphhvhap3aym6yb8xfp1d72kpw"))))
393 (build-system python-build-system)
394 (native-inputs
395 `(("python-pytest" ,python-pytest)))
396 (arguments
397 `(;; TODO: Tests require packaging "ruamel.std.pathlib".
398 #:tests? #f))
399 (home-page "https://bitbucket.org/ruamel/yaml")
400 (synopsis "YAML 1.2 parser/emitter")
401 (description
402 "This package provides YAML parser/emitter that supports roundtrip
403 preservation of comments, seq/map flow style, and map key order. It
404 is a derivative of Kirill Simonov’s PyYAML 3.11. It supports YAML 1.2
405 and has round-trip loaders and dumpers. It supports comments. Block
406 style and key ordering are kept, so you can diff the source.")
407 (license license:expat)))
408
409 (define-public python2-ruamel.yaml
410 (package-with-python2 python-ruamel.yaml))
411
412 (define-public python-cbor
413 (package
414 (name "python-cbor")
415 (version "1.0.0")
416 (source
417 (origin
418 (method url-fetch)
419 (uri (pypi-uri "cbor" version))
420 (sha256
421 (base32
422 "1dmv163cnslyqccrybkxn0c9s1jk1mmafmgxv75iamnz5lk5l8hk"))))
423 (build-system python-build-system)
424 (home-page "https://bitbucket.org/bodhisnarkva/cbor")
425 (synopsis "Implementation of the Concise Binary Object Representation")
426 (description
427 "Python-cbor provides an implementation of the Concise Binary Object
428 Representation (@dfn{CBOR}). CBOR is comparable to JSON, has a superset of
429 JSON's ability, but serializes to a binary format which is smaller and faster
430 to generate and parse. The two primary functions are @code{cbor.loads} and
431 @code{cbor.dumps}.")
432 (license license:asl2.0)))
433
434 (define-public flatbuffers
435 (package
436 (name "flatbuffers")
437 (version "1.10.0")
438 (source
439 (origin
440 (method url-fetch)
441 (uri (string-append "https://github.com/google/flatbuffers/archive/v"
442 version ".tar.gz"))
443 (file-name (string-append name "-" version ".tar.gz"))
444 (sha256
445 (base32
446 "0z4swldxs0s31hnkqdhsbfmc8vx3p7zsvmqaw4l31r2iikdy651p"))))
447 (build-system cmake-build-system)
448 (arguments
449 '(#:build-type "Release"
450 #:configure-flags
451 (list (string-append "-DCMAKE_INSTALL_LIBDIR="
452 (assoc-ref %outputs "out") "/lib"))))
453 (home-page "https://google.github.io/flatbuffers/")
454 (synopsis "Memory-efficient serialization library")
455 (description "FlatBuffers is a cross-platform serialization library for C++,
456 C#, C, Go, Java, JavaScript, PHP, and Python. It was originally created for
457 game development and other performance-critical applications.")
458 (license license:asl2.0)))
459
460 (define-public python-feather-format
461 (package
462 (name "python-feather-format")
463 (version "0.4.0")
464 (source
465 (origin
466 (method url-fetch)
467 (uri (pypi-uri "feather-format" version))
468 (sha256
469 (base32
470 "1adivm5w5ji4qv7hq7942vqlk8l2wgw87bdlsia771z14z3zp857"))))
471 (build-system python-build-system)
472 (propagated-inputs
473 `(("python-pandas" ,python-pandas)
474 ("python-pyarrow" ,python-pyarrow)))
475 (home-page "https://github.com/wesm/feather")
476 (synopsis "Python wrapper to the Feather file format")
477 (description "This package provides a Python wrapper library to the
478 Apache Arrow-based Feather binary columnar serialization data frame format.")
479 (license license:asl2.0)))