gnu: fish: Update to 2.7.1.
[jackhill/guix/guix.git] / gnu / packages / serialization.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
4 ;;; Copyright © 2016 David Craven <david@craven.ch>
5 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
6 ;;; Copyright © 2016 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@infotropique.org>
11 ;;;
12 ;;; This file is part of GNU Guix.
13 ;;;
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
18 ;;;
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
23 ;;;
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
27 (define-module (gnu packages serialization)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix utils)
32 #:use-module (guix build-system cmake)
33 #:use-module (guix build-system gnu)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages autotools)
36 #:use-module (gnu packages boost)
37 #:use-module (gnu packages check)
38 #:use-module (gnu packages compression)
39 #:use-module (gnu packages documentation)
40 #:use-module (gnu packages lua)
41 #:use-module (gnu packages pkg-config)
42 #:use-module (gnu packages python)
43 #:use-module (gnu packages perl)
44 #:use-module (guix build-system python))
45
46 (define-public cereal
47 (package
48 (name "cereal")
49 (version "1.2.1")
50 (source (origin
51 (method url-fetch)
52 (uri (string-append "https://github.com/USCiLab/cereal/archive/v"
53 version ".tar.gz"))
54 (file-name (string-append name "-" version ".tar.gz"))
55 (sha256
56 (base32
57 "0kj32h3j2128anig0g9gzw82kfyd5xqfkwq6vdyv900jx8i1qckx"))))
58 (build-system cmake-build-system)
59 (arguments
60 `(;; The only included tests are portability tests requiring
61 ;; cross-compilation and boost. Since we are building cereal on more
62 ;; platforms anyway, there is no compelling reason to build the tests.
63 #:tests? #f
64 #:out-of-source? #f
65 #:phases
66 (modify-phases %standard-phases
67 (delete 'configure)
68 (replace 'build
69 (lambda _
70 (substitute* "doc/doxygen.in"
71 (("@CMAKE_CURRENT_SOURCE_DIR@") "."))
72 (zero? (system* "doxygen" "doc/doxygen.in"))))
73 ;; There is no "install" target, so we have to provide our own
74 ;; "install" phase.
75 (replace 'install
76 (lambda* (#:key outputs #:allow-other-keys)
77 (let* ((out (assoc-ref outputs "out"))
78 (doc (string-append out "/share/cereal/docs"))
79 (include (string-append out "/include/cereal")))
80 (mkdir-p doc)
81 (mkdir-p include)
82 (copy-recursively "include/cereal" include)
83 (copy-recursively "doc/html" doc))
84 #t)))))
85 (native-inputs
86 `(("doxygen" ,doxygen)))
87 (home-page "http://uscilab.github.io/cereal/")
88 (synopsis "C++11 library for serialization")
89 (description
90 "Cereal is a header-only C++11 serialization library. Cereal takes
91 arbitrary data types and reversibly turns them into different representations,
92 such as compact binary encodings, XML, or JSON.")
93 (license license:bsd-3)))
94
95
96 (define-public msgpack
97 (package
98 (name "msgpack")
99 (version "1.4.2")
100 (source
101 (origin
102 (method url-fetch)
103 (uri
104 (string-append
105 "https://github.com/msgpack/msgpack-c/releases/download/"
106 "cpp-" version "/msgpack-" version ".tar.gz"))
107 (snippet
108 '(let ((p (open-file "msgpack.pc.in" "a")))
109 (begin
110 (display
111 (string-append "Requires: " "zlib" "\n") p)
112 (close-output-port p))))
113 (sha256
114 (base32
115 "18hzmyfg3mvnp7ab03nqdzzvqagkl42gygjpi4zv4i7aca2dmwf0"))))
116 (build-system gnu-build-system)
117 (native-inputs
118 `(("googletest" ,googletest)
119 ("autoconf" ,autoconf)
120 ("automake" ,automake)
121 ("libtool" ,libtool)
122 ("pkg-config" ,pkg-config)))
123 (propagated-inputs
124 `(("zlib" ,zlib))) ;; Msgpack installs two headers (zbuffer.h,
125 ;; zbuffer.hpp) which #include <zlib.h>. However, 'guix gc --references'
126 ;; does not detect a store reference to zlib since these headers are not
127 ;; compiled.
128 (arguments
129 `(#:phases
130 (modify-phases %standard-phases
131 (add-after 'unpack 'autoconf
132 (lambda _
133 (system* "autoreconf" "-vfi"))))))
134 (home-page "http://www.msgpack.org")
135 (synopsis "Binary serialization library")
136 (description "Msgpack is a library for C/C++ that implements binary
137 serialization.")
138 (license license:boost1.0)))
139
140 (define-public libmpack
141 (package
142 (name "libmpack")
143 (version "1.0.5")
144 (source (origin
145 (method url-fetch)
146 (uri (string-append "https://github.com/tarruda/libmpack/"
147 "archive/" version ".tar.gz"))
148 (file-name (string-append name "-" version ".tar.gz"))
149 (sha256
150 (base32
151 "0ml922gv8y99lbldqb9ykpjndla0hlprdjyl79yskkhwv2ai7sac"))))
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 (source (origin
173 (method url-fetch)
174 (uri (string-append "https://github.com/libmpack/libmpack-lua/"
175 "archive/" (package-version libmpack) ".tar.gz"))
176 (file-name (string-append name "-" (package-version libmpack) ".tar.gz"))
177 (sha256
178 (base32
179 "153zrrbyxhf71dgzjjhrk56rfwk3nisslpgcqyg44v8fnz1xpk6i"))))
180 (build-system gnu-build-system)
181 (arguments
182 `(;; FIXME: tests require "busted", which is not yet available in Guix.
183 #:tests? #f
184 #:test-target "test"
185 #:make-flags
186 (let* ((lua-version ,(package-version lua))
187 (lua-major+minor ,(version-major+minor (package-version lua))))
188 (list "CC=gcc"
189 "FETCH=echo" ; don't fetch anything from the web
190 "UNTGZ=echo" ; and don't try to unpack it
191 "USE_SYSTEM_LUA=yes"
192 (string-append "MPACK_LUA_VERSION=" lua-version)
193 (string-append "MPACK_LUA_VERSION_NOPATCH=" lua-major+minor)
194 (string-append "PREFIX="
195 (assoc-ref %outputs "out"))
196 (string-append "LUA_CMOD_INSTALLDIR="
197 (assoc-ref %outputs "out")
198 "/lib/lua/" lua-major+minor)))
199 #:phases
200 (modify-phases %standard-phases
201 (delete 'configure)
202 (add-after 'unpack 'unpack-mpack-sources
203 (lambda* (#:key inputs #:allow-other-keys)
204 ;; This is broken because mpack-src is not a file, but all
205 ;; prerequisites are added to the inputs of the gcc invocation.
206 (substitute* "Makefile"
207 (("\\$\\(MPACK\\): mpack-src") "$(MPACK): "))
208 (mkdir-p "mpack-src")
209 (zero? (system* "tar" "-C" "mpack-src"
210 "--strip-components=1"
211 "-xvf" (assoc-ref inputs "libmpack"))))))))
212 (inputs
213 `(("lua" ,lua)))
214 (native-inputs
215 `(("pkg-config" ,pkg-config)
216 ("libmpack" ,(package-source libmpack))))
217 (home-page "https://github.com/libmpack/libmpack-lua")
218 (synopsis "Lua bindings for the libmpack binary serialization library")))
219
220 (define-public lua5.2-libmpack
221 (package (inherit lua-libmpack)
222 (name "lua5.2-libmpack")
223 (arguments
224 (substitute-keyword-arguments (package-arguments lua-libmpack)
225 ((#:make-flags flags)
226 `(let* ((lua-version ,(package-version lua-5.2))
227 (lua-major+minor ,(version-major+minor (package-version lua-5.2))))
228 (list "CC=gcc"
229 "USE_SYSTEM_LUA=yes"
230 (string-append "MPACK_LUA_VERSION=" lua-version)
231 (string-append "MPACK_LUA_VERSION_NOPATCH=" lua-major+minor)
232 (string-append "PREFIX="
233 (assoc-ref %outputs "out"))
234 (string-append "LUA_CMOD_INSTALLDIR="
235 (assoc-ref %outputs "out")
236 "/lib/lua/" lua-major+minor))))))
237 (inputs
238 `(("lua" ,lua-5.2)))))
239
240 (define-public yaml-cpp
241 (package
242 (name "yaml-cpp")
243 (version "0.5.3")
244 (source (origin
245 (method url-fetch)
246 (uri (string-append
247 "https://github.com/jbeder/yaml-cpp/archive/"
248 "yaml-cpp-" version ".tar.gz"))
249 (sha256
250 (base32
251 "1ck7jk0wjfigrf4cgcjqsir4yp1s6vamhhxhpsgfvs46pgm5pk6y"))))
252 (build-system cmake-build-system)
253 (arguments
254 '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
255 (inputs
256 `(("boost" ,boost)))
257 (native-inputs
258 `(("python" ,python)))
259 (home-page "https://github.com/jbeder/yaml-cpp")
260 (synopsis "YAML parser and emitter in C++")
261 (description "YAML parser and emitter in C++ matching the YAML 1.2 spec.")
262 (license license:bsd-3)))
263
264 (define-public jsoncpp
265 (package
266 (name "jsoncpp")
267 (version "1.8.2")
268 (source (origin
269 (method url-fetch)
270 (uri (string-append
271 "https://github.com/open-source-parsers/jsoncpp/archive/"
272 version ".tar.gz"))
273 (file-name (string-append name "-" version ".tar.gz"))
274 (sha256
275 (base32
276 "1vwf0yrv5540ygfnxikirbs63awsdzn7dabkia3g0bnz43p5l7w1"))))
277 (build-system cmake-build-system)
278 (home-page "https://github.com/open-source-parsers/jsoncpp")
279 (arguments
280 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES")))
281 (synopsis "C++ library for interacting with JSON")
282 (description "JsonCpp is a C++ library that allows manipulating JSON values,
283 including serialization and deserialization to and from strings. It can also
284 preserve existing comment in unserialization/serialization steps, making
285 it a convenient format to store user input files.")
286 (license license:expat)))
287
288 (define-public capnproto
289 (package
290 (name "capnproto")
291 (version "0.6.1")
292 (source (origin
293 (method url-fetch)
294 (uri (string-append
295 "https://capnproto.org/capnproto-c++-"
296 version ".tar.gz"))
297 (sha256
298 (base32
299 "010s9yhq4531wvdfrdf2477zswhck6cjfby79w73rff3v06090l0"))))
300 (build-system gnu-build-system)
301 (arguments
302 `(#:phases
303 (modify-phases %standard-phases
304 (add-before 'check 'do-not-require-/etc/services
305 (lambda _
306 ;; Workaround for test that tries to resolve port name from
307 ;; /etc/services, which is not present in build environment.
308 (substitute* "src/kj/async-io-test.c++" ((":http") ":80"))
309 #t)))))
310 (home-page "https://capnproto.org")
311 (synopsis "Capability-based RPC and serialization system")
312 (description
313 "Cap'n Proto is a very fast data interchange format and capability-based
314 RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster.")
315 (license license:expat)))
316
317 (define-public libbson
318 (package
319 (name "libbson")
320 (version "1.6.2")
321 (source
322 (origin
323 (method url-fetch)
324 (uri (string-append "https://github.com/mongodb/libbson/releases/"
325 "download/" version "/libbson-" version ".tar.gz"))
326 (sha256
327 (base32
328 "1fj4554msq0rrz14snbj908dzqj46gh7jg9w9j0akn2b7q911m5a"))))
329 (build-system gnu-build-system)
330 (native-inputs `(("perl" ,perl)))
331 (home-page "http://mongoc.org/libbson/current/index.html")
332 (synopsis "C BSON library")
333 (description "Libbson can create and parse BSON documents. It can also
334 convert JSON documents to BSON and the opposite. BSON stands for Binary JSON,
335 it is comparable to protobuf.")
336 (license license:asl2.0)))
337
338 (define-public nlohmann-json-cpp
339 (package
340 (name "nlohmann-json-cpp")
341 (version "2.1.1")
342 (source
343 (origin
344 (method url-fetch)
345 (uri (string-append "https://github.com/nlohmann/json/"
346 "archive/v" version ".tar.gz"))
347 (file-name (string-append name "-" version ".tar.gz"))
348 (sha256
349 (base32
350 "0lrh6cjd643c7kmvmwafbgq7dqj3b778483gjhjbvp6rc6z5xf2r"))))
351 (build-system cmake-build-system)
352 (home-page "https://nlohmann.github.io/json/")
353 (synopsis "JSON library for C++")
354 (description
355 "JSON library for C++ trying to accomplish “Intuitive syntax”,
356 “Trivial integration”, and “Serious testing”.
357 However, “Memory efficiency” and “Speed” have not been primary goals.")
358 (license license:expat)))
359
360 (define-public python-ruamel.yaml
361 (package
362 (name "python-ruamel.yaml")
363 (version "0.15.33")
364 (source
365 (origin
366 (method url-fetch)
367 (uri (pypi-uri "ruamel.yaml" version))
368 (sha256
369 (base32
370 "1s4b0zwn9pkk4xxjhx77giyfddc738drd6vgraw6n2syvj03s31d"))))
371 (build-system python-build-system)
372 (native-inputs
373 `(("python-pytest" ,python-pytest)))
374 (arguments
375 `(;; TODO: Tests require packaging "ruamel.std.pathlib".
376 #:tests? #f))
377 (home-page "https://bitbucket.org/ruamel/yaml")
378 (synopsis "YAML 1.2 parser/emitter")
379 (description
380 "This package provides YAML parser/emitter that supports roundtrip
381 preservation of comments, seq/map flow style, and map key order. It
382 is a derivative of Kirill Simonov’s PyYAML 3.11. It supports YAML 1.2
383 and has round-trip loaders and dumpers. It supports comments. Block
384 style and key ordering are kept, so you can diff the source.")
385 (license license:expat)))
386
387 (define-public python2-ruamel.yaml
388 (package-with-python2 python-ruamel.yaml))
389
390 (define-public python-cbor
391 (package
392 (name "python-cbor")
393 (version "1.0.0")
394 (source
395 (origin
396 (method url-fetch)
397 (uri (pypi-uri "cbor" version))
398 (sha256
399 (base32
400 "1dmv163cnslyqccrybkxn0c9s1jk1mmafmgxv75iamnz5lk5l8hk"))))
401 (build-system python-build-system)
402 (home-page "https://bitbucket.org/bodhisnarkva/cbor")
403 (synopsis "Implementation of the Concise Binary Object Representation")
404 (description
405 "Python-cbor provides an implementation of the Concise Binary Object
406 Representation (CBOR). CBOR is comparable to JSON, has a superset of JSON's
407 ability, but serializes to a binary format which is smaller and faster to
408 generate and parse. The two primary functions are @code{cbor.loads} and
409 @code{cbor.dumps}.")
410 (license license:asl2.0)))