projects/guix·blob librewolf-updates · refs

915 lines · 35.8 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;;;
17;;; This file is part of GNU Guix.
18;;;
19;;; GNU Guix is free software; you can redistribute it and/or modify it
20;;; under the terms of the GNU General Public License as published by
21;;; the Free Software Foundation; either version 3 of the License, or (at
22;;; your option) any later version.
23;;;
24;;; GNU Guix is distributed in the hope that it will be useful, but
25;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27;;; GNU General Public License for more details.
28;;;
29;;; You should have received a copy of the GNU General Public License
30;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31
32(define-module (gnu packages python-graphics)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (guix build-system pyproject)
35 #:use-module (guix build-system python)
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 graphics)
51 #:use-module (gnu packages gstreamer)
52 #:use-module (gnu packages gtk)
53 #:use-module (gnu packages image)
54 #:use-module (gnu packages maths)
55 #:use-module (gnu packages pkg-config)
56 #:use-module (gnu packages pulseaudio)
57 #:use-module (gnu packages python)
58 #:use-module (gnu packages python-build)
59 #:use-module (gnu packages python-check)
60 #:use-module (gnu packages python-web)
61 #:use-module (gnu packages python-xyz)
62 #:use-module (gnu packages qt)
63 #:use-module (gnu packages sdl)
64 #:use-module (gnu packages simulation)
65 #:use-module (gnu packages swig)
66 #:use-module (gnu packages video)
67 #:use-module (gnu packages xorg))
68
69;;; Commentary:
70;;;
71;;; Python modules which are meant to be used in GUI creation or mainly are
72;;; bindings to low level libraries such as Glue, Mesa, OpenGL, Xorg etc.
73;;;
74;;; Please: Try to add new module packages in alphabetic order.
75;;;
76;;; Code:
77
78(define-public python-asyncgui
79 (package
80 (name "python-asyncgui")
81 (version "0.8.0")
82 (source
83 (origin
84 (method git-fetch) ; no tests in PyPI release
85 (uri (git-reference
86 (url "https://github.com/asyncgui/asyncgui")
87 (commit version)))
88 (file-name (git-file-name name version))
89 (sha256
90 (base32 "1b074msb580wify2wag3swm3s21x23kckxpw974y6dibsmrfr5n3"))))
91 (build-system pyproject-build-system)
92 (native-inputs
93 (list python-poetry-core
94 python-pytest))
95 (home-page "https://github.com/asyncgui/asyncgui")
96 (synopsis "Enables async/await without an event loop")
97 (description
98 "This package provides support for async/await applications without
99requiring an event loop, useful for creative responsive GUIs.")
100 (license license:expat)))
101
102(define-public python-asynckivy
103 (package
104 (name "python-asynckivy")
105 (version "0.8.1")
106 (source
107 (origin
108 (method git-fetch) ; no tests in PyPI release
109 (uri (git-reference
110 (url "https://github.com/asyncgui/asynckivy")
111 (commit version)))
112 (file-name (git-file-name name version))
113 (sha256
114 (base32 "0gjddv6d7bbjymvly2x5zaay1gyihls1c4bh7y1ppbvz15152lkj"))))
115 (build-system pyproject-build-system)
116 (arguments
117 (list
118 #:phases
119 #~(modify-phases %standard-phases
120 (add-before 'check 'set-home
121 (lambda _
122 ;; 'kivy/__init__.py' wants to create $HOME/.kivy.
123 (setenv "HOME" "/tmp"))))))
124 (native-inputs
125 (list python-poetry-core
126 python-pytest))
127 (propagated-inputs
128 (list python-kivy
129 python-asyncgui))
130 (home-page "https://github.com/asyncgui/asynckivy")
131 (synopsis "Async library for Kivy")
132 (description
133 "This package provides async versions of Kivy functions to avoid the
134callback-heavy mode of interaction typical in some Kivy applications.")
135 (license license:expat)))
136
137(define-public python-glcontext
138 (let (;; Upstream is known for abusing mutable tag, hence pinpoint the
139 ;; relevant commit.
140 (revision "2")
141 (commit "f2875abdb18b24e785c3958cc22845c81725d5cd"))
142 (package
143 (name "python-glcontext")
144 (version (git-version "3.0.0" revision commit))
145 (source
146 (origin
147 (method git-fetch)
148 (uri (git-reference
149 (url "https://github.com/moderngl/glcontext")
150 (commit commit)))
151 (file-name (git-file-name name version))
152 (sha256
153 (base32 "15pngnc4agdvm8crq782vjlb5v1qrclln5xpqiyhz3jhmipsqb8q"))))
154 (build-system pyproject-build-system)
155 (arguments
156 (list
157 #:phases
158 #~(modify-phases %standard-phases
159 (add-before 'build 'fix-lib-paths
160 (lambda* (#:key inputs outputs #:allow-other-keys)
161 (let ((mesa (assoc-ref inputs "mesa"))
162 (libx11 (assoc-ref inputs "libx11")))
163 (substitute* '("glcontext/x11.cpp"
164 "glcontext/egl.cpp")
165 (("\"libGL.so\"")
166 (string-append "\"" mesa "/lib/libGL.so\""))
167 (("\"libEGL.so\"")
168 (string-append "\"" mesa "/lib/libEGL.so\""))
169 (("\"libX11.so\"")
170 (string-append "\"" libx11 "/lib/libX11.so\"")))
171 (substitute* '("glcontext/__init__.py")
172 (("find_library\\('GL'\\)")
173 (string-append "'" mesa "/lib/libGL.so'"))
174 (("find_library\\('EGL'\\)")
175 (string-append "'" mesa "/lib/libEGL.so'"))
176 (("find_library\\(\"X11\"\\)")
177 (string-append "'" libx11 "/lib/libX11.so'"))))))
178 (add-before 'check 'prepare-test-environment
179 (lambda _
180 (system "Xvfb :1 &")
181 (setenv "DISPLAY" ":1"))))))
182 (inputs
183 (list libx11
184 mesa))
185 (native-inputs
186 (list python-psutil
187 python-pytest
188 python-setuptools
189 python-wheel
190 xorg-server-for-tests))
191 (home-page "https://github.com/moderngl/glcontext")
192 (synopsis "Portable OpenGL Context for ModernGL")
193 (description
194 "Python-glcontext is a library providing an OpenGL implementation for
195ModernGL on multiple platforms.")
196 (license license:expat))))
197
198(define-public python-glfw
199 (package
200 (name "python-glfw")
201 (version "2.8.0")
202 (source
203 (origin
204 (method url-fetch)
205 (uri (pypi-uri "glfw" version))
206 (sha256
207 (base32 "1w36jvn6fx8p7irhwj6bbl67m2id3s0227b3w7bgw9hbicr0vsch"))))
208 (build-system pyproject-build-system)
209 (arguments
210 (list
211 #:tests? #f ; no tests provided
212 #:phases
213 #~(modify-phases %standard-phases
214 (add-after 'unpack 'fix-lib-paths
215 (lambda _
216 (substitute* "glfw/library.py"
217 (("_get_library_search_paths\\(\\), ")
218 (format #f "[ '~a/lib' ],"
219 #$(this-package-input "glfw")))))))))
220 (native-inputs
221 (list python-pytest
222 python-setuptools
223 python-wheel))
224 (inputs
225 (list glfw))
226 (home-page "https://github.com/FlorianRhiem/pyGLFW")
227 (synopsis "Python bindings for GLFW")
228 (description
229 "This package provides Python bindings for @url{http://www.glfw.org/,
230GLFW} OpenGL application development library.")
231 (license license:expat)))
232
233(define-public python-kivy
234 (package
235 (name "python-kivy")
236 (version "2.3.1")
237 (source
238 (origin
239 (method url-fetch)
240 (uri (pypi-uri "Kivy" version))
241 (sha256
242 (base32 "1ngrnkrp6xgfl4x32i2nv3bml13l8qwa87cwrymv9k826ng98cq8"))))
243 (build-system pyproject-build-system)
244 (arguments
245 `(#:tests? #f ; Tests require many optional packages
246 #:phases
247 (modify-phases %standard-phases
248 (add-after 'patch-generated-file-shebangs 'set-sdl-paths
249 (lambda* (#:key inputs #:allow-other-keys)
250 (setenv "KIVY_SDL2_PATH"
251 (search-input-directory inputs "/include/SDL2"))))
252 (add-before 'build 'set-home
253 (lambda _
254 ;; 'kivy/__init__.py' wants to create $HOME/.kivy.
255 (setenv "HOME" (getcwd)))))))
256 (native-inputs
257 (list pkg-config
258 python-cython-0
259 ;; Not packaged yet, for tests.
260 ;; python-kivy-deps-glew
261 ;; python-kivy-deps-glew-dev
262 ;; python-kivy-deps-gstreamer
263 ;; python-kivy-deps-gstreamer-dev
264 ;; python-kivy-deps-sdl2
265 ;; python-kivy-deps-sdl2-dev
266 python-packaging
267 python-setuptools
268 python-wheel))
269 (inputs
270 (list gstreamer
271 mesa
272 (sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf))))
273 (propagated-inputs
274 (list python-docutils
275 python-filetype
276 python-kivy-garden
277 python-pygments
278 python-requests))
279 (home-page "https://kivy.org")
280 (synopsis "Multitouch application framework")
281 (description
282 "Kivy is a software library for rapid development of hardware-accelerated
283multitouch applications.")
284 (license license:expat)))
285
286(define-public python-kivymd
287 (package
288 (name "python-kivymd")
289 (version "1.1.1")
290 (source
291 (origin
292 (method git-fetch) ; no tests in PyPI release
293 (uri (git-reference
294 (url "https://github.com/kivymd/KivyMD")
295 (commit version)))
296 (file-name (git-file-name name version))
297 (sha256
298 (base32 "1nprldcm54qybbwf7zlb32fkmz375j8i3k3g41d6ykc6vasq3w5j"))))
299 (build-system pyproject-build-system)
300 (arguments
301 (list
302 #:test-flags
303 ;; <https://github.com/pyinstaller/pyinstaller> is not packaged yet in
304 ;; Guix.
305 #~(list "--ignore=kivymd/tests/pyinstaller"
306 "-k" (string-join
307 ;; FIXME: Only some tests passed, the most fail with err:
308 ;; ValueError: KivyMD: App object must be initialized
309 ;; before loading root widget.
310 (list "not test_backdrop_raw_app"
311 "test_bottom_navigation_m3_style_raw_app"
312 "test_card_m3_style_raw_app"
313 "test_chip_raw_app"
314 "test_imagelist_raw_app"
315 "test_list_raw_app"
316 "test_navigationdrawer_raw_app"
317 "test_tab_raw_app"
318 "test_textfield_raw_app")
319 " and not "))
320 #:phases
321 #~(modify-phases %standard-phases
322 (add-after 'unpack 'fix-modules
323 (lambda _
324 (substitute* "setup.py"
325 ;; If excluded, sanity check fails with error:
326 ;; ModuleNotFoundError: No module named 'kivymd.tools.release'
327 (("\"kivymd.tools.release\"") ""))
328 ;; Check phase fails struggling to find tests module.
329 (with-output-to-file "kivymd/tests/__init__.py"
330 (lambda _ (display "")))))
331 (add-before 'build 'set-home
332 (lambda _
333 ;; FileNotFoundError: [Errno 2] No such file or directory:
334 ;; '/homeless-shelter/.kivy'
335 (setenv "HOME" "/tmp"))))))
336 (native-inputs
337 (list python-docutils
338 python-pytest
339 python-pytest-asyncio
340 python-setuptools
341 python-wheel))
342 (propagated-inputs
343 (list python-kivy
344 python-pillow
345 python-pygments
346 python-kivy-garden))
347 (home-page "https://github.com/kivymd/KivyMD")
348 (synopsis "Material Design compliant widgets for use with Kivy")
349 (description
350 "This package provides Kivy widgets that approximate Google's Material
351Design spec without sacrificing ease of use or application performance.")
352 (license license:expat)))
353
354(define-public python-pivy
355 (package
356 (name "python-pivy")
357 (version "0.6.8")
358 (source
359 (origin
360 (method git-fetch)
361 (uri (git-reference
362 (url "https://github.com/coin3d/pivy")
363 (commit version)))
364 (file-name (git-file-name name version))
365 (sha256
366 (base32 "00l4r06dwmgn8h29nrl3g3yv33cfyizyylk28x1j95qyj36sggfb"))))
367 (build-system python-build-system)
368 (arguments
369 (list
370 ;; The test suite fails due to an import cycle between 'pivy' and '_coin'
371 #:tests? #f
372 #:phases
373 #~(modify-phases %standard-phases
374 (add-after 'unpack 'patch-cmake-include-dirs
375 (lambda _
376 ;; Patch buildsystem to respect Coin3D include directory
377 (substitute* "CMakeLists.txt"
378 (("\\$\\{SoQt_INCLUDE_DIRS}")
379 "${Coin_INCLUDE_DIR};${SoQt_INCLUDE_DIRS}")))))))
380 (native-inputs
381 (list cmake-minimal swig-4.0))
382 (inputs
383 (list python-wrapper
384 qtbase-5
385 libxi
386 libice
387 glew
388 coin3d))
389 (home-page "https://github.com/coin3d/pivy")
390 (synopsis "Python bindings to Coin3D")
391 (description
392 "Pivy provides python bindings for Coin, a 3D graphics library with an
393Application Programming Interface based on the Open Inventor 2.1 API.")
394 (license license:isc)))
395
396(define-public python-py3exiv2
397 (package
398 (name "python-py3exiv2")
399 (version "0.12.0")
400 (source
401 (origin
402 (method url-fetch)
403 ;; Source: https://code.launchpad.net/py3exiv2
404 (uri (pypi-uri "py3exiv2" version))
405 (sha256
406 (base32 "12is7xb393wvq3la9lhi0y1xkmpvjj6v13cikb7k6iqcfrgkxckj"))))
407 (build-system pyproject-build-system)
408 (arguments
409 (list #:tests? #f)) ;no tests in PyPI
410 (native-inputs
411 (list boost
412 python-setuptools))
413 (inputs
414 (list exiv2))
415 (home-page "https://www.py3exiv2.tuxfamily.org/")
416 (synopsis "Python binding to the exiv2 library")
417 (description
418 "This package provides a Python binding to the library
419@code{https://exiv2.org/, exiv2} - cross-platform C++ library and a command
420line utility to manage image metadata.")
421 (license license:gpl3+)))
422
423(define-public python-pyglet
424 (package
425 (name "python-pyglet")
426 (version "2.0.18")
427 (source
428 (origin
429 (method url-fetch)
430 (uri (pypi-uri "pyglet" version))
431 (sha256
432 (base32 "1p4rizj81vfqxal288m3afbrgk0il3w7k5kmhai2sah8f26j7ybw"))))
433 (build-system pyproject-build-system)
434 (arguments
435 (list
436 #:test-flags
437 #~(list "tests"
438 "--ignore=tests/interactive"
439 ;; All tests errored
440 "--ignore=tests/integration/media/test_openal.py"
441 "--ignore=tests/integration/text/test_empty_document.py"
442 ;; Tests failed
443 "-k" (string-append "not test2"
444 " and not test5"
445 " and not testPad"
446 " and not testPad"
447 " and not testRange"
448 " and not testRect"
449 " and not testRect"
450 " and not testSet"
451 " and not testSquare"
452 " and not testSquare"
453 " and not testTuple"
454 " and not testTupleRange"
455 " and not test_context_noshare_texture"
456 " and not test_context_share_texture"
457 " and not test_method"
458 " and not test_openal_listener"
459 " and not test_parse_all_controller_mappings"
460 " and not test_player_play"
461 " and not test_player_play_multiple"
462 " and not test_stream_write_needed"
463 " and not test_window_caption"
464 " and not test_window_caption_from_argv"))
465 #:phases
466 #~(modify-phases %standard-phases
467 (add-after 'unpack 'patch-lib-paths
468 (lambda* (#:key inputs #:allow-other-keys)
469 (substitute* (list "pyglet/font/fontconfig.py"
470 "pyglet/font/freetype_lib.py"
471 "pyglet/gl/lib_glx.py"
472 "pyglet/input/linux/evdev.py"
473 "pyglet/libs/egl/egl.py"
474 "pyglet/libs/egl/lib.py"
475 "pyglet/libs/x11/xf86vmode.py"
476 "pyglet/libs/x11/xinerama.py"
477 "pyglet/libs/x11/xlib.py"
478 "pyglet/libs/x11/xsync.py"
479 "pyglet/media/drivers/openal/lib_openal.py"
480 "pyglet/media/drivers/pulse/lib_pulseaudio.py")
481 (("'EGL'")
482 (format #f "'~a/~a'" #$(this-package-input "mesa")
483 "lib/libEGL.so"))
484 (("\"fontconfig\"")
485 (format #f "'~a/~a'" #$(this-package-input "fontconfig-minimal")
486 "lib/libfontconfig.so"))
487 (("\"freetype\"")
488 (format #f "'~a/~a'" #$(this-package-input "freetype")
489 "lib/libfreetype.so"))
490 (("'GL'")
491 (format #f "'~a/~a'" #$(this-package-input "mesa")
492 "lib/libGL.so"))
493 (("'GLU'")
494 (format #f "'~a/~a'" #$(this-package-input "glu")
495 "lib/libGLU.so"))
496 (("'X11'")
497 (format #f "'~a/~a'" #$(this-package-input "libx11")
498 "lib/libX11.so"))
499 (("'Xext'")
500 (format #f "'~a/~a'" #$(this-package-input "libxext")
501 "lib/libXext.so"))
502 (("'Xinerama'")
503 (format #f "'~a/~a'" #$(this-package-input "libxinerama")
504 "lib/libXinerama.so"))
505 (("'Xxf86vm'")
506 (format #f "'~a/~a'" #$(this-package-input "libxxf86vm")
507 "lib/libXxf86vm.so"))
508 (("'c'")
509 (format #f "'~a/~a'" #$(this-package-input "glibc")
510 "lib/libc.so"))
511 (("'gdk-x11-2.0'")
512 (format #f "'~a/~a'" #$(this-package-input "gtk+")
513 "lib/gdk-pixbuf-2.0.so"))
514 (("'gdk_pixbuf-2.0'")
515 (format #f "'~a/~a'" #$(this-package-input "gdk-pixbuf")
516 "lib/libgdk_pixbuf-2.0.so"))
517 (("'openal'")
518 (format #f "'~a/~a'" #$(this-package-input "openal")
519 "lib/libopenal.so"))
520 (("'pulse'")
521 (format #f "'~a/~a'" #$(this-package-input "pulseaudio")
522 "lib/libpulse.so")))))
523 (add-before 'check 'prepare-test-environment
524 (lambda _
525 ;; The test suite requires a running X server.
526 (system "Xvfb :1 &")
527 (setenv "DISPLAY" ":1")
528 (setenv "HOME" "/tmp")
529 (setenv "PYGLET_HEADLESS" "True"))))))
530 (native-inputs
531 (list python-flit-core
532 python-pytest
533 unzip
534 xorg-server-for-tests))
535 (inputs
536 (list ffmpeg
537 fontconfig
538 freeglut
539 freetype
540 gdk-pixbuf
541 glibc
542 glu
543 gtk+
544 libx11
545 libxext
546 libxinerama
547 libxxf86vm
548 mesa
549 openal
550 pulseaudio))
551 (home-page "https://github.com/pyglet/pyglet")
552 (synopsis "Windowing and multimedia library")
553 (description
554 "Pyglet is a Python library for developing games and other visually-rich
555applications. It supports windowing, user interface event handling,
556Joysticks, OpenGL graphics, loading images and videos, playing sounds and
557music." )
558 (license license:bsd-3)))
559
560(define-public python-pyglet-1
561 (package
562 (inherit python-pyglet)
563 (name "python-pyglet")
564 (version "1.5.30") ;the latest 1.* version from 2024-12-24
565 (source
566 (origin
567 (method git-fetch)
568 (uri (git-reference
569 (url "https://github.com/pyglet/pyglet")
570 (commit (string-append "v" version))))
571 (file-name (git-file-name name version))
572 (sha256
573 (base32 "0q1690pqkks3na6vc8ps44h0gymlmq752xlk7fm0yvz05yqdqn51"))))
574 (arguments
575 (list
576 ;; tests: 317 passed, 24 skipped, 1 deselected, 2 warnings
577 #:test-flags
578 #~(list "--ignore=tests/base"
579 "--ignore=tests/interactive"
580 "--ignore=tests/integration/media"
581 "--ignore=tests/integration/font"
582 "--ignore=tests/integration/platform/test_linux_fontconfig.py"
583 ;; AssertionError: False is not true : Did not receive next
584 ;; expected event
585 "--ignore=tests/integration/window/test_event_sequence.py"
586 ;; pyglet.media.drivers.openal.interface.OpenALException: OpenAL
587 ;; Exception [40964: b'Invalid Value']: Failed to open device.
588 "--deselect=tests/unit/media/test_listener.py::test_openal_listener")
589 #:phases
590 #~(modify-phases %standard-phases
591 (add-after 'unpack 'patch-lib-paths
592 (lambda* (#:key inputs #:allow-other-keys)
593 (substitute* (list "pyglet/font/fontconfig.py"
594 "pyglet/font/freetype_lib.py"
595 "pyglet/gl/lib_glx.py"
596 "pyglet/libs/egl/egl.py"
597 "pyglet/libs/egl/lib.py"
598 "pyglet/libs/x11/xf86vmode.py"
599 "pyglet/libs/x11/xinerama.py"
600 "pyglet/libs/x11/xlib.py"
601 "pyglet/libs/x11/xsync.py"
602 "pyglet/media/drivers/openal/lib_openal.py"
603 "pyglet/media/drivers/pulse/lib_pulseaudio.py")
604 (("'EGL'")
605 (format #f "'~a/~a'" #$(this-package-input "mesa")
606 "lib/libEGL.so"))
607 (("'fontconfig'")
608 (format #f "'~a/~a'" #$(this-package-input "fontconfig-minimal")
609 "lib/libfontconfig.so"))
610 (("'freetype'")
611 (format #f "'~a/~a'" #$(this-package-input "freetype")
612 "lib/libfreetype.so"))
613 (("'GL'")
614 (format #f "'~a/~a'" #$(this-package-input "mesa")
615 "lib/libGL.so"))
616 (("'GLU'")
617 (format #f "'~a/~a'" #$(this-package-input "glu")
618 "lib/libGLU.so"))
619 (("'X11'")
620 (format #f "'~a/~a'" #$(this-package-input "libx11")
621 "lib/libX11.so"))
622 (("'Xext'")
623 (format #f "'~a/~a'" #$(this-package-input "libxext")
624 "lib/libXext.so"))
625 (("'Xinerama'")
626 (format #f "'~a/~a'" #$(this-package-input "libxinerama")
627 "lib/libXinerama.so"))
628 (("'Xxf86vm'")
629 (format #f "'~a/~a'" #$(this-package-input "libxxf86vm")
630 "lib/libXxf86vm.so"))
631 (("'c'")
632 (format #f "'~a/~a'" #$(this-package-input "glibc")
633 "lib/libc.so"))
634 (("'gdk-x11-2.0'")
635 (format #f "'~a/~a'" #$(this-package-input "gtk+")
636 "lib/gdk-pixbuf-2.0.so"))
637 (("'gdk_pixbuf-2.0'")
638 (format #f "'~a/~a'" #$(this-package-input "gdk-pixbuf")
639 "lib/libgdk_pixbuf-2.0.so"))
640 (("'openal'")
641 (format #f "'~a/~a'" #$(this-package-input "openal")
642 "lib/libopenal.so"))
643 (("'pulse'")
644 (format #f "'~a/~a'" #$(this-package-input "pulseaudio")
645 "lib/libpulse.so")))))
646 (add-before 'check 'prepare-test-environment
647 (lambda _
648 ;; The test suite requires a running X server.
649 (system "Xvfb :1 &")
650 (setenv "DISPLAY" ":1")
651 (setenv "HOME" "/tmp")
652 (setenv "PYGLET_HEADLESS" "True"))))))
653 (native-inputs
654 (list python-pytest
655 python-setuptools
656 xorg-server-for-tests))))
657
658(define-public python-pyopengl
659 (package
660 (name "python-pyopengl")
661 (version "3.1.9")
662 (source
663 (origin
664 (method url-fetch)
665 (uri (pypi-uri "PyOpenGL" version))
666 (sha256
667 (base32
668 "09syrsfrcknr1k2wmj05gfd5d0dyjfxzbipzbd0agv9775vwi9lf"))))
669 (build-system pyproject-build-system)
670 (arguments
671 (list
672 ;; tests: 54 passed, 5 skipped, 8 deselected, 5 warnings
673 #:test-flags
674 #~(list "-k" (string-join
675 ;; XXX: Check why these test fail.
676 (list "not test_get_read_fb_binding"
677 "test_get_version"
678 "test_glCallLists_twice2"
679 "test_glmultidraw"
680 "test_lookupint"
681 "test_numpyConversion"
682 "test_pointers")
683 " and not ")
684 ;; TypeError: list indices must be integers or slices, not
685 ;; numpy.bool
686 "--deselect=tests/test_core.py::TestCore::test_vbo")
687 #:phases
688 #~(modify-phases %standard-phases
689 (add-before 'build 'fix-paths
690 (lambda _
691 (substitute* '("OpenGL/platform/ctypesloader.py")
692 (("filenames_to_try = \\[\\]") "filenames_to_try = [name]"))
693 (substitute* '("OpenGL/platform/glx.py"
694 "OpenGL/platform/egl.py"
695 "OpenGL/platform/osmesa.py"
696 "OpenGL/platform/darwin.py"
697 "tests/check_glut_load.py")
698 (("'GLU'")
699 (format #f "'~a/~a'" #$(this-package-input "glu")
700 "lib/libGLU.so"))
701 (("'glut',")
702 (format #f "'~a/~a'," #$(this-package-input "freeglut")
703 "lib/libglut.so"))
704 (("'(GL|EGL|GLESv1_CM|GLESv2|OSMesa)'" all gl-library)
705 (format #f "'~a/~a'" #$(this-package-input "mesa")
706 (string-append "lib/lib" gl-library ".so"))))
707 ;; Not providing libgle. It seems to be very old.
708 )))))
709 (native-inputs
710 (list python-cython
711 python-numpy
712 python-pygame
713 python-pytest
714 python-setuptools
715 python-wheel))
716 (inputs
717 (list freeglut
718 glu
719 mesa))
720 (home-page "https://pyopengl.sourceforge.net")
721 (synopsis "Standard OpenGL bindings for Python")
722 (description
723 "PyOpenGL is the most common cross platform Python binding to OpenGL and
724related APIs. The binding is created using the standard @code{ctypes}
725library.")
726 (license license:bsd-3)))
727
728(define-public python-pyopengl-accelerate
729 (package
730 (inherit python-pyopengl)
731 (name "python-pyopengl-accelerate")
732 (version "3.1.10")
733 (source
734 (origin
735 (method url-fetch)
736 (uri (pypi-uri "pyopengl_accelerate" version))
737 (sha256
738 (base32
739 "0waskwvw9mp830bnnxcqd8bkh7a4qbnr0fcjnnw35xx6y21iqxc2"))))
740 (arguments
741 `(#:tests? #f
742 #:phases
743 (modify-phases %standard-phases
744 (delete 'fix-paths))))
745 (synopsis "Acceleration code for PyOpenGL")
746 (description
747 "This is the Cython-coded accelerator module for PyOpenGL.")))
748
749(define-public python-pysdl2
750 (package
751 (name "python-pysdl2")
752 (version "0.9.17")
753 (source
754 (origin
755 (method url-fetch)
756 (uri (pypi-uri "pysdl2" version))
757 (sha256
758 (base32 "0axm6m3wj8x643zg65g60xdpaxanaqdilvp4yysks4pblh0yzij8"))))
759 (build-system pyproject-build-system)
760 (arguments
761 (list
762 #:tests? #f ;; Requires /dev/dri, OpenGL module, etc.
763 #:phases
764 #~(modify-phases %standard-phases
765 (add-after 'unpack 'patch-paths
766 (lambda _
767 (substitute* "sdl2/dll.py"
768 ;; Disable pysdl2-dll. It can't be packaged on GNU Guix
769 ;; as it duplicates an existing package (sdl2).
770 (("prepath = os\\.getenv\\('PYSDL2_DLL_PATH'\\)")
771 "prepath = \"system\"")
772 (("^import sdl2dll$") "")
773 (("postpath = os\\.getenv\\('PYSDL2_DLL_PATH'\\)")
774 "postpath = \"system\"")
775 (("DLL\\(.*, os\\.getenv\\(\"PYSDL2_DLL_PATH\"\\)\\)")
776 (format #f "DLL('SDL2', ['SDL2', 'SDL2-2.0', 'SDL2-2.0.0'], '~a/lib')"
777 #$(this-package-input "sdl2"))))
778 (substitute* "sdl2/sdlimage.py"
779 (("os\\.getenv\\(\"PYSDL2_DLL_PATH\"\\)")
780 (format #f "'~a/~a'" #$(this-package-input "sdl2-image")
781 "lib/libSDL2_image.so")))
782 (substitute* "sdl2/sdlgfx.py"
783 (("os\\.getenv\\(\"PYSDL2_DLL_PATH\"\\)")
784 (format #f "'~a/~a'" #$(this-package-input "sdl2-gfx")
785 "lib/libSDL2_gfx.so")))
786 (substitute* "sdl2/sdlmixer.py"
787 (("os\\.getenv\\(\"PYSDL2_DLL_PATH\"\\)")
788 (format #f "'~a/~a'" #$(this-package-input "sdl2-mixer")
789 "lib/libSDL2_mixer.so")))
790 (substitute* "sdl2/sdlttf.py"
791 (("os\\.getenv\\(\"PYSDL2_DLL_PATH\"\\)")
792 (format #f "'~a/~a'" #$(this-package-input "sdl2-ttf")
793 "lib/libSDL2_ttf.so"))))))))
794 (native-inputs
795 (list python-setuptools
796 python-wheel))
797 (inputs
798 (list sdl2 sdl2-image sdl2-gfx sdl2-mixer sdl2-ttf))
799 (home-page "https://github.com/py-sdl/py-sdl2")
800 (synopsis "Python bindings around the SDL2 game development library")
801 (description
802 "PySDL2 is a pure Python wrapper around the
803@code{SDL2},@code{SDL2_mixer}, @code{SDL2_image}, @code{SDL2_ttf}, and
804@code{SDL2_gfx} libraries. Instead of relying on C code, it uses the built-in
805ctypes module to interface with SDL2, and provides simple Python classes and
806wrappers for common SDL2 functionality.")
807 (license license:cc0)))
808
809(define-public python-qtawesome
810 (package
811 (name "python-qtawesome")
812 (version "1.4.0")
813 (source
814 (origin
815 (method git-fetch)
816 (uri (git-reference
817 (url "https://github.com/spyder-ide/qtawesome")
818 (commit (string-append "v" version))))
819 (file-name (git-file-name name version))
820 (sha256
821 (base32 "109anjlnin5cafx579clj1x21ggig3qkcm2g1wlx0lshxqzjadan"))))
822 (build-system pyproject-build-system)
823 (arguments
824 (list
825 #:test-flags
826 ;; Actually just ::test_get_fonts_info would be better.
827 #~(list "--ignore" "qtawesome/tests/test_qtawesome.py")
828 #:phases
829 #~(modify-phases %standard-phases
830 (add-before 'check 'setenv
831 (lambda _
832 (setenv "QT_QPA_PLATFORM" "offscreen"))))))
833 (propagated-inputs (list python-qtpy python-pyqt))
834 (native-inputs (list python-pytest python-pytest-qt python-setuptools))
835 (home-page "https://github.com/spyder-ide/qtawesome")
836 (synopsis "FontAwesome icons in PyQt and PySide applications")
837 (description
838 "@code{FontAwesome} icons in @code{PyQt} and @code{PySide} applications.")
839 (license license:expat)))
840
841(define-public python-vispy
842 (package
843 (name "python-vispy")
844 (version "0.14.3")
845 (source
846 (origin
847 (method url-fetch)
848 (uri (pypi-uri "vispy" version))
849 (sha256
850 (base32 "07fkk4bdffn0iq5cprk7ydj978rqc4lvzfcs2vkzgfh8m53vifzg"))))
851 (build-system pyproject-build-system)
852 (arguments
853 (list
854 #:test-flags
855 ;; Test requiring network access to download test data from
856 ;; <https://raw.githubusercontent.com/vispy/demo-data/main/CONTRIBUTING.txt>.
857 #~(list "-k" (string-append "not test_read_write_image"
858 " and not test_wavefront"
859 " and not test_config"))
860 #:phases
861 #~(modify-phases %standard-phases
862 (add-after 'unpack 'patch-library-path
863 (lambda _
864 (substitute* (list "vispy/ext/egl.py"
865 "vispy/ext/fontconfig.py"
866 "vispy/gloo/gl/es2.py"
867 "vispy/gloo/gl/gl2.py")
868 (("ctypes\\.util\\.find_library\\('EGL'\\)")
869 (format #f "'~a/~a'" #$(this-package-input "mesa")
870 "lib/libEGL.so"))
871 (("ctypes\\.util\\.find_library\\('GL'\\)")
872 (format #f "'~a/~a'" #$(this-package-input "mesa")
873 "lib/libGL.so"))
874 (("ctypes\\.util\\.find_library\\('GLESv2'\\)")
875 (format #f "'~a/~a'" #$(this-package-input "mesa")
876 "lib/libGLESv2.so"))
877 (("util\\.find_library\\('fontconfig'\\)")
878 (format #f "'~a/~a'" #$(this-package-input "fontconfig-minimal")
879 "lib/libfontconfig.so")))))
880 (add-before 'check 'prepare-test-environment
881 (lambda _
882 ;; XXX: Check how to set DPI to run headless tests, fails when
883 ;; DISPLAY is set.
884 ;; E RuntimeError: could not determine DPI
885 (setenv "HOME" "/tmp")
886 (invoke "python" "setup.py" "build_ext" "--inplace"))))))
887 (native-inputs
888 (list python-cython
889 python-pytest
890 python-setuptools
891 python-setuptools-scm
892 python-wheel))
893 (inputs
894 (list fontconfig
895 mesa))
896 (propagated-inputs
897 (list python-freetype-py
898 python-hsluv
899 python-kiwisolver
900 python-meshio
901 python-numpy
902 python-packaging
903 python-pillow))
904 (home-page "http://vispy.org")
905 (synopsis "Interactive scientific visualization in Python")
906 (description
907 "VisPy is a high-performance interactive 2D/3D data visualization library
908leveraging the computational power of modern Graphics Processing Units (GPUs)
909through the OpenGL library to display very large datasets.")
910 (license license:bsd-3)))
911
912;;;
913;;; Avoid adding new packages to the end of this file. To reduce the chances
914;;; of a merge conflict, place them above in alphabetical order.
915;;;