From 97c8620483d69201321c2c249e1b5e7fcd475855 Mon Sep 17 00:00:00 2001 From: Gwyn Ciesla Date: Fri, 16 Apr 2021 10:19:27 -0500 Subject: [PATCH] Upstream patch to support Python 3.10. --- ...701a17618939fa0746ff532449f933213a68.patch | 33 +++++++++++++++++++ brltty.spec | 7 +++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 09b9701a17618939fa0746ff532449f933213a68.patch diff --git a/09b9701a17618939fa0746ff532449f933213a68.patch b/09b9701a17618939fa0746ff532449f933213a68.patch new file mode 100644 index 0000000..d5474d8 --- /dev/null +++ b/09b9701a17618939fa0746ff532449f933213a68.patch @@ -0,0 +1,33 @@ +From 09b9701a17618939fa0746ff532449f933213a68 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Thu, 15 Apr 2021 11:32:15 +0200 +Subject: [PATCH] Python modules check: Assert exit code, not empty output + +Distutils is deprecated in Python 3.10+: +https://www.python.org/dev/peps/pep-0632/ + +When importing it, there is a warning: + + DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives + +The configure script falsely assumed this is an error. +Instead, we now check for the exit code, which is more explicit. + +In the long term, we need to migrate away from distutils, this is a stopgap measure only. +--- + Bindings/Python/bindings.m4 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Bindings/Python/bindings.m4 b/Bindings/Python/bindings.m4 +index 784418f0c..ee28525fc 100644 +--- a/Bindings/Python/bindings.m4 ++++ b/Bindings/Python/bindings.m4 +@@ -40,7 +40,7 @@ else + for python_module in sys distutils.sysconfig + do + python_error="`"${PYTHON}" -c "import ${python_module};" 2>&1`" +- if test -n "${python_error}" ++ if test $? -ne 0 + then + AC_MSG_WARN([Python module not found: ${python_module}: ${python_error}]) + PYTHON_OK=false diff --git a/brltty.spec b/brltty.spec index 4a8cd76..1b7c6bf 100644 --- a/brltty.spec +++ b/brltty.spec @@ -33,7 +33,7 @@ Name: brltty Version: %{pkg_version} -Release: 3%{?dist} +Release: 4%{?dist} License: LGPLv2+ URL: http://brltty.app/ Source0: http://brltty.app/archive/%{name}-%{version}.tar.xz @@ -41,6 +41,7 @@ Source1: brltty.service Patch1: brltty-6.3-loadLibrary.patch # libspeechd.h moved in latest speech-dispatch (NOT sent upstream) Patch2: brltty-6.3-libspeechd.patch +Patch3: 09b9701a17618939fa0746ff532449f933213a68.patch Summary: Braille display driver for Linux/Unix BuildRequires: byacc, glibc-kernheaders, bluez-libs-devel, systemd BuildRequires: gettext, at-spi2-core-devel, alsa-lib-devel @@ -238,6 +239,7 @@ mv %{name}-%{version} python2 pushd python2 %patch1 -p1 -b .loadLibrary %patch2 -p1 -b .libspeechd +%patch3 -p1 -b .py10 # remove packaged binary file rm -f Programs/brltty-ktb @@ -549,6 +551,9 @@ fi %config(noreplace) %verify(not size md5 mtime) %{_sysconfdir}/brltty/Initramfs/cmdline %changelog +* Fri Apr 16 2021 Gwyn Ciesla - 6.3-4 +- Upstream patch to support Python 3.10. + * Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 6.3-3 - Rebuilt for updated systemd-rpm-macros See https://pagure.io/fesco/issue/2583.