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