unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Daniel Meißner via Guix-patches via" <guix-patches@gnu.org>
To: 64314@debbugs.gnu.org
Cc: "Daniel Meißner" <daniel.meissner-i4k@ruhr-uni-bochum.de>,
	"Lars-Dominik Braun" <lars@6xq.net>, jgart <jgart@dismail.de>
Subject: [bug#64314] [PATCH] gnu: Add python-glcontext.
Date: Tue, 27 Jun 2023 09:08:07 +0200	[thread overview]
Message-ID: <20230627070807.16383-1-daniel.meissner-i4k@rub.de> (raw)

From: Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de>

* gnu/packages/python-xyz.scm (python-glcontext): New variable.
---
 gnu/packages/python-xyz.scm | 51 +++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 4c926ede92..6124b87a15 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -22673,6 +22673,57 @@ (define-public python-pyopengl-accelerate
     (description
      "This is the Cython-coded accelerator module for PyOpenGL.")))
 
+(define-public python-glcontext
+  (package
+    (name "python-glcontext")
+    (version "2.4.0")
+    (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
+                "0zzpwyqg19y600n09xz07cxk4jimh9vjraszda7g7ipijq6iasac"))))
+    (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
   (package
    (name "python-rencode")
-- 
2.39.1





             reply	other threads:[~2023-06-27  7:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-27  7:08 Daniel Meißner via Guix-patches via [this message]
2023-08-30 13:05 ` bug#64314: Closing Andreas Enge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230627070807.16383-1-daniel.meissner-i4k@rub.de \
    --to=guix-patches@gnu.org \
    --cc=64314@debbugs.gnu.org \
    --cc=daniel.meissner-i4k@rub.de \
    --cc=daniel.meissner-i4k@ruhr-uni-bochum.de \
    --cc=jgart@dismail.de \
    --cc=lars@6xq.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).