From 6ad495e5bfdbf838249418bb79b17feb7f4dcc415efa074a70e20503f6c8e02b Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 6 Jun 2024 06:55:37 +0000 Subject: [PATCH 1/2] Accepting request 1178768 from home:glaubitz:branches:devel:languages:python - Cherry-pick upstream patch to fix build with GCC 14 * https://github.com/mcfletch/pyopengl/pull/112.patch OBS-URL: https://build.opensuse.org/request/show/1178768 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-opengl-accelerate?expand=0&rev=24 --- 112.patch | 54 ++++++++++++++++++++++++++++++++ python-opengl-accelerate.changes | 6 ++++ python-opengl-accelerate.spec | 3 ++ 3 files changed, 63 insertions(+) create mode 100644 112.patch diff --git a/112.patch b/112.patch new file mode 100644 index 0000000..5986611 --- /dev/null +++ b/112.patch @@ -0,0 +1,54 @@ +From fbe0fab7947788039cb4fbc9a5a1ea65a0c0e15b Mon Sep 17 00:00:00 2001 +From: Florian Weimer +Date: Fri, 5 Jan 2024 08:48:12 +0100 +Subject: [PATCH 1/2] accelerate: Fix type of PyArray_FillWithScalar + +The first argument is of type PyArrayObject, not PyObject. +--- + accelerate/src/numpy_formathandler.pyx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/accelerate/src/numpy_formathandler.pyx b/accelerate/src/numpy_formathandler.pyx +index 0c01d78e..10813694 100644 +--- a/accelerate/src/numpy_formathandler.pyx ++++ b/accelerate/src/numpy_formathandler.pyx +@@ -21,7 +21,7 @@ cdef extern from "numpy/arrayobject.h": + int PyArray_ISCARRAY_RO( np.ndarray instance ) + cdef np.ndarray PyArray_Zeros(int nd, np.Py_intptr_t* dims, np.dtype, int fortran) + cdef np.ndarray PyArray_EnsureArray(object) +- cdef int PyArray_FillWithScalar(object, object) ++ cdef int PyArray_FillWithScalar(np.ndarray, object) + cdef void import_array() + cdef void* PyArray_DATA( np.ndarray ) + cdef int PyArray_NDIM( np.ndarray ) + +From f62dd58a5437c628d3ff3e626d4507811ef2127b Mon Sep 17 00:00:00 2001 +From: Florian Weimer +Date: Fri, 5 Jan 2024 08:48:43 +0100 +Subject: [PATCH 2/2] accelerate: Use recommended way to integrate NumPy with + Cython + +This approach follows +. +--- + accelerate/src/numpy_formathandler.pyx | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/accelerate/src/numpy_formathandler.pyx b/accelerate/src/numpy_formathandler.pyx +index 10813694..47dacaa0 100644 +--- a/accelerate/src/numpy_formathandler.pyx ++++ b/accelerate/src/numpy_formathandler.pyx +@@ -22,7 +22,6 @@ cdef extern from "numpy/arrayobject.h": + cdef np.ndarray PyArray_Zeros(int nd, np.Py_intptr_t* dims, np.dtype, int fortran) + cdef np.ndarray PyArray_EnsureArray(object) + cdef int PyArray_FillWithScalar(np.ndarray, object) +- cdef void import_array() + cdef void* PyArray_DATA( np.ndarray ) + cdef int PyArray_NDIM( np.ndarray ) + cdef int *PyArray_DIMS( np.ndarray ) +@@ -226,4 +225,4 @@ cdef class NumpyHandler(FormatHandler): + + # Cython numpy tutorial neglects to mention this AFAICS + # get segfaults without it +-import_array() ++np.import_array() diff --git a/python-opengl-accelerate.changes b/python-opengl-accelerate.changes index cca83c2..4e23721 100644 --- a/python-opengl-accelerate.changes +++ b/python-opengl-accelerate.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jun 5 14:28:18 UTC 2024 - John Paul Adrian Glaubitz + +- Cherry-pick upstream patch to fix build with GCC 14 + * https://github.com/mcfletch/pyopengl/pull/112.patch + ------------------------------------------------------------------- Thu Jan 4 08:33:49 UTC 2024 - Markéta Machová diff --git a/python-opengl-accelerate.spec b/python-opengl-accelerate.spec index 304d480..b835fc2 100644 --- a/python-opengl-accelerate.spec +++ b/python-opengl-accelerate.spec @@ -27,6 +27,8 @@ License: BSD-3-Clause Group: Development/Libraries/Python URL: http://pyopengl.sourceforge.net Source0: %{tarname}-%{_version}.tar.gz +# PATCH-FIX-UPSTREAM - accelerate: Fix C type errors for GCC 14/Clang compatibility +Patch0: https://github.com/mcfletch/pyopengl/pull/112.patch BuildRequires: %{python_module Cython} BuildRequires: %{python_module devel} BuildRequires: %{python_module opengl >= %{version}} @@ -47,6 +49,7 @@ code. %prep %setup -q -n %{tarname}-%{_version} +%patch -P0 -p1 # _service pulldown creates %%{tarname}-%%{_version}/accelerate/, # move them to root of build area and remove 'accelerate' directory From a9ff18be4335cd00ecc8357d47a9e4a2d015e101d89406a7d99e997c20f262ec Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 6 Jun 2024 06:59:26 +0000 Subject: [PATCH 2/2] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-opengl-accelerate?expand=0&rev=25 --- python-opengl-accelerate.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python-opengl-accelerate.spec b/python-opengl-accelerate.spec index b835fc2..7ccba04 100644 --- a/python-opengl-accelerate.spec +++ b/python-opengl-accelerate.spec @@ -48,8 +48,7 @@ arrays extensively speed-up is around 10% compared to unaccelerated code. %prep -%setup -q -n %{tarname}-%{_version} -%patch -P0 -p1 +%autosetup -p1 -n %{tarname}-%{_version} # _service pulldown creates %%{tarname}-%%{_version}/accelerate/, # move them to root of build area and remove 'accelerate' directory