projects/guix·blob rename-kernel-team · refs

962 lines · 38.7 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 download)
36 #:use-module (guix gexp)
37 #:use-module (guix git-download)
38 #:use-module (guix packages)
39 #:use-module (gnu packages)
40 #:use-module (gnu packages audio)
41 #:use-module (gnu packages base)
42 #:use-module (gnu packages boost)
43 #:use-module (gnu packages check)
44 #:use-module (gnu packages cmake)
45 #:use-module (gnu packages compression)
46 #:use-module (gnu packages fontutils)
47 #:use-module (gnu packages game-development)
48 #:use-module (gnu packages gl)
49 #:use-module (gnu packages graphics)
50 #:use-module (gnu packages gstreamer)
51 #:use-module (gnu packages gtk)
52 #:use-module (gnu packages image)
53 #:use-module (gnu packages maths)
54 #:use-module (gnu packages pkg-config)
55 #:use-module (gnu packages pulseaudio)
56 #:use-module (gnu packages python)
57 #:use-module (gnu packages python-build)
58 #:use-module (gnu packages python-check)
59 #:use-module (gnu packages python-web)
60 #:use-module (gnu packages python-xyz)
61 #:use-module (gnu packages qt)
62 #:use-module (gnu packages sdl)
63 #:use-module (gnu packages simulation)
64 #:use-module (gnu packages swig)
65 #:use-module (gnu packages video)
66 #:use-module (gnu packages xorg))
67
68;;; Commentary:
69;;;
70;;; Python modules which are meant to be used in GUI creation or mainly are
71;;; bindings to low level libraries such as Glue, Mesa, OpenGL, Xorg etc.
72;;;
73;;; Please: Try to add new module packages in alphabetic order.
74;;;
75;;; Code:
76
77(define-public python-asyncgui
78 (package
79 (name "python-asyncgui")
80 (version "0.8.0")
81 (source
82 (origin
83 (method git-fetch) ; no tests in PyPI release
84 (uri (git-reference
85 (url "https://github.com/asyncgui/asyncgui")
86 (commit version)))
87 (file-name (git-file-name name version))
88 (sha256
89 (base32 "1b074msb580wify2wag3swm3s21x23kckxpw974y6dibsmrfr5n3"))))
90 (build-system pyproject-build-system)
91 (native-inputs
92 (list python-poetry-core
93 python-pytest))
94 (home-page "https://github.com/asyncgui/asyncgui")
95 (synopsis "Enables async/await without an event loop")
96 (description
97 "This package provides support for async/await applications without
98requiring an event loop, useful for creative responsive GUIs.")
99 (license license:expat)))
100
101(define-public python-asynckivy
102 (package
103 (name "python-asynckivy")
104 (version "0.8.1")
105 (source
106 (origin
107 (method git-fetch) ; no tests in PyPI release
108 (uri (git-reference
109 (url "https://github.com/asyncgui/asynckivy")
110 (commit version)))
111 (file-name (git-file-name name version))
112 (sha256
113 (base32 "0gjddv6d7bbjymvly2x5zaay1gyihls1c4bh7y1ppbvz15152lkj"))))
114 (build-system pyproject-build-system)
115 (arguments
116 (list
117 #:phases
118 #~(modify-phases %standard-phases
119 (add-before 'check 'set-home
120 (lambda _
121 ;; 'kivy/__init__.py' wants to create $HOME/.kivy.
122 (setenv "HOME" "/tmp"))))))
123 (native-inputs
124 (list python-poetry-core
125 python-pytest))
126 (propagated-inputs
127 (list python-kivy
128 python-asyncgui))
129 (home-page "https://github.com/asyncgui/asynckivy")
130 (synopsis "Async library for Kivy")
131 (description
132 "This package provides async versions of Kivy functions to avoid the
133callback-heavy mode of interaction typical in some Kivy applications.")
134 (license license:expat)))
135
136(define-public python-glcontext
137 (let (;; Upstream is known for abusing mutable tag, hence pinpoint the
138 ;; relevant commit.
139 (revision "2")
140 (commit "f2875abdb18b24e785c3958cc22845c81725d5cd"))
141 (package
142 (name "python-glcontext")
143 (version (git-version "3.0.0" revision commit))
144 (source
145 (origin
146 (method git-fetch)
147 (uri (git-reference
148 (url "https://github.com/moderngl/glcontext")
149 (commit commit)))
150 (file-name (git-file-name name version))
151 (sha256
152 (base32 "15pngnc4agdvm8crq782vjlb5v1qrclln5xpqiyhz3jhmipsqb8q"))))
153 (build-system pyproject-build-system)
154 (arguments
155 (list
156 #:phases
157 #~(modify-phases %standard-phases
158 (add-before 'build 'fix-lib-paths
159 (lambda* (#:key inputs outputs #:allow-other-keys)
160 (let ((mesa (assoc-ref inputs "mesa"))
161 (libx11 (assoc-ref inputs "libx11")))
162 (substitute* '("glcontext/x11.cpp"
163 "glcontext/egl.cpp")
164 (("\"libGL.so\"")
165 (string-append "\"" mesa "/lib/libGL.so\""))
166 (("\"libEGL.so\"")
167 (string-append "\"" mesa "/lib/libEGL.so\""))
168 (("\"libX11.so\"")
169 (string-append "\"" libx11 "/lib/libX11.so\"")))
170 (substitute* '("glcontext/__init__.py")
171 (("find_library\\('GL'\\)")
172 (string-append "'" mesa "/lib/libGL.so'"))
173 (("find_library\\('EGL'\\)")
174 (string-append "'" mesa "/lib/libEGL.so'"))
175 (("find_library\\(\"X11\"\\)")
176 (string-append "'" libx11 "/lib/libX11.so'"))))))
177 (add-before 'check 'prepare-test-environment
178 (lambda _
179 (system "Xvfb :1 &")
180 (setenv "DISPLAY" ":1"))))))
181 (inputs
182 (list libx11
183 mesa))
184 (native-inputs
185 (list python-psutil
186 python-pytest
187 python-setuptools
188 python-wheel
189 xorg-server-for-tests))
190 (home-page "https://github.com/moderngl/glcontext")
191 (synopsis "Portable OpenGL Context for ModernGL")
192 (description
193 "Python-glcontext is a library providing an OpenGL implementation for
194ModernGL on multiple platforms.")
195 (license license:expat))))
196
197(define-public python-glfw
198 (package
199 (name "python-glfw")
200 (version "2.8.0")
201 (source
202 (origin
203 (method url-fetch)
204 (uri (pypi-uri "glfw" version))
205 (sha256
206 (base32 "1w36jvn6fx8p7irhwj6bbl67m2id3s0227b3w7bgw9hbicr0vsch"))))
207 (build-system pyproject-build-system)
208 (arguments
209 (list
210 #:tests? #f ; no tests provided
211 #:phases
212 #~(modify-phases %standard-phases
213 (add-after 'unpack 'fix-lib-paths
214 (lambda _
215 (substitute* "glfw/library.py"
216 (("_get_library_search_paths\\(\\), ")
217 (format #f "[ '~a/lib' ],"
218 #$(this-package-input "glfw")))))))))
219 (native-inputs
220 (list python-pytest
221 python-setuptools
222 python-wheel))
223 (inputs
224 (list glfw))
225 (home-page "https://github.com/FlorianRhiem/pyGLFW")
226 (synopsis "Python bindings for GLFW")
227 (description
228 "This package provides Python bindings for @url{http://www.glfw.org/,
229GLFW} OpenGL application development library.")
230 (license license:expat)))
231
232(define-public python-kivy
233 (package
234 (name "python-kivy")
235 (version "2.3.1")
236 (source
237 (origin
238 (method url-fetch)
239 (uri (pypi-uri "Kivy" version))
240 (sha256
241 (base32 "1ngrnkrp6xgfl4x32i2nv3bml13l8qwa87cwrymv9k826ng98cq8"))))
242 (build-system pyproject-build-system)
243 (arguments
244 `(#:tests? #f ; Tests require many optional packages
245 #:phases
246 (modify-phases %standard-phases
247 (add-after 'patch-generated-file-shebangs 'set-sdl-paths
248 (lambda* (#:key inputs #:allow-other-keys)
249 (setenv "KIVY_SDL2_PATH"
250 (search-input-directory inputs "/include/SDL2"))))
251 (add-before 'build 'set-home
252 (lambda _
253 ;; 'kivy/__init__.py' wants to create $HOME/.kivy.
254 (setenv "HOME" (getcwd)))))))
255 (native-inputs
256 (list pkg-config
257 python-cython-0
258 ;; Not packaged yet, for tests.
259 ;; python-kivy-deps-glew
260 ;; python-kivy-deps-glew-dev
261 ;; python-kivy-deps-gstreamer
262 ;; python-kivy-deps-gstreamer-dev
263 ;; python-kivy-deps-sdl2
264 ;; python-kivy-deps-sdl2-dev
265 python-packaging
266 python-setuptools
267 python-wheel))
268 (inputs
269 (list gstreamer
270 mesa
271 (sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf))))
272 (propagated-inputs
273 (list python-docutils
274 python-filetype
275 python-kivy-garden
276 python-pygments
277 python-requests))
278 (home-page "https://kivy.org")
279 (synopsis "Multitouch application framework")
280 (description
281 "Kivy is a software library for rapid development of hardware-accelerated
282multitouch applications.")
283 (license license:expat)))
284
285(define-public python-kivymd
286 (package
287 (name "python-kivymd")
288 (version "1.1.1")
289 (source
290 (origin
291 (method git-fetch) ; no tests in PyPI release
292 (uri (git-reference
293 (url "https://github.com/kivymd/KivyMD")
294 (commit version)))
295 (file-name (git-file-name name version))
296 (sha256
297 (base32 "1nprldcm54qybbwf7zlb32fkmz375j8i3k3g41d6ykc6vasq3w5j"))))
298 (build-system pyproject-build-system)
299 (arguments
300 (list
301 #:test-flags
302 ;; <https://github.com/pyinstaller/pyinstaller> is not packaged yet in
303 ;; Guix.
304 #~(list "--ignore=kivymd/tests/pyinstaller"
305 "-k" (string-join
306 ;; FIXME: Only some tests passed, the most fail with err:
307 ;; ValueError: KivyMD: App object must be initialized
308 ;; before loading root widget.
309 (list "not test_backdrop_raw_app"
310 "test_bottom_navigation_m3_style_raw_app"
311 "test_card_m3_style_raw_app"
312 "test_chip_raw_app"
313 "test_imagelist_raw_app"
314 "test_list_raw_app"
315 "test_navigationdrawer_raw_app"
316 "test_tab_raw_app"
317 "test_textfield_raw_app")
318 " and not "))
319 #:phases
320 #~(modify-phases %standard-phases
321 (add-after 'unpack 'fix-modules
322 (lambda _
323 (substitute* "setup.py"
324 ;; If excluded, sanity check fails with error:
325 ;; ModuleNotFoundError: No module named 'kivymd.tools.release'
326 (("\"kivymd.tools.release\"") ""))
327 ;; Check phase fails struggling to find tests module.
328 (with-output-to-file "kivymd/tests/__init__.py"
329 (lambda _ (display "")))))
330 (add-before 'build 'set-home
331 (lambda _
332 ;; FileNotFoundError: [Errno 2] No such file or directory:
333 ;; '/homeless-shelter/.kivy'
334 (setenv "HOME" "/tmp"))))))
335 (native-inputs
336 (list python-docutils
337 python-pytest
338 python-pytest-asyncio
339 python-setuptools
340 python-wheel))
341 (propagated-inputs
342 (list python-kivy
343 python-pillow
344 python-pygments
345 python-kivy-garden))
346 (home-page "https://github.com/kivymd/KivyMD")
347 (synopsis "Material Design compliant widgets for use with Kivy")
348 (description
349 "This package provides Kivy widgets that approximate Google's Material
350Design spec without sacrificing ease of use or application performance.")
351 (license license:expat)))
352
353(define-public python-pivy
354 (package
355 (name "python-pivy")
356 (version "0.6.11")
357 (source
358 (origin
359 (method git-fetch)
360 (uri (git-reference
361 (url "https://github.com/coin3d/pivy")
362 (commit version)))
363 (file-name (git-file-name name version))
364 (sha256
365 (base32 "0rjbhhxyrh0fszc0va7qmkv6ayf2s49ppnw31p51xmq63bx3n5wc"))))
366 (build-system pyproject-build-system)
367 (arguments
368 (list
369 ;; The test suite fails due to an import cycle between 'pivy' and '_coin'
370 #:tests? #f
371 #:phases
372 #~(modify-phases %standard-phases
373 (add-after 'unpack 'patch-cmake-include-dirs
374 (lambda _
375 ;; Patch buildsystem to respect Coin3D include directory
376 (substitute* "CMakeLists.txt"
377 (("\\$\\{SoQt_INCLUDE_DIRS}")
378 "${Coin_INCLUDE_DIR};${SoQt_INCLUDE_DIRS}")))))))
379 (native-inputs
380 (list cmake-minimal
381 python-setuptools
382 swig-4.4))
383 (inputs
384 (list qtbase
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 'fix-python-3.12-incompatibility
592 ;; The only user of pyglet@1 is printrun, see:
593 ;; <https://github.com/kliment/Printrun/issues/1468>.
594 (lambda _
595 (substitute* "tests/integration/test_toplevel_imports.py"
596 (("import imp") ""))))
597 (add-after 'unpack 'patch-lib-paths
598 (lambda* (#:key inputs #:allow-other-keys)
599 (substitute* (list "pyglet/font/fontconfig.py"
600 "pyglet/font/freetype_lib.py"
601 "pyglet/gl/lib_glx.py"
602 "pyglet/libs/egl/egl.py"
603 "pyglet/libs/egl/lib.py"
604 "pyglet/libs/x11/xf86vmode.py"
605 "pyglet/libs/x11/xinerama.py"
606 "pyglet/libs/x11/xlib.py"
607 "pyglet/libs/x11/xsync.py"
608 "pyglet/media/drivers/openal/lib_openal.py"
609 "pyglet/media/drivers/pulse/lib_pulseaudio.py")
610 (("'EGL'")
611 (format #f "'~a/~a'" #$(this-package-input "mesa")
612 "lib/libEGL.so"))
613 (("'fontconfig'")
614 (format #f "'~a/~a'" #$(this-package-input "fontconfig-minimal")
615 "lib/libfontconfig.so"))
616 (("'freetype'")
617 (format #f "'~a/~a'" #$(this-package-input "freetype")
618 "lib/libfreetype.so"))
619 (("'GL'")
620 (format #f "'~a/~a'" #$(this-package-input "mesa")
621 "lib/libGL.so"))
622 (("'GLU'")
623 (format #f "'~a/~a'" #$(this-package-input "glu")
624 "lib/libGLU.so"))
625 (("'X11'")
626 (format #f "'~a/~a'" #$(this-package-input "libx11")
627 "lib/libX11.so"))
628 (("'Xext'")
629 (format #f "'~a/~a'" #$(this-package-input "libxext")
630 "lib/libXext.so"))
631 (("'Xinerama'")
632 (format #f "'~a/~a'" #$(this-package-input "libxinerama")
633 "lib/libXinerama.so"))
634 (("'Xxf86vm'")
635 (format #f "'~a/~a'" #$(this-package-input "libxxf86vm")
636 "lib/libXxf86vm.so"))
637 (("'c'")
638 (format #f "'~a/~a'" #$(this-package-input "glibc")
639 "lib/libc.so"))
640 (("'gdk-x11-2.0'")
641 (format #f "'~a/~a'" #$(this-package-input "gtk+")
642 "lib/gdk-pixbuf-2.0.so"))
643 (("'gdk_pixbuf-2.0'")
644 (format #f "'~a/~a'" #$(this-package-input "gdk-pixbuf")
645 "lib/libgdk_pixbuf-2.0.so"))
646 (("'openal'")
647 (format #f "'~a/~a'" #$(this-package-input "openal")
648 "lib/libopenal.so"))
649 (("'pulse'")
650 (format #f "'~a/~a'" #$(this-package-input "pulseaudio")
651 "lib/libpulse.so")))))
652 (add-before 'check 'prepare-test-environment
653 (lambda _
654 ;; The test suite requires a running X server.
655 (system "Xvfb :1 &")
656 (setenv "DISPLAY" ":1")
657 (setenv "HOME" "/tmp")
658 (setenv "PYGLET_HEADLESS" "True"))))))
659 (native-inputs
660 (list python-pytest
661 python-setuptools
662 xorg-server-for-tests))))
663
664(define-public python-pyopengl
665 (package
666 (name "python-pyopengl")
667 (version "3.1.10")
668 (source
669 (origin
670 (method git-fetch)
671 (uri (git-reference
672 (url "https://github.com/mcfletch/pyopengl")
673 (commit version)))
674 (file-name (git-file-name name version))
675 (sha256
676 (base32 "0gn6n6z76xrvwj9inl2v6rr707n1w8s072qxfmzpla1i9bfckzjk"))))
677 (build-system pyproject-build-system)
678 (arguments
679 (list
680 ;; 62 passed, 26 skipped, 26 deselected, 2 xfailed, 2 warnings
681 #:test-flags
682 #~(list #$@(map (lambda (test) (string-append "--deselect=tests/" test))
683 (list
684 ;; RuntimeError: Test script failure on <...>
685 "test_checks.py::test_check_crash_on_glutinit"
686 "test_checks.py::test_check_egl_es1"
687 "test_checks.py::test_check_egl_es2"
688 "test_checks.py::test_check_egl_opengl"
689 "test_checks.py::test_check_glutwindow"
690 "test_checks.py::test_check_freeglut_deinit"
691 "test_checks.py::test_check_glut_debug"
692 "test_checks.py::test_check_glut_fc"
693 "test_checks.py::test_check_glut_load"
694 "test_checks.py::test_check_glutinit"
695 "test_checks.py::test_check_glutinit_0args"
696 "test_checks.py::test_check_glutinit_single"
697 "test_checks.py::test_check_glutinit_simplest"
698 "test_checks.py::test_egl_ext_enumerate"
699 "test_checks.py::test_test_instanced_draw_detect"
700 "test_checks.py::test_test_gldouble_ctypes"
701 ;; OpenGL.error.Error: Attempt to retrieve context when
702 ;; no valid context
703 "test_arraydatatype.py::TestCoreDatatype::test_numpyConversion"
704 "test_arraydatatype.py::TestCoreDatatype::test_pointers"
705 "test_core.py::TestCore::test_glCallLists_twice2"
706 "test_core.py::TestCore::test_glmultidraw"
707 ;; RuntimeError: Test Failed
708 "test_checks.py::test_feedbackvarying"
709 "test_checks.py::test_test_sf2946226"
710 "test_checks.py::test_test_glgetactiveuniform"
711 ;; TypeError: '<' not supported between instances of
712 ;; 'bool' and 'list'
713 "test_core.py::TestCore::test_get_read_fb_binding"
714 "test_core.py::TestCore::test_lookupint"
715 ;; assert not glShaderSource
716 "test_core.py::TestCore::test_get_version")))
717 #:phases
718 #~(modify-phases %standard-phases
719 (add-before 'build 'fix-paths
720 (lambda* (#:key inputs #:allow-other-keys)
721 (substitute* '("OpenGL/platform/ctypesloader.py")
722 (("filenames_to_try = \\[base_name\\]")
723 "filenames_to_try = [name]"))
724 (substitute* '("OpenGL/platform/glx.py"
725 "OpenGL/platform/egl.py"
726 "OpenGL/platform/osmesa.py"
727 "OpenGL/platform/darwin.py"
728 "tests/check_glut_load.py")
729 (("\"GLU\",")
730 (format #f "~s," (search-input-file inputs "lib/libGLU.so")))
731 (("'GLU',")
732 (format #f "~s," (search-input-file inputs "lib/libGLU.so")))
733 (("\"glut\",")
734 (format #f "~s," (search-input-file inputs "lib/libglut.so")))
735 (("'glut',")
736 (format #f "~s," (search-input-file inputs "lib/libglut.so")))
737 (("'(GL|EGL|GLESv1_CM|GLESv2)'" all gl-library)
738 (format #f "~s" (search-input-file inputs (string-append
739 "lib/lib"
740 gl-library ".so"))))
741 (("\"(GLESv1_CM|GLESv2)\"" all gl-library)
742 (format #f "~s" (search-input-file inputs (string-append
743 "lib/lib"
744 gl-library ".so")))))))
745 (add-before 'check 'pre-check
746 (lambda _
747 (setenv "LANG" "fr_FR.UTF-8")
748 (setenv "LANGUAGE" "fr_FR.UTF-8")
749 (setenv "DISPLAY" ":1")
750 (setenv "HOME" "/tmp")
751 (setenv "USER" "guix")
752 (setenv "XDG_RUNTIME_DIR" "/tmp")
753 (setenv "XDG_SESSION_ID" "11235813")
754 (setenv "XDG_SESSION_PATH" "/tmp")
755 (setenv "XDG_SESSION_TYPE" "x11"))))))
756 (native-inputs
757 (list python-cython
758 python-numpy
759 python-psutil
760 python-pygame-ce
761 python-pytest
762 python-setuptools))
763 (inputs
764 (list freeglut
765 glu
766 mesa))
767 (home-page "https://pyopengl.sourceforge.net")
768 (synopsis "Standard OpenGL bindings for Python")
769 (description
770 "PyOpenGL is the most common cross platform Python binding to OpenGL and
771related APIs. The binding is created using the standard @code{ctypes}
772library.")
773 (license license:bsd-3)))
774
775(define-public python-pyopengl-accelerate
776 (package
777 (inherit python-pyopengl)
778 (name "python-pyopengl-accelerate")
779 (version "3.1.10")
780 (source
781 (origin
782 (method url-fetch)
783 (uri (pypi-uri "pyopengl_accelerate" version))
784 (sha256
785 (base32
786 "0waskwvw9mp830bnnxcqd8bkh7a4qbnr0fcjnnw35xx6y21iqxc2"))))
787 (arguments
788 `(#:tests? #f
789 #:phases
790 (modify-phases %standard-phases
791 (delete 'fix-paths))))
792 (synopsis "Acceleration code for PyOpenGL")
793 (description
794 "This is the Cython-coded accelerator module for PyOpenGL.")))
795
796(define-public python-pysdl2
797 (package
798 (name "python-pysdl2")
799 (version "0.9.17")
800 (source
801 (origin
802 (method url-fetch)
803 (uri (pypi-uri "pysdl2" version))
804 (sha256
805 (base32 "0axm6m3wj8x643zg65g60xdpaxanaqdilvp4yysks4pblh0yzij8"))))
806 (build-system pyproject-build-system)
807 (arguments
808 (list
809 #:tests? #f ;; Requires /dev/dri, OpenGL module, etc.
810 #:phases
811 #~(modify-phases %standard-phases
812 (add-after 'unpack 'patch-paths
813 (lambda _
814 (substitute* "sdl2/dll.py"
815 ;; Disable pysdl2-dll. It can't be packaged on GNU Guix
816 ;; as it duplicates an existing package (sdl2).
817 (("prepath = os\\.getenv\\('PYSDL2_DLL_PATH'\\)")
818 "prepath = \"system\"")
819 (("^import sdl2dll$") "")
820 (("postpath = os\\.getenv\\('PYSDL2_DLL_PATH'\\)")
821 "postpath = \"system\"")
822 (("DLL\\(.*, os\\.getenv\\(\"PYSDL2_DLL_PATH\"\\)\\)")
823 (format #f "DLL('SDL2', ['SDL2', 'SDL2-2.0', 'SDL2-2.0.0'], '~a/lib')"
824 #$(this-package-input "sdl2"))))
825 (substitute* "sdl2/sdlimage.py"
826 (("os\\.getenv\\(\"PYSDL2_DLL_PATH\"\\)")
827 (format #f "'~a/~a'" #$(this-package-input "sdl2-image")
828 "lib/libSDL2_image.so")))
829 (substitute* "sdl2/sdlgfx.py"
830 (("os\\.getenv\\(\"PYSDL2_DLL_PATH\"\\)")
831 (format #f "'~a/~a'" #$(this-package-input "sdl2-gfx")
832 "lib/libSDL2_gfx.so")))
833 (substitute* "sdl2/sdlmixer.py"
834 (("os\\.getenv\\(\"PYSDL2_DLL_PATH\"\\)")
835 (format #f "'~a/~a'" #$(this-package-input "sdl2-mixer")
836 "lib/libSDL2_mixer.so")))
837 (substitute* "sdl2/sdlttf.py"
838 (("os\\.getenv\\(\"PYSDL2_DLL_PATH\"\\)")
839 (format #f "'~a/~a'" #$(this-package-input "sdl2-ttf")
840 "lib/libSDL2_ttf.so"))))))))
841 (native-inputs
842 (list python-setuptools
843 python-wheel))
844 (inputs
845 (list sdl2 sdl2-image sdl2-gfx sdl2-mixer sdl2-ttf))
846 (home-page "https://github.com/py-sdl/py-sdl2")
847 (synopsis "Python bindings around the SDL2 game development library")
848 (description
849 "PySDL2 is a pure Python wrapper around the
850@code{SDL2},@code{SDL2_mixer}, @code{SDL2_image}, @code{SDL2_ttf}, and
851@code{SDL2_gfx} libraries. Instead of relying on C code, it uses the built-in
852ctypes module to interface with SDL2, and provides simple Python classes and
853wrappers for common SDL2 functionality.")
854 (license license:cc0)))
855
856(define-public python-qtawesome
857 (package
858 (name "python-qtawesome")
859 (version "1.4.2")
860 (source
861 (origin
862 (method git-fetch)
863 (uri (git-reference
864 (url "https://github.com/spyder-ide/qtawesome")
865 (commit (string-append "v" version))))
866 (file-name (git-file-name name version))
867 (sha256
868 (base32 "16vjnngg5hjmmbp0c2ikgc88g8q0l44n1w3wa04ga5zfhd1yhyn2"))))
869 (build-system pyproject-build-system)
870 (arguments
871 (list
872 #:test-flags
873 ;; Actually just ::test_get_fonts_info would be better.
874 #~(list "--ignore" "qtawesome/tests/test_qtawesome.py")
875 #:phases
876 #~(modify-phases %standard-phases
877 (add-before 'check 'setenv
878 (lambda _
879 (setenv "QT_QPA_PLATFORM" "offscreen"))))))
880 (propagated-inputs (list python-qtpy python-pyqt))
881 (native-inputs (list python-pytest python-pytest-qt python-setuptools))
882 (home-page "https://github.com/spyder-ide/qtawesome")
883 (synopsis "FontAwesome icons in PyQt and PySide applications")
884 (description
885 "@code{FontAwesome} icons in @code{PyQt} and @code{PySide} applications.")
886 (license license:expat)))
887
888(define-public python-vispy
889 (package
890 (name "python-vispy")
891 (version "0.14.3")
892 (source
893 (origin
894 (method url-fetch)
895 (uri (pypi-uri "vispy" version))
896 (sha256
897 (base32 "07fkk4bdffn0iq5cprk7ydj978rqc4lvzfcs2vkzgfh8m53vifzg"))))
898 (build-system pyproject-build-system)
899 (arguments
900 (list
901 #:test-flags
902 ;; Test requiring network access to download test data from
903 ;; <https://raw.githubusercontent.com/vispy/demo-data/main/CONTRIBUTING.txt>.
904 #~(list "-k" (string-append "not test_read_write_image"
905 " and not test_wavefront"
906 " and not test_config"))
907 #:phases
908 #~(modify-phases %standard-phases
909 (add-after 'unpack 'patch-library-path
910 (lambda _
911 (substitute* (list "vispy/ext/egl.py"
912 "vispy/ext/fontconfig.py"
913 "vispy/gloo/gl/es2.py"
914 "vispy/gloo/gl/gl2.py")
915 (("ctypes\\.util\\.find_library\\('EGL'\\)")
916 (format #f "'~a/~a'" #$(this-package-input "mesa")
917 "lib/libEGL.so"))
918 (("ctypes\\.util\\.find_library\\('GL'\\)")
919 (format #f "'~a/~a'" #$(this-package-input "mesa")
920 "lib/libGL.so"))
921 (("ctypes\\.util\\.find_library\\('GLESv2'\\)")
922 (format #f "'~a/~a'" #$(this-package-input "mesa")
923 "lib/libGLESv2.so"))
924 (("util\\.find_library\\('fontconfig'\\)")
925 (format #f "'~a/~a'" #$(this-package-input "fontconfig-minimal")
926 "lib/libfontconfig.so")))))
927 (add-before 'check 'prepare-test-environment
928 (lambda _
929 ;; XXX: Check how to set DPI to run headless tests, fails when
930 ;; DISPLAY is set.
931 ;; E RuntimeError: could not determine DPI
932 (setenv "HOME" "/tmp")
933 (invoke "python" "setup.py" "build_ext" "--inplace"))))))
934 (native-inputs
935 (list python-cython
936 python-pytest
937 python-setuptools
938 python-setuptools-scm
939 python-wheel))
940 (inputs
941 (list fontconfig
942 mesa))
943 (propagated-inputs
944 (list python-freetype-py
945 python-hsluv
946 python-kiwisolver
947 python-meshio
948 python-numpy
949 python-packaging
950 python-pillow))
951 (home-page "http://vispy.org")
952 (synopsis "Interactive scientific visualization in Python")
953 (description
954 "VisPy is a high-performance interactive 2D/3D data visualization library
955leveraging the computational power of modern Graphics Processing Units (GPUs)
956through the OpenGL library to display very large datasets.")
957 (license license:bsd-3)))
958
959;;;
960;;; Avoid adding new packages to the end of this file. To reduce the chances
961;;; of a merge conflict, place them above in alphabetical order.
962;;;