1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 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>
8 ;;; This file is part of GNU Guix.
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.
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.
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/>.
23 (define-module (gnu packages serialization)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build-system cmake)
28 #:use-module (guix build-system gnu)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages autotools)
31 #:use-module (gnu packages boost)
32 #:use-module (gnu packages check)
33 #:use-module (gnu packages compression)
34 #:use-module (gnu packages documentation)
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages python))
44 (uri (string-append "https://github.com/USCiLab/cereal/archive/v"
46 (file-name (string-append name "-" version ".tar.gz"))
49 "0kj32h3j2128anig0g9gzw82kfyd5xqfkwq6vdyv900jx8i1qckx"))))
50 (build-system cmake-build-system)
52 `(;; The only included tests are portability tests requiring
53 ;; cross-compilation and boost. Since we are building cereal on more
54 ;; platforms anyway, there is no compelling reason to build the tests.
58 (modify-phases %standard-phases
62 (substitute* "doc/doxygen.in"
63 (("@CMAKE_CURRENT_SOURCE_DIR@") "."))
64 (zero? (system* "doxygen" "doc/doxygen.in"))))
65 ;; There is no "install" target, so we have to provide our own
68 (lambda* (#:key outputs #:allow-other-keys)
69 (let* ((out (assoc-ref outputs "out"))
70 (doc (string-append out "/share/cereal/docs"))
71 (include (string-append out "/include/cereal")))
74 (copy-recursively "include/cereal" include)
75 (copy-recursively "doc/html" doc))
78 `(("doxygen" ,doxygen)))
79 (home-page "http://uscilab.github.io/cereal/")
80 (synopsis "C++11 library for serialization")
82 "Cereal is a header-only C++11 serialization library. Cereal takes
83 arbitrary data types and reversibly turns them into different representations,
84 such as compact binary encodings, XML, or JSON.")
85 (license license:bsd-3)))
88 (define-public msgpack
97 "https://github.com/msgpack/msgpack-c/releases/download/"
98 "cpp-" version "/msgpack-" version ".tar.gz"))
100 '(let ((p (open-file "msgpack.pc.in" "a")))
103 (string-append "Requires: " "zlib" "\n") p)
104 (close-output-port p))))
107 "0bpjfh9vz0n2k93mph3x15clmigkgs223xfn8h12ymrh5gsi5ica"))))
108 (build-system gnu-build-system)
110 `(("googletest" ,googletest)
111 ("autoconf" ,autoconf)
112 ("automake" ,automake)
114 ("pkg-config" ,pkg-config)))
116 `(("zlib" ,zlib))) ;; Msgpack installs two headers (zbuffer.h,
117 ;; zbuffer.hpp) which #include <zlib.h>. However, 'guix gc --references'
118 ;; does not detect a store reference to zlib since these headers are not
122 (modify-phases %standard-phases
123 (add-before 'configure 'autoconf
125 (system* "autoreconf" "-vfi"))))))
126 (home-page "http://www.msgpack.org")
127 (synopsis "Binary serialization library")
128 (description "Msgpack is a library for C/C++ that implements binary
130 (license license:boost1.0)))
132 (define-public yaml-cpp
139 "https://github.com/jbeder/yaml-cpp/archive/"
140 "yaml-cpp-" version ".tar.gz"))
143 "1vk6pjh0f5k6jwk2sszb9z5169whmiha9ainbdpa1arxlkq7v3b6"))))
144 (build-system cmake-build-system)
148 `(("python" ,python)))
149 (home-page "https://github.com/jbeder/yaml-cpp")
150 (synopsis "YAML parser and emitter in C++")
151 (description "YAML parser and emitter in C++ matching the YAML 1.2 spec.")
152 (license license:bsd-3)))
154 (define-public jsoncpp
161 "https://github.com/open-source-parsers/jsoncpp/archive/"
163 (file-name (string-append name "-" version ".tar.gz"))
166 "15wg14480lrbrhc2myk9rwpwb2gzix9bk80p4y7gxg3zrzml0xh8"))))
167 (build-system cmake-build-system)
168 (home-page "https://github.com/open-source-parsers/jsoncpp")
170 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES")))
171 (synopsis "C++ library for interacting with JSON")
172 (description "JsonCpp is a C++ library that allows manipulating JSON values,
173 including serialization and deserialization to and from strings. It can also
174 preserve existing comment in unserialization/serialization steps, making
175 it a convenient format to store user input files.")
176 (license license:expat)))
178 (define-public capnproto
185 "https://capnproto.org/capnproto-c++-"
189 "1yvaadhgakskqq5wpv53hd6fc3pp17mrdldw4i5cvgck4iwprcfd"))))
190 (build-system gnu-build-system)
193 (modify-phases %standard-phases
194 (add-before 'check 'do-not-require-/etc/services
196 ;; Workaround for test that tries to resolve port name from
197 ;; /etc/services, which is not present in build environment.
198 (substitute* "src/kj/async-io-test.c++" ((":http") ":80"))
200 (home-page "https://capnproto.org")
201 (synopsis "Capability-based RPC and serialization system")
203 "Cap'n Proto is a very fast data interchange format and capability-based
204 RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster.")
205 (license license:expat)))