summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSharlatan Hellseher <sharlatanus@gmail.com>2024-11-02 23:34:29 +0000
committerSharlatan Hellseher <sharlatanus@gmail.com>2024-11-30 15:10:42 +0000
commit8df2acd5fe5d311d64abb8011f22d663a4be2508 (patch)
treed254c898fe6d96edcaafeb775951c1f8da8d6a15
parent58537a3b89805292b9c74e1753c5a90dbb48dad6 (diff)
gnu: Add python-vispy.
* gnu/packages/python-graphics.scm (python-vispy): New variable. Change-Id: Icb648d621101e0f4b60ada8c0ebbd3a05eea6fb4
-rw-r--r--gnu/packages/python-graphics.scm74
1 files changed, 73 insertions, 1 deletions
diff --git a/gnu/packages/python-graphics.scm b/gnu/packages/python-graphics.scm
index 403a3c3b344..bc0c93a8ee3 100644
--- a/gnu/packages/python-graphics.scm
+++ b/gnu/packages/python-graphics.scm
@@ -16,15 +16,17 @@
16 #:use-module (guix packages) 16 #:use-module (guix packages)
17 #:use-module (gnu packages) 17 #:use-module (gnu packages)
18 #:use-module (gnu packages audio) 18 #:use-module (gnu packages audio)
19 #:use-module (gnu packages base)
19 #:use-module (gnu packages check) 20 #:use-module (gnu packages check)
20 #:use-module (gnu packages compression) 21 #:use-module (gnu packages compression)
21 #:use-module (gnu packages fontutils) 22 #:use-module (gnu packages fontutils)
22 #:use-module (gnu packages gl) 23 #:use-module (gnu packages gl)
23 #:use-module (gnu packages base)
24 #:use-module (gnu packages gtk) 24 #:use-module (gnu packages gtk)
25 #:use-module (gnu packages maths)
25 #:use-module (gnu packages pulseaudio) 26 #:use-module (gnu packages pulseaudio)
26 #:use-module (gnu packages python-build) 27 #:use-module (gnu packages python-build)
27 #:use-module (gnu packages python-xyz) 28 #:use-module (gnu packages python-xyz)
29 #:use-module (gnu packages simulation)
28 #:use-module (gnu packages video) 30 #:use-module (gnu packages video)
29 #:use-module (gnu packages xorg)) 31 #:use-module (gnu packages xorg))
30 32
@@ -235,6 +237,76 @@ Joysticks, OpenGL graphics, loading images and videos, playing sounds and
235music." ) 237music." )
236 (license license:bsd-3))) 238 (license license:bsd-3)))
237 239
240(define-public python-vispy
241 (package
242 (name "python-vispy")
243 (version "0.14.3")
244 (source
245 (origin
246 (method url-fetch)
247 (uri (pypi-uri "vispy" version))
248 (sha256
249 (base32 "07fkk4bdffn0iq5cprk7ydj978rqc4lvzfcs2vkzgfh8m53vifzg"))))
250 (build-system pyproject-build-system)
251 (arguments
252 (list
253 #:test-flags
254 ;; Test requiring network access to download test data from
255 ;; <https://raw.githubusercontent.com/vispy/demo-data/main/CONTRIBUTING.txt>.
256 #~(list "-k" (string-append "not test_read_write_image"
257 " and not test_wavefront"
258 " and not test_config"))
259 #:phases
260 #~(modify-phases %standard-phases
261 (add-after 'unpack 'patch-library-path
262 (lambda _
263 (substitute* (list "vispy/ext/egl.py"
264 "vispy/ext/fontconfig.py"
265 "vispy/gloo/gl/es2.py"
266 "vispy/gloo/gl/gl2.py")
267 (("ctypes\\.util\\.find_library\\('EGL'\\)")
268 (format #f "'~a/~a'" #$(this-package-input "mesa")
269 "lib/libEGL.so"))
270 (("ctypes\\.util\\.find_library\\('GL'\\)")
271 (format #f "'~a/~a'" #$(this-package-input "mesa")
272 "lib/libGL.so"))
273 (("ctypes\\.util\\.find_library\\('GLESv2'\\)")
274 (format #f "'~a/~a'" #$(this-package-input "mesa")
275 "lib/libGLESv2.so"))
276 (("util\\.find_library\\('fontconfig'\\)")
277 (format #f "'~a/~a'" #$(this-package-input "fontconfig-minimal")
278 "lib/libfontconfig.so")))))
279 (add-before 'check 'prepare-test-environment
280 (lambda _
281 ;; XXX: Check how to set DPI to run headless tests, fails when
282 ;; DISPLAY is set.
283 ;; E RuntimeError: could not determine DPI
284 (setenv "HOME" "/tmp")
285 (invoke "python" "setup.py" "build_ext" "--inplace"))))))
286 (native-inputs
287 (list python-cython-3
288 python-pytest
289 python-setuptools
290 python-setuptools-scm))
291 (inputs
292 (list fontconfig
293 mesa))
294 (propagated-inputs
295 (list python-freetype-py
296 python-hsluv
297 python-kiwisolver
298 python-meshio
299 python-numpy
300 python-packaging
301 python-pillow))
302 (home-page "http://vispy.org")
303 (synopsis "Interactive scientific visualization in Python")
304 (description
305 "VisPy is a high-performance interactive 2D/3D data visualization library
306leveraging the computational power of modern Graphics Processing Units (GPUs)
307through the OpenGL library to display very large datasets.")
308 (license license:bsd-3)))
309
238;;; 310;;;
239;;; Avoid adding new packages to the end of this file. To reduce the chances 311;;; Avoid adding new packages to the end of this file. To reduce the chances
240;;; of a merge conflict, place them above in alphabetical order. 312;;; of a merge conflict, place them above in alphabetical order.