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") | |
7ec309af RW |
168 | (source (origin |
169 | (method url-fetch) | |
170 | (uri (string-append "https://github.com/libmpack/libmpack-lua/" | |
171 | "archive/" (package-version libmpack) ".tar.gz")) | |
172 | (file-name (string-append name "-" (package-version libmpack) ".tar.gz")) | |
173 | (sha256 | |
174 | (base32 | |
175 | "153zrrbyxhf71dgzjjhrk56rfwk3nisslpgcqyg44v8fnz1xpk6i")))) | |
8e664e7e RW |
176 | (build-system gnu-build-system) |
177 | (arguments | |
178 | `(;; FIXME: tests require "busted", which is not yet available in Guix. | |
179 | #:tests? #f | |
180 | #:test-target "test" | |
181 | #:make-flags | |
182 | (let* ((lua-version ,(package-version lua)) | |
183 | (lua-major+minor ,(version-major+minor (package-version lua)))) | |
184 | (list "CC=gcc" | |
7ec309af RW |
185 | "FETCH=echo" ; don't fetch anything from the web |
186 | "UNTGZ=echo" ; and don't try to unpack it | |
8e664e7e | 187 | "USE_SYSTEM_LUA=yes" |
7ec309af RW |
188 | (string-append "MPACK_LUA_VERSION=" lua-version) |
189 | (string-append "MPACK_LUA_VERSION_NOPATCH=" lua-major+minor) | |
8e664e7e RW |
190 | (string-append "PREFIX=" |
191 | (assoc-ref %outputs "out")) | |
192 | (string-append "LUA_CMOD_INSTALLDIR=" | |
193 | (assoc-ref %outputs "out") | |
7ec309af | 194 | "/lib/lua/" lua-major+minor))) |
8e664e7e RW |
195 | #:phases |
196 | (modify-phases %standard-phases | |
197 | (delete 'configure) | |
7ec309af RW |
198 | (add-after 'unpack 'unpack-mpack-sources |
199 | (lambda* (#:key inputs #:allow-other-keys) | |
200 | ;; This is broken because mpack-src is not a file, but all | |
201 | ;; prerequisites are added to the inputs of the gcc invocation. | |
202 | (substitute* "Makefile" | |
203 | (("\\$\\(MPACK\\): mpack-src") "$(MPACK): ")) | |
204 | (mkdir-p "mpack-src") | |
205 | (zero? (system* "tar" "-C" "mpack-src" | |
206 | "--strip-components=1" | |
207 | "-xvf" (assoc-ref inputs "libmpack")))))))) | |
8e664e7e RW |
208 | (inputs |
209 | `(("lua" ,lua))) | |
210 | (native-inputs | |
7ec309af RW |
211 | `(("pkg-config" ,pkg-config) |
212 | ("libmpack" ,(package-source libmpack)))) | |
213 | (home-page "https://github.com/libmpack/libmpack-lua") | |
8e664e7e RW |
214 | (synopsis "Lua bindings for the libmpack binary serialization library"))) |
215 | ||
369ee96b RW |
216 | (define-public lua5.2-libmpack |
217 | (package (inherit lua-libmpack) | |
218 | (name "lua5.2-libmpack") | |
219 | (arguments | |
220 | (substitute-keyword-arguments (package-arguments lua-libmpack) | |
221 | ((#:make-flags flags) | |
222 | `(let* ((lua-version ,(package-version lua-5.2)) | |
223 | (lua-major+minor ,(version-major+minor (package-version lua-5.2)))) | |
224 | (list "CC=gcc" | |
225 | "USE_SYSTEM_LUA=yes" | |
0cdc3343 RW |
226 | (string-append "MPACK_LUA_VERSION=" lua-version) |
227 | (string-append "MPACK_LUA_VERSION_NOPATCH=" lua-major+minor) | |
369ee96b RW |
228 | (string-append "PREFIX=" |
229 | (assoc-ref %outputs "out")) | |
230 | (string-append "LUA_CMOD_INSTALLDIR=" | |
231 | (assoc-ref %outputs "out") | |
232 | "/lib/lua/" lua-major+minor)))))) | |
233 | (inputs | |
234 | `(("lua" ,lua-5.2))))) | |
235 | ||
f50f4ae4 DC |
236 | (define-public yaml-cpp |
237 | (package | |
238 | (name "yaml-cpp") | |
239 | (version "0.5.3") | |
240 | (source (origin | |
241 | (method url-fetch) | |
242 | (uri (string-append | |
243 | "https://github.com/jbeder/yaml-cpp/archive/" | |
244 | "yaml-cpp-" version ".tar.gz")) | |
245 | (sha256 | |
246 | (base32 | |
247 | "1vk6pjh0f5k6jwk2sszb9z5169whmiha9ainbdpa1arxlkq7v3b6")))) | |
248 | (build-system cmake-build-system) | |
249 | (inputs | |
250 | `(("boost" ,boost))) | |
251 | (native-inputs | |
252 | `(("python" ,python))) | |
253 | (home-page "https://github.com/jbeder/yaml-cpp") | |
254 | (synopsis "YAML parser and emitter in C++") | |
255 | (description "YAML parser and emitter in C++ matching the YAML 1.2 spec.") | |
256 | (license license:bsd-3))) | |
cd131a76 DC |
257 | |
258 | (define-public jsoncpp | |
259 | (package | |
260 | (name "jsoncpp") | |
9fa72841 | 261 | (version "1.8.0") |
cd131a76 DC |
262 | (source (origin |
263 | (method url-fetch) | |
264 | (uri (string-append | |
265 | "https://github.com/open-source-parsers/jsoncpp/archive/" | |
266 | version ".tar.gz")) | |
267 | (file-name (string-append name "-" version ".tar.gz")) | |
268 | (sha256 | |
269 | (base32 | |
9fa72841 | 270 | "1g35ci93s03wph4kabi46iz42wgyfbn2763cklf15h7hrdi29ssx")))) |
cd131a76 DC |
271 | (build-system cmake-build-system) |
272 | (home-page "https://github.com/open-source-parsers/jsoncpp") | |
996f5ece EB |
273 | (arguments |
274 | `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"))) | |
cd131a76 DC |
275 | (synopsis "C++ library for interacting with JSON") |
276 | (description "JsonCpp is a C++ library that allows manipulating JSON values, | |
277 | including serialization and deserialization to and from strings. It can also | |
278 | preserve existing comment in unserialization/serialization steps, making | |
279 | it a convenient format to store user input files.") | |
280 | (license license:expat))) | |
557d3328 MB |
281 | |
282 | (define-public capnproto | |
283 | (package | |
284 | (name "capnproto") | |
0866dd46 | 285 | (version "0.6.1") |
557d3328 MB |
286 | (source (origin |
287 | (method url-fetch) | |
288 | (uri (string-append | |
289 | "https://capnproto.org/capnproto-c++-" | |
290 | version ".tar.gz")) | |
291 | (sha256 | |
292 | (base32 | |
0866dd46 | 293 | "010s9yhq4531wvdfrdf2477zswhck6cjfby79w73rff3v06090l0")))) |
557d3328 MB |
294 | (build-system gnu-build-system) |
295 | (arguments | |
296 | `(#:phases | |
297 | (modify-phases %standard-phases | |
298 | (add-before 'check 'do-not-require-/etc/services | |
299 | (lambda _ | |
300 | ;; Workaround for test that tries to resolve port name from | |
301 | ;; /etc/services, which is not present in build environment. | |
302 | (substitute* "src/kj/async-io-test.c++" ((":http") ":80")) | |
303 | #t))))) | |
304 | (home-page "https://capnproto.org") | |
305 | (synopsis "Capability-based RPC and serialization system") | |
306 | (description | |
307 | "Cap'n Proto is a very fast data interchange format and capability-based | |
308 | RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster.") | |
309 | (license license:expat))) | |
9d625512 CB |
310 | |
311 | (define-public libbson | |
312 | (package | |
313 | (name "libbson") | |
314 | (version "1.6.2") | |
315 | (source | |
316 | (origin | |
317 | (method url-fetch) | |
318 | (uri (string-append "https://github.com/mongodb/libbson/releases/" | |
319 | "download/" version "/libbson-" version ".tar.gz")) | |
320 | (sha256 | |
321 | (base32 | |
322 | "1fj4554msq0rrz14snbj908dzqj46gh7jg9w9j0akn2b7q911m5a")))) | |
323 | (build-system gnu-build-system) | |
324 | (native-inputs `(("perl" ,perl))) | |
325 | (home-page "http://mongoc.org/libbson/current/index.html") | |
326 | (synopsis "C BSON library") | |
327 | (description "Libbson can create and parse BSON documents. It can also | |
328 | convert JSON documents to BSON and the opposite. BSON stands for Binary JSON, | |
329 | it is comparable to protobuf.") | |
330 | (license license:asl2.0))) |