projects/guix·blob r-team · refs

1294 lines · 50.6 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2020, 2023 Lars-Dominik Braun <[email protected]>
3;;; Copyright © 2021 Adam Kandur <[email protected]>
4;;; Copyright © 2021 Ekaitz Zarraga <[email protected]>
5;;; Copyright © 2021 Ludovic Courtès <[email protected]>
6;;; Copyright © 2021 Morgan Smith <[email protected]>
7;;; Copyright © 2021, 2023 Daniel Meißner <[email protected]>
8;;; Copyright © 2022 Jean-Pierre De Jesus DIAZ <[email protected]>
9;;; Copyright © 2022 Marius Bakke <[email protected]>
10;;; Copyright © 2022 Ryan Prior <[email protected]>
11;;; Copyright © 2023 Adam Faiz <[email protected]>
12;;; Copyright © 2023 Simon Tournier <[email protected]>
13;;; Copyright © 2024 Artyom V. Poptsov <[email protected]>
14;;; Copyright © 2024-2025 Sharlatan Hellseher <[email protected]>
15;;; Copyright © 2025 Sisiutl <[email protected]>
16;;; Copyright © 2026 Sergio Pastor Pérez <[email protected]>
17;;;
18;;; This file is part of GNU Guix.
19;;;
20;;; GNU Guix is free software; you can redistribute it and/or modify it
21;;; under the terms of the GNU General Public License as published by
22;;; the Free Software Foundation; either version 3 of the License, or (at
23;;; your option) any later version.
24;;;
25;;; GNU Guix is distributed in the hope that it will be useful, but
26;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28;;; GNU General Public License for more details.
29;;;
30;;; You should have received a copy of the GNU General Public License
31;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32
33(define-module (gnu packages python-graphics)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (guix build-system pyproject)
36 #:use-module (guix download)
37 #:use-module (guix gexp)
38 #:use-module (guix git-download)
39 #:use-module (guix packages)
40 #:use-module (gnu packages)
41 #:use-module (gnu packages audio)
42 #:use-module (gnu packages base)
43 #:use-module (gnu packages boost)
44 #:use-module (gnu packages check)
45 #:use-module (gnu packages cmake)
46 #:use-module (gnu packages compression)
47 #:use-module (gnu packages fontutils)
48 #:use-module (gnu packages game-development)
49 #:use-module (gnu packages gl)
50 #:use-module (gnu packages glib)
51 #:use-module (gnu packages graphics)
52 #:use-module (gnu packages gstreamer)
53 #:use-module (gnu packages gtk)
54 #:use-module (gnu packages image)
55 #:use-module (gnu packages maths)
56 #:use-module (gnu packages pkg-config)
57 #:use-module (gnu packages pulseaudio)
58 #:use-module (gnu packages python)
59 #:use-module (gnu packages python-build)
60 #:use-module (gnu packages python-check)
61 #:use-module (gnu packages python-science)
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 sdl)
66 #:use-module (gnu packages simulation)
67 #:use-module (gnu packages swig)
68 #:use-module (gnu packages tex)
69 #:use-module (gnu packages video)
70 #:use-module (gnu packages xml)
71 #:use-module (gnu packages xorg))
72
73;;; Commentary:
74;;;
75;;; Python modules which are meant to be used in GUI creation or mainly are
76;;; bindings to low level libraries such as Glue, Mesa, OpenGL, Xorg etc.
77;;;
78;;; Please: Try to add new module packages in alphabetic order.
79;;;
80;;; Code:
81
82(define-public python-asyncgui
83 (package
84 (name "python-asyncgui")
85 (version "0.11.1")
86 (source
87 (origin
88 (method git-fetch)
89 (uri (git-reference
90 (url "https://github.com/asyncgui/asyncgui")
91 (commit (string-append "v" version))))
92 (file-name (git-file-name name version))
93 (sha256
94 (base32 "0fcd4gshygwcfpmxb3sas9awp15rv3m3m1gcxdbf2vrbdchdqhgf"))))
95 (build-system pyproject-build-system)
96 (arguments
97 (list
98 #:build-backend "poetry.core.masonry.api"))
99 (native-inputs
100 (list python-poetry-core
101 python-pytest))
102 (home-page "https://github.com/asyncgui/asyncgui")
103 (synopsis "Enables async/await without an event loop")
104 (description
105 "This package provides support for async/await applications without
106requiring an event loop, useful for creative responsive GUIs.")
107 (license license:expat)))
108
109(define-public python-asynckivy
110 (package
111 (name "python-asynckivy")
112 (version "0.11.0")
113 (source
114 (origin
115 (method git-fetch)
116 (uri (git-reference
117 (url "https://github.com/asyncgui/asynckivy")
118 (commit (string-append "v" version))))
119 (file-name (git-file-name name version))
120 (sha256
121 (base32 "0jxij58ax5lpnhhmhvvbf3sa1mdrbpq6kxab9r25lzgsbqjxj62z"))))
122 (build-system pyproject-build-system)
123 (arguments
124 (list
125 #:build-backend "poetry.core.masonry.api"
126 ;; XXX: Tests need some setup: AttributeError: 'NoneType' object has no
127 ;; attribute 'create_window'.
128 #:tests? #f))
129 (native-inputs
130 (list python-poetry-core))
131 (propagated-inputs
132 (list python-asyncgui))
133 (home-page "https://github.com/asyncgui/asynckivy")
134 (synopsis "Async library for Kivy")
135 (description
136 "This package provides async versions of Kivy functions to avoid the
137callback-heavy mode of interaction typical in some Kivy applications.")
138 (license license:expat)))
139
140(define-public python-glcontext
141 (let (;; Upstream is known for abusing mutable tag, hence pinpoint the
142 ;; relevant commit.
143 (revision "2")
144 (commit "f2875abdb18b24e785c3958cc22845c81725d5cd"))
145 (package
146 (name "python-glcontext")
147 (version (git-version "3.0.0" revision commit))
148 (source
149 (origin
150 (method git-fetch)
151 (uri (git-reference
152 (url "https://github.com/moderngl/glcontext")
153 (commit commit)))
154 (file-name (git-file-name name version))
155 (sha256
156 (base32 "15pngnc4agdvm8crq782vjlb5v1qrclln5xpqiyhz3jhmipsqb8q"))))
157 (build-system pyproject-build-system)
158 (arguments
159 (list
160 #:phases
161 #~(modify-phases %standard-phases
162 (add-before 'build 'fix-lib-paths
163 (lambda* (#:key inputs outputs #:allow-other-keys)
164 (let ((mesa (assoc-ref inputs "mesa"))
165 (libx11 (assoc-ref inputs "libx11")))
166 (substitute* '("glcontext/x11.cpp"
167 "glcontext/egl.cpp")
168 (("\"libGL.so\"")
169 (string-append "\"" mesa "/lib/libGL.so\""))
170 (("\"libEGL.so\"")
171 (string-append "\"" mesa "/lib/libEGL.so\""))
172 (("\"libX11.so\"")
173 (string-append "\"" libx11 "/lib/libX11.so\"")))
174 (substitute* '("glcontext/__init__.py")
175 (("find_library\\('GL'\\)")
176 (string-append "'" mesa "/lib/libGL.so'"))
177 (("find_library\\('EGL'\\)")
178 (string-append "'" mesa "/lib/libEGL.so'"))
179 (("find_library\\(\"X11\"\\)")
180 (string-append "'" libx11 "/lib/libX11.so'"))))))
181 (add-before 'check 'prepare-test-environment
182 (lambda _
183 (system "Xvfb :1 &")
184 (setenv "DISPLAY" ":1"))))))
185 (inputs
186 (list libx11
187 mesa))
188 (native-inputs
189 (list python-psutil
190 python-pytest
191 python-setuptools
192 python-wheel
193 xorg-server-for-tests))
194 (home-page "https://github.com/moderngl/glcontext")
195 (synopsis "Portable OpenGL Context for ModernGL")
196 (description
197 "Python-glcontext is a library providing an OpenGL implementation for
198ModernGL on multiple platforms.")
199 (license license:expat))))
200
201(define-public python-glfw
202 (package
203 (name "python-glfw")
204 (version "2.8.0")
205 (source
206 (origin
207 (method url-fetch)
208 (uri (pypi-uri "glfw" version))
209 (sha256
210 (base32 "1w36jvn6fx8p7irhwj6bbl67m2id3s0227b3w7bgw9hbicr0vsch"))))
211 (build-system pyproject-build-system)
212 (arguments
213 (list
214 #:tests? #f ; no tests provided
215 #:phases
216 #~(modify-phases %standard-phases
217 (add-after 'unpack 'fix-lib-paths
218 (lambda _
219 (substitute* "glfw/library.py"
220 (("_get_library_search_paths\\(\\), ")
221 (format #f "[ '~a/lib' ],"
222 #$(this-package-input "glfw")))))))))
223 (native-inputs
224 (list python-pytest
225 python-setuptools
226 python-wheel))
227 (inputs
228 (list glfw))
229 (home-page "https://github.com/FlorianRhiem/pyGLFW")
230 (synopsis "Python bindings for GLFW")
231 (description
232 "This package provides Python bindings for @url{http://www.glfw.org/,
233GLFW} OpenGL application development library.")
234 (license license:expat)))
235
236(define-public python-isosurfaces
237 (package
238 (name "python-isosurfaces")
239 (version "0.1.2")
240 (source
241 (origin
242 (method git-fetch)
243 (uri (git-reference
244 (url "https://github.com/jared-hughes/isosurfaces")
245 (commit (string-append "v" version))))
246 (file-name (git-file-name name version))
247 (sha256
248 (base32 "11rmbx6hfjz14sykcmqasg4akqm31b67v95sxaxcnkpmqqq8kqzz"))))
249 (build-system pyproject-build-system)
250 (arguments
251 (list
252 #:tests? #f)) ;no tests provided.
253 (native-inputs
254 (list python-setuptools))
255 (propagated-inputs
256 (list python-numpy))
257 (home-page "https://github.com/jared-hughes/isosurfaces")
258 (synopsis "Construct isolines/isosurfaces over a 2D/3D scalar field")
259 (description
260 "Construct isolines/isosurfaces of a 2D/3D scalar field defined by a
261function, i.e. curves over which @code{f(x,y)=0} or surfaces over which
262@code{f(x,y,z)=0}. Most similar libraries use marching squares or similar
263over a uniform grid, but this uses a quadtree to avoid wasting time sampling
264many far from the implicit surface.")
265 (license license:expat)))
266
267(define-public python-kivy
268 (package
269 (name "python-kivy")
270 ;; 2.3.1 (2024-12-26), to suport Python 3.12+ and Cython 3+.
271 (properties '((commit . "92d2cc2f56453c55ae7913e1a64809df6cc61ae5")
272 (revision . "1")))
273 (version (git-version "2.3.1"
274 (assoc-ref properties 'revision)
275 (assoc-ref properties 'commit)))
276 (source
277 (origin
278 (method git-fetch)
279 (uri (git-reference
280 (url "https://github.com/kivy/kivy")
281 (commit (assoc-ref properties 'commit))))
282 (file-name (git-file-name name version))
283 (sha256
284 (base32 "19fk1l061kjmnhm2yl4vym323s53x1p4jfb1armfd4ly5h0ik0m0"))))
285 (build-system pyproject-build-system)
286 (arguments
287 `(#:tests? #f ; Tests require many optional packages
288 #:phases
289 (modify-phases %standard-phases
290 (add-after 'patch-generated-file-shebangs 'set-sdl-paths
291 (lambda* (#:key inputs #:allow-other-keys)
292 (setenv "KIVY_SDL2_PATH"
293 (search-input-directory inputs "/include/SDL2"))))
294 (add-before 'build 'set-home
295 (lambda _
296 ;; 'kivy/__init__.py' wants to create $HOME/.kivy.
297 (setenv "HOME" (getcwd)))))))
298 (native-inputs
299 (list pkg-config
300 python-cython
301 ;; Not packaged yet, for tests.
302 ;; python-kivy-deps-glew
303 ;; python-kivy-deps-glew-dev
304 ;; python-kivy-deps-gstreamer
305 ;; python-kivy-deps-gstreamer-dev
306 ;; python-kivy-deps-sdl2
307 ;; python-kivy-deps-sdl2-dev
308 python-packaging
309 python-setuptools))
310 (inputs
311 (list gstreamer
312 mesa
313 (sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf))))
314 (propagated-inputs
315 (list python-docutils
316 python-filetype
317 python-kivy-garden
318 python-pygments
319 python-requests))
320 (home-page "https://kivy.org")
321 (synopsis "Multitouch application framework")
322 (description
323 "Kivy is a software library for rapid development of hardware-accelerated
324multitouch applications.")
325 (license license:expat)))
326
327(define-public python-kivymd
328 (package
329 (name "python-kivymd")
330 (version "1.1.1")
331 (source
332 (origin
333 (method git-fetch) ; no tests in PyPI release
334 (uri (git-reference
335 (url "https://github.com/kivymd/KivyMD")
336 (commit version)))
337 (file-name (git-file-name name version))
338 (sha256
339 (base32 "1nprldcm54qybbwf7zlb32fkmz375j8i3k3g41d6ykc6vasq3w5j"))))
340 (build-system pyproject-build-system)
341 (arguments
342 (list
343 #:test-flags
344 ;; <https://github.com/pyinstaller/pyinstaller> is not packaged yet in
345 ;; Guix.
346 #~(list "--ignore=kivymd/tests/pyinstaller"
347 "-k" (string-join
348 ;; FIXME: Only some tests passed, the most fail with err:
349 ;; ValueError: KivyMD: App object must be initialized
350 ;; before loading root widget.
351 (list "not test_backdrop_raw_app"
352 "test_bottom_navigation_m3_style_raw_app"
353 "test_card_m3_style_raw_app"
354 "test_chip_raw_app"
355 "test_imagelist_raw_app"
356 "test_list_raw_app"
357 "test_navigationdrawer_raw_app"
358 "test_tab_raw_app"
359 "test_textfield_raw_app")
360 " and not "))
361 #:phases
362 #~(modify-phases %standard-phases
363 (add-after 'unpack 'fix-modules
364 (lambda _
365 (substitute* "setup.py"
366 ;; If excluded, sanity check fails with error:
367 ;; ModuleNotFoundError: No module named 'kivymd.tools.release'
368 (("\"kivymd.tools.release\"") ""))
369 ;; Check phase fails struggling to find tests module.
370 (with-output-to-file "kivymd/tests/__init__.py"
371 (lambda _ (display "")))))
372 (add-before 'build 'set-home
373 (lambda _
374 ;; FileNotFoundError: [Errno 2] No such file or directory:
375 ;; '/homeless-shelter/.kivy'
376 (setenv "HOME" "/tmp"))))))
377 (native-inputs
378 (list python-docutils
379 python-pytest
380 python-pytest-asyncio
381 python-setuptools
382 python-wheel))
383 (propagated-inputs
384 (list python-kivy
385 python-pillow
386 python-pygments
387 python-kivy-garden))
388 (home-page "https://github.com/kivymd/KivyMD")
389 (synopsis "Material Design compliant widgets for use with Kivy")
390 (description
391 "This package provides Kivy widgets that approximate Google's Material
392Design spec without sacrificing ease of use or application performance.")
393 (license license:expat)))
394
395;; XXX: The package was placed here to prevent adding (gnu packages video) to
396;; (gnu packages maths) module, it fits more there.
397(define-public python-manim
398 (package
399 (name "python-manim")
400 (version "0.20.1")
401 (source
402 (origin
403 (method git-fetch)
404 (uri (git-reference
405 (url "https://github.com/ManimCommunity/manim")
406 (commit (string-append "v" version))))
407 (file-name (git-file-name name version))
408 (sha256
409 (base32 "1ifgcsz9dhb7qyqsi60q840wqcqfmqxf19r8qlncakziyqlfmwxd"))))
410 (build-system pyproject-build-system)
411 (arguments
412 (list
413 #:test-flags
414 #~(list "--numprocesses" (number->string (parallel-job-count))
415 ;; OpenGL tests skipped: require GPU/EGL acceleration
416 ;; unavailable in build environment. These tests pass on systems
417 ;; with proper GPU drivers.
418 ;;
419 ;; command/logging tests skipped: expected failures due to Guix
420 ;; build environment specifics (PATH wrapping, offline mode).
421 "-k" "not (opengl or OpenGL)"
422 "--ignore=tests/interface/test_commands.py"
423 "--ignore=tests/test_logging/test_logging.py")
424 #:phases
425 #~(modify-phases %standard-phases
426 (add-before 'check 'set-x-server
427 (lambda _
428 (system "Xvfb :1 -screen 0 1024x768x24 &")
429 (setenv "DISPLAY" ":1")))
430 (add-after 'unpack 'fix-pytest-config
431 (lambda _
432 (substitute* "pyproject.toml"
433 ((" -n auto ") " ")))))))
434 (native-inputs
435 (list python-hatchling
436 python-pytest
437 python-pytest-xdist
438 (texlive-local-tree
439 (list texlive-dvisvgm
440 texlive-fontspec
441 texlive-preview
442 texlive-standalone
443 texlive-xcolor))
444 xorg-server))
445 (propagated-inputs
446 (list ffmpeg
447 python-av
448 python-beautifulsoup4
449 python-click
450 python-cloup
451 python-decorator
452 python-isosurfaces
453 python-manimpango
454 python-mapbox-earcut
455 python-moderngl
456 python-moderngl-window
457 python-networkx
458 python-numpy
459 python-pillow
460 python-pycairo
461 python-pydub
462 python-pygments
463 python-rich
464 python-screeninfo
465 python-skia-pathops
466 python-srt
467 python-svgelements
468 python-tqdm
469 python-typing-extensions
470 python-watchdog))
471 (home-page "https://www.manim.community/")
472 (synopsis "Python animation engine for explanatory math videos")
473 (description
474 "Manim is a Python library for creating mathematical animations. The
475animations are written as Python code which is based on predefined objects.
476You can make animations with maths formulas (LaTeX-based), simple shapes, 3D
477objects, function graphs and more.")
478 (license license:expat)))
479
480(define-public python-mapbox-earcut
481 (package
482 (name "python-mapbox-earcut")
483 (version "2.0.0")
484 (source
485 (origin
486 (method git-fetch)
487 (uri (git-reference
488 (url "https://github.com/skogler/mapbox_earcut_python")
489 (commit (string-append "v" version))))
490 (file-name (git-file-name name version))
491 (sha256
492 (base32 "18mpr453wbfdaa95xsvhqy5vmb311ja59dzi0aizwdf3nwjh75j7"))))
493 (build-system pyproject-build-system)
494 (native-inputs
495 (list python-nanobind
496 python-pytest
497 python-scikit-build-core))
498 (propagated-inputs
499 (list python-numpy))
500 (home-page "https://github.com/skogler/mapbox_earcut_python")
501 (synopsis "Python bindings to the mapbox earcut C++ library")
502 (description
503 "Python bindings for the C++ implementation of the Mapbox Earcut library,
504which provides very fast and quite robust triangulation of 2D polygons.
505
506The library implements a modified ear slicing algorithm, optimized by z-order
507curve hashing and extended to handle holes, twisted polygons, degeneracies and
508self-intersections in a way that doesn't guarantee correctness of
509triangulation, but attempts to always produce acceptable results for practical
510data like geographical shapes.")
511 (license license:isc)))
512
513(define-public python-moderngl
514 (package
515 (name "python-moderngl")
516 (version "5.12.0")
517 (source
518 (origin
519 (method git-fetch)
520 (uri (git-reference
521 (url "https://github.com/moderngl/moderngl")
522 (commit version)))
523 (file-name (git-file-name name version))
524 (sha256
525 (base32 "0gf8cam9m6sz73ndlwz8a5vd0qz06lbww3lgfjcdmla6bwyxjxd5"))))
526 (build-system pyproject-build-system)
527 (arguments
528 (list
529 #:test-flags
530 #~(list "-k" "not (test_local or test_compute_shader)")))
531 (native-inputs
532 (list python-numpy
533 python-pyopengl
534 python-pytest
535 python-scipy-minimal
536 python-setuptools))
537 (propagated-inputs
538 (list python-glcontext))
539 (home-page "https://github.com/moderngl/moderngl")
540 (synopsis "Modern OpenGL binding for Python")
541 (description
542 "ModernGL is a Python wrapper over OpenGL Core. ModernGL simplifies the
543creation of graphics applications like scientific simulations, games or user
544interfaces. Usually, acquiring in-depth knowledge of OpenGL requires a steep
545learning curve. In contrast, ModernGL is easy to learn and use. ModernGL is
546capable of rendering with high performance and quality, with less code
547written.")
548 (license license:expat)))
549
550(define-public python-moderngl-window
551 (package
552 (name "python-moderngl-window")
553 (version "3.1.1")
554 (source
555 (origin
556 (method git-fetch)
557 (uri (git-reference
558 (url "https://github.com/moderngl/moderngl-window")
559 (commit version)))
560 (file-name (git-file-name name version))
561 (sha256
562 (base32 "1f5mnm1c92ssn7hww40k5yyz4r6b1d5xb2i9y99mcrjv6g1m4jd4"))))
563 (build-system pyproject-build-system)
564 (arguments
565 (list
566 #:phases
567 #~(modify-phases %standard-phases
568 (add-before 'check 'set-x-server
569 (lambda _
570 (system "Xvfb :1 &")
571 (setenv "DISPLAY" ":1"))))))
572 (native-inputs
573 (list python-pytest
574 python-pywavefront
575 python-setuptools
576 python-trimesh
577 xorg-server-for-tests))
578 (propagated-inputs
579 (list python-moderngl
580 python-numpy
581 python-pillow
582 python-pyglet
583 python-pyglm))
584 (home-page "https://github.com/moderngl/moderngl_window")
585 (synopsis "Helper library for ModernGL making window simple")
586 (description
587 "Cross platform utility library for ModernGL making window creation and
588resource loading simple. It can also be used with PyOpenGL for rendering with
589the programmable pipeline.
590
591Features:
592
593@itemize
594@item Cross platform support.
595@item Easily create a window for ModernGL using pyglet, pygame, PySide2, GLFW,
596SDL2, PyQt5 or tkinter supporting a wide range of window, keyboard and mouse
597events. These events are unified into a single system so your project can
598work with any window.
599@item Load 2D textures, texture arrays and cube maps using Pillow.
600@item Load shaders as single or multiple @code{glsl} files.
601@item Load objects/scenes from wavefront/obj, GLTF 2.0 or STL.
602@item Resource finder system supporting multiple resource directories.
603@item A highly plugable library supporting custom loaders, resource finders
604and windows.
605@item Type hints everywhere making code completion and linting a breeze.
606@end itemize")
607 (license license:expat)))
608
609(define-public python-picosvg
610 (package
611 (name "python-picosvg")
612 (version "0.23.0")
613 (source
614 (origin
615 (method git-fetch)
616 (uri (git-reference
617 (url "https://github.com/googlefonts/picosvg")
618 (commit (string-append "v" version))))
619 (file-name (git-file-name name version))
620 (sha256
621 (base32 "0glc6d9d81jnwqnizhdifvhhxhk5ly7qbss1alsyqxh3h64hs9g0"))))
622 (build-system pyproject-build-system)
623 (native-inputs
624 (list python-pytest python-setuptools python-setuptools-scm))
625 (propagated-inputs
626 (list python-absl-py python-lxml python-skia-pathops))
627 (home-page "https://github.com/googlefonts/picosvg")
628 (synopsis "Tool to simplify SVGs")
629 (description
630 "@code{picosvg} converts an input SVG into a @code{pico} SVG.
631
632A @code{pico} SVG has the following characteristics:
633@itemize
634@item Exactly 1 <defs> element, first child of root
635@item Only gradients defined under <defs>
636@item After the initial <defs>, only <g> and <path> <g> is eliminated when
637possible, but may be retained for opacity
638@item Only absolute coordinates
639@item Only commands that specify full coordinates, no shorthand (H, S, etc)
640@end itemize")
641 (license license:asl2.0)))
642
643(define-public python-pivy
644 (package
645 (name "python-pivy")
646 (version "0.6.11")
647 (source
648 (origin
649 (method git-fetch)
650 (uri (git-reference
651 (url "https://github.com/coin3d/pivy")
652 (commit version)))
653 (file-name (git-file-name name version))
654 (sha256
655 (base32 "0rjbhhxyrh0fszc0va7qmkv6ayf2s49ppnw31p51xmq63bx3n5wc"))))
656 (build-system pyproject-build-system)
657 (arguments
658 (list
659 ;; The test suite fails due to an import cycle between 'pivy' and '_coin'
660 #:tests? #f
661 #:phases
662 #~(modify-phases %standard-phases
663 (add-after 'unpack 'patch-cmake-include-dirs
664 (lambda _
665 ;; Patch buildsystem to respect Coin3D include directory
666 (substitute* "CMakeLists.txt"
667 (("\\$\\{SoQt_INCLUDE_DIRS}")
668 "${Coin_INCLUDE_DIR};${SoQt_INCLUDE_DIRS}")))))))
669 (native-inputs
670 (list cmake-minimal
671 python-setuptools
672 swig-4.4))
673 (inputs
674 (list qtbase
675 libxi
676 libice
677 glew
678 coin3d))
679 (home-page "https://github.com/coin3d/pivy")
680 (synopsis "Python bindings to Coin3D")
681 (description
682 "Pivy provides python bindings for Coin, a 3D graphics library with an
683Application Programming Interface based on the Open Inventor 2.1 API.")
684 (license license:isc)))
685
686(define-public python-py3exiv2
687 (package
688 (name "python-py3exiv2")
689 (version "0.12.0")
690 (source
691 (origin
692 (method url-fetch)
693 ;; Source: https://code.launchpad.net/py3exiv2
694 (uri (pypi-uri "py3exiv2" version))
695 (sha256
696 (base32 "12is7xb393wvq3la9lhi0y1xkmpvjj6v13cikb7k6iqcfrgkxckj"))))
697 (build-system pyproject-build-system)
698 (arguments
699 (list #:tests? #f)) ;no tests in PyPI
700 (native-inputs
701 (list boost
702 python-setuptools))
703 (inputs
704 (list exiv2))
705 (home-page "https://www.py3exiv2.tuxfamily.org/")
706 (synopsis "Python binding to the exiv2 library")
707 (description
708 "This package provides a Python binding to the library
709@code{https://exiv2.org/, exiv2} - cross-platform C++ library and a command
710line utility to manage image metadata.")
711 (license license:gpl3+)))
712
713(define-public python-pyglet
714 (package
715 (name "python-pyglet")
716 (version "2.0.18")
717 (source
718 (origin
719 (method url-fetch)
720 (uri (pypi-uri "pyglet" version))
721 (sha256
722 (base32 "1p4rizj81vfqxal288m3afbrgk0il3w7k5kmhai2sah8f26j7ybw"))))
723 (build-system pyproject-build-system)
724 (arguments
725 (list
726 #:test-flags
727 #~(list "tests"
728 "--ignore=tests/interactive"
729 ;; All tests errored
730 "--ignore=tests/integration/media/test_openal.py"
731 "--ignore=tests/integration/text/test_empty_document.py"
732 ;; Tests failed
733 "-k" (string-append "not test2"
734 " and not test5"
735 " and not testPad"
736 " and not testPad"
737 " and not testRange"
738 " and not testRect"
739 " and not testRect"
740 " and not testSet"
741 " and not testSquare"
742 " and not testSquare"
743 " and not testTuple"
744 " and not testTupleRange"
745 " and not test_context_noshare_texture"
746 " and not test_context_share_texture"
747 " and not test_method"
748 " and not test_openal_listener"
749 " and not test_parse_all_controller_mappings"
750 " and not test_player_play"
751 " and not test_player_play_multiple"
752 " and not test_stream_write_needed"
753 " and not test_window_caption"
754 " and not test_window_caption_from_argv"))
755 #:phases
756 #~(modify-phases %standard-phases
757 (add-after 'unpack 'patch-lib-paths
758 (lambda* (#:key inputs #:allow-other-keys)
759 (substitute* (list "pyglet/font/fontconfig.py"
760 "pyglet/font/freetype_lib.py"
761 "pyglet/gl/lib_glx.py"
762 "pyglet/input/linux/evdev.py"
763 "pyglet/libs/egl/egl.py"
764 "pyglet/libs/egl/lib.py"
765 "pyglet/libs/x11/xf86vmode.py"
766 "pyglet/libs/x11/xinerama.py"
767 "pyglet/libs/x11/xlib.py"
768 "pyglet/libs/x11/xsync.py"
769 "pyglet/media/drivers/openal/lib_openal.py"
770 "pyglet/media/drivers/pulse/lib_pulseaudio.py")
771 (("'EGL'")
772 (format #f "'~a/~a'" #$(this-package-input "mesa")
773 "lib/libEGL.so"))
774 (("\"fontconfig\"")
775 (format #f "'~a/~a'" #$(this-package-input "fontconfig-minimal")
776 "lib/libfontconfig.so"))
777 (("\"freetype\"")
778 (format #f "'~a/~a'" #$(this-package-input "freetype")
779 "lib/libfreetype.so"))
780 (("'GL'")
781 (format #f "'~a/~a'" #$(this-package-input "mesa")
782 "lib/libGL.so"))
783 (("'GLU'")
784 (format #f "'~a/~a'" #$(this-package-input "glu")
785 "lib/libGLU.so"))
786 (("'X11'")
787 (format #f "'~a/~a'" #$(this-package-input "libx11")
788 "lib/libX11.so"))
789 (("'Xext'")
790 (format #f "'~a/~a'" #$(this-package-input "libxext")
791 "lib/libXext.so"))
792 (("'Xinerama'")
793 (format #f "'~a/~a'" #$(this-package-input "libxinerama")
794 "lib/libXinerama.so"))
795 (("'Xxf86vm'")
796 (format #f "'~a/~a'" #$(this-package-input "libxxf86vm")
797 "lib/libXxf86vm.so"))
798 (("'c'")
799 (format #f "'~a/~a'" #$(this-package-input "glibc")
800 "lib/libc.so"))
801 (("'gdk-x11-2.0'")
802 (format #f "'~a/~a'" #$(this-package-input "gtk+")
803 "lib/gdk-pixbuf-2.0.so"))
804 (("'gdk_pixbuf-2.0'")
805 (format #f "'~a/~a'" #$(this-package-input "gdk-pixbuf")
806 "lib/libgdk_pixbuf-2.0.so"))
807 (("'openal'")
808 (format #f "'~a/~a'" #$(this-package-input "openal")
809 "lib/libopenal.so"))
810 (("'pulse'")
811 (format #f "'~a/~a'" #$(this-package-input "pulseaudio")
812 "lib/libpulse.so")))))
813 (add-before 'check 'prepare-test-environment
814 (lambda _
815 ;; The test suite requires a running X server.
816 (system "Xvfb :1 &")
817 (setenv "DISPLAY" ":1")
818 (setenv "HOME" "/tmp")
819 (setenv "PYGLET_HEADLESS" "True"))))))
820 (native-inputs
821 (list python-flit-core
822 python-pytest
823 unzip
824 xorg-server-for-tests))
825 (inputs
826 (list ffmpeg
827 fontconfig
828 freeglut
829 freetype
830 gdk-pixbuf
831 glibc
832 glu
833 gtk+
834 libx11
835 libxext
836 libxinerama
837 libxxf86vm
838 mesa
839 openal
840 pulseaudio
841 python-pygobject))
842 (home-page "https://github.com/pyglet/pyglet")
843 (synopsis "Windowing and multimedia library")
844 (description
845 "Pyglet is a Python library for developing games and other visually-rich
846applications. It supports windowing, user interface event handling,
847Joysticks, OpenGL graphics, loading images and videos, playing sounds and
848music." )
849 (license license:bsd-3)))
850
851(define-public python-pyglet-1
852 (package
853 (inherit python-pyglet)
854 (name "python-pyglet")
855 (version "1.5.30") ;the latest 1.* version from 2024-12-24
856 (source
857 (origin
858 (method git-fetch)
859 (uri (git-reference
860 (url "https://github.com/pyglet/pyglet")
861 (commit (string-append "v" version))))
862 (file-name (git-file-name name version))
863 (sha256
864 (base32 "0q1690pqkks3na6vc8ps44h0gymlmq752xlk7fm0yvz05yqdqn51"))))
865 (arguments
866 (list
867 ;; tests: 317 passed, 24 skipped, 1 deselected, 2 warnings
868 #:test-flags
869 #~(list "--ignore=tests/base"
870 "--ignore=tests/interactive"
871 "--ignore=tests/integration/media"
872 "--ignore=tests/integration/font"
873 "--ignore=tests/integration/platform/test_linux_fontconfig.py"
874 ;; AssertionError: False is not true : Did not receive next
875 ;; expected event
876 "--ignore=tests/integration/window/test_event_sequence.py"
877 ;; pyglet.media.drivers.openal.interface.OpenALException: OpenAL
878 ;; Exception [40964: b'Invalid Value']: Failed to open device.
879 "--deselect=tests/unit/media/test_listener.py::test_openal_listener")
880 #:phases
881 #~(modify-phases %standard-phases
882 (add-after 'unpack 'fix-python-3.12-incompatibility
883 ;; The only user of pyglet@1 is printrun, see:
884 ;; <https://github.com/kliment/Printrun/issues/1468>.
885 (lambda _
886 (substitute* "tests/integration/test_toplevel_imports.py"
887 (("import imp") ""))))
888 (add-after 'unpack 'patch-lib-paths
889 (lambda* (#:key inputs #:allow-other-keys)
890 (substitute* (list "pyglet/font/fontconfig.py"
891 "pyglet/font/freetype_lib.py"
892 "pyglet/gl/lib_glx.py"
893 "pyglet/libs/egl/egl.py"
894 "pyglet/libs/egl/lib.py"
895 "pyglet/libs/x11/xf86vmode.py"
896 "pyglet/libs/x11/xinerama.py"
897 "pyglet/libs/x11/xlib.py"
898 "pyglet/libs/x11/xsync.py"
899 "pyglet/media/drivers/openal/lib_openal.py"
900 "pyglet/media/drivers/pulse/lib_pulseaudio.py")
901 (("'EGL'")
902 (format #f "'~a/~a'" #$(this-package-input "mesa")
903 "lib/libEGL.so"))
904 (("'fontconfig'")
905 (format #f "'~a/~a'" #$(this-package-input "fontconfig-minimal")
906 "lib/libfontconfig.so"))
907 (("'freetype'")
908 (format #f "'~a/~a'" #$(this-package-input "freetype")
909 "lib/libfreetype.so"))
910 (("'GL'")
911 (format #f "'~a/~a'" #$(this-package-input "mesa")
912 "lib/libGL.so"))
913 (("'GLU'")
914 (format #f "'~a/~a'" #$(this-package-input "glu")
915 "lib/libGLU.so"))
916 (("'X11'")
917 (format #f "'~a/~a'" #$(this-package-input "libx11")
918 "lib/libX11.so"))
919 (("'Xext'")
920 (format #f "'~a/~a'" #$(this-package-input "libxext")
921 "lib/libXext.so"))
922 (("'Xinerama'")
923 (format #f "'~a/~a'" #$(this-package-input "libxinerama")
924 "lib/libXinerama.so"))
925 (("'Xxf86vm'")
926 (format #f "'~a/~a'" #$(this-package-input "libxxf86vm")
927 "lib/libXxf86vm.so"))
928 (("'c'")
929 (format #f "'~a/~a'" #$(this-package-input "glibc")
930 "lib/libc.so"))
931 (("'gdk-x11-2.0'")
932 (format #f "'~a/~a'" #$(this-package-input "gtk+")
933 "lib/gdk-pixbuf-2.0.so"))
934 (("'gdk_pixbuf-2.0'")
935 (format #f "'~a/~a'" #$(this-package-input "gdk-pixbuf")
936 "lib/libgdk_pixbuf-2.0.so"))
937 (("'openal'")
938 (format #f "'~a/~a'" #$(this-package-input "openal")
939 "lib/libopenal.so"))
940 (("'pulse'")
941 (format #f "'~a/~a'" #$(this-package-input "pulseaudio")
942 "lib/libpulse.so")))))
943 (add-before 'check 'prepare-test-environment
944 (lambda _
945 ;; The test suite requires a running X server.
946 (system "Xvfb :1 &")
947 (setenv "DISPLAY" ":1")
948 (setenv "HOME" "/tmp")
949 (setenv "PYGLET_HEADLESS" "True"))))))
950 (native-inputs
951 (list python-pytest
952 python-setuptools
953 xorg-server-for-tests))))
954
955(define-public python-pyopengl
956 (package
957 (name "python-pyopengl")
958 (version "3.1.10")
959 (source
960 (origin
961 (method git-fetch)
962 (uri (git-reference
963 (url "https://github.com/mcfletch/pyopengl")
964 (commit version)))
965 (file-name (git-file-name name version))
966 (sha256
967 (base32 "0gn6n6z76xrvwj9inl2v6rr707n1w8s072qxfmzpla1i9bfckzjk"))))
968 (build-system pyproject-build-system)
969 (arguments
970 (list
971 ;; 62 passed, 26 skipped, 26 deselected, 2 xfailed, 2 warnings
972 #:test-flags
973 #~(list #$@(map (lambda (test) (string-append "--deselect=tests/" test))
974 (list
975 ;; RuntimeError: Test script failure on <...>
976 "test_checks.py::test_check_crash_on_glutinit"
977 "test_checks.py::test_check_egl_es1"
978 "test_checks.py::test_check_egl_es2"
979 "test_checks.py::test_check_egl_opengl"
980 "test_checks.py::test_check_glutwindow"
981 "test_checks.py::test_check_freeglut_deinit"
982 "test_checks.py::test_check_glut_debug"
983 "test_checks.py::test_check_glut_fc"
984 "test_checks.py::test_check_glut_load"
985 "test_checks.py::test_check_glutinit"
986 "test_checks.py::test_check_glutinit_0args"
987 "test_checks.py::test_check_glutinit_single"
988 "test_checks.py::test_check_glutinit_simplest"
989 "test_checks.py::test_egl_ext_enumerate"
990 "test_checks.py::test_test_instanced_draw_detect"
991 "test_checks.py::test_test_gldouble_ctypes"
992 ;; OpenGL.error.Error: Attempt to retrieve context when
993 ;; no valid context
994 "test_arraydatatype.py::TestCoreDatatype::test_numpyConversion"
995 "test_arraydatatype.py::TestCoreDatatype::test_pointers"
996 "test_core.py::TestCore::test_glCallLists_twice2"
997 "test_core.py::TestCore::test_glmultidraw"
998 ;; RuntimeError: Test Failed
999 "test_checks.py::test_feedbackvarying"
1000 "test_checks.py::test_test_sf2946226"
1001 "test_checks.py::test_test_glgetactiveuniform"
1002 ;; TypeError: '<' not supported between instances of
1003 ;; 'bool' and 'list'
1004 "test_core.py::TestCore::test_get_read_fb_binding"
1005 "test_core.py::TestCore::test_lookupint"
1006 ;; assert not glShaderSource
1007 "test_core.py::TestCore::test_get_version")))
1008 #:phases
1009 #~(modify-phases %standard-phases
1010 (add-before 'build 'fix-paths
1011 (lambda* (#:key inputs #:allow-other-keys)
1012 (substitute* '("OpenGL/platform/ctypesloader.py")
1013 (("filenames_to_try = \\[base_name\\]")
1014 "filenames_to_try = [name]"))
1015 (substitute* '("OpenGL/platform/glx.py"
1016 "OpenGL/platform/egl.py"
1017 "OpenGL/platform/osmesa.py"
1018 "OpenGL/platform/darwin.py"
1019 "tests/check_glut_load.py")
1020 (("\"GLU\",")
1021 (format #f "~s," (search-input-file inputs "lib/libGLU.so")))
1022 (("'GLU',")
1023 (format #f "~s," (search-input-file inputs "lib/libGLU.so")))
1024 (("\"glut\",")
1025 (format #f "~s," (search-input-file inputs "lib/libglut.so")))
1026 (("'glut',")
1027 (format #f "~s," (search-input-file inputs "lib/libglut.so")))
1028 (("'(GL|EGL|GLESv1_CM|GLESv2)'" all gl-library)
1029 (format #f "~s" (search-input-file inputs (string-append
1030 "lib/lib"
1031 gl-library ".so"))))
1032 (("\"(GLESv1_CM|GLESv2)\"" all gl-library)
1033 (format #f "~s" (search-input-file inputs (string-append
1034 "lib/lib"
1035 gl-library ".so")))))))
1036 (add-before 'check 'pre-check
1037 (lambda _
1038 (setenv "LANG" "fr_FR.UTF-8")
1039 (setenv "LANGUAGE" "fr_FR.UTF-8")
1040 (setenv "DISPLAY" ":1")
1041 (setenv "HOME" "/tmp")
1042 (setenv "USER" "guix")
1043 (setenv "XDG_RUNTIME_DIR" "/tmp")
1044 (setenv "XDG_SESSION_ID" "11235813")
1045 (setenv "XDG_SESSION_PATH" "/tmp")
1046 (setenv "XDG_SESSION_TYPE" "x11"))))))
1047 (native-inputs
1048 (list python-cython
1049 python-numpy
1050 python-psutil
1051 python-pygame-ce
1052 python-pytest
1053 python-setuptools))
1054 (inputs
1055 (list freeglut
1056 glu
1057 mesa))
1058 (home-page "https://pyopengl.sourceforge.net")
1059 (synopsis "Standard OpenGL bindings for Python")
1060 (description
1061 "PyOpenGL is the most common cross platform Python binding to OpenGL and
1062related APIs. The binding is created using the standard @code{ctypes}
1063library.")
1064 (license license:bsd-3)))
1065
1066(define-public python-pyopengl-accelerate
1067 (package
1068 (inherit python-pyopengl)
1069 (name "python-pyopengl-accelerate")
1070 (version "3.1.10")
1071 (source
1072 (origin
1073 (method url-fetch)
1074 (uri (pypi-uri "pyopengl_accelerate" version))
1075 (sha256
1076 (base32
1077 "0waskwvw9mp830bnnxcqd8bkh7a4qbnr0fcjnnw35xx6y21iqxc2"))))
1078 (arguments
1079 `(#:tests? #f
1080 #:phases
1081 (modify-phases %standard-phases
1082 (delete 'fix-paths))))
1083 (synopsis "Acceleration code for PyOpenGL")
1084 (description
1085 "This is the Cython-coded accelerator module for PyOpenGL.")))
1086
1087(define-public python-pysdl2
1088 (package
1089 (name "python-pysdl2")
1090 (version "0.9.17")
1091 (source
1092 (origin
1093 (method url-fetch)
1094 (uri (pypi-uri "pysdl2" version))
1095 (sha256
1096 (base32 "0axm6m3wj8x643zg65g60xdpaxanaqdilvp4yysks4pblh0yzij8"))))
1097 (build-system pyproject-build-system)
1098 (arguments
1099 (list
1100 #:tests? #f ;; Requires /dev/dri, OpenGL module, etc.
1101 #:phases
1102 #~(modify-phases %standard-phases
1103 (add-after 'unpack 'patch-paths
1104 (lambda _
1105 (substitute* "sdl2/dll.py"
1106 ;; Disable pysdl2-dll. It can't be packaged on GNU Guix
1107 ;; as it duplicates an existing package (sdl2).
1108 (("prepath = os\\.getenv\\('PYSDL2_DLL_PATH'\\)")
1109 "prepath = \"system\"")
1110 (("^import sdl2dll$") "")
1111 (("postpath = os\\.getenv\\('PYSDL2_DLL_PATH'\\)")
1112 "postpath = \"system\"")
1113 (("DLL\\(.*, os\\.getenv\\(\"PYSDL2_DLL_PATH\"\\)\\)")
1114 (format #f "DLL('SDL2', ['SDL2', 'SDL2-2.0', 'SDL2-2.0.0'], '~a/lib')"
1115 #$(this-package-input "sdl2"))))
1116 (substitute* "sdl2/sdlimage.py"
1117 (("os\\.getenv\\(\"PYSDL2_DLL_PATH\"\\)")
1118 (format #f "'~a/~a'" #$(this-package-input "sdl2-image")
1119 "lib/libSDL2_image.so")))
1120 (substitute* "sdl2/sdlgfx.py"
1121 (("os\\.getenv\\(\"PYSDL2_DLL_PATH\"\\)")
1122 (format #f "'~a/~a'" #$(this-package-input "sdl2-gfx")
1123 "lib/libSDL2_gfx.so")))
1124 (substitute* "sdl2/sdlmixer.py"
1125 (("os\\.getenv\\(\"PYSDL2_DLL_PATH\"\\)")
1126 (format #f "'~a/~a'" #$(this-package-input "sdl2-mixer")
1127 "lib/libSDL2_mixer.so")))
1128 (substitute* "sdl2/sdlttf.py"
1129 (("os\\.getenv\\(\"PYSDL2_DLL_PATH\"\\)")
1130 (format #f "'~a/~a'" #$(this-package-input "sdl2-ttf")
1131 "lib/libSDL2_ttf.so"))))))))
1132 (native-inputs
1133 (list python-setuptools
1134 python-wheel))
1135 (inputs
1136 (list sdl2 sdl2-image sdl2-gfx sdl2-mixer sdl2-ttf))
1137 (home-page "https://github.com/py-sdl/py-sdl2")
1138 (synopsis "Python bindings around the SDL2 game development library")
1139 (description
1140 "PySDL2 is a pure Python wrapper around the
1141@code{SDL2},@code{SDL2_mixer}, @code{SDL2_image}, @code{SDL2_ttf}, and
1142@code{SDL2_gfx} libraries. Instead of relying on C code, it uses the built-in
1143ctypes module to interface with SDL2, and provides simple Python classes and
1144wrappers for common SDL2 functionality.")
1145 (license license:cc0)))
1146
1147(define-public python-pywavefront
1148 (package
1149 (name "python-pywavefront")
1150 (version "1.3.3")
1151 (source
1152 (origin
1153 (method git-fetch)
1154 (uri (git-reference
1155 (url "https://github.com/pywavefront/PyWavefront")
1156 (commit version)))
1157 (file-name (git-file-name name version))
1158 (sha256
1159 (base32 "07r9z0dzz5xq9qlmp855mxsf9776b1ypk06nc9cf69r9d8pk8bkj"))))
1160 (build-system pyproject-build-system)
1161 (native-inputs
1162 (list python-mock
1163 python-pytest
1164 python-setuptools))
1165 (home-page "https://github.com/pywavefront/PyWavefront")
1166 (synopsis "Python library for loading Wavefront @code{.obj} files")
1167 (description
1168 "PyWavefront reads Wavefront 3D object files (@code{something.obj},
1169@code{something.obj.gz} and @code{something.mtl}) and generates interleaved
1170vertex data for each material ready for rendering.
1171
1172A simple (optional) visualization module is also provided for rendering the
1173object(s). The interleaved data can also be used by more modern renderers
1174thought VBOs or VAOs.
1175
1176Currently the most commonly used features in the specification has been
1177implemented:
1178@itemize
1179@item positions;
1180@item texture coordinates;
1181@item normals;
1182@item vertex color;
1183@item material parsing;
1184@item texture and texture parameters.
1185@end itemize")
1186 (license license:bsd-3)))
1187
1188(define-public python-qtawesome
1189 (package
1190 (name "python-qtawesome")
1191 (version "1.4.2")
1192 (source
1193 (origin
1194 (method git-fetch)
1195 (uri (git-reference
1196 (url "https://github.com/spyder-ide/qtawesome")
1197 (commit (string-append "v" version))))
1198 (file-name (git-file-name name version))
1199 (sha256
1200 (base32 "16vjnngg5hjmmbp0c2ikgc88g8q0l44n1w3wa04ga5zfhd1yhyn2"))))
1201 (build-system pyproject-build-system)
1202 (arguments
1203 (list
1204 #:test-flags
1205 ;; Actually just ::test_get_fonts_info would be better.
1206 #~(list "--ignore" "qtawesome/tests/test_qtawesome.py")
1207 #:phases
1208 #~(modify-phases %standard-phases
1209 (add-before 'check 'setenv
1210 (lambda _
1211 (setenv "QT_QPA_PLATFORM" "offscreen"))))))
1212 (propagated-inputs (list python-qtpy python-pyqt-6))
1213 (native-inputs (list python-pytest python-pytest-qt python-setuptools))
1214 (home-page "https://github.com/spyder-ide/qtawesome")
1215 (synopsis "FontAwesome icons in PyQt and PySide applications")
1216 (description
1217 "@code{FontAwesome} icons in @code{PyQt} and @code{PySide} applications.")
1218 (license license:expat)))
1219
1220(define-public python-vispy
1221 (package
1222 (name "python-vispy")
1223 (version "0.14.3")
1224 (source
1225 (origin
1226 (method url-fetch)
1227 (uri (pypi-uri "vispy" version))
1228 (sha256
1229 (base32 "07fkk4bdffn0iq5cprk7ydj978rqc4lvzfcs2vkzgfh8m53vifzg"))))
1230 (build-system pyproject-build-system)
1231 (arguments
1232 (list
1233 #:test-flags
1234 ;; Test requiring network access to download test data from
1235 ;; <https://raw.githubusercontent.com/vispy/demo-data/main/CONTRIBUTING.txt>.
1236 #~(list "-k" (string-append "not test_read_write_image"
1237 " and not test_wavefront"
1238 " and not test_config"))
1239 #:phases
1240 #~(modify-phases %standard-phases
1241 (add-after 'unpack 'patch-library-path
1242 (lambda _
1243 (substitute* (list "vispy/ext/egl.py"
1244 "vispy/ext/fontconfig.py"
1245 "vispy/gloo/gl/es2.py"
1246 "vispy/gloo/gl/gl2.py")
1247 (("ctypes\\.util\\.find_library\\('EGL'\\)")
1248 (format #f "'~a/~a'" #$(this-package-input "mesa")
1249 "lib/libEGL.so"))
1250 (("ctypes\\.util\\.find_library\\('GL'\\)")
1251 (format #f "'~a/~a'" #$(this-package-input "mesa")
1252 "lib/libGL.so"))
1253 (("ctypes\\.util\\.find_library\\('GLESv2'\\)")
1254 (format #f "'~a/~a'" #$(this-package-input "mesa")
1255 "lib/libGLESv2.so"))
1256 (("util\\.find_library\\('fontconfig'\\)")
1257 (format #f "'~a/~a'" #$(this-package-input "fontconfig-minimal")
1258 "lib/libfontconfig.so")))))
1259 (add-before 'check 'prepare-test-environment
1260 (lambda _
1261 ;; XXX: Check how to set DPI to run headless tests, fails when
1262 ;; DISPLAY is set.
1263 ;; E RuntimeError: could not determine DPI
1264 (setenv "HOME" "/tmp")
1265 (invoke "python" "setup.py" "build_ext" "--inplace"))))))
1266 (native-inputs
1267 (list python-cython
1268 python-pytest
1269 python-setuptools
1270 python-setuptools-scm
1271 python-wheel))
1272 (inputs
1273 (list fontconfig
1274 mesa))
1275 (propagated-inputs
1276 (list python-freetype-py
1277 python-hsluv
1278 python-kiwisolver
1279 python-meshio
1280 python-numpy
1281 python-packaging
1282 python-pillow))
1283 (home-page "http://vispy.org")
1284 (synopsis "Interactive scientific visualization in Python")
1285 (description
1286 "VisPy is a high-performance interactive 2D/3D data visualization library
1287leveraging the computational power of modern Graphics Processing Units (GPUs)
1288through the OpenGL library to display very large datasets.")
1289 (license license:bsd-3)))
1290
1291;;;
1292;;; Avoid adding new packages to the end of this file. To reduce the chances
1293;;; of a merge conflict, place them above in alphabetical order.
1294;;;