mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-01-06 00:05:54 +03:00
dev-python/pyserial: fix glibc-2.42 compat
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
39
dev-python/pyserial/files/pyserial-3.5-glibc-2.42.patch
Normal file
39
dev-python/pyserial/files/pyserial-3.5-glibc-2.42.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
https://github.com/pyserial/pyserial/issues/805
|
||||
https://github.com/pyserial/pyserial/pull/808
|
||||
|
||||
From 152f2639c630141b9d23f023178b619751e624a0 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander von Gluck IV <alex@terarocket.io>
|
||||
Date: Sun, 24 Aug 2025 20:17:51 -0500
|
||||
Subject: [PATCH] serial_posix: Fix custom baud rates for glibc >=2.42; solves
|
||||
#805
|
||||
|
||||
* https://sourceware.org/pipermail/libc-alpha/2025-July/168553.html
|
||||
* Based on changes recommended by JoaoBarioni in #805
|
||||
* Reverts 0085e1e1d (#519)
|
||||
---
|
||||
serial/serialposix.py | 11 ++---------
|
||||
1 file changed, 2 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/serial/serialposix.py b/serial/serialposix.py
|
||||
index 0464075b..6f843918 100644
|
||||
--- a/serial/serialposix.py
|
||||
+++ b/serial/serialposix.py
|
||||
@@ -430,15 +430,8 @@ def _reconfigure_port(self, force_update=False):
|
||||
ispeed = ospeed = self.BAUDRATE_CONSTANTS[self._baudrate]
|
||||
except KeyError:
|
||||
#~ raise ValueError('Invalid baud rate: %r' % self._baudrate)
|
||||
-
|
||||
- # See if BOTHER is defined for this platform; if it is, use
|
||||
- # this for a speed not defined in the baudrate constants list.
|
||||
- try:
|
||||
- ispeed = ospeed = BOTHER
|
||||
- except NameError:
|
||||
- # may need custom baud rate, it isn't in our list.
|
||||
- ispeed = ospeed = getattr(termios, 'B38400')
|
||||
-
|
||||
+ # Use safe placeholder for tcsetattr(), try to set special baudrate later
|
||||
+ ispeed = ospeed = termios.B38400
|
||||
try:
|
||||
custom_baud = int(self._baudrate) # store for later
|
||||
except ValueError:
|
||||
|
||||
42
dev-python/pyserial/pyserial-3.5-r3.ebuild
Normal file
42
dev-python/pyserial/pyserial-3.5-r3.ebuild
Normal file
@@ -0,0 +1,42 @@
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
DISTUTILS_USE_PEP517=setuptools
|
||||
PYTHON_COMPAT=( python3_{11..14} pypy3_11 )
|
||||
|
||||
inherit distutils-r1 pypi
|
||||
|
||||
DESCRIPTION="Python Serial Port extension"
|
||||
HOMEPAGE="
|
||||
https://github.com/pyserial/pyserial/
|
||||
https://pypi.org/project/pyserial/
|
||||
"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos"
|
||||
IUSE="examples"
|
||||
|
||||
DOCS=( CHANGES.rst README.rst )
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${P}-unittest-fix.patch"
|
||||
"${FILESDIR}/${P}-glibc-2.42.patch"
|
||||
)
|
||||
|
||||
distutils_enable_sphinx documentation --no-autodoc
|
||||
|
||||
python_test() {
|
||||
"${EPYTHON}" test/run_all_tests.py loop:// -v ||
|
||||
die "Testing failed with ${EPYTHON}"
|
||||
}
|
||||
|
||||
python_install_all() {
|
||||
distutils-r1_python_install_all
|
||||
if use examples; then
|
||||
dodoc -r examples
|
||||
docompress -x /usr/share/doc/${PF}/examples
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user