projects/guix·blob python-team · refs

534 lines · 20.9 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014, 2015 Andreas Enge <[email protected]>
3;;; Copyright © 2015, 2016, 2018, 2024 Ricardo Wurmus <[email protected]>
4;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <[email protected]>
5;;; Copyright © 2019 Julien Lepiller <[email protected]>
6;;; Copyright © 2020 Alexandros Theodotou <[email protected]>
7;;; Copyright © 2020 Pjotr Prins <[email protected]>
8;;; Copyright © 2020, 2024 Efraim Flashner <[email protected]>
9;;; Copyright © 2020 pukkamustard <[email protected]>
10;;; Copyright © 2022 Marius Bakke <[email protected]>
11;;; Copyright © 2022 Maxim Cournoyer <[email protected]>
12;;; Copyright © 2023 Brendan Tildesley <[email protected]>
13;;; Copyright © 2024, 2025 Janneke Nieuwenhuizen <[email protected]>
14;;;
15;;; This file is part of GNU Guix.
16;;;
17;;; GNU Guix is free software; you can redistribute it and/or modify it
18;;; under the terms of the GNU General Public License as published by
19;;; the Free Software Foundation; either version 3 of the License, or (at
20;;; your option) any later version.
21;;;
22;;; GNU Guix is distributed in the hope that it will be useful, but
23;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25;;; GNU General Public License for more details.
26;;;
27;;; You should have received a copy of the GNU General Public License
28;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29
30(define-module (gnu packages rdf)
31 #:use-module (guix gexp)
32 #:use-module ((guix licenses) #:prefix license:)
33 #:use-module (guix packages)
34 #:use-module (guix git-download)
35 #:use-module (guix download)
36 #:use-module (guix build-system cmake)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix build-system meson)
39 #:use-module (guix build-system pyproject)
40 #:use-module (guix build-system waf)
41 #:use-module (gnu packages)
42 #:use-module (gnu packages autotools)
43 #:use-module (gnu packages boost)
44 #:use-module (gnu packages check)
45 #:use-module (gnu packages compression)
46 #:use-module (gnu packages curl)
47 #:use-module (gnu packages cyrus-sasl)
48 #:use-module (gnu packages datastructures)
49 #:use-module (gnu packages documentation)
50 #:use-module (gnu packages dbm)
51 #:use-module (gnu packages gnupg)
52 #:use-module (gnu packages gtk)
53 #:use-module (gnu packages kerberos)
54 #:use-module (gnu packages linux)
55 #:use-module (gnu packages multiprecision)
56 #:use-module (gnu packages nettle)
57 #:use-module (gnu packages pcre)
58 #:use-module (gnu packages perl)
59 #:use-module (gnu packages pkg-config)
60 #:use-module (gnu packages python)
61 #:use-module (gnu packages python-build)
62 #:use-module (gnu packages python-web)
63 #:use-module (gnu packages python-xyz)
64 #:use-module (gnu packages qt)
65 #:use-module (gnu packages time)
66 #:use-module (gnu packages tls)
67 #:use-module (gnu packages xml))
68
69(define-public raptor2
70 (package
71 (name "raptor2")
72 (version "2.0.16")
73 (source (origin
74 (method url-fetch)
75 (uri (string-append "https://download.librdf.org/source/" name
76 "-" version ".tar.gz"))
77 (sha256
78 (base32
79 "1026whyxpajwijlr4k5c0iliwn09mwxrg7gkvd5kb0n9ga6vg788"))
80 (patches (search-patches "raptor2-libxml2.patch"))))
81 (build-system gnu-build-system)
82 (inputs
83 (list curl libxml2 libxslt zlib))
84 (arguments
85 `(#:parallel-tests? #f))
86 (home-page "https://librdf.org/raptor/")
87 (synopsis "RDF syntax library")
88 (description "Raptor is a C library providing a set of parsers and
89serialisers that generate Resource Description Framework (RDF) triples
90by parsing syntaxes or serialise the triples into a syntax. The supported
91parsing syntaxes are RDF/XML, N-Quads, N-Triples 1.0 and 1.1, TRiG,
92Turtle 2008 and 2013, RDFa 1.0 and 1.1, RSS tag soup including all versions
93of RSS, Atom 1.0 and 0.3, GRDDL and microformats for HTML, XHTML and
94XML. The serialising syntaxes are RDF/XML (regular, abbreviated, XMP),
95Turtle 2013, N-Quads, N-Triples 1.1, Atom 1.0, RSS 1.0, GraphViz DOT,
96HTML and JSON.")
97 (license license:lgpl2.1+))) ; or any choice of gpl2+ or asl2.0
98
99(define-public clucene
100 (package
101 (name "clucene")
102 (version "2.3.3.4")
103 (source
104 (origin
105 (method url-fetch)
106 (uri (string-append "mirror://sourceforge/clucene/"
107 "clucene-core-unstable/2.3/clucene-core-"
108 version ".tar.gz"))
109 (sha256
110 (base32 "1arffdwivig88kkx685pldr784njm0249k0rb1f1plwavlrw9zfx"))
111 (modules '((guix build utils)))
112 (snippet
113 #~(substitute* "src/shared/cmake/MacroCheckGccVisibility.cmake"
114 (("exec_program\\(") "execute_process(COMMAND ")
115 (("ARGS ") "")))
116 (patches (search-patches "clucene-pkgconfig.patch"
117 "clucene-contribs-lib.patch"
118 "clucene-gcc-14.patch"))))
119 (build-system cmake-build-system)
120 (inputs
121 (list boost ; could also use bundled copy
122 zlib))
123 (arguments
124 (list
125 ;; Tests do not compile, as TestIndexSearcher.cpp uses
126 ;; undeclared usleep. After fixing this, one needs to run
127 ;; "make test" in addition to "make cl_test", then
128 ;; SimpleTest fails.
129 #:tests? #f
130 #:configure-flags
131 #~(cons
132 "-DBUILD_CONTRIBS_LIB=ON"
133 (if #$(%current-target-system)
134 '("-D_CL_HAVE_PTHREAD_MUTEX_RECURSIVE_EXITCODE=FAILED_TO_RUN"
135 "-D_CL_HAVE_GCC_ATOMIC_FUNCTIONS_EXITCODE=FAILED_TO_RUN"
136 "-D_CL_HAVE_TRY_BLOCKS_EXITCODE=FAILED_TO_RUN"
137 "-D_CL_HAVE_NAMESPACES_EXITCODE=FAILED_TO_RUN"
138 "-D_CL_HAVE_NO_SNPRINTF_BUG_EXITCODE=FAILED_TO_RUN"
139 "-DLUCENE_STATIC_CONSTANT_SYNTAX_EXITCODE=FAILED_TO_RUN")
140 '()))))
141 (home-page "https://clucene.sourceforge.net/")
142 (synopsis "C text indexing and searching library")
143 (description "CLucene is a high-performance, scalable, cross platform,
144full-featured indexing and searching API. It is a port of the very popular
145Java Lucene text search engine API to C++.")
146 (license license:lgpl2.1)))
147
148(define-public lucene++
149 (package
150 (name "lucene++")
151 (version "3.0.8")
152 (source (origin
153 (method git-fetch)
154 (uri (git-reference
155 (url "https://github.com/luceneplusplus/LucenePlusPlus")
156 (commit (string-append "rel_" version))))
157 (file-name (git-file-name name version))
158 (sha256
159 (base32
160 "12v7r62f7pqh5h210pb74sfx6h70lj4pgfpva8ya2d55fn0qxrr2"))
161 (modules '((guix build utils)))
162 (snippet
163 #~(begin
164 (substitute* (list "src/config/core/CMakeLists.txt"
165 "src/config/contrib/CMakeLists.txt")
166 (("include/pkgconfig")
167 "lib/pkgconfig")
168 (("include/cmake")
169 "share/cmake/lucene++"))))))
170 (build-system cmake-build-system)
171 (arguments
172 (list #:configure-flags
173 #~(list (string-append "-DLIB_DESTINATION:PATH="
174 #$output "/lib")
175 "-DINSTALL_GTEST:BOOL=OFF")
176 #:phases
177 #~(modify-phases %standard-phases
178 (replace 'check
179 ;; XXX Tests are built unconditionally during the 'build phase.
180 ;; There's no ‘test’ target. README.md suggests running this.
181 (lambda* (#:key tests? #:allow-other-keys)
182 (when tests?
183 (invoke "src/test/lucene++-tester"
184 "--test_dir=../source/src/test/testfiles")))))))
185 (native-inputs
186 (list pkg-config))
187 (inputs
188 (list boost-1.83 zlib))
189 (home-page "https://github.com/luceneplusplus/LucenePlusPlus")
190 (synopsis "Text search engine")
191 (description "Lucene++ is an up to date C++ port of the popular Java
192Lucene library, a high-performance, full-featured text search engine.")
193 (license (list license:asl2.0 license:lgpl3+)))); either asl or lgpl.
194
195(define-public lrdf
196 (package
197 (name "lrdf")
198 (version "0.6.1")
199 (source (origin
200 (method git-fetch)
201 (uri (git-reference
202 (url "https://github.com/swh/LRDF")
203 (commit (string-append "v" version))))
204 (file-name (git-file-name name version))
205 (sha256
206 (base32
207 "00wzkfb8y0aqd519ypz067cq099dpc89w69zw8ln39vl6f9x2pd4"))))
208 (build-system gnu-build-system)
209 (arguments
210 '(#:phases
211 (modify-phases %standard-phases
212 (add-after 'unpack 'remove-out-of-tree-references
213 (lambda _
214 ;; remove_test depends on an out-of-tree RDF file
215 (substitute* "examples/Makefile.am"
216 (("instances_test remove_test") "instances_test")
217 (("\\$\\(TESTS\\) remove_test") "$(TESTS)"))
218 #t))
219 ;; The default bootstrap phase executes autogen.sh, which fails.
220 (replace 'bootstrap
221 (lambda _ (invoke "autoreconf" "-vif") #t)))))
222 (inputs
223 (list cyrus-sasl mit-krb5 nettle raptor2 zlib))
224 (native-inputs
225 (list autoconf automake libtool pkg-config))
226 (home-page "https://github.com/swh/LRDF")
227 (synopsis "Lightweight RDF library for accessing LADSPA plugin metadata")
228 (description
229 "LRDF is a library to make it easy to manipulate RDF files describing
230LADSPA plugins. It can also be used for general RDF manipulation. It can
231read RDF/XLM and N3 files and export N3 files, and it also has a light
232taxonomic inference capability.")
233 (license license:gpl2)))
234
235(define-public rasqal
236 (package
237 (name "rasqal")
238 (version "0.9.33")
239 (source (origin
240 (method url-fetch)
241 (uri (string-append "http://download.librdf.org/source/" name
242 "-" version ".tar.gz"))
243 (sha256
244 (base32
245 "0z6rrwn4jsagvarg8d5zf0j352kjgi33py39jqd29gbhcnncj939"))))
246 (build-system gnu-build-system)
247 (native-inputs
248 (list perl perl-xml-dom ; for the tests
249 pkg-config))
250 (inputs
251 (list libgcrypt libxml2 mpfr pcre
252 `(,util-linux "lib")))
253 (propagated-inputs
254 (list raptor2)) ; stipulated by rasqal.pc
255 (arguments
256 `(#:parallel-tests? #f
257 ; test failure reported upstream, see
258 ; http://bugs.librdf.org/mantis/view.php?id=571
259 #:tests? #f))
260 (home-page "https://librdf.org/rasqal/")
261 (synopsis "RDF query library")
262 (description "Rasqal is a C library that handles Resource Description
263Framework (RDF) query language syntaxes, query construction and execution
264of queries returning results as bindings, boolean, RDF graphs/triples or
265syntaxes. The supported query languages are SPARQL Query 1.0,
266SPARQL Query 1.1, SPARQL Update 1.1 (no executing) and the Experimental
267SPARQL extensions (LAQRS). Rasqal can write binding query results in the
268SPARQL XML, SPARQL JSON, CSV, TSV, HTML, ASCII tables, RDF/XML and
269Turtle/N3 and read them in SPARQL XML, RDF/XML and Turtle/N3.")
270 (license license:lgpl2.1+))) ; or any choice of gpl2+ or asl2.0
271
272(define-public redland
273 ;; XXX: No tags for the last release, although it's clear from
274 ;; Github and logs a new release has been made.
275 (let ((commit "3ec9bda623107f9b1c86c0a3f261ffd3f8a40965")
276 (revision "0"))
277 (package
278 (name "redland")
279 (version (git-version "1.0.17" revision commit))
280 (source
281 (origin
282 (method git-fetch)
283 (uri (git-reference
284 (url "https://github.com/dajobe/librdf")
285 (commit commit)))
286 (file-name (git-file-name name version))
287 (sha256
288 (base32 "0qwxmwi96lqjqi1mdx0mfbw23a5xg20xbv8bv18pmr4h4fxr51q7"))))
289 (build-system gnu-build-system)
290 (arguments
291 (list
292 #:phases
293 #~(modify-phases %standard-phases
294 ;; XXX: Copied files from libtool have been generated with
295 ;; another version of autoconf.
296 (add-after 'bootstrap 'bootstrap-libtool
297 (lambda _
298 (with-directory-excursion "libltdl"
299 (delete-file "aclocal.m4")
300 (invoke "autoreconf" "-vfi"))))
301 ;; XXX: 1/17 fails with recent compilers. No patch seems to have
302 ;; been done for Nix nor Debian.
303 (add-after 'unpack 'disable-problematic-test
304 (lambda _
305 (substitute* "src/Makefile.am"
306 (("test rdf_parser_test")
307 "test")))))))
308 (native-inputs
309 (list autoconf
310 automake
311 libtool
312 gtk-doc
313 perl ; needed for installation
314 pkg-config))
315 (propagated-inputs
316 (list rasqal)) ; in Requires.private field of .pc
317 (inputs
318 (list bdb))
319 (home-page "https://librdf.org/")
320 (synopsis "RDF library")
321 (description
322 "The Redland RDF Library (librdf) provides the RDF API and triple
323stores.")
324 (license license:lgpl2.1+)))) ; or any choice of gpl2+ or asl2.0
325
326(define-public serd
327 (package
328 (name "serd")
329 (version "0.32.0")
330 (source (origin
331 (method url-fetch)
332 (uri (string-append "https://download.drobilla.net/serd-"
333 version ".tar.xz"))
334 (sha256
335 (base32
336 "18cwj8xxsaq6iw45kcljbhrral0cqvav80p4mdv2l7g0d2a6ks6i"))))
337 (build-system meson-build-system)
338 (native-inputs (list python-minimal))
339 (home-page "https://drobilla.net/software/serd.html")
340 (synopsis "Library for RDF syntax supporting Turtle and NTriples")
341 (description
342 "Serd is a lightweight C library for RDF syntax which supports reading
343and writing Turtle and NTriples. Serd is not intended to be a swiss-army
344knife of RDF syntax, but rather is suited to resource limited or performance
345critical applications (e.g. converting many gigabytes of NTriples to Turtle),
346or situations where a simple reader/writer with minimal dependencies is
347ideal (e.g. in LV2 implementations or embedded applications).")
348 (license license:isc)))
349
350(define-public sord
351 (package
352 (name "sord")
353 (version "0.16.16")
354 (source (origin
355 (method url-fetch)
356 (uri (string-append "https://download.drobilla.net/sord-"
357 version ".tar.xz"))
358 (sha256
359 (base32
360 "1l2zjz6gypxbf1z32zyqkljdcn9mz452djc4xq1dlhv1fmnqfzr5"))))
361 (build-system meson-build-system)
362 (inputs
363 (list pcre))
364 (native-inputs
365 (list pkg-config))
366 (propagated-inputs
367 (list serd zix)) ;required by sord-0.pc
368 (home-page "https://drobilla.net/software/sord.html")
369 (synopsis "C library for storing RDF data in memory")
370 (description
371 "Sord is a lightweight C library for storing RDF data in memory.")
372 (license license:isc)))
373
374(define-public python-rdflib
375 (package
376 (name "python-rdflib")
377 (version "7.1.1")
378 (source
379 (origin
380 (method url-fetch)
381 (uri (pypi-uri "rdflib" version))
382 (sha256
383 (base32
384 "0glin9v600gmaa0pm8f742ja390ncr7xi0x95j05hiansdmyhk8n"))))
385 (build-system pyproject-build-system)
386 (arguments
387 (list
388 #:test-flags
389 '(list "-m" "not webtest"
390 ;; These two tests attempt to use "pip install"
391 "-k" "not test_sparqleval and not test_parser")))
392 (native-inputs
393 (list python-pytest python-poetry-core))
394 (propagated-inputs
395 (list python-isodate
396 python-lxml
397 python-networkx
398 python-orjson
399 python-pyparsing))
400 (home-page "https://github.com/RDFLib/rdflib")
401 (synopsis "Python RDF library")
402 (description
403 "RDFLib is a Python library for working with RDF, a simple yet
404powerful language for representing information.")
405 (license (license:non-copyleft "file://LICENSE"
406 "See LICENSE in the distribution."))))
407
408(define-public python-rdflib-6
409 (package
410 (name "python-rdflib")
411 (version "6.3.2")
412 (source
413 (origin
414 (method url-fetch)
415 (uri (pypi-uri "rdflib" version))
416 (sha256
417 (base32
418 "1q122padnlmwm4slzpc90hz5bf2nj1d0rk3yxancmx04ywgmkbvj"))))
419 (build-system pyproject-build-system)
420 (arguments
421 (list
422 #:test-flags
423 ;; This test needs a font that is not shipped.
424 '(list "--ignore=test/test_so_69984830.py"
425 ;; These tests need internet access.
426 "--ignore=rdflib/extras/infixowl.py"
427 "--ignore=test/test_examples.py"
428 "--ignore=test/test_sparql/test_service.py"
429 "--ignore-glob=test/test_extras/test_infixowl/*.py"
430 "--ignore=test/jsonld/test_onedotone.py"
431 ;; These tests use pip install
432 "--ignore=test/test_misc/test_plugins.py"
433 ;; Unknown causes
434 "--ignore=rdflib/__init__.py"
435 "--ignore=test/test_misc/test_parse_file_guess_format.py"
436 ;; Exceeds maximum recursion depth
437 "-k" "not test_literal_addsub")
438 #:phases
439 '(modify-phases %standard-phases
440 (add-after 'unpack 'compatibility
441 (lambda _
442 (substitute* "pyproject.toml"
443 (("^isodate = .*") "isodate = \">0.6.0\"\n"))
444 (substitute* "PKG-INFO"
445 (("^Requires-Dist: isodate .*")
446 "Requires-Dist: isodate (>=0.6.0)\n")))))))
447 (native-inputs
448 (list python-poetry-core python-pytest))
449 (propagated-inputs
450 (list python-html5lib python-isodate python-pyparsing))
451 (home-page "https://github.com/RDFLib/rdflib")
452 (synopsis "Python RDF library")
453 (description
454 "RDFLib is a Python library for working with RDF, a simple yet
455powerful language for representing information.")
456 (license (license:non-copyleft "file://LICENSE"
457 "See LICENSE in the distribution."))))
458
459(define-public hdt-cpp
460 (package
461 (name "hdt-cpp")
462 ;; 1.3.3 is from 2019 and does not compile on gcc 14.
463 (properties '((commit . "88110cc24d4d7d07080b40325d1905fae999ef95")
464 (revision . "0")))
465 (version (git-version "1.3.3"
466 (assoc-ref properties 'revision)
467 (assoc-ref properties 'commit)))
468 (source
469 (origin
470 (method git-fetch)
471 (uri (git-reference
472 (url "https://github.com/rdfhdt/hdt-cpp")
473 (commit (assoc-ref properties 'commit))))
474 (file-name (git-file-name name version))
475 (sha256
476 (base32 "19n37zpnwa1k5vq1ajw5ahhvcmc8x5m6q4c737k04kpzlnk248ra"))))
477 (build-system gnu-build-system)
478 (inputs
479 (list serd zlib))
480 (native-inputs
481 (list autoconf automake libtool pkg-config))
482 (home-page "https://github.com/rdfhdt/hdt-cpp")
483 (synopsis "C++ implementation of the HDT compression format")
484 (description "Header Dictionary Triples (HDT) is a compression format for
485RDF data that can also be queried for Triple Patterns. This package provides a
486C++ library as well as various command-line tools to to work with HDT.")
487(license license:lgpl2.1+)))
488
489(define-public python-pyrdfa3
490 (package
491 (name "python-pyrdfa3")
492 (version "3.6.2")
493 (source
494 (origin
495 (method url-fetch)
496 (uri (pypi-uri "pyRdfa3" version))
497 (sha256
498 (base32 "1hhlhgqkc3igzdpxllf41drrqxm5aswqhwvnjqb90q3zjnmiss3k"))))
499 (build-system pyproject-build-system)
500 (arguments (list #:tests? #f)) ;no test suite
501 (propagated-inputs (list python-html5lib python-rdflib python-requests))
502 (native-inputs (list python-setuptools python-wheel))
503 (home-page "https://www.w3.org/2012/pyRdfa/")
504 (synopsis "RDFa Python distiller/parser library")
505 (description "This library can extract RDFa 1.1 from (X)HTML, SVG, or XML.
506It can produce serialized versions of the extracted graph, or an RDFLib
507Graph.")
508 (license license:bsd-3)))
509
510(define-public python-sparqlwrapper
511 (package
512 (name "python-sparqlwrapper")
513 (version "2.0.0")
514 (source (origin
515 (method git-fetch)
516 (uri (git-reference
517 (url "https://github.com/RDFLib/sparqlwrapper")
518 (commit version)))
519 (file-name (git-file-name name version))
520 (sha256
521 (base32
522 "1b4vg754kcxvinwdv7pjfmwbnmgm50w8mb2naf2lwp27bpyllvkb"))))
523 (build-system pyproject-build-system)
524 (arguments
525 ;; The test suite simply queries external HTTP endpoints.
526 (list #:tests? #f))
527 (native-inputs (list python-setuptools))
528 (propagated-inputs (list python-rdflib))
529 (home-page "https://rdflib.dev/sparqlwrapper/")
530 (synopsis "SPARQL Endpoint interface to Python")
531 (description "Python wrapper around a SPARQL service. It helps in creating
532the query URI and, possibly, convert the result into a more manageable
533format.")
534 (license license:w3c)))