From 3234ca462414d2d14494c901a9b7b186443df55d Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Jul 18 2023 14:40:52 +0000 Subject: Fix FTBFS with Python 3.12 (#2220441) --- diff --git a/python-3.12.patch b/python-3.12.patch new file mode 100644 index 0000000..5c4327a --- /dev/null +++ b/python-3.12.patch @@ -0,0 +1,12 @@ +diff -up PyOpenGL-3.1.6/PyOpenGL-3.1.6/OpenGL/__init__.py.py312 PyOpenGL-3.1.6/PyOpenGL-3.1.6/OpenGL/__init__.py +--- PyOpenGL-3.1.6/PyOpenGL-3.1.6/OpenGL/__init__.py.py312 2022-02-19 17:44:47.000000000 -0500 ++++ PyOpenGL-3.1.6/PyOpenGL-3.1.6/OpenGL/__init__.py 2023-07-18 10:33:16.209937577 -0400 +@@ -260,7 +260,7 @@ FormatHandler( + 'ctypesparameter', + 'OpenGL.arrays.ctypesparameters.CtypesParameterHandler', + [ +- _bi+'.CArgObject', ++ ("_ctypes" if sys.version_info[:2] >= (3,12) else _bi) + ".CArgObject", + 'ctypes.c_uint', + 'ctypes.c_int', + 'ctypes.c_float', diff --git a/python-pyopengl.spec b/python-pyopengl.spec index 5c9767d..2be9f5e 100644 --- a/python-pyopengl.spec +++ b/python-pyopengl.spec @@ -3,12 +3,13 @@ Name: python-%{shortname} Version: 3.1.6 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Python bindings for OpenGL License: BSD URL: https://github.com/mcfletch/pyopengl Source0: https://pypi.python.org/packages/source/P/%{srcname}/%{srcname}-%{version}.tar.gz Source1: https://pypi.python.org/packages/source/P/%{srcname}-accelerate/%{srcname}-accelerate-%{version}.tar.gz +Patch0: python-3.12.patch BuildRequires: gcc BuildRequires: python3-devel @@ -62,6 +63,7 @@ Requires: python3-tkinter %prep %setup -q -c -n %{srcname}-%{version} -T -a0 -a1 +%patch -P0 -p1 %build # Delete all Cython generated .c files to force a rebuild in py3_build @@ -119,6 +121,9 @@ PYTHONPATH=%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib} \ %changelog +* Tue Jul 18 2023 Scott Talbert - 3.1.6-3 +- Fix FTBFS with Python 3.12 (#2220441) + * Tue Jun 13 2023 Python Maint - 3.1.6-2 - Rebuilt for Python 3.12