Built and tested ok with SWIG 4.2.1 and SWIG 4.4.1 on amd64 and i386.

diff -Nurp /usr/ports/devel/libftdi1/Makefile ./Makefile
--- /usr/ports/devel/libftdi1/Makefile  Wed Jan  8 11:50:06 2025
+++ ./Makefile  Sat Jan 24 10:27:40 2026
@@ -4,7 +4,7 @@ CATEGORIES =    devel
 
 V =            1.5
 DISTNAME =     libftdi1-$V
-REVISION =     3
+REVISION =     4
 
 SHARED_LIBS +=  ftdi1                     0.1 # 2.4
 
diff -Nurp /usr/ports/devel/libftdi1/patches/patch-python_ftdi1_i 
./patches/patch-python_ftdi1_i
--- /usr/ports/devel/libftdi1/patches/patch-python_ftdi1_i      Wed Dec 31 
19:00:00 1969
+++ ./patches/patch-python_ftdi1_i      Sat Jan 24 10:27:28 2026
@@ -0,0 +1,69 @@
+http://developer.intra2net.com/git/?p=libftdi;a=commit;h=ff7707e3ffadc09af420b26370b9e097a5b2bc8b
+https://bugzilla.redhat.com/show_bug.cgi?id=2319133
+https://github.com/swig/swig/pull/2907
+http://developer.intra2net.com/mailarchive/html/libftdi/2024/msg00024.html
+
+http://developer.intra2net.com/git/?p=libftdi;a=commitdiff_plain;h=ff7707e3ffadc09af420b26370b9e097a5b2bc8b
+
+http://developer.intra2net.com/git/?p=libftdi;a=commitdiff;h=ff7707e3ffadc09af420b26370b9e097a5b2bc8b;hp=3f314ed78111473b7cbf1b9d1854c9f6322eea7a
+
+
+Index: python/ftdi1.i
+--- python/ftdi1.i.orig
++++ python/ftdi1.i
+@@ -52,7 +52,7 @@ char * str2charp_size(PyObject* pyObj, int * size)
+ %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,noblock=1) 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);
+@@ -92,12 +92,12 @@ char * str2charp_size(PyObject* pyObj, int * size)
+ %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(argout) (unsigned char *buf, int size) %{
++%typemap(argout,noblock=1) (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);
+ %clear (unsigned char *buf, int size);
+ 
+@@ -119,12 +119,12 @@ char * str2charp_size(PyObject* pyObj, int * size)
+ %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,noblock=1) (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,noblock=1) (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;
+ 
+@@ -137,12 +137,12 @@ char * str2charp_size(PyObject* pyObj, int * size)
+ %clear int* value;
+ 
+ %typemap(in,numinputs=1) (unsigned char *buf, int size) %{ $2 = 
PyInt_AsLong($input);$1 = (unsigned char*)malloc($2*sizeof(char)); %}
+-%typemap(argout) (unsigned char *buf, int size) %{
++%typemap(argout,noblock=1) (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);
+ %clear (unsigned char *buf, int size);
+ 

Reply via email to