commit:     12e756e356090a641a4b12f4817953599f0260ee
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 17 19:06:53 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Nov 17 20:39:25 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=12e756e3

dev-python/pyopengl: Enable pypy3

Sponsored-by: Ex Makhina, Inc. <info-gentoo <AT> exmakhina.com>
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../pyopengl/files/pyopengl-3.1.7-pypy3.patch      | 26 ++++++++++++++++++++++
 ...pengl-3.1.7.ebuild => pyopengl-3.1.7-r1.ebuild} |  4 +++-
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/dev-python/pyopengl/files/pyopengl-3.1.7-pypy3.patch 
b/dev-python/pyopengl/files/pyopengl-3.1.7-pypy3.patch
new file mode 100644
index 000000000000..f3a434cf290f
--- /dev/null
+++ b/dev-python/pyopengl/files/pyopengl-3.1.7-pypy3.patch
@@ -0,0 +1,26 @@
+From 33da175a6d89945ea9e74e85df8ef8929fc86b62 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgo...@gentoo.org>
+Date: Fri, 17 Nov 2023 19:56:58 +0100
+Subject: [PATCH] PYPY3 Add support for pypy3 in FormatHandler
+
+Add `_ctypes.array.ArrayMeta` to classes recognized by `ctypesarrays`
+formathandler.  This is the class used by arrays on PyPy3.10.  Adding
+this makes the test suite pass on PyPy3.10 7.3.13.
+
+Fixes #108
+---
+ OpenGL/__init__.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/OpenGL/__init__.py b/OpenGL/__init__.py
+index 77dc8c0b..959186ce 100644
+--- a/OpenGL/__init__.py
++++ b/OpenGL/__init__.py
+@@ -301,6 +301,7 @@ def setPlatform(key):
+         "_ctypes.PyCArrayType",
+         "_ctypes.Array",
+         "_ctypes.array.Array",
++        "_ctypes.array.ArrayMeta",
+     ],
+     isOutput=True,
+ )

diff --git a/dev-python/pyopengl/pyopengl-3.1.7.ebuild 
b/dev-python/pyopengl/pyopengl-3.1.7-r1.ebuild
similarity index 91%
rename from dev-python/pyopengl/pyopengl-3.1.7.ebuild
rename to dev-python/pyopengl/pyopengl-3.1.7-r1.ebuild
index 52f90ccbfbbf..4ba447f89f0e 100644
--- a/dev-python/pyopengl/pyopengl-3.1.7.ebuild
+++ b/dev-python/pyopengl/pyopengl-3.1.7-r1.ebuild
@@ -7,7 +7,7 @@ DISTUTILS_USE_PEP517=setuptools
 PYPI_NO_NORMALIZE=1
 PYPI_PN=PyOpenGL
 PYTHON_REQ_USE="tk?"
-PYTHON_COMPAT=( python3_{10..12} )
+PYTHON_COMPAT=( pypy3 python3_{10..12} )
 
 inherit distutils-r1 pypi virtualx
 
@@ -52,6 +52,8 @@ distutils_enable_tests pytest
 PATCHES=(
        # 
https://github.com/mcfletch/pyopengl/commit/b49af26c615236ebc29cf125a8315091482a4a2a
        "${FILESDIR}/${P}-py312.patch"
+       # https://github.com/mcfletch/pyopengl/pull/109
+       "${FILESDIR}/${P}-pypy3.patch"
 )
 
 EPYTEST_DESELECT=(

Reply via email to