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/libftdi] rawhide: Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility
Date: Tue, 11 Aug 2026 11:53:53 GMT	[thread overview]
Message-ID: <178644923337.1.10284896386033603108.rpms-libftdi-7a90b25c6115@fedoraproject.org> (raw)

A new commit has been pushed.

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

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

---
diff --git a/libftdi-swig45.patch b/libftdi-swig45.patch
new file mode 100644
index 0000000..6f267d5
--- /dev/null
+++ b/libftdi-swig45.patch
@@ -0,0 +1,21 @@
+diff -up libftdi1-1.5/python/ftdi1.i.swig45 libftdi1-1.5/python/ftdi1.i
+--- libftdi1-1.5/python/ftdi1.i.swig45	2026-07-28 09:34:18.344364413 +0200
++++ libftdi1-1.5/python/ftdi1.i	2026-07-28 09:34:18.347364489 +0200
+@@ -91,7 +91,7 @@ char * str2charp_size(PyObject* pyObj, i
+ "read_data(context) -> (return_code, buf)"
+ %enddef
+ %feature("autodoc", ftdi_read_data_docstring) ftdi_read_data;
+-%typemap(in,numinputs=1) (unsigned char *buf, int size) %{ $2 = PyInt_AsLong($input);$1 = (unsigned char*)malloc($2*sizeof(char)); %}
++%typemap(in,numinputs=1) (unsigned char *buf, int size) %{ $2 = PyLong_AsLong($input);$1 = (unsigned char*)malloc($2*sizeof(char)); %}
+ %typemap(argout,noblock=1) (unsigned char *buf, int size) {
+         if(result<0)
+                 $2=0;
+@@ -136,7 +136,7 @@ char * str2charp_size(PyObject* pyObj, i
+     int ftdi_get_eeprom_value(struct ftdi_context *ftdi, enum ftdi_eeprom_value value_name, int* value);
+ %clear int* value;
+ 
+-%typemap(in,numinputs=1) (unsigned char *buf, int size) %{ $2 = PyInt_AsLong($input);$1 = (unsigned char*)malloc($2*sizeof(char)); %}
++%typemap(in,numinputs=1) (unsigned char *buf, int size) %{ $2 = PyLong_AsLong($input);$1 = (unsigned char*)malloc($2*sizeof(char)); %}
+ %typemap(argout,noblock=1) (unsigned char *buf, int size) {
+         if(result<0)
+                 $2=0;

diff --git a/libftdi.spec b/libftdi.spec
index be43159..758795a 100644
--- a/libftdi.spec
+++ b/libftdi.spec
@@ -1,6 +1,6 @@
 Name:		libftdi
 Version:	1.5
-Release:	26%{?dist}
+Release:	27%{?dist}
 Summary:	Library to program and control the FTDI USB controller
 
 License:	LGPL-2.1-only AND GPL-2.0-only AND GPL-2.0-or-later AND (GPL-2.0-only WITH eCos-exception-2.0) AND MIT AND BSD-2-Clause-Views
@@ -23,6 +23,9 @@ Patch3:		libftdi-1.5-swig-4.3.patch
 # http://developer.intra2net.com/git/?p=libftdi;a=commitdiff;h=3dc444f99bbc780f06ee6115c086e30f2dda471a
 # http://developer.intra2net.com/git/?p=libftdi;a=commitdiff;h=de9f01ece34d2fe6e842e0250a38f4b16eda2429
 Patch4:		libftdi-1.5-cmake.patch
+# Replace removed Python 2 C API macros with Python 3 equivalents
+# for compatibility with SWIG 4.5.0
+Patch5:		libftdi-swig45.patch
 
 BuildRequires:	cmake
 BuildRequires:	gcc
@@ -133,6 +136,9 @@ rm -f %{buildroot}%{_datadir}/doc/libftdipp1/example.conf
 
 
 %changelog
+* Tue Jul 28 2026 Jitka Plesnikova <jplesnik@redhat.com> - 1.5-27
+- Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility
+
 * Wed Jul 22 2026 Python Maint <python-maint@redhat.com> - 1.5-26
 - Rebuilt for Python 3.15.0b4 ABI change
 

                 reply	other threads:[~2026-08-11 11:53 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=178644923337.1.10284896386033603108.rpms-libftdi-7a90b25c6115@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