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