projects/guix·blob python-team · refs

1210 lines · 44.7 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015, 2017, 2019, 2020, 2021, 2023, 2024 Ricardo Wurmus <[email protected]>
3;;; Copyright © 2016 Lukas Gradl <[email protected]>
4;;; Copyright © 2016 David Craven <[email protected]>
5;;; Copyright © 2016, 2019, 2020, 2022 Marius Bakke <[email protected]>
6;;; Copyright © 2016, 2018, 2019, 2021 Efraim Flashner <[email protected]>
7;;; Copyright © 2017 Corentin Bocquillon <[email protected]>
8;;; Copyright © 2017 Gregor Giesen <[email protected]>
9;;; Copyright © 2017 Frederick M. Muriithi <[email protected]>
10;;; Copyright © 2017 Nikita <[email protected]>
11;;; Copyright © 2017–2019, 2022 Tobias Geerinckx-Rice <[email protected]>
12;;; Copyright © 2018 Joshua Sierles, Nextjournal <[email protected]>
13;;; Copyright © 2020 Martin Becze <[email protected]>
14;;; Copyright © 2020 Alexandros Theodotou <[email protected]>
15;;; Copyright © 2023 Alexey Abramov <[email protected]>
16;;; Copyright © 2023 Sharlatan Hellseher <[email protected]>
17;;; Copyright © 2023 Vinicius Monego <[email protected]>
18;;; Copyright © 2023-2024, 2026 Maxim Cournoyer <[email protected]>
19;;; Copyright © 2023 Zheng Junjie <[email protected]>
20;;; Copyright © 2024 Paul A. Patience <[email protected]>
21;;; Copyright © 2024 Arun Isaac <[email protected]>
22;;; Copyright © 2024 Wilko Meyer <[email protected]>
23;;; Copyright © 2024, 2025 David Elsing <[email protected]>
24;;; Copyright © 2025-2026 Hennadii Stepanov <[email protected]>
25;;; Copyright © 2025 Brendan Tildesley <[email protected]>
26;;; Copyright © 2026 Ashish SHUKLA <[email protected]>
27;;;
28;;; This file is part of GNU Guix.
29;;;
30;;; GNU Guix is free software; you can redistribute it and/or modify it
31;;; under the terms of the GNU General Public License as published by
32;;; the Free Software Foundation; either version 3 of the License, or (at
33;;; your option) any later version.
34;;;
35;;; GNU Guix is distributed in the hope that it will be useful, but
36;;; WITHOUT ANY WARRANTY; without even the implied warranty of
37;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38;;; GNU General Public License for more details.
39;;;
40;;; You should have received a copy of the GNU General Public License
41;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
42
43(define-module (gnu packages serialization)
44 #:use-module ((guix licenses) #:prefix license:)
45 #:use-module (guix packages)
46 #:use-module (guix gexp)
47 #:use-module (guix download)
48 #:use-module (guix hg-download)
49 #:use-module (guix git-download)
50 #:use-module (guix utils)
51 #:use-module (guix build-system cmake)
52 #:use-module (guix build-system copy)
53 #:use-module (guix build-system gnu)
54 #:use-module (guix build-system go)
55 #:use-module (guix build-system meson)
56 #:use-module (guix build-system pyproject)
57 #:use-module (guix build-system qt)
58 #:use-module (gnu packages)
59 #:use-module (gnu packages autotools)
60 #:use-module (gnu packages base)
61 #:use-module (gnu packages bash)
62 #:use-module (gnu packages boost)
63 #:use-module (gnu packages c)
64 #:use-module (gnu packages check)
65 #:use-module (gnu packages compression)
66 #:use-module (gnu packages databases)
67 #:use-module (gnu packages documentation)
68 #:use-module (gnu packages gcc)
69 #:use-module (gnu packages llvm)
70 #:use-module (gnu packages lua)
71 #:use-module (gnu packages pkg-config)
72 #:use-module (gnu packages python)
73 #:use-module (gnu packages python-build)
74 #:use-module (gnu packages python-check)
75 #:use-module (gnu packages python-science)
76 #:use-module (gnu packages python-xyz)
77 #:use-module (gnu packages pretty-print)
78 #:use-module (gnu packages qt)
79 #:use-module (gnu packages time)
80 #:use-module (gnu packages web))
81
82(define-public avro-cpp
83 (package
84 (name "avro-cpp")
85 (version "1.12.1")
86 (source (origin
87 (method url-fetch)
88 (uri (string-append
89 "mirror://apache/avro/avro-" version
90 "/avro-src-" version ".tar.gz"))
91 (sha256
92 (base32 "0bkd05q0pgir09ngyjrm4hhh9l5828xzrzd65salzw0dhp04g3i6"))))
93 (build-system cmake-build-system)
94 (arguments
95 (list #:phases
96 #~(modify-phases %standard-phases
97 (add-after 'unpack 'chdir
98 (lambda _ (chdir "lang/c++")))
99 (add-after 'chdir 'fix-dependencies
100 (lambda _
101 (substitute* "CMakeLists.txt"
102 (("^FetchContent_MakeAvailable\\(fmt\\)")
103 "find_package(fmt REQUIRED)")))))))
104 (inputs
105 (list boost-1.88 fmt snappy zlib))
106 (home-page "https://avro.apache.org/")
107 (synopsis "Data serialization system")
108 (description "Apache Avro is a data serialization system. Avro provides:
109@enumerate
110@item Rich data structures;
111@item a compact, fast, binary data format;
112@item a container file, to store persistent data;
113@item remote procedure call (RPC); and
114@item simple integration with dynamic languages.
115@end enumerate
116
117Code generation is not required to read or write data files nor to use or
118implement RPC protocols.")
119 (license license:asl2.0)))
120
121(define-public cereal
122 (package
123 (name "cereal")
124 (version "1.3.2")
125 (source
126 (origin
127 (method git-fetch)
128 (uri (git-reference
129 (url "https://github.com/USCiLab/cereal")
130 (commit (string-append "v" version))))
131 (file-name (git-file-name name version))
132 (sha256
133 (base32
134 "02sd90ynya7wg013zwzjr79fsv4bzqgfg9l2mapd4j38rv06gahx"))))
135 (build-system cmake-build-system)
136 (arguments
137 (list
138 #:configure-flags #~'("-DSKIP_PORTABILITY_TEST=ON"
139 ;; Don't bother building the sandbox examples.
140 "-DSKIP_PERFORMANCE_COMPARISON=ON"
141 "-DBUILD_SANDBOX=OFF")
142 #:phases
143 #~(modify-phases %standard-phases
144 (add-after 'install 'install-doc
145 (lambda _
146 (let ((doc (string-append #$output "/share/doc/html")))
147 (invoke "make" "doc")
148 (mkdir-p doc)
149 (copy-recursively "doc/html" doc)))))))
150 (native-inputs
151 (list doxygen))
152 (home-page "https://uscilab.github.io/cereal/")
153 (synopsis "C++11 library for serialization")
154 (description
155 "Cereal is a header-only C++11 serialization library. Cereal takes
156arbitrary data types and reversibly turns them into different representations,
157such as compact binary encodings, XML, or JSON.")
158 ;; Note: Cereal bundles forked versions of rapidxml and rapidjson
159 ;; (see include/cereal/external/), so list their licenses too.
160 (license (list license:bsd-3 ;Cereal itself
161 ;; The bundled RapidXML is dual Boost/Expat (users choice).
162 ;; RapidJSON is Expat licensed, and further bundles a
163 ;; stdint.h with BSD-3.
164 license:boost1.0 license:expat
165 ;; Finally, include/cereal/external/base64.hpp has a
166 ;; home-grown BSD-like license.
167 (license:non-copyleft
168 "file://include/cereal/external/LICENSE")))))
169
170(define-public msgpack-c
171 (package
172 (name "msgpack-c")
173 (version "6.0.0")
174 (source
175 (origin
176 (method url-fetch)
177 (uri
178 (string-append
179 "https://github.com/msgpack/msgpack-c/releases/download/"
180 "c-" version "/" name "-" version ".tar.gz"))
181 (sha256
182 (base32 "1fmf08babfsjq5qkgw034wk2nw6mayxp1qlkm7h55p2jqvigam1n"))
183 (snippet
184 '(let ((p (open-file "msgpack-c.pc.in" "a")))
185 (display "Requires: zlib\n" p)
186 (close-output-port p)))))
187 (build-system cmake-build-system)
188 (arguments (list #:configure-flags #~(list "-DMSGPACK_BUILD_TESTS=ON")))
189 (native-inputs (list googletest))
190 (propagated-inputs (list zlib)) ;zbuffer.h includes zlib.h
191 (home-page "https://www.msgpack.org")
192 (synopsis "Binary serialization library")
193 (description "Msgpack is a library for C that implements binary
194serialization.")
195 (license license:boost1.0)))
196
197(define-public msgpack-cxx
198 (package
199 (inherit msgpack-c)
200 (name "msgpack-cxx")
201 (version "7.0.0")
202 (source
203 (origin
204 (method url-fetch)
205 (uri
206 (string-append
207 "https://github.com/msgpack/msgpack-c/releases/download/"
208 "cpp-" version "/" name "-" version ".tar.gz"))
209 (sha256
210 (base32 "0vqmpdwsrfjavbkhqy38ax1zpcbz3cg98kwxab70543vgspvf13m"))))
211 (build-system cmake-build-system)
212 (propagated-inputs (list boost zlib)) ;included in headers
213 (description "Msgpack is a library for C++ that implements binary
214serialization.")))
215
216(define-public libmpack
217 (package
218 (name "libmpack")
219 (version "1.0.5")
220 (source
221 (origin
222 (method git-fetch)
223 (uri (git-reference
224 (url "https://github.com/tarruda/libmpack")
225 (commit version)))
226 (file-name (git-file-name name version))
227 (sha256
228 (base32 "0rai5djdkjz7bsn025k5489in7r1amagw1pib0z4qns6b52kiar2"))))
229 (build-system gnu-build-system)
230 (arguments
231 `(#:test-target "test"
232 #:make-flags
233 (list "CC=gcc"
234 (string-append "PREFIX=" (assoc-ref %outputs "out")))
235 #:phases
236 (modify-phases %standard-phases
237 (delete 'configure))))
238 (native-inputs
239 (list libtool))
240 (home-page "https://github.com/tarruda/libmpack")
241 (synopsis "Small binary serialization library")
242 (description "Libmpack is a small binary serialization and RPC library
243that implements both the msgpack and msgpack-rpc specifications.")
244 (license license:expat)))
245
246(define-public lua-libmpack
247 (package (inherit libmpack)
248 (name "lua-libmpack")
249 (version "1.0.8")
250 (source
251 (origin
252 (method git-fetch)
253 (uri (git-reference
254 (url "https://github.com/libmpack/libmpack-lua")
255 (commit version)))
256 (file-name (git-file-name name version))
257 (sha256
258 (base32 "1ijvzgq5hvib03w5rghv31wi7byamwg7qdx5pawvhvnflaii8ivw"))))
259 (build-system gnu-build-system)
260 (arguments
261 `(;; FIXME: tests require "busted", which is not yet available in Guix.
262 #:tests? #f
263 #:test-target "test"
264 #:make-flags
265 (let* ((lua-version ,(package-version lua))
266 (lua-major+minor ,(version-major+minor (package-version lua))))
267 (list "CC=gcc"
268 "FETCH=echo" ; don't fetch anything from the web
269 "UNTGZ=echo" ; and don't try to unpack it
270 "USE_SYSTEM_LUA=yes"
271 (string-append "MPACK_LUA_VERSION=" lua-version)
272 (string-append "MPACK_LUA_VERSION_NOPATCH=" lua-major+minor)
273 (string-append "PREFIX="
274 (assoc-ref %outputs "out"))
275 (string-append "LUA_CMOD_INSTALLDIR="
276 (assoc-ref %outputs "out")
277 "/lib/lua/" lua-major+minor)))
278 #:phases
279 (modify-phases %standard-phases
280 (delete 'configure)
281 (add-after 'unpack 'unpack-mpack-sources
282 (lambda* (#:key inputs #:allow-other-keys)
283 ;; This is broken because mpack-src is not a file, but all
284 ;; prerequisites are added to the inputs of the gcc invocation.
285 (substitute* "Makefile"
286 (("\\$\\(MPACK\\): mpack-src") "$(MPACK): "))
287 (copy-recursively (assoc-ref inputs "libmpack")
288 "mpack-src")
289 #t)))))
290 (inputs
291 (list lua))
292 (native-inputs
293 `(("pkg-config" ,pkg-config)
294 ("libmpack" ,(package-source libmpack))))
295 (home-page "https://github.com/libmpack/libmpack-lua")
296 (synopsis "Lua bindings for the libmpack binary serialization library")))
297
298(define-public lua5.1-libmpack
299 (package/inherit lua-libmpack
300 (name "lua5.1-libmpack")
301 (arguments
302 (substitute-keyword-arguments arguments
303 ((#:make-flags flags)
304 `(let* ((lua-version ,(package-version lua-5.1))
305 (lua-major+minor ,(version-major+minor (package-version lua-5.1))))
306 (list "CC=gcc"
307 "USE_SYSTEM_LUA=yes"
308 (string-append "MPACK_LUA_VERSION=" lua-version)
309 (string-append "MPACK_LUA_VERSION_NOPATCH=" lua-major+minor)
310 (string-append "PREFIX="
311 (assoc-ref %outputs "out"))
312 (string-append "LUA_CMOD_INSTALLDIR="
313 (assoc-ref %outputs "out")
314 "/lib/lua/" lua-major+minor))))))
315 (inputs
316 `(("lua" ,lua-5.1)))))
317
318(define-public lua5.2-libmpack
319 (package/inherit lua-libmpack
320 (name "lua5.2-libmpack")
321 (arguments
322 (substitute-keyword-arguments arguments
323 ((#:make-flags flags)
324 `(let* ((lua-version ,(package-version lua-5.2))
325 (lua-major+minor ,(version-major+minor (package-version lua-5.2))))
326 (list "CC=gcc"
327 "USE_SYSTEM_LUA=yes"
328 (string-append "MPACK_LUA_VERSION=" lua-version)
329 (string-append "MPACK_LUA_VERSION_NOPATCH=" lua-major+minor)
330 (string-append "PREFIX="
331 (assoc-ref %outputs "out"))
332 (string-append "LUA_CMOD_INSTALLDIR="
333 (assoc-ref %outputs "out")
334 "/lib/lua/" lua-major+minor))))))
335 (inputs
336 `(("lua" ,lua-5.2)))))
337
338(define-public libcsv
339 (package
340 (name "libcsv")
341 (version "3.0.3")
342 (source (origin
343 (method url-fetch)
344 (uri (string-append "mirror://sourceforge/libcsv/libcsv/libcsv-"
345 version "/libcsv-" version ".tar.gz"))
346 (sha256
347 (base32
348 "1r6pxdxrc3vfil1f9ng1dblm82asdqz6hkz7dj4vkkh3p0f47h6r"))))
349 (build-system gnu-build-system)
350 (home-page "http://sourceforge.net/projects/libcsv/")
351 (synopsis "CSV parser and writer library")
352 (description
353 "This package provides a C library for parsing and writing CSV data.")
354 (license license:lgpl2.1+)))
355
356(define-public qtcsv
357 (package
358 (name "qtcsv")
359 (version "1.7")
360 (source (origin
361 (method git-fetch)
362 (uri (git-reference
363 (url "https://github.com/iamantony/qtcsv")
364 (commit (string-append "v" version))))
365 (file-name (git-file-name name version))
366 (sha256
367 (base32
368 "1c9i93kr7wvpr01i4wixi9mf991nd3k2adg5fy0vxwwlvvc7dgdw"))))
369 (build-system qt-build-system)
370 (arguments
371 (list #:modules '((guix build cmake-build-system)
372 (guix build qt-build-system)
373 ((guix build gnu-build-system) #:prefix gnu:)
374 (guix build utils))
375 #:qtbase qtbase
376 #:phases
377 #~(modify-phases %standard-phases
378 (replace 'check
379 (lambda* (#:rest args)
380 (apply (assoc-ref gnu:%standard-phases 'check)
381 #:test-target "tests" args))))))
382 (home-page "https://github.com/iamantony/qtcsv")
383 (synopsis "Library for reading and writing CSV files in Qt")
384 (description
385 "@code{qtcsv} is a library for reading and writing
386@acronym{CSV,comma-seperated values} files in Qt.")
387 (license license:expat)))
388
389(define-public libscfg
390 (package
391 (name "libscfg")
392 (version "0.2.0")
393 (home-page "https://codeberg.org/emersion/libscfg")
394 (source
395 (origin
396 (method git-fetch)
397 (uri (git-reference
398 (url "https://codeberg.org/emersion/libscfg")
399 (commit (string-append "v" version))))
400 (file-name (git-file-name name version))
401 (sha256
402 (base32 "05csd5923yc6yknyvyr95wkhway65app69a3w5c0mmk61wf42sk5"))))
403 (build-system meson-build-system)
404 (synopsis "Scfg library written in C")
405 (description
406 "This package provides a C library for parsing
407@uref{https://git.sr.ht/~emersion/scfg, scfg}, a simple configuration file
408format with one directive per line.")
409 (license license:expat)))
410
411(define-public libyaml
412 (package
413 (name "libyaml")
414 (version "0.2.5")
415 (source
416 (origin
417 (method url-fetch)
418 (uri (string-append "https://pyyaml.org/download/libyaml/yaml-"
419 version ".tar.gz"))
420 (sha256
421 (base32
422 "1x4fcw13r3lqy8ndydr3ili87wicplw2awbcv6r21qgyfndswhn6"))))
423 (build-system gnu-build-system)
424 (arguments
425 '(#:configure-flags '("--disable-static")))
426 (home-page "https://pyyaml.org/wiki/LibYAML")
427 (synopsis "YAML 1.1 parser and emitter written in C")
428 (description
429 "LibYAML is a YAML 1.1 parser and emitter written in C.")
430 (license license:expat)))
431
432(define-public libyaml+static
433 (package
434 (inherit libyaml)
435 (name "libyaml+static")
436 (arguments
437 '(#:configure-flags '("--enable-static")))))
438
439(define-public libcyaml
440 (package
441 (name "libcyaml")
442 (version "1.3.1")
443 (source
444 (origin
445 (method git-fetch)
446 (uri (git-reference
447 (url "https://github.com/tlsa/libcyaml")
448 (commit (string-append "v" version))))
449 (file-name (git-file-name name version))
450 (patches (search-patches "libcyaml-libyaml-compat.patch"))
451 (sha256
452 (base32 "0gvf3h8r8300wdwfjgxw3nzlj7w14q63m67p8wdm5fvpha017n4y"))))
453 (build-system gnu-build-system)
454 (arguments
455 `(#:test-target "test"
456 #:make-flags
457 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
458 (string-append "CC=" ,(cc-for-target)))
459 #:phases
460 (modify-phases %standard-phases
461 (delete 'configure)))) ; no configure script
462 (inputs
463 (list libyaml))
464 (native-inputs
465 (list pkg-config))
466 (synopsis "C library for reading and writing YAML")
467 (description
468 "LibCYAML is a C library written in ISO C11 for reading and writing
469structured YAML documents. The fundamental idea behind CYAML is to allow
470applications to construct schemas which describe both the permissible
471structure of the YAML documents to read/write, and the C data structure(s)
472in which the loaded data is arranged in memory.")
473 (home-page "https://github.com/tlsa/libcyaml")
474 (license license:isc)))
475
476(define-public libfyaml
477 (package
478 (name "libfyaml")
479 (version "0.9.6")
480 (source
481 (origin
482 (method git-fetch)
483 (uri (git-reference
484 (url "https://github.com/pantoniou/libfyaml")
485 (commit (string-append "v" version))))
486 (file-name (git-file-name name version))
487 (sha256
488 (base32 "1hrp1vaa1f192krrvkmmfr9rsladzpm5jgxjzpnx5hkrw9xi054r"))
489 (patches (search-patches "libfyaml-vlsize-32bit-fixes.patch"))))
490 (build-system gnu-build-system)
491 (native-inputs
492 (list autoconf
493 automake
494 libtool
495 pkg-config))
496 (home-page "https://github.com/pantoniou/libfyaml")
497 (synopsis "YAML version 1.2 and JSON parser and writer")
498 (description "Libfyaml is a YAML parser and emitter, supporting the latest
499YAML spec and passing the full YAML testsuite. It is designed to be very
500efficient, avoiding copies of data, and has no artificial limits like the 1024
501character limit for implicit keys.")
502 (license license:expat)))
503
504(define-public yaml-cpp
505 (package
506 (name "yaml-cpp")
507 (version "0.9.0")
508 (source
509 (origin
510 (method git-fetch)
511 (uri (git-reference
512 (url "https://github.com/jbeder/yaml-cpp")
513 (commit (string-append name "-" version))))
514 (modules '((guix build utils)))
515 (snippet #~(delete-file-recursively "test/googletest-1.13.0"))
516 (file-name (git-file-name name version))
517 (sha256
518 (base32 "0v44chsa2gmc2kknhnyxlmh25fflpknxqc6iyrh1vqiq0qysqlzq"))))
519 (build-system cmake-build-system)
520 (arguments
521 (list #:configure-flags #~(list "-DYAML_BUILD_SHARED_LIBS=ON"
522 "-DYAML_CPP_BUILD_TESTS=ON"
523 "-DYAML_USE_SYSTEM_GTEST=ON")))
524 (native-inputs (list python))
525 (inputs (list googletest-1.8))
526 (home-page "https://github.com/jbeder/yaml-cpp")
527 (synopsis "YAML parser and emitter in C++")
528 (description "YAML parser and emitter in C++ matching the YAML 1.2 spec.")
529 (license license:bsd-3)))
530
531(define-public jsoncpp
532 (package
533 (name "jsoncpp")
534 (version "1.9.6")
535 (home-page "https://github.com/open-source-parsers/jsoncpp")
536 (source (origin
537 (method git-fetch)
538 (uri (git-reference (url home-page) (commit version)))
539 (file-name (git-file-name name version))
540 (sha256
541 (base32
542 "070xg4i52z3yv5b9bw5k95qskw0daivh0njka87mzj0d3zf1qsyy"))))
543 (build-system meson-build-system)
544 (synopsis "C++ library for interacting with JSON")
545 (description "JsonCpp is a C++ library that allows manipulating JSON values,
546including serialization and deserialization to and from strings. It can also
547preserve existing comment in unserialization/serialization steps, making
548it a convenient format to store user input files.")
549 (license license:expat)))
550
551(define-public jsoncpp/pinned
552 (hidden-package
553 ;; Version that rarely changes, depended on by CMake.
554 (package/inherit jsoncpp
555 (version "1.9.6")
556 (source
557 (origin
558 (method git-fetch)
559 (uri (git-reference (url (package-home-page jsoncpp)) (commit version)))
560 (file-name (git-file-name (package-name jsoncpp) version))
561 (sha256
562 (base32
563 "070xg4i52z3yv5b9bw5k95qskw0daivh0njka87mzj0d3zf1qsyy")))))))
564
565(define-public json.sh
566 (let ((commit "0d5e5c77365f63809bf6e77ef44a1f34b0e05840") ;no releases
567 (revision "1"))
568 (package
569 (name "json.sh")
570 (version (git-version "0.0.0" revision commit))
571 (source
572 (origin
573 (method git-fetch)
574 (uri (git-reference
575 (url "https://github.com/dominictarr/JSON.sh")
576 (commit commit)))
577 (file-name (git-file-name name version))
578 (sha256
579 (base32
580 "14lxvp5xbdk0dcwkjbdp098z1108j8z48zaibndh4i731kkcz43i"))))
581 (build-system copy-build-system)
582 (arguments
583 `(#:install-plan '(("JSON.sh" "bin/"))
584 #:phases
585 (modify-phases %standard-phases
586 (add-before 'install 'check
587 (lambda* (#:key tests? #:allow-other-keys)
588 (when tests? (invoke "./all-tests.sh"))
589 #t))
590 (add-after 'install 'wrap-program
591 (lambda* (#:key inputs outputs #:allow-other-keys)
592 (wrap-program (string-append (assoc-ref outputs "out") "/bin/JSON.sh")
593 `("PATH" ":" prefix
594 (,(string-join
595 (map (lambda (in) (string-append (assoc-ref inputs in) "/bin"))
596 '("grep" "sed"))
597 ":"))))
598 #t)))))
599 (inputs
600 (list bash-minimal grep sed))
601 (synopsis "Pipeable JSON parser written in shell")
602 (description
603 "This package provides a JSON parser written in shell, compatible with
604ash, Bash, Dash and Zsh. Pipe JSON to it, and it traverses the JSON objects
605and prints out the path to the current object (as a JSON array) and then the
606object, without whitespace.")
607 (home-page "https://github.com/dominictarr/JSON.sh")
608 (license (list license:expat license:asl2.0))))) ;dual-licensed
609
610(define-public ckdl
611 (package
612 (name "ckdl")
613 (version "1.0")
614 (source
615 (origin
616 (method git-fetch)
617 (uri (git-reference
618 (url "https://github.com/tjol/ckdl")
619 (commit version)))
620 (file-name (git-file-name name version))
621 (sha256
622 (base32 "0dj6kjc7shs3sq6xj3mhpc2wzj4sg3iwg86mk4p9yh8l79kx2ix8"))))
623 (build-system cmake-build-system)
624 (arguments
625 (list #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON"
626 "-DDOWNLOAD_TEST_DATA=OFF")))
627 (home-page "https://ckdl.readthedocs.io/en/latest/")
628 (synopsis "C library for parsing and emitting KDL")
629 (description "@samp{ckdl} is a C library for parsing and emitting KDL.
630This package also provides @samp{kdlpp}, a C++20 wrapper around @samp{ckdl}.")
631 (license license:expat)))
632
633(define-public python-ckdl
634 (package/inherit ckdl
635 (name "python-ckdl")
636 (build-system pyproject-build-system)
637 (arguments
638 (list #:test-backend #~'custom
639 #:test-flags #~(list "bindings/python/tests/ckdl_test.py")))
640 (native-inputs
641 (list python-cython
642 python-scikit-build
643 python-setuptools))
644 (synopsis "Python library for parsing and emitting KDL")))
645
646(define-public capnproto
647 (package
648 (name "capnproto")
649 (version "1.5.0")
650 (source
651 (origin
652 (method git-fetch)
653 (uri (git-reference
654 (url "https://github.com/capnproto/capnproto")
655 (commit (string-append "v" version))))
656 (file-name (git-file-name name version))
657 (sha256
658 (base32 "0p6zb9icy2cjj6y8bj2ai7csghak5aix8wld3jhvddf00diwb7fq"))))
659 (build-system cmake-build-system)
660 (arguments
661 (list
662 #:configure-flags
663 #~(list "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
664 #:phases
665 #~(modify-phases %standard-phases
666 (add-before 'check 'use-tmp-for-temporary-files
667 (lambda _
668 ;; Use TMPDIR for temporary files, as the default /var/tmp directory
669 ;; doesn't exist.
670 (setenv "TEST_TMPDIR"
671 (getenv "TMPDIR")))))))
672 (home-page "https://capnproto.org")
673 (synopsis "Capability-based RPC and serialization system")
674 (description
675 "Cap'n Proto is a very fast data interchange format and capability-based
676RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster.")
677 (license license:expat)))
678
679(define-public capnproto-clang
680 (package/inherit capnproto
681 (name "capnproto-clang")
682 (arguments
683 (substitute-keyword-arguments arguments
684 ((#:configure-flags flags #~'())
685 #~(cons* "-DCMAKE_C_COMPILER=clang"
686 "-DCMAKE_CXX_COMPILER=clang++"
687 "-DCMAKE_CXX_FLAGS=-std=c++20"
688 #$flags))))
689 (native-inputs
690 (modify-inputs native-inputs
691 (prepend clang
692 lld
693 llvm)))))
694
695(define-public python-msgspec
696 (package
697 (name "python-msgspec")
698 (version "0.20.0")
699 (source
700 (origin
701 (method git-fetch)
702 (uri (git-reference
703 (url "https://github.com/jcrist/msgspec")
704 (commit version)))
705 (file-name (git-file-name name version))
706 (modules '((guix build utils)))
707 (snippet
708 #~(begin
709 ;; Delete autogenerated file, regenerate in a phase.
710 (delete-file "src/msgspec/atof_consts.h")
711 ;; See: <https://github.com/jcrist/msgspec/pull/981>.
712 (substitute* "scripts/generate_atof_consts.py"
713 (("os.path.join\\(repo, " all)
714 (string-append all "\"src\", ")))))
715 (sha256
716 (base32 "1nbaqdyn71zcqj3wj33xw90spm9s93c7qmfkjwbnmmx85ffycq0d"))))
717 (build-system pyproject-build-system)
718 (arguments
719 (list
720 #:test-flags
721 ;; .pytest.toml declares testpaths = ["tests/unit", "tests/typing"]
722 ;; so --ignore=tests/typing will not work.
723 #~(list "tests/unit")
724 #:phases
725 #~(modify-phases %standard-phases
726 (add-after 'unpack 'atof-consts
727 (lambda _
728 (with-directory-excursion "scripts"
729 ;; Regenerate the autogenerated file.
730 (invoke "python" "generate_atof_consts.py")))))))
731 (native-inputs
732 (list python-attrs
733 python-msgpack
734 python-pytest
735 python-setuptools
736 python-setuptools-scm))
737 (propagated-inputs
738 (list python-pyyaml
739 python-tomli
740 python-tomli-w))
741 (home-page "https://jcristharif.com/msgspec/")
742 (synopsis "Fast serialization/validation library")
743 (description "@code{msgspec} is a fast serialization and validation
744library, with builtin support for JSON, MessagePack, YAML, and TOML. It
745includes the following features:
746
747@itemize
748@item High performance encoders/decoders for common protocols.
749@item Support for a wide variety of Python types.
750@item Zero-cost schema validation using familiar Python type annotations.
751@item A speedy Struct type for representing structured data.
752@end itemize")
753 (license license:bsd-3)))
754
755(define-public python-ruamel.yaml
756 (package
757 ;; TODO: Fix package name.
758 (name "python-ruamel.yaml")
759 (version "0.18.14")
760 (source
761 (origin
762 (method url-fetch)
763 (uri (pypi-uri "ruamel.yaml" version))
764 (sha256
765 (base32
766 "1dsj3zcb5p73p2xpimdig45hrcvjgnzyyc37jcaxyr63mrmbf9vj"))))
767 (build-system pyproject-build-system)
768 (arguments (list #:tests? #f)) ;no tests in PyPI archive
769 (native-inputs
770 (list python-setuptools))
771 (propagated-inputs
772 (list python-ruamel.yaml.clib))
773 (home-page "https://sourceforge.net/projects/ruamel-yaml/")
774 (synopsis "YAML 1.2 parser/emitter")
775 (description
776 "This package provides YAML parser/emitter that supports roundtrip
777preservation of comments, seq/map flow style, and map key order. It
778is a derivative of Kirill Simonov’s PyYAML 3.11. It supports YAML 1.2
779and has round-trip loaders and dumpers. It supports comments. Block
780style and key ordering are kept, so you can diff the source.")
781 (license license:expat)))
782
783(define-public python-ruamel.yaml.string
784 (package
785 (name "python-ruamel.yaml.string")
786 (version "0.1.1")
787 (source
788 (origin
789 (method url-fetch)
790 (uri (pypi-uri "ruamel.yaml.string" version))
791 (sha256
792 (base32 "0l23g04mfhaqrrbcxx2id08gpgjf8xc6yxcbsc2c0iax0p6fsyks"))))
793 (build-system pyproject-build-system)
794 (arguments (list #:tests? #f)) ;no tests
795 (propagated-inputs (list python-ruamel.yaml))
796 (native-inputs (list python-setuptools))
797 (home-page "https://sourceforge.net/projects/ruamel-yaml-string/")
798 (synopsis "Dump to string methods for ruamel.yaml")
799 (description
800 "This package provides two dump_to_string/dumps methods that returns YAML
801document as string.")
802 (license license:expat)))
803
804(define-public python-ruamel.yaml-0.16
805 (package
806 (inherit python-ruamel.yaml)
807 (version "0.16.13")
808 (source
809 (origin
810 (method url-fetch)
811 (uri (pypi-uri "ruamel.yaml" version))
812 (sha256
813 (base32
814 "0hm9yg785f46bkrgqknd6fdvmkby9dpzjnm0b63qf0i748acaj5v"))))
815 (arguments
816 `(;; TODO: Tests require packaging "ruamel.std.pathlib".
817 #:tests? #f))))
818
819(define-public python-ruamel.yaml.clib
820 (package
821 ;; TODO: Fix the name
822 (name "python-ruamel.yaml.clib")
823 (version "0.2.12")
824 (source
825 (origin
826 ;; pypi release code has cythonized code without corresponding source.
827 (method hg-fetch)
828 (uri (hg-reference
829 (url "http://hg.code.sf.net/p/ruamel-yaml-clib/code")
830 (changeset version)))
831 (file-name (hg-file-name name version))
832 (sha256
833 (base32
834 "12ixp46706pl911f6i4wmik8x0j9vnxy2cqx65ixbdl9cnvqva2l"))
835 (modules '((guix build utils)))
836 (snippet
837 '(begin
838 (delete-file "_ruamel_yaml.c")))))
839 (build-system pyproject-build-system)
840 (arguments
841 `(#:tests? #f ; This package is split from python-ruamel.yaml and
842 ; depends on modules from it for the test suite.
843 #:phases
844 (modify-phases %standard-phases
845 (delete 'sanity-check) ; Depends on python-ruamel.yaml
846 (add-after 'ensure-no-cythonized-files 'cythonize-code
847 (lambda _
848 (invoke "cython" "_ruamel_yaml.pyx"))))))
849 (native-inputs
850 (list python-cython python-setuptools))
851 (home-page "https://sourceforge.net/p/ruamel-yaml-clib/code/ci/default/tree")
852 (synopsis "C version of reader, parser and emitter for ruamel.yaml")
853 (description
854 "This package provides a C version of the reader, parser and emitter for
855@code{ruamel.yaml} derived from libyaml.")
856 (license license:expat)))
857
858(define-public python-strictyaml
859 (package
860 (name "python-strictyaml")
861 (version "1.7.3")
862 (source
863 (origin
864 (method url-fetch)
865 (uri (pypi-uri "strictyaml" version))
866 (sha256
867 (base32 "01y4hrakk1psdj6ir5k70apqkjjipvja0c40pbfvahmbzjjm9y12"))
868 (modules '((guix build utils)))
869 (snippet
870 #~(begin
871 ;; Unbundle ruamel.
872 (delete-file-recursively "strictyaml/ruamel")))))
873 (build-system pyproject-build-system)
874 (arguments
875 (list
876 ;; XXX: Tests require running Docker and an external test framework,
877 ;; see: <https://github.com/crdoconnor/strictyaml/blob/1.7.3/key.sh>
878 #:tests? #f
879 #:phases
880 #~(modify-phases %standard-phases
881 (add-after 'unpack 'remove-bundled-ruamel
882 (lambda _
883 (substitute* "pyproject.toml"
884 ((", \"strictyaml.ruamel\"")
885 "")
886 (("\"python-dateutil>=2.6.0\"" dateutils)
887 (string-append dateutils ", \"ruamel.yaml\"")))
888 (substitute* "strictyaml/parser.py"
889 (("from strictyaml import ruamel")
890 "import ruamel.yaml"))
891 (substitute* (find-files "." "\\.py$")
892 (("from strictyaml.ruamel")
893 "from ruamel.yaml")))))))
894 (native-inputs
895 (list python-setuptools))
896 (propagated-inputs
897 (list python-dateutil
898 python-ruamel.yaml-0.16))
899 (home-page "https://hitchdev.com/strictyaml/")
900 (synopsis "Strict, typed YAML parser")
901 (description "StrictYAML is a type-safe YAML parser that parses and
902validates a restricted subset of the YAML specification.")
903 (license license:expat)))
904
905(define-public python-cbor
906 (package
907 (name "python-cbor")
908 (version "1.0.0")
909 (source
910 (origin
911 (method url-fetch)
912 (uri (pypi-uri "cbor" version))
913 (sha256
914 (base32
915 "1dmv163cnslyqccrybkxn0c9s1jk1mmafmgxv75iamnz5lk5l8hk"))))
916 (build-system pyproject-build-system)
917 (arguments
918 (list
919 ;; Tests are broken upstrea, see <https://github.com/brianolson/cbor_py/issues/6>.
920 #:tests? #f))
921 (native-inputs
922 (list python-setuptools))
923 (home-page "https://github.com/brianolson/cbor_py")
924 (synopsis "Implementation of the Concise Binary Object Representation")
925 (description
926 "Python-cbor provides an implementation of the Concise Binary Object
927Representation (@dfn{CBOR}). CBOR is comparable to JSON, has a superset of
928JSON's ability, but serializes to a binary format which is smaller and faster
929to generate and parse. The two primary functions are @code{cbor.loads} and
930@code{cbor.dumps}.")
931 (license license:asl2.0)))
932
933(define-public flatbuffers
934 ;; python-flatbuffers inherits version of flatbuffers, make sure to refresh
935 ;; hash after update it here.
936 (package
937 (name "flatbuffers")
938 (version "25.2.10")
939 (source
940 (origin
941 (method git-fetch)
942 (uri (git-reference
943 (url "https://github.com/google/flatbuffers")
944 (commit (string-append "v" version))))
945 (file-name (git-file-name "flatbuffers" version))
946 (sha256
947 (base32 "1wcpaj4k9dwccb752pl8p54pqwajr51sxjym32q2bpm9ny6ib45v"))))
948 (build-system cmake-build-system)
949 (arguments
950 (list
951 #:build-type "Release"
952 #:configure-flags
953 #~(list "-DFLATBUFFERS_BUILD_SHAREDLIB=ON"
954 (string-append "-DCMAKE_INSTALL_LIBDIR=" #$output "/lib"))
955 #:phases
956 #~(modify-phases %standard-phases
957 (add-after 'unpack 'make-writable
958 (lambda _ (for-each make-file-writable (find-files ".")))))))
959 (home-page "https://google.github.io/flatbuffers/")
960 (synopsis "Memory-efficient serialization library")
961 (description
962 "FlatBuffers is a cross-platform serialization library for C++,C#, C, Go,
963Java, JavaScript, PHP, and Python. It was originally created for game
964development and other performance-critical applications.")
965 (license license:asl2.0)))
966
967(define-public flatbuffers-23.5
968 (hidden-package
969 (package
970 (inherit flatbuffers)
971 ;; needed explicitly by onnxruntime and [email protected]
972 (version "23.5.26")
973 (source
974 (origin
975 (method git-fetch)
976 (uri (git-reference
977 (url "https://github.com/google/flatbuffers")
978 (commit (string-append "v" version))))
979 (file-name (git-file-name "flatbuffers" version))
980 (sha256
981 (base32 "0cd12dvkzqdafz46q4302mzgpzbz589zmmiga7bq07f2sqy4vrvv"))))
982 (arguments
983 (substitute-keyword-arguments arguments
984 ((#:configure-flags flags #~'())
985 #~(append #$flags '("-DCMAKE_POSITION_INDEPENDENT_CODE=ON"))))))))
986
987(define-public go-github-com-google-flatbuffers
988 (package/inherit flatbuffers
989 (name "go-github-com-google-flatbuffers")
990 (build-system go-build-system)
991 (arguments
992 (list
993 #:skip-build? #t
994 #:tests? #f
995 #:import-path "github.com/google/flatbuffers"))))
996
997(define-public python-flatbuffers
998 ;; TODO: Build from source the same way as go-github-com-google-flatbuffers.
999 (package
1000 (name "python-flatbuffers")
1001 (version (package-version flatbuffers))
1002 (source
1003 (origin
1004 (method url-fetch)
1005 (uri (pypi-uri "flatbuffers" version))
1006 (sha256
1007 (base32 "0vnj03mr5bx421j9djyq0g61ad0k6v45qaflkf6jy9j1g8vm3r4p"))))
1008 (build-system pyproject-build-system)
1009 ;; XXX: No tests on Pypi. Even in the upstream repository, it's unclear
1010 ;; if there is a way to run tests for the python library only.
1011 (arguments (list #:tests? #f))
1012 (native-inputs (list python-setuptools))
1013 (home-page "https://flatbuffers.dev")
1014 (synopsis "FlatBuffers serialization for Python")
1015 (description
1016 "This package provides the @code{FlatBuffers} serialization format for
1017Python.")
1018 (license license:asl2.0)))
1019
1020(define-public python-feather-format
1021 (package
1022 (name "python-feather-format")
1023 (version "0.4.1")
1024 (source
1025 (origin
1026 (method url-fetch)
1027 (uri (pypi-uri "feather-format" version))
1028 (sha256
1029 (base32 "00w9hwz7sj3fkdjc378r066vdy6lpxmn6vfac3qx956k8lvpxxj5"))))
1030 (build-system pyproject-build-system)
1031 (arguments
1032 (list #:tests? #f)) ;no tests in PyPI or Git
1033 (native-inputs
1034 (list python-setuptools))
1035 (propagated-inputs
1036 (list python-pandas
1037 python-pyarrow))
1038 (home-page "https://github.com/wesm/feather")
1039 (synopsis "Python wrapper to the Feather file format")
1040 (description "This package provides a Python wrapper library to the
1041Apache Arrow-based Feather binary columnar serialization data frame format.")
1042 (license license:asl2.0)))
1043
1044(define-public libnop
1045 (let ((commit "35e800d81f28c632956c5a592e3cbe8085ecd430")
1046 (revision "0"))
1047 (package
1048 (name "libnop")
1049 (version (git-version "0" revision commit))
1050 (source (origin
1051 (method git-fetch)
1052 (uri (git-reference
1053 (url "https://github.com/google/libnop")
1054 (commit commit)))
1055 (file-name (git-file-name name version))
1056 (sha256
1057 (base32
1058 "0qqbaljq54qiq0dky9nj47igfcs065ry526jg9a0aafbfl9krpy2"))))
1059 (build-system gnu-build-system)
1060 (arguments
1061 (list
1062 #:test-target "test"
1063 #:phases
1064 #~(modify-phases %standard-phases
1065 (delete 'configure)
1066 (replace 'check
1067 (lambda* (#:key tests? #:allow-other-keys)
1068 (when tests?
1069 (invoke "out/test"))))
1070 (replace 'install
1071 (lambda _
1072 (copy-recursively
1073 "include" (string-append #$output "/include")))))))
1074 (native-inputs (list googletest-1.12))
1075 (home-page "https://github.com/google/libnop")
1076 (synopsis "C++ Native Object Protocols")
1077 (description "@code{libnop} is a header-only library for serializing and
1078deserializing C++ data types without external code generators or runtime
1079support libraries.")
1080 (license license:asl2.0))))
1081
1082(define-public valijson
1083 (package
1084 (name "valijson")
1085 (version "1.0.2")
1086 (source (origin
1087 (method git-fetch)
1088 (uri (git-reference
1089 (url "https://github.com/tristanpenman/valijson")
1090 (commit (string-append "v" version))))
1091 (file-name (git-file-name name version))
1092 (sha256
1093 (base32
1094 "1ai6bj6mxd12mpvf1xwlad2vic5lsqy44adilp17wa7dq275vwf2"))))
1095 (build-system cmake-build-system)
1096 ;; The test suite is disabled as it requires Boost, Qt 5, Poco as well as
1097 ;; other bundled libraries.
1098 (arguments (list #:tests? #f))
1099 (home-page "https://github.com/tristanpenman/valijson")
1100 (synopsis "JSON schema validation C++ header-only library")
1101 (description "Valijson is a header-only JSON Schema validation library for
1102C++11. It provides a simple validation API that allows loading JSON Schemas,
1103and validate documents loaded by one of several supported parser libraries.")
1104 (license license:bsd-2)))
1105
1106(define-public libvarlink
1107 (package
1108 (name "libvarlink")
1109 (version "24")
1110 (source
1111 (origin
1112 (method git-fetch)
1113 (uri (git-reference
1114 (url "https://github.com/varlink/libvarlink")
1115 (commit version)))
1116 (file-name (git-file-name name version))
1117 (sha256
1118 (base32 "098jw9h48p2py6lwxyjrlzvv9zqvqgfsxc4pddfsviab65n9n5gw"))))
1119 (build-system meson-build-system)
1120 (native-inputs
1121 (list python-minimal
1122 glibc-utf8-locales)) ;needed for unit tests
1123 (arguments
1124 (list
1125 #:phases #~(modify-phases %standard-phases
1126 (add-after 'unpack 'patch-/bin/sh
1127 (lambda _
1128 (substitute* "lib/meson.build"
1129 (("/bin/sh")
1130 (which "sh")))))
1131 (add-after 'unpack 'patch-/usr/bin/env
1132 (lambda _
1133 (substitute* "varlink-wrapper.py"
1134 (("/usr/bin/env")
1135 (which "env"))))))))
1136 (home-page "https://varlink.org/")
1137 (synopsis "Varlink C IPC library and command line tool")
1138 (description
1139 "This package provides the C implementation of the varlink
1140interface description protocol and its associated command line tool")
1141 (license license:asl2.0)))
1142
1143(define-public python-rencode
1144 (package
1145 (name "python-rencode")
1146 (version "1.0.8")
1147 (source
1148 (origin
1149 (method git-fetch) ;no tests in PyPI archive
1150 (uri (git-reference
1151 (url "https://github.com/aresch/rencode")
1152 (commit (string-append "v" version))))
1153 (file-name (git-file-name name version))
1154 (sha256
1155 (base32 "1dicbm8gdii2bjp85s2p4pnclf25k9x4b4kaj80y8ddhh87glrlk"))))
1156 (build-system pyproject-build-system)
1157 (arguments
1158 (list
1159 #:phases
1160 #~(modify-phases %standard-phases
1161 (add-after 'unpack 'disable-native-optimization
1162 (lambda _
1163 (substitute* "build.py"
1164 (("^COMPILE_ARGS.*")
1165 "COMPILE_ARGS: list[str] = []\n")))))))
1166 (native-inputs
1167 ;; XXX: Borrow the same hack to make --tune work from python-pyscf to fix
1168 ;; guix build: error: failed to determine which compiler is used
1169 (list (canonical-package gcc)
1170 python-cython
1171 python-pytest
1172 python-poetry-core
1173 python-setuptools))
1174 (home-page "https://github.com/aresch/rencode")
1175 (synopsis "Serialization of heterogeneous data structures")
1176 (description
1177 "The @code{rencode} module is a data structure serialization library,
1178similar to @code{bencode} from the BitTorrent project. For complex,
1179heterogeneous data structures with many small elements, r-encoding stake up
1180significantly less space than b-encodings. This version of rencode is a
1181complete rewrite in Cython to attempt to increase the performance over the
1182pure Python module.")
1183 (license license:bsd-3)
1184 (properties '((tunable? . #t)))))
1185
1186(define-public vali
1187 (package
1188 (name "vali")
1189 (version "0.1.1")
1190 (home-page "https://gitlab.freedesktop.org/emersion/vali")
1191 (source
1192 (origin
1193 (method git-fetch)
1194 (uri (git-reference
1195 (url home-page)
1196 (commit (string-append "v" version))))
1197 (file-name (git-file-name name version))
1198 (sha256
1199 (base32 "0xycciy9f2iz41w8vrj0w0pan75x3hfgb15g67262kw7ga5lkfxv"))))
1200 (build-system meson-build-system)
1201 (native-inputs (list pkg-config))
1202 (inputs (list aml json-c))
1203 ;; needed by pkg-config, but guix store paths are not referenced
1204 ;; in the output
1205 (propagated-inputs (list aml json-c))
1206 (synopsis "Varlink C implementation and code generator")
1207 (description
1208 "This package provides a C implementation of the varlink
1209interface description protocol and a code generator.")
1210 (license license:expat)))