public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/plplot] rawhide: Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility
@ 2026-07-29  3:06 Jitka Plesnikova
  0 siblings, 0 replies; only message in thread
From: Jitka Plesnikova @ 2026-07-29  3:06 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/plplot
Branch : rawhide
Commit : a28bbddc314bb3a7026beed5d8296f32884639e8
Author : Jitka Plesnikova <jplesnik@redhat.com>
Date   : 2026-07-28T15:29:18+02:00
Stats  : +62/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/plplot/c/a28bbddc314bb3a7026beed5d8296f32884639e8?branch=rawhide

Log:
Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility

---
diff --git a/plplot-swig45.patch b/plplot-swig45.patch
new file mode 100644
index 0000000..69007e3
--- /dev/null
+++ b/plplot-swig45.patch
@@ -0,0 +1,58 @@
+diff -up plplot-5.15.0/bindings/python/plplotc.i.swig45 plplot-5.15.0/bindings/python/plplotc.i
+--- plplot-5.15.0/bindings/python/plplotc.i.swig45	2026-07-28 10:23:36.392606837 +0200
++++ plplot-5.15.0/bindings/python/plplotc.i	2026-07-28 10:23:36.396606919 +0200
+@@ -756,7 +756,7 @@ typedef PLINT          PLBOOL;
+     $1 = buff;
+ }
+ %typemap( argout ) char *OUTPUT {
+-    PyObject *o = PyString_FromString( $1 );
++    PyObject *o = PyUnicode_FromString( $1 );
+     $result = SWIG_AppendOutput( $result, o );
+ }
+ 
+@@ -1143,10 +1143,10 @@ typedef void ( *label_func )( PLINT, PLF
+                 fprintf( stderr, "label callback failed with 3 arguments\n" );
+                 PyErr_SetString( PyExc_RuntimeError, "label callback must take 3 arguments." );
+             }
+-            else if ( PyString_Check( result ) )
++            else if ( PyBytes_Check( result ) )
+             {
+                 // should I test the type here?
+-                pystring = PyString_AsString( result );
++                pystring = PyBytes_AsString( result );
+                 strncpy( string, pystring, len );
+             }
+             else if ( PyUnicode_Check( result ) )
+@@ -1266,7 +1266,7 @@ typedef void ( *label_func )( PLINT, PLF
+             }
+             else
+             {
+-                str = PyString_AsString( rep );
++                str = PyBytes_AsString( rep );
+             }
+             if ( strstr( str, "function pltr0" ) != 0 )
+             {
+@@ -1587,9 +1587,9 @@ typedef void ( *label_func )( PLINT, PLF
+     {
+         $1[i] = NULL;
+         elt   = PySequence_Fast_GET_ITEM( $input, i );
+-        if ( PyString_Check( elt ) )
++        if ( PyBytes_Check( elt ) )
+         {
+-            $1[i] = PyString_AsString( elt );
++            $1[i] = PyBytes_AsString( elt );
+         }
+         else if ( PyUnicode_Check( elt ) )
+         {
+@@ -1626,9 +1626,9 @@ typedef void ( *label_func )( PLINT, PLF
+     for ( i = 0; i < tmp; i++ )
+     {
+         PyObject *s = PyList_GetItem( $input, i );
+-        if ( PyString_Check( s ) )
++        if ( PyBytes_Check( s ) )
+         {
+-            $2[i] = PyString_AsString( s );
++            $2[i] = PyBytes_AsString( s );
+         }
+         else if ( PyUnicode_Check( s ) )
+         {

diff --git a/plplot.spec b/plplot.spec
index 7dc87b1..a88ea59 100644
--- a/plplot.spec
+++ b/plplot.spec
@@ -98,6 +98,9 @@ Patch14:        plplot-5.15.0-swig-4.3.patch
 # Fix for SWIG 4.4.0
 # https://sourceforge.net/p/plplot/support-requests/56/
 Patch15:        https://sourceforge.net/p/plplot/support-requests/_discuss/thread/bd326c8bff/fec5/attachment/plplot-5.15.0-swig-4.4.patch
+# Replace removed Python 2 C API macros with Python 3 equivalents
+# for compatibility with SWIG 4.5.0
+Patch16:        plplot-swig45.patch
 
 
 BuildRequires:  cmake >= 3.13.2
@@ -429,6 +432,7 @@ Requires:       wxGTK-devel%{?_isa}
 %patch -P13 -p1 -b .ocamlmklib
 %patch -P14 -p1
 %patch -P15 -p1
+%patch -P16 -p1
 # Use cmake FindLua
 rm cmake/modules/FindLua.cmake
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-29  3:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-29  3:06 [rpms/plplot] rawhide: Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility Jitka Plesnikova

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox