[packages/plplot] - rel 20, fix compatibility with python 3.13 and numpy 2.x

baggins baggins at pld-linux.org
Sun Mar 23 19:47:13 CET 2025


commit 8b490a6eeb2f120b2810124beb9bf777437fa5af
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun Mar 23 20:29:35 2025 +0100

    - rel 20, fix compatibility with python 3.13 and numpy 2.x

 plplot.spec      |  7 ++++++-
 python3.13.patch | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+), 1 deletion(-)
---
diff --git a/plplot.spec b/plplot.spec
index bf448c3..5cce5d0 100644
--- a/plplot.spec
+++ b/plplot.spec
@@ -38,7 +38,7 @@ Summary:	PLplot - a library of functions that are useful for making scientific p
 Summary(pl.UTF-8):	PLplot - biblioteka funkcji przydatnych do tworzenia wykresów naukowych
 Name:		plplot
 Version:	5.15.0
-Release:	19
+Release:	20
 License:	LGPL v2+
 Group:		Libraries
 Source0:	https://downloads.sourceforge.net/plplot/%{name}-%{version}.tar.gz
@@ -48,6 +48,7 @@ Patch1:		%{name}-plmeta.patch
 Patch2:		%{name}-d.patch
 Patch3:		qt-5.15.patch
 Patch4:		%{name}-sip-build-support.patch
+Patch5:		python3.13.patch
 URL:		http://plplot.sourceforge.net/
 BuildRequires:	Qt5Gui-devel >= 5
 BuildRequires:	Qt5PrintSupport-devel >= 5
@@ -644,6 +645,7 @@ Biblioteka PLplot - przykłady do wiązania dla Pythona.
 %patch -P2 -p1
 %patch -P3 -p1
 %patch -P4 -p1
+%patch -P5 -p1
 
 %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python2(\s|$),#!%{__python3}\1,' \
 		-e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python3}\1,' \
@@ -653,6 +655,9 @@ Biblioteka PLplot - przykłady do wiązania dla Pythona.
 %build
 # required for cmake to find JNI headers/libs when lib64 is in use
 %{?with_java:export JAVA_HOME=%{_jvmlibdir}/java}
+_numpy_cflags="$(/usr/bin/numpy-config --cflags)"
+export CFLAGS="%{rpmcflags} $_numpy_cflags"
+export CXXFLAGS="%{rpmcxxflags} $_numpy_cflags"
 # NOTE: no %{_libdir}/jni in PLD, use plain %{_libdir}
 %cmake -B build \
 %if %{with ada}
diff --git a/python3.13.patch b/python3.13.patch
new file mode 100644
index 0000000..fcfde5a
--- /dev/null
+++ b/python3.13.patch
@@ -0,0 +1,49 @@
+diff --git a/bindings/python/plplotc.i b/bindings/python/plplotc.i
+index 050ef54e1..84a133b83 100644
+--- a/bindings/python/plplotc.i
++++ b/bindings/python/plplotc.i
+@@ -1039,7 +1039,7 @@ typedef void ( *label_func )( PLINT, PLFLT, char *, PLINT, PLPointer );
+                 return;
+             }
+             // call the python function
+-            result = PyEval_CallObject( python_pltr, arglist );
++            result = PyObject_CallObject( python_pltr, arglist );
+             // release the argument list
+             Py_CLEAR( arglist );
+             // check and unpack the result
+@@ -1088,7 +1088,7 @@ typedef void ( *label_func )( PLINT, PLFLT, char *, PLINT, PLPointer );
+             // build the argument list
+                 arglist = Py_BuildValue( "(iiO)", x, y, pdata );
+             // call the python function
+-            result = PyEval_CallObject( python_f2eval, arglist );
++            result = PyObject_CallObject( python_f2eval, arglist );
+             // release the argument list
+             Py_CLEAR( arglist );
+             // check and unpack the result
+@@ -1132,7 +1132,7 @@ typedef void ( *label_func )( PLINT, PLFLT, char *, PLINT, PLPointer );
+             arglist = Py_BuildValue( "(lfO)", axis, value, pdata );
+ #endif
+             // call the python function
+-            result = PyEval_CallObject( python_label, arglist );
++            result = PyObject_CallObject( python_label, arglist );
+             // release the argument list
+             //Py_CLEAR(arglist);
+             // check and unpack the result
+@@ -1189,7 +1189,7 @@ typedef void ( *label_func )( PLINT, PLFLT, char *, PLINT, PLPointer );
+             py      = PyArray_SimpleNewFromData( 1, &n, NPY_PLFLT, (void *) yt );
+             arglist = Py_BuildValue( "(ddOOO)", x, y, px, py, pdata );
+             // call the python function
+-            result = PyEval_CallObject( python_ct, arglist );
++            result = PyObject_CallObject( python_ct, arglist );
+             // release the argument list
+             Py_CLEAR( arglist );
+             Py_CLEAR( px );
+@@ -1230,7 +1230,7 @@ typedef void ( *label_func )( PLINT, PLFLT, char *, PLINT, PLPointer );
+ #endif
+             arglist = Py_BuildValue( "(iOO)", n, px, py );
+             // call the python function
+-            result = PyEval_CallObject( python_mapform, arglist );
++            result = PyObject_CallObject( python_mapform, arglist );
+             // release the argument list
+             Py_CLEAR( arglist );
+             Py_CLEAR( px );
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/plplot.git/commitdiff/8b490a6eeb2f120b2810124beb9bf777437fa5af



More information about the pld-cvs-commit mailing list