[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#50505] [PATCH 03/12] gnu: Add python-glcontext.
From: |
Xinglu Chen |
Subject: |
[bug#50505] [PATCH 03/12] gnu: Add python-glcontext. |
Date: |
Sat, 11 Sep 2021 21:42:32 +0200 |
On Fri, Sep 10 2021, Daniel Meißner via Guix-patches via wrote:
> * gnu/packages/python-xyz.scm (python-glcontext): New variable.
> ---
> gnu/packages/python-xyz.scm | 46 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 46 insertions(+)
>
> diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
> index 75646aec7f..251aad5b61 100644
> --- a/gnu/packages/python-xyz.scm
> +++ b/gnu/packages/python-xyz.scm
> @@ -18884,6 +18884,52 @@ library.")
> (description
> "This is the Cython-coded accelerator module for PyOpenGL.")))
>
> +(define-public python-glcontext
> + (package
> + (name "python-glcontext")
> + (version "2.3.4")
> + (source
> + (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/moderngl/glcontext")
> + (commit version)))
> + (file-name (git-file-name name version))
> + (sha256
> + (base32
> + "1m2zkl696vqmgrd5k1c5kl0krk6qgjgsz88qhahwva0l40bswvhp"))))
> + (build-system python-build-system)
> + (arguments
> + '(#:phases
> + (modify-phases %standard-phases
> + (add-before 'build 'fix-lib-paths
> + (lambda* (#:key inputs outputs #:allow-other-keys)
> + (substitute* '("glcontext/x11.cpp" "glcontext/egl.cpp")
> + (("\"libGL.so\"")
> + (string-append "\"" (assoc-ref inputs "mesa")
> "/lib/libGL.so\""))
> + (("\"libEGL.so\"")
> + (string-append "\"" (assoc-ref inputs "mesa")
> "/lib/libEGL.so\""))
> + (("\"libX11.so\"")
> + (string-append "\"" (assoc-ref inputs "libx11")
> "/lib/libX11.so\"")))
Please keep lines =<80 columns wide. Also I would use a ‘let’ form to
avoid writing (assoc-ref inputs "mesa") twice.
> + (substitute* '("glcontext/__init__.py")
> + (("find_library\\('GL'\\)")
> + (string-append "'" (assoc-ref inputs "mesa")
> "/lib/libGL.so'"))
> + (("find_library\\('EGL'\\)")
> + (string-append "'" (assoc-ref inputs "mesa")
> "/lib/libEGL.so'"))
Likewise (‘let’ form).
> + (("find_library\\(\"X11\"\\)")
> + (string-append "'" (assoc-ref inputs "libx11")
> "/lib/libX11.so'")))
> + #t))
Phases don’t need to return #t once the ‘core-updates-frozen’ branch
gets merged, which should happen soon™. :-)
> + ;; tests fail with: Exception: (standalone) XOpenDisplay: cannot
> open display
> + (delete 'check))))
> + (inputs
> + `(("libx11" ,libx11)
> + ("mesa" ,mesa)))
> + (home-page "https://github.com/moderngl/glcontext")
> + (synopsis "Portable OpenGL Context for ModernGL")
> + (description "Python-glcontext is a library providing OpenGL
> implementation
> +for ModernGL on multiple platforms.")
“providing an OpenGL implementation” (missing article).
signature.asc
Description: PGP signature
- [bug#50505] [PATCH 06/12] gnu: Add python-multipledispatch., (continued)
- [bug#50505] [PATCH 04/12] gnu: Add python-moderngl., Daniel Meißner, 2021/09/10
- [bug#50505] [PATCH 10/12] gnu: Add python-manimpango., Daniel Meißner, 2021/09/10
- [bug#50505] [PATCH 02/12] gnu: Add python-cloup-0.7., Daniel Meißner, 2021/09/10
- [bug#50505] [PATCH 09/12] gnu: Add python-moderngl-window., Daniel Meißner, 2021/09/10
- [bug#50505] [PATCH 07/12] gnu: Add python-pyrr., Daniel Meißner, 2021/09/10
- [bug#50505] [PATCH 11/12] gnu: Add python-mapbox-earcut., Daniel Meißner, 2021/09/10
- [bug#50505] [PATCH 03/12] gnu: Add python-glcontext., Daniel Meißner, 2021/09/10
- [bug#50505] [PATCH 03/12] gnu: Add python-glcontext.,
Xinglu Chen <=
- [bug#50505] [PATCH 08/12] gnu: Add python-screeninfo., Daniel Meißner, 2021/09/10
- [bug#50505] [PATCH 12/12] gnu: Add python-manim 0.9.0., Daniel Meißner, 2021/09/10
- [bug#50505] [PATCH 05/12] gnu: Add python-pyglet., Daniel Meißner, 2021/09/10
- [bug#50505] [PATCH 01/12] gnu: Add python-cloup., Xinglu Chen, 2021/09/11
- [bug#50505] [PATCH 00/12] gnu: Add python-manim, Liliana Marie Prikler, 2021/09/10