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

A new commit has been pushed.

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

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

---
diff --git a/libcec-swig45.patch b/libcec-swig45.patch
new file mode 100644
index 0000000..5617ef4
--- /dev/null
+++ b/libcec-swig45.patch
@@ -0,0 +1,26 @@
+diff -up libcec-libcec-8.0.0/src/libcec/libcec.i.swig45 libcec-libcec-8.0.0/src/libcec/libcec.i
+--- libcec-libcec-8.0.0/src/libcec/libcec.i.swig45	2026-07-28 09:30:38.390102964 +0200
++++ libcec-libcec-8.0.0/src/libcec/libcec.i	2026-07-28 09:30:38.393103024 +0200
+@@ -12,7 +12,7 @@
+ %ignore *::operator=;
+ 
+ %typemap(out) CEC::cec_osd_name {
+-  $result = PyString_FromString($1.name);
++  $result = PyUnicode_FromString($1.name);
+ }
+ 
+ /////// libcec_configuration::strDeviceLanguage ///////
+diff -up libcec-libcec-8.0.0/src/libcec/SwigHelper.h.swig45 libcec-libcec-8.0.0/src/libcec/SwigHelper.h
+--- libcec-libcec-8.0.0/src/libcec/SwigHelper.h.swig45	2026-07-28 09:30:38.389102944 +0200
++++ libcec-libcec-8.0.0/src/libcec/SwigHelper.h	2026-07-28 09:30:38.392669050 +0200
+@@ -137,8 +137,8 @@ namespace CEC
+           Py_DECREF(arglist);
+         if (!!result)
+         {
+-          if (PyInt_Check(result))
+-            retval = (int)PyInt_AsLong(result);
++          if (PyLong_Check(result))
++            retval = (int)PyLong_AsLong(result);
+           Py_XDECREF(result);
+         }
+       }

diff --git a/libcec.spec b/libcec.spec
index fd951b0..6863d3f 100644
--- a/libcec.spec
+++ b/libcec.spec
@@ -1,11 +1,15 @@
 Name:          libcec
 Version:       8.0.0
-Release:       2%{?dist}
+Release:       3%{?dist}
 Summary:       Library and utilities for HDMI-CEC device control
 License:       GPL-2.0-or-later
 URL:           http://libcec.pulse-eight.com/
 Source0:       https://github.com/Pulse-Eight/%{name}/archive/%{name}-%{version}.tar.gz
 
+# Replace removed Python 2 C API macros with Python 3 equivalents
+# for compatibility with SWIG 4.5.0
+Patch0:        libcec-swig45.patch
+
 # Per i686 leaf package policy 
 # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
 ExcludeArch: %{ix86}
@@ -112,6 +116,9 @@ mv %{buildroot}%{_bindir}/cecc-client-%{version} %{buildroot}%{_bindir}/cecc-cli
 %{python3_sitearch}/*
 
 %changelog
+* Tue Jul 28 2026 Jitka Plesnikova <jplesnik@redhat.com> - 8.0.0-3
+- Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility
+
 * Wed Jul 22 2026 Python Maint <python-maint@redhat.com> - 8.0.0-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 16:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-28 16:49 [rpms/libcec] 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