public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jitka Plesnikova <jplesnik@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/kicad] f44: Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility
Date: Tue, 28 Jul 2026 15:35:35 GMT	[thread overview]
Message-ID: <178525293549.1.4071481841569716194.rpms-kicad-660f978a6ddb@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/kicad
Branch : f44
Commit : 660f978a6ddbad4cefb0f9e80e777b108f5db911
Author : Jitka Plesnikova <jplesnik@redhat.com>
Date   : 2026-07-28T15:29:18+02:00
Stats  : +72/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/kicad/c/660f978a6ddbad4cefb0f9e80e777b108f5db911?branch=f44

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

---
diff --git a/kicad-swig45.patch b/kicad-swig45.patch
new file mode 100644
index 0000000..75ddb22
--- /dev/null
+++ b/kicad-swig45.patch
@@ -0,0 +1,63 @@
+diff -up kicad-10.0.5/common/swig/math.i.swig45 kicad-10.0.5/common/swig/math.i
+--- kicad-10.0.5/common/swig/math.i.swig45	2026-07-28 08:43:30.800348685 +0200
++++ kicad-10.0.5/common/swig/math.i	2026-07-28 08:43:30.803733215 +0200
+@@ -64,8 +64,8 @@
+     PyObject* Get()
+     {
+         PyObject* tup = PyTuple_New(2);
+-        PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
+-        PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
++        PyTuple_SET_ITEM(tup, 0, PyLong_FromLong(self->x));
++        PyTuple_SET_ITEM(tup, 1, PyLong_FromLong(self->y));
+         return tup;
+     }
+ 
+diff -up kicad-10.0.5/common/swig/wx.i.swig45 kicad-10.0.5/common/swig/wx.i
+--- kicad-10.0.5/common/swig/wx.i.swig45	2026-07-28 08:43:30.800348685 +0200
++++ kicad-10.0.5/common/swig/wx.i	2026-07-28 08:43:30.804165750 +0200
+@@ -79,10 +79,10 @@ public:
+        PyObject* Get()
+        {
+             PyObject* res = PyTuple_New(4);
+-            PyTuple_SET_ITEM(res, 0, PyInt_FromLong(self->x));
+-            PyTuple_SET_ITEM(res, 1, PyInt_FromLong(self->y));
+-            PyTuple_SET_ITEM(res, 2, PyInt_FromLong(self->width));
+-            PyTuple_SET_ITEM(res, 3, PyInt_FromLong(self->height));
++            PyTuple_SET_ITEM(res, 0, PyLong_FromLong(self->x));
++            PyTuple_SET_ITEM(res, 1, PyLong_FromLong(self->y));
++            PyTuple_SET_ITEM(res, 2, PyLong_FromLong(self->width));
++            PyTuple_SET_ITEM(res, 3, PyLong_FromLong(self->height));
+             return res;
+         }
+     }
+@@ -122,8 +122,8 @@ public:
+        PyObject* Get()
+        {
+             PyObject* res = PyTuple_New(2);
+-            PyTuple_SET_ITEM(res, 0, PyInt_FromLong(self->x));
+-            PyTuple_SET_ITEM(res, 1, PyInt_FromLong(self->y));
++            PyTuple_SET_ITEM(res, 0, PyLong_FromLong(self->x));
++            PyTuple_SET_ITEM(res, 1, PyLong_FromLong(self->y));
+             return res;
+         }
+     }
+@@ -174,8 +174,8 @@ public:
+         PyObject* Get()
+         {
+             PyObject* tup = PyTuple_New(2);
+-            PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
+-            PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
++            PyTuple_SET_ITEM(tup, 0, PyLong_FromLong(self->x));
++            PyTuple_SET_ITEM(tup, 1, PyLong_FromLong(self->y));
+             return tup;
+         }
+     }
+@@ -301,7 +301,7 @@ public:
+ 
+ 
+ %typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER) wxString& {
+-    $1 = PyString_Check($input) || PyUnicode_Check($input);
++    $1 = PyBytes_Check($input) || PyUnicode_Check($input);
+ }
+ 
+ %apply wxString& { wxString* }

diff --git a/kicad.spec b/kicad.spec
index d3eb4a4..d39e922 100644
--- a/kicad.spec
+++ b/kicad.spec
@@ -1,6 +1,6 @@
 Name:           kicad
 Version:        10.0.5
-Release:        2%{?dist}
+Release:        3%{?dist}
 Epoch:          1
 Summary:        EDA software suite for creation of schematic diagrams and PCBs
 
@@ -14,6 +14,10 @@ Source3:        https://gitlab.com/kicad/libraries/kicad-symbols/-/archive/%{ver
 Source4:        https://gitlab.com/kicad/libraries/kicad-footprints/-/archive/%{version}/kicad-footprints-%{version}.tar.gz
 Source5:        https://gitlab.com/kicad/libraries/kicad-packages3D/-/archive/%{version}/kicad-packages3D-%{version}.tar.gz
 
+# Replace removed Python 2 C API macros with Python 3 equivalents
+# for compatibility with SWIG 4.5.0
+Patch0:         kicad-swig45.patch
+
 # https://gitlab.com/kicad/code/kicad/-/issues/237
 ExclusiveArch:  x86_64 aarch64 ppc64le
 
@@ -93,6 +97,7 @@ Documentation for KiCad.
 
 %prep
 %setup -q -a 1 -a 2 -a 3 -a 4 -a 5
+%patch -P 0 -p1
 
 %build
 
@@ -228,6 +233,9 @@ appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.metainfo.xml
 
 
 %changelog
+* Tue Jul 28 2026 Jitka Plesnikova <jplesnik@redhat.com> - 1:10.0.5-3
+- Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility
+
 * Wed Jul 22 2026 Python Maint <python-maint@redhat.com> - 1:10.0.5-2
 - Rebuilt for Python 3.15.0b4 ABI change
 

                 reply	other threads:[~2026-07-28 15:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178525293549.1.4071481841569716194.rpms-kicad-660f978a6ddb@fedoraproject.org \
    --to=jplesnik@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox