diff options
| author | Sharlatan Hellseher <sharlatanus@gmail.com> | 2024-10-18 12:19:17 +0100 |
|---|---|---|
| committer | Sharlatan Hellseher <sharlatanus@gmail.com> | 2024-10-18 21:09:33 +0100 |
| commit | af7e1d89e630bf2a71507da6bcd24f5fbb742f69 (patch) | |
| tree | c295ad03d40cbe9815ca1cc3b6f4d0124f59a52d /gnu/packages/python-graphics.scm | |
| parent | 81702aa7433e5fcf0a83eaf771d263e53ebdbf26 (diff) | |
gnu: python-glcontext: Move to python-graphics.
* gnu/packages/python-xyz.scm (python-glcontext): Move from here ...
* gnu/packages/python-graphics.scm: ... to here.
Change-Id: If984a8b0c128df8bcaffae2cce8d9caabda7890b
Diffstat (limited to 'gnu/packages/python-graphics.scm')
| -rw-r--r-- | gnu/packages/python-graphics.scm | 66 |
1 files changed, 65 insertions, 1 deletions
diff --git a/gnu/packages/python-graphics.scm b/gnu/packages/python-graphics.scm index d0b4a1df74e..29b199922c9 100644 --- a/gnu/packages/python-graphics.scm +++ b/gnu/packages/python-graphics.scm | |||
| @@ -1,8 +1,9 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2021 Adam Kandur <kefironpremise@gmail.com> | 2 | ;;; Copyright © 2021 Adam Kandur <kefironpremise@gmail.com> |
| 3 | ;;; Copyright © 2021 Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de> | ||
| 4 | ;;; Copyright © 2021 Morgan Smith <Morgan.J.Smith@outlook.com> | 3 | ;;; Copyright © 2021 Morgan Smith <Morgan.J.Smith@outlook.com> |
| 4 | ;;; Copyright © 2021, 2023 Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de> | ||
| 5 | ;;; Copyright © 2023 Adam Faiz <adam.faiz@disroot.org> | 5 | ;;; Copyright © 2023 Adam Faiz <adam.faiz@disroot.org> |
| 6 | ;;; Copyright © 2023 Simon Tournier <zimon.toutoune@gmail.com> | ||
| 6 | ;;; Copyright © 2024 Sharlatan Hellseher <sharlatanus@gmail.com> | 7 | ;;; Copyright © 2024 Sharlatan Hellseher <sharlatanus@gmail.com> |
| 7 | 8 | ||
| 8 | (define-module (gnu packages python-graphics) | 9 | (define-module (gnu packages python-graphics) |
| @@ -11,6 +12,7 @@ | |||
| 11 | #:use-module (guix build-system pyproject) | 12 | #:use-module (guix build-system pyproject) |
| 12 | #:use-module (guix download) | 13 | #:use-module (guix download) |
| 13 | #:use-module (guix gexp) | 14 | #:use-module (guix gexp) |
| 15 | #:use-module (guix git-download) | ||
| 14 | #:use-module (guix packages) | 16 | #:use-module (guix packages) |
| 15 | #:use-module (gnu packages) | 17 | #:use-module (gnu packages) |
| 16 | #:use-module (gnu packages audio) | 18 | #:use-module (gnu packages audio) |
| @@ -35,6 +37,68 @@ | |||
| 35 | ;;; | 37 | ;;; |
| 36 | ;;; Code: | 38 | ;;; Code: |
| 37 | 39 | ||
| 40 | (define-public python-glcontext | ||
| 41 | (let (;; Upstream is known for abusing mutable tag, hence pinpoint the | ||
| 42 | ;; relevant commit. | ||
| 43 | (revision "2") | ||
| 44 | (commit "f2875abdb18b24e785c3958cc22845c81725d5cd")) | ||
| 45 | (package | ||
| 46 | (name "python-glcontext") | ||
| 47 | (version (git-version "3.0.0" revision commit)) | ||
| 48 | (source | ||
| 49 | (origin | ||
| 50 | (method git-fetch) | ||
| 51 | (uri (git-reference | ||
| 52 | (url "https://github.com/moderngl/glcontext") | ||
| 53 | (commit commit))) | ||
| 54 | (file-name (git-file-name name version)) | ||
| 55 | (sha256 | ||
| 56 | (base32 "15pngnc4agdvm8crq782vjlb5v1qrclln5xpqiyhz3jhmipsqb8q")))) | ||
| 57 | (build-system pyproject-build-system) | ||
| 58 | (arguments | ||
| 59 | (list | ||
| 60 | #:phases | ||
| 61 | #~(modify-phases %standard-phases | ||
| 62 | (add-before 'build 'fix-lib-paths | ||
| 63 | (lambda* (#:key inputs outputs #:allow-other-keys) | ||
| 64 | (let ((mesa (assoc-ref inputs "mesa")) | ||
| 65 | (libx11 (assoc-ref inputs "libx11"))) | ||
| 66 | (substitute* '("glcontext/x11.cpp" | ||
| 67 | "glcontext/egl.cpp") | ||
| 68 | (("\"libGL.so\"") | ||
| 69 | (string-append "\"" mesa "/lib/libGL.so\"")) | ||
| 70 | (("\"libEGL.so\"") | ||
| 71 | (string-append "\"" mesa "/lib/libEGL.so\"")) | ||
| 72 | (("\"libX11.so\"") | ||
| 73 | (string-append "\"" libx11 "/lib/libX11.so\""))) | ||
| 74 | (substitute* '("glcontext/__init__.py") | ||
| 75 | (("find_library\\('GL'\\)") | ||
| 76 | (string-append "'" mesa "/lib/libGL.so'")) | ||
| 77 | (("find_library\\('EGL'\\)") | ||
| 78 | (string-append "'" mesa "/lib/libEGL.so'")) | ||
| 79 | (("find_library\\(\"X11\"\\)") | ||
| 80 | (string-append "'" libx11 "/lib/libX11.so'")))))) | ||
| 81 | (replace 'check | ||
| 82 | (lambda* (#:key inputs outputs tests? #:allow-other-keys) | ||
| 83 | (when tests? | ||
| 84 | (system "Xvfb :1 &") | ||
| 85 | (setenv "DISPLAY" ":1") | ||
| 86 | (add-installed-pythonpath inputs outputs) | ||
| 87 | (invoke "pytest" "tests"))))))) | ||
| 88 | (inputs | ||
| 89 | (list libx11 | ||
| 90 | mesa)) | ||
| 91 | (native-inputs | ||
| 92 | (list python-psutil | ||
| 93 | python-pytest | ||
| 94 | xorg-server-for-tests)) | ||
| 95 | (home-page "https://github.com/moderngl/glcontext") | ||
| 96 | (synopsis "Portable OpenGL Context for ModernGL") | ||
| 97 | (description | ||
| 98 | "Python-glcontext is a library providing an OpenGL implementation for | ||
| 99 | ModernGL on multiple platforms.") | ||
| 100 | (license license:expat)))) | ||
| 101 | |||
| 38 | (define-public python-pyglet | 102 | (define-public python-pyglet |
| 39 | (package | 103 | (package |
| 40 | (name "python-pyglet") | 104 | (name "python-pyglet") |
