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> |
0149354d RW |
8 | ;;; |
9 | ;;; This file is part of GNU Guix. | |
10 | ;;; | |
11 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
12 | ;;; under the terms of the GNU General Public License as published by | |
13 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
14 | ;;; your option) any later version. | |
15 | ;;; | |
16 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
17 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | ;;; GNU General Public License for more details. | |
20 | ;;; | |
21 | ;;; You should have received a copy of the GNU General Public License | |
22 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
23 | ||
24 | (define-module (gnu packages serialization) | |
25 | #:use-module ((guix licenses) #:prefix license:) | |
26 | #:use-module (guix packages) | |
27 | #:use-module (guix download) | |
8e664e7e | 28 | #:use-module (guix utils) |
0149354d | 29 | #:use-module (guix build-system cmake) |
d1ef573d | 30 | #:use-module (guix build-system gnu) |
0149354d | 31 | #:use-module (gnu packages) |
d1ef573d | 32 | #:use-module (gnu packages autotools) |
f50f4ae4 | 33 | #:use-module (gnu packages boost) |
d1ef573d LG |
34 | #:use-module (gnu packages check) |
35 | #:use-module (gnu packages compression) | |
36 | #:use-module (gnu packages documentation) | |
8e664e7e | 37 | #:use-module (gnu packages lua) |
f47dc8dd | 38 | #:use-module (gnu packages pkg-config) |
9d625512 CB |
39 | #:use-module (gnu packages python) |
40 | #:use-module (gnu packages perl)) | |
0149354d RW |
41 | |
42 | (define-public cereal | |
43 | (package | |
44 | (name "cereal") | |
43593f5b | 45 | (version "1.2.1") |
0149354d RW |
46 | (source (origin |
47 | (method url-fetch) | |
48 | (uri (string-append "https://github.com/USCiLab/cereal/archive/v" | |
49 | version ".tar.gz")) | |
50 | (file-name (string-append name "-" version ".tar.gz")) | |
51 | (sha256 | |
52 | (base32 | |
43593f5b | 53 | "0kj32h3j2128anig0g9gzw82kfyd5xqfkwq6vdyv900jx8i1qckx")))) |
0149354d RW |
54 | (build-system cmake-build-system) |
55 | (arguments | |
56 | `(;; The only included tests are portability tests requiring | |
57 | ;; cross-compilation and boost. Since we are building cereal on more | |
58 | ;; platforms anyway, there is no compelling reason to build the tests. | |
59 | #:tests? #f | |
60 | #:out-of-source? #f | |
61 | #:phases | |
62 | (modify-phases %standard-phases | |
63 | (delete 'configure) | |
64 | (replace 'build | |
65 | (lambda _ | |
66 | (substitute* "doc/doxygen.in" | |
67 | (("@CMAKE_CURRENT_SOURCE_DIR@") ".")) | |
68 | (zero? (system* "doxygen" "doc/doxygen.in")))) | |
69 | ;; There is no "install" target, so we have to provide our own | |
70 | ;; "install" phase. | |
71 | (replace 'install | |
72 | (lambda* (#:key outputs #:allow-other-keys) | |
73 | (let* ((out (assoc-ref outputs "out")) | |
74 | (doc (string-append out "/share/cereal/docs")) | |
75 | (include (string-append out "/include/cereal"))) | |
76 | (mkdir-p doc) | |
77 | (mkdir-p include) | |
78 | (copy-recursively "include/cereal" include) | |
79 | (copy-recursively "doc/html" doc)) | |
80 | #t))))) | |
81 | (native-inputs | |
82 | `(("doxygen" ,doxygen))) | |
83 | (home-page "http://uscilab.github.io/cereal/") | |
84 | (synopsis "C++11 library for serialization") | |
85 | (description | |
86 | "Cereal is a header-only C++11 serialization library. Cereal takes | |
87 | arbitrary data types and reversibly turns them into different representations, | |
88 | such as compact binary encodings, XML, or JSON.") | |
89 | (license license:bsd-3))) | |
d1ef573d LG |
90 | |
91 | ||
92 | (define-public msgpack | |
93 | (package | |
94 | (name "msgpack") | |
e54ae862 | 95 | (version "1.4.2") |
d1ef573d LG |
96 | (source |
97 | (origin | |
98 | (method url-fetch) | |
99 | (uri | |
100 | (string-append | |
101 | "https://github.com/msgpack/msgpack-c/releases/download/" | |
102 | "cpp-" version "/msgpack-" version ".tar.gz")) | |
103 | (snippet | |
104 | '(let ((p (open-file "msgpack.pc.in" "a"))) | |
105 | (begin | |
106 | (display | |
107 | (string-append "Requires: " "zlib" "\n") p) | |
108 | (close-output-port p)))) | |
109 | (sha256 | |
110 | (base32 | |
e54ae862 | 111 | "18hzmyfg3mvnp7ab03nqdzzvqagkl42gygjpi4zv4i7aca2dmwf0")))) |
d1ef573d LG |
112 | (build-system gnu-build-system) |
113 | (native-inputs | |
114 | `(("googletest" ,googletest) | |
115 | ("autoconf" ,autoconf) | |
116 | ("automake" ,automake) | |
117 | ("libtool" ,libtool) | |
118 | ("pkg-config" ,pkg-config))) | |
119 | (propagated-inputs | |
120 | `(("zlib" ,zlib))) ;; Msgpack installs two headers (zbuffer.h, | |
121 | ;; zbuffer.hpp) which #include <zlib.h>. However, 'guix gc --references' | |
122 | ;; does not detect a store reference to zlib since these headers are not | |
123 | ;; compiled. | |
124 | (arguments | |
125 | `(#:phases | |
126 | (modify-phases %standard-phases | |
127 | (add-before 'configure 'autoconf | |
128 | (lambda _ | |
129 | (system* "autoreconf" "-vfi")))))) | |
130 | (home-page "http://www.msgpack.org") | |
131 | (synopsis "Binary serialization library") | |
132 | (description "Msgpack is a library for C/C++ that implements binary | |
133 | serialization.") | |
134 | (license license:boost1.0))) | |
f50f4ae4 | 135 | |
c57e5fd0 RW |
136 | (define-public libmpack |
137 | (package | |
138 | (name "libmpack") | |
b5236121 | 139 | (version "1.0.5") |
c57e5fd0 RW |
140 | (source (origin |
141 | (method url-fetch) | |
142 | (uri (string-append "https://github.com/tarruda/libmpack/" | |
143 | "archive/" version ".tar.gz")) | |
144 | (file-name (string-append name "-" version ".tar.gz")) | |
145 | (sha256 | |
b5236121 LF |
146 | (base32 |
147 | "0ml922gv8y99lbldqb9ykpjndla0hlprdjyl79yskkhwv2ai7sac")))) | |
c57e5fd0 RW |
148 | (build-system gnu-build-system) |
149 | (arguments | |
150 | `(#:test-target "test" | |
151 | #:make-flags | |
152 | (list "CC=gcc" | |
153 | (string-append "PREFIX=" (assoc-ref %outputs "out"))) | |
154 | #:phases | |
155 | (modify-phases %standard-phases | |
156 | (delete 'configure)))) | |
157 | (native-inputs | |
158 | `(("libtool" ,libtool))) | |
159 | (home-page "https://github.com/tarruda/libmpack") | |
160 | (synopsis "Small binary serialization library") | |
161 | (description "Libmpack is a small binary serialization and RPC library | |
162 | that implements both the msgpack and msgpack-rpc specifications.") | |
163 | (license license:expat))) | |
164 | ||
8e664e7e RW |
165 | (define-public lua-libmpack |
166 | (package (inherit libmpack) | |
167 | (name "lua-libmpack") | |
168 | (build-system gnu-build-system) | |
169 | (arguments | |
170 | `(;; FIXME: tests require "busted", which is not yet available in Guix. | |
171 | #:tests? #f | |
172 | #:test-target "test" | |
173 | #:make-flags | |
174 | (let* ((lua-version ,(package-version lua)) | |
175 | (lua-major+minor ,(version-major+minor (package-version lua)))) | |
176 | (list "CC=gcc" | |
177 | "USE_SYSTEM_LUA=yes" | |
178 | (string-append "LUA_VERSION=" lua-version) | |
179 | (string-append "LUA_VERSION_MAJ_MIN=" lua-major+minor) | |
180 | (string-append "PREFIX=" | |
181 | (assoc-ref %outputs "out")) | |
182 | (string-append "LUA_CMOD_INSTALLDIR=" | |
183 | (assoc-ref %outputs "out") | |
184 | "/lib/lua/" lua-major+minor) | |
185 | ;; This is unnecessary as of upstream commit 02886c13ff8a2, | |
186 | ;; which is not part of the current release. | |
187 | "CFLAGS=-DLUA_C89_NUMBERS -fPIC")) | |
188 | #:phases | |
189 | (modify-phases %standard-phases | |
190 | (delete 'configure) | |
191 | (add-after 'unpack 'chdir | |
192 | (lambda _ (chdir "binding/lua") #t))))) | |
193 | (inputs | |
194 | `(("lua" ,lua))) | |
195 | (native-inputs | |
196 | `(("pkg-config" ,pkg-config))) | |
197 | (synopsis "Lua bindings for the libmpack binary serialization library"))) | |
198 | ||
369ee96b RW |
199 | (define-public lua5.2-libmpack |
200 | (package (inherit lua-libmpack) | |
201 | (name "lua5.2-libmpack") | |
202 | (arguments | |
203 | (substitute-keyword-arguments (package-arguments lua-libmpack) | |
204 | ((#:make-flags flags) | |
205 | `(let* ((lua-version ,(package-version lua-5.2)) | |
206 | (lua-major+minor ,(version-major+minor (package-version lua-5.2)))) | |
207 | (list "CC=gcc" | |
208 | "USE_SYSTEM_LUA=yes" | |
209 | (string-append "LUA_VERSION=" lua-version) | |
210 | (string-append "LUA_VERSION_MAJ_MIN=" lua-major+minor) | |
211 | (string-append "PREFIX=" | |
212 | (assoc-ref %outputs "out")) | |
213 | (string-append "LUA_CMOD_INSTALLDIR=" | |
214 | (assoc-ref %outputs "out") | |
215 | "/lib/lua/" lua-major+minor)))))) | |
216 | (inputs | |
217 | `(("lua" ,lua-5.2))))) | |
218 | ||
f50f4ae4 DC |
219 | (define-public yaml-cpp |
220 | (package | |
221 | (name "yaml-cpp") | |
222 | (version "0.5.3") | |
223 | (source (origin | |
224 | (method url-fetch) | |
225 | (uri (string-append | |
226 | "https://github.com/jbeder/yaml-cpp/archive/" | |
227 | "yaml-cpp-" version ".tar.gz")) | |
228 | (sha256 | |
229 | (base32 | |
230 | "1vk6pjh0f5k6jwk2sszb9z5169whmiha9ainbdpa1arxlkq7v3b6")))) | |
231 | (build-system cmake-build-system) | |
232 | (inputs | |
233 | `(("boost" ,boost))) | |
234 | (native-inputs | |
235 | `(("python" ,python))) | |
236 | (home-page "https://github.com/jbeder/yaml-cpp") | |
237 | (synopsis "YAML parser and emitter in C++") | |
238 | (description "YAML parser and emitter in C++ matching the YAML 1.2 spec.") | |
239 | (license license:bsd-3))) | |
cd131a76 DC |
240 | |
241 | (define-public jsoncpp | |
242 | (package | |
243 | (name "jsoncpp") | |
9fa72841 | 244 | (version "1.8.0") |
cd131a76 DC |
245 | (source (origin |
246 | (method url-fetch) | |
247 | (uri (string-append | |
248 | "https://github.com/open-source-parsers/jsoncpp/archive/" | |
249 | version ".tar.gz")) | |
250 | (file-name (string-append name "-" version ".tar.gz")) | |
251 | (sha256 | |
252 | (base32 | |
9fa72841 | 253 | "1g35ci93s03wph4kabi46iz42wgyfbn2763cklf15h7hrdi29ssx")))) |
cd131a76 DC |
254 | (build-system cmake-build-system) |
255 | (home-page "https://github.com/open-source-parsers/jsoncpp") | |
996f5ece EB |
256 | (arguments |
257 | `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"))) | |
cd131a76 DC |
258 | (synopsis "C++ library for interacting with JSON") |
259 | (description "JsonCpp is a C++ library that allows manipulating JSON values, | |
260 | including serialization and deserialization to and from strings. It can also | |
261 | preserve existing comment in unserialization/serialization steps, making | |
262 | it a convenient format to store user input files.") | |
263 | (license license:expat))) | |
557d3328 MB |
264 | |
265 | (define-public capnproto | |
266 | (package | |
267 | (name "capnproto") | |
55a79799 | 268 | (version "0.6.0") |
557d3328 MB |
269 | (source (origin |
270 | (method url-fetch) | |
271 | (uri (string-append | |
272 | "https://capnproto.org/capnproto-c++-" | |
273 | version ".tar.gz")) | |
274 | (sha256 | |
275 | (base32 | |
55a79799 | 276 | "0gpp1cxsb9nfd7qkjjykzknx03y0z0n4bq5q0fmxci7w38ci22g5")))) |
557d3328 MB |
277 | (build-system gnu-build-system) |
278 | (arguments | |
279 | `(#:phases | |
280 | (modify-phases %standard-phases | |
281 | (add-before 'check 'do-not-require-/etc/services | |
282 | (lambda _ | |
283 | ;; Workaround for test that tries to resolve port name from | |
284 | ;; /etc/services, which is not present in build environment. | |
285 | (substitute* "src/kj/async-io-test.c++" ((":http") ":80")) | |
286 | #t))))) | |
287 | (home-page "https://capnproto.org") | |
288 | (synopsis "Capability-based RPC and serialization system") | |
289 | (description | |
290 | "Cap'n Proto is a very fast data interchange format and capability-based | |
291 | RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster.") | |
292 | (license license:expat))) | |
9d625512 CB |
293 | |
294 | (define-public libbson | |
295 | (package | |
296 | (name "libbson") | |
297 | (version "1.6.2") | |
298 | (source | |
299 | (origin | |
300 | (method url-fetch) | |
301 | (uri (string-append "https://github.com/mongodb/libbson/releases/" | |
302 | "download/" version "/libbson-" version ".tar.gz")) | |
303 | (sha256 | |
304 | (base32 | |
305 | "1fj4554msq0rrz14snbj908dzqj46gh7jg9w9j0akn2b7q911m5a")))) | |
306 | (build-system gnu-build-system) | |
307 | (native-inputs `(("perl" ,perl))) | |
308 | (home-page "http://mongoc.org/libbson/current/index.html") | |
309 | (synopsis "C BSON library") | |
310 | (description "Libbson can create and parse BSON documents. It can also | |
311 | convert JSON documents to BSON and the opposite. BSON stands for Binary JSON, | |
312 | it is comparable to protobuf.") | |
313 | (license license:asl2.0))) |