From 80cbd58eb7eac3adfd69ef4851a8d90c92875e11 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Tue, 16 Jan 2024 10:18:12 -0700 Subject: [PATCH] Update the incompatible pointer patch from the PR --- sympy-incompatible-pointer.patch | 33 ++++++++++++++++++++++---------- sympy.spec | 1 + 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/sympy-incompatible-pointer.patch b/sympy-incompatible-pointer.patch index b0a7580..2c5a9a8 100644 --- a/sympy-incompatible-pointer.patch +++ b/sympy-incompatible-pointer.patch @@ -5,34 +5,47 @@ wrapper_module_15.c:32:60: error: initialization of ‘void (*)(char **, const n | ^ error: command '/usr/bin/gcc' failed with exit code 1 ---- sympy-sympy-1.12/sympy/utilities/autowrap.py.orig 2023-05-09 17:42:05.000000000 -0600 -+++ sympy-sympy-1.12/sympy/utilities/autowrap.py 2023-11-30 13:26:06.612852361 -0700 -@@ -714,7 +714,7 @@ static PyMethodDef ${module}Methods[] = +diff --git a/sympy/utilities/autowrap.py b/sympy/utilities/autowrap.py +index 566fd2ee21..feff051ded 100644 +--- a/sympy/utilities/autowrap.py ++++ b/sympy/utilities/autowrap.py +@@ -714,7 +714,11 @@ def binary_function(symfunc, expr, **kwargs): _ufunc_outcalls = Template("*((double *)out${outnum}) = ${funcname}(${call_args});") _ufunc_body = Template("""\ --static void ${funcname}_ufunc(char **args, npy_intp *dimensions, npy_intp* steps, void* data) ++#ifdef NPY_1_19_API_VERSION +static void ${funcname}_ufunc(char **args, const npy_intp *dimensions, const npy_intp* steps, void* data) ++#else + static void ${funcname}_ufunc(char **args, npy_intp *dimensions, npy_intp* steps, void* data) ++#endif { npy_intp i; npy_intp n = dimensions[0]; ---- sympy-sympy-1.12/sympy/utilities/tests/test_autowrap.py.orig 2023-05-09 17:42:05.000000000 -0600 -+++ sympy-sympy-1.12/sympy/utilities/tests/test_autowrap.py 2023-11-30 12:42:03.489842964 -0700 -@@ -284,7 +284,7 @@ static PyMethodDef wrapper_module_%(num) +diff --git a/sympy/utilities/tests/test_autowrap.py b/sympy/utilities/tests/test_autowrap.py +index 2d6d1796d5..acb0e9a5ef 100644 +--- a/sympy/utilities/tests/test_autowrap.py ++++ b/sympy/utilities/tests/test_autowrap.py +@@ -284,7 +284,11 @@ def test_ufuncify_source(): {NULL, NULL, 0, NULL} }; --static void test_ufunc(char **args, npy_intp *dimensions, npy_intp* steps, void* data) ++#ifdef NPY_1_19_API_VERSION +static void test_ufunc(char **args, const npy_intp *dimensions, const npy_intp* steps, void* data) ++#else + static void test_ufunc(char **args, npy_intp *dimensions, npy_intp* steps, void* data) ++#endif { npy_intp i; npy_intp n = dimensions[0]; -@@ -378,7 +378,7 @@ static PyMethodDef wrapper_module_%(num) +@@ -378,7 +382,11 @@ def test_ufuncify_source_multioutput(): {NULL, NULL, 0, NULL} }; --static void multitest_ufunc(char **args, npy_intp *dimensions, npy_intp* steps, void* data) ++#ifdef NPY_1_19_API_VERSION +static void multitest_ufunc(char **args, const npy_intp *dimensions, const npy_intp* steps, void* data) ++#else + static void multitest_ufunc(char **args, npy_intp *dimensions, npy_intp* steps, void* data) ++#endif { npy_intp i; npy_intp n = dimensions[0]; diff --git a/sympy.spec b/sympy.spec index 638d570..c98cc0c 100644 --- a/sympy.spec +++ b/sympy.spec @@ -20,6 +20,7 @@ Patch0: %{name}-circuitplot.patch # Adapt to python 3.12 Patch1: %{name}-python3.12.patch # Fix incompatible pointers, which are an error with GCC 14 +# https://github.com/sympy/sympy/pull/25968 Patch2: %{name}-incompatible-pointer.patch # This package used to be noarch, and should still be noarch. However, because