GNU bug report logs - #50505
[PATCH 00/12] gnu: Add python-manim

Previous Next

Package: guix-patches;

Reported by: Daniel Meißner <daniel.meissner-i4k <at> ruhr-uni-bochum.de>

Date: Fri, 10 Sep 2021 11:23:02 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Xinglu Chen <public <at> yoctocell.xyz>
To: 50505 <at> debbugs.gnu.org
Cc: Daniel Meißner <daniel.meissner-i4k <at> ruhr-uni-bochum.de>
Subject: [bug#50505] [PATCH 03/12] gnu: Add python-glcontext.
Date: Sat, 11 Sep 2021 21:42:32 +0200
[Message part 1 (text/plain, inline)]
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 (application/pgp-signature, inline)]

This bug report was last modified 238 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.