public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/kicad] rawhide: Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility
@ 2026-07-28 15:33 Jitka Plesnikova
0 siblings, 0 replies; only message in thread
From: Jitka Plesnikova @ 2026-07-28 15:33 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/kicad
Branch : rawhide
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=rawhide
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-28 15:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-28 15:33 [rpms/kicad] 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