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
This commit is contained in:
Sharlatan Hellseher 2024-10-18 12:19:17 +01:00
parent 81702aa743
commit af7e1d89e6
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5
2 changed files with 65 additions and 56 deletions

View file

@ -1,8 +1,9 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2021 Adam Kandur <kefironpremise@gmail.com> ;;; Copyright © 2021 Adam Kandur <kefironpremise@gmail.com>
;;; Copyright © 2021 Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de>
;;; Copyright © 2021 Morgan Smith <Morgan.J.Smith@outlook.com> ;;; Copyright © 2021 Morgan Smith <Morgan.J.Smith@outlook.com>
;;; Copyright © 2021, 2023 Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de>
;;; Copyright © 2023 Adam Faiz <adam.faiz@disroot.org> ;;; Copyright © 2023 Adam Faiz <adam.faiz@disroot.org>
;;; Copyright © 2023 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2024 Sharlatan Hellseher <sharlatanus@gmail.com> ;;; Copyright © 2024 Sharlatan Hellseher <sharlatanus@gmail.com>
(define-module (gnu packages python-graphics) (define-module (gnu packages python-graphics)
@ -11,6 +12,7 @@ (define-module (gnu packages python-graphics)
#:use-module (guix build-system pyproject) #:use-module (guix build-system pyproject)
#:use-module (guix download) #:use-module (guix download)
#:use-module (guix gexp) #:use-module (guix gexp)
#:use-module (guix git-download)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (gnu packages) #:use-module (gnu packages)
#:use-module (gnu packages audio) #:use-module (gnu packages audio)
@ -35,6 +37,68 @@ (define-module (gnu packages python-graphics)
;;; ;;;
;;; Code: ;;; Code:
(define-public python-glcontext
(let (;; Upstream is known for abusing mutable tag, hence pinpoint the
;; relevant commit.
(revision "2")
(commit "f2875abdb18b24e785c3958cc22845c81725d5cd"))
(package
(name "python-glcontext")
(version (git-version "3.0.0" revision commit))
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/moderngl/glcontext")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(base32 "15pngnc4agdvm8crq782vjlb5v1qrclln5xpqiyhz3jhmipsqb8q"))))
(build-system pyproject-build-system)
(arguments
(list
#:phases
#~(modify-phases %standard-phases
(add-before 'build 'fix-lib-paths
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((mesa (assoc-ref inputs "mesa"))
(libx11 (assoc-ref inputs "libx11")))
(substitute* '("glcontext/x11.cpp"
"glcontext/egl.cpp")
(("\"libGL.so\"")
(string-append "\"" mesa "/lib/libGL.so\""))
(("\"libEGL.so\"")
(string-append "\"" mesa "/lib/libEGL.so\""))
(("\"libX11.so\"")
(string-append "\"" libx11 "/lib/libX11.so\"")))
(substitute* '("glcontext/__init__.py")
(("find_library\\('GL'\\)")
(string-append "'" mesa "/lib/libGL.so'"))
(("find_library\\('EGL'\\)")
(string-append "'" mesa "/lib/libEGL.so'"))
(("find_library\\(\"X11\"\\)")
(string-append "'" libx11 "/lib/libX11.so'"))))))
(replace 'check
(lambda* (#:key inputs outputs tests? #:allow-other-keys)
(when tests?
(system "Xvfb :1 &")
(setenv "DISPLAY" ":1")
(add-installed-pythonpath inputs outputs)
(invoke "pytest" "tests")))))))
(inputs
(list libx11
mesa))
(native-inputs
(list python-psutil
python-pytest
xorg-server-for-tests))
(home-page "https://github.com/moderngl/glcontext")
(synopsis "Portable OpenGL Context for ModernGL")
(description
"Python-glcontext is a library providing an OpenGL implementation for
ModernGL on multiple platforms.")
(license license:expat))))
(define-public python-pyglet (define-public python-pyglet
(package (package
(name "python-pyglet") (name "python-pyglet")

View file

@ -25567,61 +25567,6 @@ (define-public python-pyopengl-accelerate
(description (description
"This is the Cython-coded accelerator module for PyOpenGL."))) "This is the Cython-coded accelerator module for PyOpenGL.")))
(define-public python-glcontext
(let (;; Upstream is known for abusing mutable tag, hence pinpoint the
;; relevant commit.
(revision "2")
(commit "f2875abdb18b24e785c3958cc22845c81725d5cd"))
(package
(name "python-glcontext")
(version (git-version "3.0.0" revision commit))
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/moderngl/glcontext")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(base32
"15pngnc4agdvm8crq782vjlb5v1qrclln5xpqiyhz3jhmipsqb8q"))))
(build-system pyproject-build-system)
(arguments
(list #:phases #~(modify-phases %standard-phases
(add-before 'build 'fix-lib-paths
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((mesa (assoc-ref inputs "mesa"))
(libx11 (assoc-ref inputs "libx11")))
(substitute* '("glcontext/x11.cpp"
"glcontext/egl.cpp")
(("\"libGL.so\"")
(string-append "\"" mesa "/lib/libGL.so\""))
(("\"libEGL.so\"")
(string-append "\"" mesa "/lib/libEGL.so\""))
(("\"libX11.so\"")
(string-append "\"" libx11 "/lib/libX11.so\"")))
(substitute* '("glcontext/__init__.py")
(("find_library\\('GL'\\)")
(string-append "'" mesa "/lib/libGL.so'"))
(("find_library\\('EGL'\\)")
(string-append "'" mesa "/lib/libEGL.so'"))
(("find_library\\(\"X11\"\\)")
(string-append "'" libx11 "/lib/libX11.so'"))))))
(replace 'check
(lambda* (#:key inputs outputs tests?
#:allow-other-keys)
(when tests?
(system "Xvfb :1 &")
(setenv "DISPLAY" ":1")
(add-installed-pythonpath inputs outputs)
(invoke "pytest" "tests")))))))
(inputs (list libx11 mesa))
(native-inputs (list xorg-server-for-tests python-pytest python-psutil))
(home-page "https://github.com/moderngl/glcontext")
(synopsis "Portable OpenGL Context for ModernGL")
(description "Python-glcontext is a library providing an OpenGL
implementation for ModernGL on multiple platforms.")
(license license:expat))))
(define-public python-rencode (define-public python-rencode
(package (package
(name "python-rencode") (name "python-rencode")