[packages/libftdi1] - added swig 4.3 compatibility patch

qboosh qboosh at pld-linux.org
Sun Mar 15 11:54:05 CET 2026


commit d1d9843e2087946f5d78789b15ab7247237c69df
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Mar 15 11:54:15 2026 +0100

    - added swig 4.3 compatibility patch

 libftdi1-swig4.3.patch | 44 ++++++++++++++++++++++++++++++++++++++++++++
 libftdi1.spec          |  6 ++++--
 2 files changed, 48 insertions(+), 2 deletions(-)
---
diff --git a/libftdi1.spec b/libftdi1.spec
index ad112e7..9a3339b 100644
--- a/libftdi1.spec
+++ b/libftdi1.spec
@@ -14,6 +14,7 @@ Group:		Libraries
 Source0:	https://www.intra2net.com/en/developer/libftdi/download/%{name}-%{version}.tar.bz2
 # Source0-md5:	f515d7d69170a9afc8b273e8f1466a80
 Patch0:		%{name}-cmake.patch
+Patch1:		%{name}-swig4.3.patch
 URL:		https://www.intra2net.com/en/developer/libftdi/
 BuildRequires:	boost-devel >= 1.33
 BuildRequires:	cmake >= 2.6
@@ -25,7 +26,7 @@ BuildRequires:	pkgconfig
 %{?with_python2:BuildRequires:	python-devel >= 1:2.6}
 %{?with_python3:BuildRequires:	python3-devel >= 1:3.3}
 BuildRequires:	rpmbuild(macros) >= 1.605
-BuildRequires:	swig-python
+BuildRequires:	swig-python >= 2
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -142,7 +143,8 @@ Wiązanie Pythona 3 do libftdi1.
 
 %prep
 %setup -q
-%patch -P 0 -p1
+%patch -P0 -p1
+%patch -P1 -p1
 
 %build
 install -d build-doc
diff --git a/libftdi1-swig4.3.patch b/libftdi1-swig4.3.patch
new file mode 100644
index 0000000..35aba9d
--- /dev/null
+++ b/libftdi1-swig4.3.patch
@@ -0,0 +1,44 @@
+--- libftdi1-1.5/python/ftdi1.i.orig	2020-07-07 21:32:55.000000000 +0200
++++ libftdi1-1.5/python/ftdi1.i	2026-03-15 11:51:14.210223094 +0100
+@@ -52,7 +52,7 @@ char * str2charp_size(PyObject* pyObj, i
+ %enddef
+ %feature("autodoc", ftdi_usb_find_all_docstring) ftdi_usb_find_all;
+ %typemap(in,numinputs=0) SWIGTYPE** OUTPUT ($*ltype temp) %{ $1 = &temp; %}
+-%typemap(argout) SWIGTYPE** OUTPUT %{ $result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)*$1,$*descriptor,0)); %}
++%typemap(argout) SWIGTYPE** OUTPUT %{ $result = SWIG_AppendOutput($result, SWIG_NewPointerObj((void*)*$1,$*descriptor,0)); %}
+ %apply SWIGTYPE** OUTPUT { struct ftdi_device_list **devlist };
+     int ftdi_usb_find_all(struct ftdi_context *ftdi, struct ftdi_device_list **devlist,
+                           int vendor, int product);
+@@ -95,7 +95,7 @@ char * str2charp_size(PyObject* pyObj, i
+ %typemap(argout) (unsigned char *buf, int size) %{
+         if(result<0)
+                 $2=0;
+-        $result = SWIG_Python_AppendOutput($result, charp2str((char*)$1, $2));
++        $result = SWIG_AppendOutput($result, charp2str((char*)$1, $2));
+         free($1);
+ %}
+     int ftdi_read_data(struct ftdi_context *ftdi, unsigned char *buf, int size);
+@@ -119,12 +119,12 @@ char * str2charp_size(PyObject* pyObj, i
+ %enddef
+ %feature("autodoc", ftdi_read_pins_docstring) ftdi_read_pins;
+ %typemap(in,numinputs=0) unsigned char *pins ($*ltype temp) %{ $1 = &temp; %}
+-%typemap(argout) (unsigned char *pins) %{ $result = SWIG_Python_AppendOutput($result, charp2str((char*)$1, 1)); %}
++%typemap(argout) (unsigned char *pins) %{ $result = SWIG_AppendOutput($result, charp2str((char*)$1, 1)); %}
+     int ftdi_read_pins(struct ftdi_context *ftdi, unsigned char *pins);
+ %clear unsigned char *pins;
+ 
+ %typemap(in,numinputs=0) unsigned char *latency ($*ltype temp) %{ $1 = &temp; %}
+-%typemap(argout) (unsigned char *latency) %{ $result = SWIG_Python_AppendOutput($result, charp2str((char*)$1, 1)); %}
++%typemap(argout) (unsigned char *latency) %{ $result = SWIG_AppendOutput($result, charp2str((char*)$1, 1)); %}
+     int ftdi_get_latency_timer(struct ftdi_context *ftdi, unsigned char *latency);
+ %clear unsigned char *latency;
+ 
+@@ -140,7 +140,7 @@ char * str2charp_size(PyObject* pyObj, i
+ %typemap(argout) (unsigned char *buf, int size) %{
+         if(result<0)
+                 $2=0;
+-        $result = SWIG_Python_AppendOutput($result, charp2str((char*)$1, $2));
++        $result = SWIG_AppendOutput($result, charp2str((char*)$1, $2));
+         free($1);
+ %}
+     int ftdi_get_eeprom_buf(struct ftdi_context *ftdi, unsigned char * buf, int size);
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libftdi1.git/commitdiff/d1d9843e2087946f5d78789b15ab7247237c69df



More information about the pld-cvs-commit mailing list