1 |
commit: d0d32526c2f5a421da0d79cd55d287bab06e260a |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Sep 16 01:05:11 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 16 01:17:33 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d0d32526 |
7 |
|
8 |
dev-libs/libserialport: add patch for runtime breakage w/ new kernels |
9 |
|
10 |
Closes: https://bugs.gentoo.org/813273 |
11 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
12 |
|
13 |
.../files/libserialport-0.1.1-kernel-termiox.patch | 32 +++++++++++++++ |
14 |
.../libserialport/libserialport-0.1.1-r1.ebuild | 46 ++++++++++++++++++++++ |
15 |
2 files changed, 78 insertions(+) |
16 |
|
17 |
diff --git a/dev-libs/libserialport/files/libserialport-0.1.1-kernel-termiox.patch b/dev-libs/libserialport/files/libserialport-0.1.1-kernel-termiox.patch |
18 |
new file mode 100644 |
19 |
index 00000000000..8a8aed26a31 |
20 |
--- /dev/null |
21 |
+++ b/dev-libs/libserialport/files/libserialport-0.1.1-kernel-termiox.patch |
22 |
@@ -0,0 +1,32 @@ |
23 |
+https://sigrok.org/gitweb/?p=libserialport.git;a=commitdiff;h=6f9b03e597ea7200eb616a4e410add3dd1690cb1 |
24 |
+https://sigrok.org/bugzilla/show_bug.cgi?id=1687 |
25 |
+https://bugs.gentoo.org/813273 |
26 |
+ |
27 |
+Fixes runtime breakage with newer kernels. |
28 |
+ |
29 |
+From: Karl Palsson <karlp@××××××××.com> |
30 |
+Date: Fri, 11 Jun 2021 17:07:09 +0000 |
31 |
+Subject: [PATCH] HACK: don't even check for termiox |
32 |
+ |
33 |
+termiox was removed from linux in e0efb3168d34 |
34 |
+Some more information available in https://www.spinics.net/lists/linux-serial/msg41926.html |
35 |
+ |
36 |
+Attempting to use the termiox ioctls on more modern kernels results in |
37 |
+"Inappropriate IOCTL" errors. |
38 |
+ |
39 |
+While the "right" solution might be to remove the termiox code from the |
40 |
+linux path, simply not checking for termiox builds a libserialport that |
41 |
+functions on modern linux kernels. |
42 |
+ |
43 |
+Signed-off-by: Karl Palsson <karlp@××××××××.com> |
44 |
+--- a/configure.ac |
45 |
++++ b/configure.ac |
46 |
+@@ -112,7 +112,7 @@ AC_SYS_LARGEFILE |
47 |
+ AC_TYPE_SIZE_T |
48 |
+ |
49 |
+ # Check for specific termios structures. |
50 |
+-AC_CHECK_TYPES([struct termios2, struct termiox],,, |
51 |
++AC_CHECK_TYPES([struct termios2],,, |
52 |
+ [[#include <linux/termios.h>]]) |
53 |
+ AC_CHECK_MEMBERS([struct termios.c_ispeed, struct termios.c_ospeed, |
54 |
+ struct termios2.c_ispeed, struct termios2.c_ospeed],,, |
55 |
|
56 |
diff --git a/dev-libs/libserialport/libserialport-0.1.1-r1.ebuild b/dev-libs/libserialport/libserialport-0.1.1-r1.ebuild |
57 |
new file mode 100644 |
58 |
index 00000000000..a06498d3dbf |
59 |
--- /dev/null |
60 |
+++ b/dev-libs/libserialport/libserialport-0.1.1-r1.ebuild |
61 |
@@ -0,0 +1,46 @@ |
62 |
+# Copyright 1999-2021 Gentoo Authors |
63 |
+# Distributed under the terms of the GNU General Public License v2 |
64 |
+ |
65 |
+EAPI=7 |
66 |
+ |
67 |
+inherit autotools |
68 |
+ |
69 |
+if [[ ${PV} == "9999" ]]; then |
70 |
+ EGIT_REPO_URI="git://sigrok.org/${PN}" |
71 |
+ inherit git-r3 |
72 |
+else |
73 |
+ SRC_URI="https://sigrok.org/download/source/${PN}/${P}.tar.gz" |
74 |
+ KEYWORDS="~amd64 ~x86" |
75 |
+fi |
76 |
+ |
77 |
+DESCRIPTION="Cross platform serial port access library" |
78 |
+HOMEPAGE="https://sigrok.org/wiki/Libserialport" |
79 |
+ |
80 |
+LICENSE="LGPL-3" |
81 |
+SLOT="0" |
82 |
+IUSE="static-libs" |
83 |
+ |
84 |
+BDEPEND="virtual/pkgconfig" |
85 |
+ |
86 |
+PATCHES=( |
87 |
+ "${FILESDIR}"/${P}-kernel-termiox.patch |
88 |
+) |
89 |
+ |
90 |
+src_prepare() { |
91 |
+ default |
92 |
+ |
93 |
+ #[[ ${PV} == "9999" ]] && eautoreconf |
94 |
+ # Needed for the termiox patch, should be able to drop on next release |
95 |
+ # (change back this + inherit to just for 9999) |
96 |
+ eautoreconf |
97 |
+} |
98 |
+ |
99 |
+src_configure() { |
100 |
+ econf $(use_enable static-libs static) |
101 |
+} |
102 |
+ |
103 |
+src_install() { |
104 |
+ default |
105 |
+ |
106 |
+ find "${ED}" -name '*.la' -type f -delete || die |
107 |
+} |