serialization.scm 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2015, 2017, 2019, 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
  3. ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
  4. ;;; Copyright © 2016 David Craven <david@craven.ch>
  5. ;;; Copyright © 2016, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
  6. ;;; Copyright © 2016, 2018, 2019, 2021 Efraim Flashner <efraim@flashner.co.il>
  7. ;;; Copyright © 2017 Corentin Bocquillon <corentin@nybble.fr>
  8. ;;; Copyright © 2017 Gregor Giesen <giesen@zaehlwerk.net>
  9. ;;; Copyright © 2017 Frederick M. Muriithi <fredmanglis@gmail.com>
  10. ;;; Copyright © 2017 Nikita <nikita@n0.is>
  11. ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
  12. ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
  13. ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
  14. ;;; Copyright © 2020 Alexandros Theodotou <alex@zrythm.org>
  15. ;;;
  16. ;;; This file is part of GNU Guix.
  17. ;;;
  18. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  19. ;;; under the terms of the GNU General Public License as published by
  20. ;;; the Free Software Foundation; either version 3 of the License, or (at
  21. ;;; your option) any later version.
  22. ;;;
  23. ;;; GNU Guix is distributed in the hope that it will be useful, but
  24. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  25. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26. ;;; GNU General Public License for more details.
  27. ;;;
  28. ;;; You should have received a copy of the GNU General Public License
  29. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  30. (define-module (gnu packages serialization)
  31. #:use-module ((guix licenses) #:prefix license:)
  32. #:use-module (guix packages)
  33. #:use-module (guix download)
  34. #:use-module (guix hg-download)
  35. #:use-module (guix git-download)
  36. #:use-module (guix utils)
  37. #:use-module (guix build-system cmake)
  38. #:use-module (guix build-system gnu)
  39. #:use-module (guix build-system python)
  40. #:use-module (gnu packages)
  41. #:use-module (gnu packages autotools)
  42. #:use-module (gnu packages boost)
  43. #:use-module (gnu packages check)
  44. #:use-module (gnu packages compression)
  45. #:use-module (gnu packages cmake)
  46. #:use-module (gnu packages cpp)
  47. #:use-module (gnu packages databases)
  48. #:use-module (gnu packages documentation)
  49. #:use-module (gnu packages gcc)
  50. #:use-module (gnu packages llvm)
  51. #:use-module (gnu packages lua)
  52. #:use-module (gnu packages pkg-config)
  53. #:use-module (gnu packages python)
  54. #:use-module (gnu packages python-science)
  55. #:use-module (gnu packages python-xyz)
  56. #:use-module (gnu packages perl))
  57. (define-public avro-cpp-1.9
  58. (package
  59. (name "avro-cpp")
  60. (version "1.9.2")
  61. (source (origin
  62. (method url-fetch)
  63. (uri (string-append
  64. "https://archive.apache.org/dist/avro/avro-" version
  65. "/avro-src-" version ".tar.gz"))
  66. (sha256
  67. (base32 "0i3fpm7r72yw397qc8yw9ybzk2mxjkv0yk5hnn00ylc1wbd0np73"))))
  68. (build-system cmake-build-system)
  69. (arguments
  70. `(#:phases
  71. (modify-phases %standard-phases
  72. (add-after 'unpack 'chdir
  73. (lambda _ (chdir "lang/c++"))))))
  74. (inputs
  75. `(("boost" ,boost)
  76. ("snappy" ,snappy)))
  77. (home-page "https://avro.apache.org/")
  78. (synopsis "Data serialization system")
  79. (description "Apache Avro is a data serialization system. Avro provides:
  80. @enumerate
  81. @item Rich data structures;
  82. @item a compact, fast, binary data format;
  83. @item a container file, to store persistent data;
  84. @item remote procedure call (RPC); and
  85. @item simple integration with dynamic languages.
  86. @end enumerate
  87. Code generation is not required to read or write data files nor to use or
  88. implement RPC protocols.")
  89. (license license:asl2.0)))
  90. (define-public avro-cpp-1.9-for-irods
  91. (package
  92. (inherit avro-cpp-1.9)
  93. (properties `((hidden? . #true)))
  94. (arguments
  95. `(#:configure-flags
  96. '("-DCMAKE_CXX_COMPILER=clang++"
  97. "-DCMAKE_CXX_FLAGS=-stdlib=libc++"
  98. "-DCMAKE_EXE_LINKER_FLAGS=-lc++abi -lz")
  99. #:phases
  100. (modify-phases %standard-phases
  101. (add-after 'unpack 'chdir
  102. (lambda _ (chdir "lang/c++")))
  103. (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
  104. (lambda* (#:key inputs #:allow-other-keys)
  105. (let ((gcc (assoc-ref inputs "gcc")))
  106. (setenv "CPLUS_INCLUDE_PATH"
  107. (string-join
  108. (cons* (search-input-directory inputs "include/c++/v1")
  109. ;; Hide GCC's C++ headers so that they do not interfere with
  110. ;; the Clang headers.
  111. (delete (string-append gcc "/include/c++")
  112. (string-split (getenv "CPLUS_INCLUDE_PATH")
  113. #\:)))
  114. ":"))
  115. (format #true
  116. "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
  117. (getenv "CPLUS_INCLUDE_PATH"))))))))
  118. (inputs
  119. `(("boost" ,boost-for-irods)
  120. ("clang" ,clang-toolchain-6)
  121. ("libcxx+libcxxabi" ,libcxx+libcxxabi-6)
  122. ("libcxxabi" ,libcxxabi-6)
  123. ("snappy" ,snappy-with-clang6)
  124. ("zlib" ,zlib)))))
  125. (define-public cereal
  126. (package
  127. (name "cereal")
  128. (version "1.3.0")
  129. (source
  130. (origin
  131. (method git-fetch)
  132. (uri (git-reference
  133. (url "https://github.com/USCiLab/cereal")
  134. (commit (string-append "v" version))))
  135. (file-name (git-file-name name version))
  136. (sha256
  137. (base32
  138. "0hc8wh9dwpc1w1zf5lfss4vg5hmgpblqxbrpp1rggicpx9ar831p"))))
  139. (build-system cmake-build-system)
  140. (arguments
  141. `(;; The only included tests are portability tests requiring
  142. ;; cross-compilation and boost. Since we are building cereal on more
  143. ;; platforms anyway, there is no compelling reason to build the tests.
  144. #:tests? #f
  145. #:out-of-source? #f
  146. #:phases
  147. (modify-phases %standard-phases
  148. (delete 'configure)
  149. (replace 'build
  150. (lambda _
  151. (substitute* "doc/doxygen.in"
  152. (("@CMAKE_CURRENT_BINARY_DIR@") ".")
  153. (("@CMAKE_CURRENT_SOURCE_DIR@") "."))
  154. (with-directory-excursion "doc"
  155. (invoke "doxygen" "doxygen.in"))))
  156. ;; There is no "install" target, so we have to provide our own
  157. ;; "install" phase.
  158. (replace 'install
  159. (lambda* (#:key outputs #:allow-other-keys)
  160. (let* ((out (assoc-ref outputs "out"))
  161. (doc (string-append out "/share/cereal/docs"))
  162. (include (string-append out "/include/cereal")))
  163. (mkdir-p doc)
  164. (mkdir-p include)
  165. (copy-recursively "include/cereal" include)
  166. (copy-recursively "doc/html" doc)))))))
  167. (native-inputs
  168. `(("doxygen" ,doxygen)))
  169. (home-page "https://uscilab.github.io/cereal/")
  170. (synopsis "C++11 library for serialization")
  171. (description
  172. "Cereal is a header-only C++11 serialization library. Cereal takes
  173. arbitrary data types and reversibly turns them into different representations,
  174. such as compact binary encodings, XML, or JSON.")
  175. (license license:bsd-3)))
  176. (define-public msgpack
  177. (package
  178. (name "msgpack")
  179. (version "3.3.0")
  180. (source
  181. (origin
  182. (method url-fetch)
  183. (uri
  184. (string-append
  185. "https://github.com/msgpack/msgpack-c/releases/download/"
  186. "cpp-" version "/msgpack-" version ".tar.gz"))
  187. (snippet
  188. '(let ((p (open-file "msgpack.pc.in" "a")))
  189. (display
  190. (string-append "Requires: " "zlib" "\n") p)
  191. (close-output-port p)
  192. #t))
  193. (sha256
  194. (base32 "0yzhq50ijvwrfkr97knhvn54lj3f4hr3zy39yq8wpf6xll94s4bf"))))
  195. (build-system cmake-build-system)
  196. (native-inputs
  197. `(("googletest" ,googletest-1.8)
  198. ("pkg-config" ,pkg-config)))
  199. (propagated-inputs
  200. `(("zlib" ,zlib))) ;; Msgpack installs two headers (zbuffer.h,
  201. ;; zbuffer.hpp) which #include <zlib.h>. However, 'guix gc --references'
  202. ;; does not detect a store reference to zlib since these headers are not
  203. ;; compiled.
  204. (home-page "https://www.msgpack.org")
  205. (synopsis "Binary serialization library")
  206. (description "Msgpack is a library for C/C++ that implements binary
  207. serialization.")
  208. (license license:boost1.0)))
  209. (define-public libmpack
  210. (package
  211. (name "libmpack")
  212. (version "1.0.5")
  213. (source
  214. (origin
  215. (method git-fetch)
  216. (uri (git-reference
  217. (url "https://github.com/tarruda/libmpack")
  218. (commit version)))
  219. (file-name (git-file-name name version))
  220. (sha256
  221. (base32 "0rai5djdkjz7bsn025k5489in7r1amagw1pib0z4qns6b52kiar2"))))
  222. (build-system gnu-build-system)
  223. (arguments
  224. `(#:test-target "test"
  225. #:make-flags
  226. (list "CC=gcc"
  227. (string-append "PREFIX=" (assoc-ref %outputs "out")))
  228. #:phases
  229. (modify-phases %standard-phases
  230. (delete 'configure))))
  231. (native-inputs
  232. `(("libtool" ,libtool)))
  233. (home-page "https://github.com/tarruda/libmpack")
  234. (synopsis "Small binary serialization library")
  235. (description "Libmpack is a small binary serialization and RPC library
  236. that implements both the msgpack and msgpack-rpc specifications.")
  237. (license license:expat)))
  238. (define-public lua-libmpack
  239. (package (inherit libmpack)
  240. (name "lua-libmpack")
  241. (version "1.0.8")
  242. (source
  243. (origin
  244. (method git-fetch)
  245. (uri (git-reference
  246. (url "https://github.com/libmpack/libmpack-lua")
  247. (commit version)))
  248. (file-name (git-file-name name version))
  249. (sha256
  250. (base32 "1ijvzgq5hvib03w5rghv31wi7byamwg7qdx5pawvhvnflaii8ivw"))))
  251. (build-system gnu-build-system)
  252. (arguments
  253. `(;; FIXME: tests require "busted", which is not yet available in Guix.
  254. #:tests? #f
  255. #:test-target "test"
  256. #:make-flags
  257. (let* ((lua-version ,(package-version lua))
  258. (lua-major+minor ,(version-major+minor (package-version lua))))
  259. (list "CC=gcc"
  260. "FETCH=echo" ; don't fetch anything from the web
  261. "UNTGZ=echo" ; and don't try to unpack it
  262. "USE_SYSTEM_LUA=yes"
  263. (string-append "MPACK_LUA_VERSION=" lua-version)
  264. (string-append "MPACK_LUA_VERSION_NOPATCH=" lua-major+minor)
  265. (string-append "PREFIX="
  266. (assoc-ref %outputs "out"))
  267. (string-append "LUA_CMOD_INSTALLDIR="
  268. (assoc-ref %outputs "out")
  269. "/lib/lua/" lua-major+minor)))
  270. #:phases
  271. (modify-phases %standard-phases
  272. (delete 'configure)
  273. (add-after 'unpack 'unpack-mpack-sources
  274. (lambda* (#:key inputs #:allow-other-keys)
  275. ;; This is broken because mpack-src is not a file, but all
  276. ;; prerequisites are added to the inputs of the gcc invocation.
  277. (substitute* "Makefile"
  278. (("\\$\\(MPACK\\): mpack-src") "$(MPACK): "))
  279. (copy-recursively (assoc-ref inputs "libmpack")
  280. "mpack-src")
  281. #t)))))
  282. (inputs
  283. `(("lua" ,lua)))
  284. (native-inputs
  285. `(("pkg-config" ,pkg-config)
  286. ("libmpack" ,(package-source libmpack))))
  287. (home-page "https://github.com/libmpack/libmpack-lua")
  288. (synopsis "Lua bindings for the libmpack binary serialization library")))
  289. (define-public lua5.1-libmpack
  290. (package/inherit lua-libmpack
  291. (name "lua5.1-libmpack")
  292. (arguments
  293. (substitute-keyword-arguments (package-arguments lua-libmpack)
  294. ((#:make-flags flags)
  295. `(let* ((lua-version ,(package-version lua-5.1))
  296. (lua-major+minor ,(version-major+minor (package-version lua-5.1))))
  297. (list "CC=gcc"
  298. "USE_SYSTEM_LUA=yes"
  299. (string-append "MPACK_LUA_VERSION=" lua-version)
  300. (string-append "MPACK_LUA_VERSION_NOPATCH=" lua-major+minor)
  301. (string-append "PREFIX="
  302. (assoc-ref %outputs "out"))
  303. (string-append "LUA_CMOD_INSTALLDIR="
  304. (assoc-ref %outputs "out")
  305. "/lib/lua/" lua-major+minor))))))
  306. (inputs
  307. `(("lua" ,lua-5.1)))))
  308. (define-public lua5.2-libmpack
  309. (package/inherit lua-libmpack
  310. (name "lua5.2-libmpack")
  311. (arguments
  312. (substitute-keyword-arguments (package-arguments lua-libmpack)
  313. ((#:make-flags flags)
  314. `(let* ((lua-version ,(package-version lua-5.2))
  315. (lua-major+minor ,(version-major+minor (package-version lua-5.2))))
  316. (list "CC=gcc"
  317. "USE_SYSTEM_LUA=yes"
  318. (string-append "MPACK_LUA_VERSION=" lua-version)
  319. (string-append "MPACK_LUA_VERSION_NOPATCH=" lua-major+minor)
  320. (string-append "PREFIX="
  321. (assoc-ref %outputs "out"))
  322. (string-append "LUA_CMOD_INSTALLDIR="
  323. (assoc-ref %outputs "out")
  324. "/lib/lua/" lua-major+minor))))))
  325. (inputs
  326. `(("lua" ,lua-5.2)))))
  327. (define-public libyaml
  328. (package
  329. (name "libyaml")
  330. (version "0.2.5")
  331. (source
  332. (origin
  333. (method url-fetch)
  334. (uri (string-append "https://pyyaml.org/download/libyaml/yaml-"
  335. version ".tar.gz"))
  336. (sha256
  337. (base32
  338. "1x4fcw13r3lqy8ndydr3ili87wicplw2awbcv6r21qgyfndswhn6"))))
  339. (build-system gnu-build-system)
  340. (arguments
  341. '(#:configure-flags '("--disable-static")))
  342. (home-page "https://pyyaml.org/wiki/LibYAML")
  343. (synopsis "YAML 1.1 parser and emitter written in C")
  344. (description
  345. "LibYAML is a YAML 1.1 parser and emitter written in C.")
  346. (license license:expat)))
  347. (define-public libyaml+static
  348. (package
  349. (inherit libyaml)
  350. (name "libyaml+static")
  351. (arguments
  352. '(#:configure-flags '("--enable-static")))))
  353. (define-public libcyaml
  354. (package
  355. (name "libcyaml")
  356. (version "1.1.0")
  357. (source
  358. (origin
  359. (method git-fetch)
  360. (uri (git-reference
  361. (url "https://github.com/tlsa/libcyaml")
  362. (commit (string-append "v" version))))
  363. (file-name (git-file-name name version))
  364. (patches (search-patches "libcyaml-libyaml-compat.patch"))
  365. (sha256
  366. (base32 "0428p0rwq71nhh5nzcbapsbrjxa0x5l6h6ns32nxv7j624f0zd93"))))
  367. (build-system gnu-build-system)
  368. (arguments
  369. `(#:make-flags
  370. (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
  371. (string-append "CC=gcc"))
  372. #:phases
  373. (modify-phases %standard-phases
  374. (delete 'configure) ; no configure script
  375. (replace 'check
  376. (lambda _
  377. (setenv "CC" "gcc")
  378. (invoke "make" "test"))))))
  379. (inputs
  380. `(("libyaml" ,libyaml)))
  381. (native-inputs
  382. `(("pkg-config" ,pkg-config)))
  383. (synopsis "C library for reading and writing YAML")
  384. (description
  385. "LibCYAML is a C library written in ISO C11 for reading and writing
  386. structured YAML documents. The fundamental idea behind CYAML is to allow
  387. applications to construct schemas which describe both the permissible
  388. structure of the YAML documents to read/write, and the C data structure(s)
  389. in which the loaded data is arranged in memory.")
  390. (home-page "https://github.com/tlsa/libcyaml")
  391. (license license:isc)))
  392. (define-public yaml-cpp
  393. (package
  394. (name "yaml-cpp")
  395. (version "0.6.3")
  396. (source
  397. (origin
  398. (method git-fetch)
  399. (uri (git-reference
  400. (url "https://github.com/jbeder/yaml-cpp")
  401. (commit (string-append "yaml-cpp-" version))))
  402. (file-name (git-file-name name version))
  403. (sha256
  404. (base32 "0ykkxzxcwwiv8l8r697gyqh1nl582krpvi7m7l6b40ijnk4pw30s"))))
  405. (build-system cmake-build-system)
  406. (arguments
  407. '(#:configure-flags '("-DYAML_BUILD_SHARED_LIBS=ON")))
  408. (native-inputs
  409. `(("python" ,python)))
  410. (home-page "https://github.com/jbeder/yaml-cpp")
  411. (synopsis "YAML parser and emitter in C++")
  412. (description "YAML parser and emitter in C++ matching the YAML 1.2 spec.")
  413. (license license:bsd-3)))
  414. (define-public jsoncpp
  415. (package
  416. (name "jsoncpp")
  417. (version "1.9.4")
  418. (home-page "https://github.com/open-source-parsers/jsoncpp")
  419. (source (origin
  420. (method git-fetch)
  421. (uri (git-reference (url home-page) (commit version)))
  422. (file-name (git-file-name name version))
  423. (sha256
  424. (base32
  425. "0qnx5y6c90fphl9mj9d20j2dfgy6s5yr5l0xnzid0vh71zrp6jwv"))))
  426. (build-system cmake-build-system)
  427. (arguments
  428. `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
  429. ,@(if (%current-target-system)
  430. `("-DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF")
  431. '()))
  432. ,@(if (%current-target-system)
  433. '()
  434. `(#:cmake ,cmake-bootstrap))))
  435. (synopsis "C++ library for interacting with JSON")
  436. (description "JsonCpp is a C++ library that allows manipulating JSON values,
  437. including serialization and deserialization to and from strings. It can also
  438. preserve existing comment in unserialization/serialization steps, making
  439. it a convenient format to store user input files.")
  440. (license license:expat)))
  441. ;; XXX: TODO(core-updates): Remove this package and apply the patch to the
  442. ;; jsoncpp package. This patch fixes the package version declared in the
  443. ;; pkg-config file.
  444. (define-public jsoncpp-with-pkg-version
  445. (package
  446. (inherit jsoncpp)
  447. (name "jsoncpp")
  448. (version "1.9.4")
  449. (home-page "https://github.com/open-source-parsers/jsoncpp")
  450. (source (origin
  451. (method git-fetch)
  452. (uri (git-reference (url home-page) (commit version)))
  453. (file-name (git-file-name name version))
  454. (sha256
  455. (base32
  456. "0qnx5y6c90fphl9mj9d20j2dfgy6s5yr5l0xnzid0vh71zrp6jwv"))
  457. (patches
  458. (search-patches "jsoncpp-pkg-config-version.patch"))))))
  459. ;; Tensorflow does not build with jsoncpp 1.8.x. It is built with commit
  460. ;; 4356d9bba191e1e16ce7a92073cbf3e63564e973, which lies between version 1.7.2
  461. ;; and 1.7.3.
  462. (define-public jsoncpp-for-tensorflow
  463. (package (inherit jsoncpp)
  464. (name "jsoncpp")
  465. (version "1.7.3")
  466. (source (origin
  467. (method git-fetch)
  468. (uri (git-reference
  469. (url "https://github.com/open-source-parsers/jsoncpp")
  470. (commit version)))
  471. (file-name (git-file-name name version))
  472. (sha256
  473. (base32
  474. "1180ln8blrb0mwzpcf78k49hlki6di65q77rsvglf83kfcyh4d7z"))))))
  475. (define-public capnproto
  476. (package
  477. (name "capnproto")
  478. (version "0.8.0")
  479. (source (origin
  480. (method url-fetch)
  481. (uri (string-append
  482. "https://capnproto.org/capnproto-c++-"
  483. version ".tar.gz"))
  484. (sha256
  485. (base32
  486. "03f1862ljdshg7d0rg3j7jzgm3ip55kzd2y91q7p0racax3hxx6i"))))
  487. (build-system gnu-build-system)
  488. (arguments
  489. `(#:phases
  490. (modify-phases %standard-phases
  491. (add-before 'check 'do-not-require-/etc/services
  492. (lambda _
  493. ;; Workaround for test that tries to resolve port name from
  494. ;; /etc/services, which is not present in build environment.
  495. (substitute* "src/kj/async-io-test.c++" ((":http") ":80"))
  496. #t))
  497. (add-before 'check 'use-tmp-for-temporary-files
  498. (lambda _
  499. ;; Use /tmp for temporary files, as the default /var/tmp directory
  500. ;; doesn't exist.
  501. (substitute* "src/kj/filesystem-disk-test.c++"
  502. (("VAR\\_TMP \"/var/tmp\"")
  503. "VAR_TMP \"/tmp\""))
  504. #t)))))
  505. (home-page "https://capnproto.org")
  506. (synopsis "Capability-based RPC and serialization system")
  507. (description
  508. "Cap'n Proto is a very fast data interchange format and capability-based
  509. RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster.")
  510. (license license:expat)))
  511. (define-public libbson
  512. (package
  513. (name "libbson")
  514. (version "1.6.2")
  515. (source
  516. (origin
  517. (method url-fetch)
  518. (uri (string-append "https://github.com/mongodb/libbson/releases/"
  519. "download/" version "/libbson-" version ".tar.gz"))
  520. (sha256
  521. (base32
  522. "1fj4554msq0rrz14snbj908dzqj46gh7jg9w9j0akn2b7q911m5a"))))
  523. (build-system gnu-build-system)
  524. (native-inputs `(("perl" ,perl)))
  525. (home-page "http://mongoc.org/libbson/current/index.html")
  526. (synopsis "C BSON library")
  527. (description "Libbson can create and parse BSON documents. It can also
  528. convert JSON documents to BSON and the opposite. BSON stands for Binary JSON,
  529. it is comparable to protobuf.")
  530. (license license:asl2.0)))
  531. (define-public python-ruamel.yaml
  532. (package
  533. (name "python-ruamel.yaml")
  534. (version "0.16.13")
  535. (source
  536. (origin
  537. (method url-fetch)
  538. (uri (pypi-uri "ruamel.yaml" version))
  539. (sha256
  540. (base32
  541. "0hm9yg785f46bkrgqknd6fdvmkby9dpzjnm0b63qf0i748acaj5v"))))
  542. (build-system python-build-system)
  543. (native-inputs
  544. `(("python-pytest" ,python-pytest)))
  545. (propagated-inputs
  546. `(("python-ruamel.yaml.clib" ,python-ruamel.yaml.clib)))
  547. (arguments
  548. `(;; TODO: Tests require packaging "ruamel.std.pathlib".
  549. #:tests? #f))
  550. (home-page "https://sourceforge.net/projects/ruamel-yaml/")
  551. (synopsis "YAML 1.2 parser/emitter")
  552. (description
  553. "This package provides YAML parser/emitter that supports roundtrip
  554. preservation of comments, seq/map flow style, and map key order. It
  555. is a derivative of Kirill Simonov’s PyYAML 3.11. It supports YAML 1.2
  556. and has round-trip loaders and dumpers. It supports comments. Block
  557. style and key ordering are kept, so you can diff the source.")
  558. (license license:expat)))
  559. (define-public python-ruamel.yaml.clib
  560. (package
  561. (name "python-ruamel.yaml.clib")
  562. (version "0.2.6")
  563. (source
  564. (origin
  565. ;; pypi release code has cythonized code without corresponding source.
  566. (method hg-fetch)
  567. (uri (hg-reference
  568. (url "http://hg.code.sf.net/p/ruamel-yaml-clib/code")
  569. (changeset version)))
  570. (file-name (string-append name "-" version "-checkout"))
  571. (sha256
  572. (base32
  573. "05m3y7pjfbaarqbbgw1k6gs6cnnmxnwadjipxvw1aaaqk3s236cs"))
  574. (modules '((guix build utils)))
  575. (snippet
  576. '(begin
  577. (delete-file "_ruamel_yaml.c")))))
  578. (build-system python-build-system)
  579. (arguments
  580. `(#:tests? #f ; This package is split from python-ruamel.yaml and
  581. ; depends on modules from it for the test suite.
  582. #:phases
  583. (modify-phases %standard-phases
  584. (delete 'sanity-check) ; Depends on python-ruamel.yaml
  585. (add-after 'unpack 'cythonize-code
  586. (lambda _
  587. (invoke "cython" "_ruamel_yaml.pyx"))))))
  588. (native-inputs
  589. `(("python-cython" ,python-cython)))
  590. (home-page "https://sourceforge.net/p/ruamel-yaml-clib/code/ci/default/tree")
  591. (synopsis "C version of reader, parser and emitter for ruamel.yaml")
  592. (description
  593. "This package provides a C version of the reader, parser and emitter for
  594. @code{ruamel.yaml} derived from libyaml.")
  595. (license license:expat)))
  596. (define-public python-cbor
  597. (package
  598. (name "python-cbor")
  599. (version "1.0.0")
  600. (source
  601. (origin
  602. (method url-fetch)
  603. (uri (pypi-uri "cbor" version))
  604. (sha256
  605. (base32
  606. "1dmv163cnslyqccrybkxn0c9s1jk1mmafmgxv75iamnz5lk5l8hk"))))
  607. (build-system python-build-system)
  608. (home-page "https://bitbucket.org/bodhisnarkva/cbor")
  609. (synopsis "Implementation of the Concise Binary Object Representation")
  610. (description
  611. "Python-cbor provides an implementation of the Concise Binary Object
  612. Representation (@dfn{CBOR}). CBOR is comparable to JSON, has a superset of
  613. JSON's ability, but serializes to a binary format which is smaller and faster
  614. to generate and parse. The two primary functions are @code{cbor.loads} and
  615. @code{cbor.dumps}.")
  616. (license license:asl2.0)))
  617. (define-public flatbuffers
  618. (package
  619. (name "flatbuffers")
  620. (version "2.0.0")
  621. (source
  622. (origin
  623. (method git-fetch)
  624. (uri (git-reference
  625. (url "https://github.com/google/flatbuffers")
  626. (commit (string-append "v" version))))
  627. (file-name (git-file-name name version))
  628. (sha256
  629. (base32
  630. "1zbf6bdpps8369r1ql00irxrp58jnalycc8jcapb8iqg654vlfz8"))))
  631. (build-system cmake-build-system)
  632. (arguments
  633. '(#:build-type "Release"
  634. #:configure-flags
  635. (list "-DFLATBUFFERS_BUILD_SHAREDLIB=ON"
  636. (string-append "-DCMAKE_INSTALL_LIBDIR="
  637. (assoc-ref %outputs "out") "/lib"))
  638. #:phases
  639. (modify-phases %standard-phases
  640. (add-after 'unpack 'make-writable
  641. (lambda _ (for-each make-file-writable (find-files ".")))))))
  642. (home-page "https://google.github.io/flatbuffers/")
  643. (synopsis "Memory-efficient serialization library")
  644. (description "FlatBuffers is a cross-platform serialization library for C++,
  645. C#, C, Go, Java, JavaScript, PHP, and Python. It was originally created for
  646. game development and other performance-critical applications.")
  647. (license license:asl2.0)))
  648. (define-public python-feather-format
  649. (package
  650. (name "python-feather-format")
  651. (version "0.4.1")
  652. (source
  653. (origin
  654. (method url-fetch)
  655. (uri (pypi-uri "feather-format" version))
  656. (sha256
  657. (base32
  658. "00w9hwz7sj3fkdjc378r066vdy6lpxmn6vfac3qx956k8lvpxxj5"))))
  659. (build-system python-build-system)
  660. (propagated-inputs
  661. `(("python-pandas" ,python-pandas)
  662. ("python-pyarrow" ,python-pyarrow)))
  663. (home-page "https://github.com/wesm/feather")
  664. (synopsis "Python wrapper to the Feather file format")
  665. (description "This package provides a Python wrapper library to the
  666. Apache Arrow-based Feather binary columnar serialization data frame format.")
  667. (license license:asl2.0)))