libserialport: add patch so it doesn't use termiox

termios has been removed from recent kernels, so not having this patch
causes "no such ioctl for device"-errors, preventing any use of the
library
This commit is contained in:
PoroCYon 2021-07-17 22:11:09 +02:00 committed by lemmi
parent dd54d352cb
commit 54b0ac41f4
2 changed files with 37 additions and 1 deletions

View file

@ -0,0 +1,36 @@
Inspired by this commit from the upstream package:
https://sigrok.org/gitweb/?p=libserialport.git;a=commit;h=6f9b03e597ea7200eb616a4e410add3dd1690cb1
Applying this patch directly added some extra dependencies (autoconf,
automake), as the configure script needs to be regenerated with the
original commit.
original commit message:
termiox was removed from linux in e0efb3168d34
Some more information available in https://www.spinics.net/lists/linux-serial/msg41926.html
Attempting to use the termiox ioctls on more modern kernels results in
"Inappropriate IOCTL" errors.
While the "right" solution might be to remove the termiox code from the
linux path, simply not checking for termiox builds a libserialport that
functions on modern linux kernels.
---
diff --git a/libserialport_internal.h b/libserialport_internal.new.h
index 669152b..9a57b81 100644
--- libserialport_internal.h
+++ libserialport_internal.h
@@ -69,11 +69,6 @@
#include "linux/serial.h"
#endif
#include "linux_termios.h"
-
-/* TCGETX/TCSETX is not available everywhere. */
-#if defined(TCGETX) && defined(TCSETX) && defined(HAVE_STRUCT_TERMIOX)
-#define USE_TERMIOX
-#endif
#endif
/* TIOCINQ/TIOCOUTQ is not available everywhere. */

View file

@ -1,7 +1,7 @@
# Template file for 'libserialport'
pkgname=libserialport
version=0.1.1
revision=2
revision=3
build_style=gnu-configure
short_desc="Cross-platform library for accessing serial ports"
maintainer="lemmi <lemmi@nerd2nerd.org>"