Upstream patch to support Python 3.10.

This commit is contained in:
Gwyn Ciesla 2021-04-16 10:19:27 -05:00
parent 9bbed4233b
commit 97c8620483
2 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,33 @@
From 09b9701a17618939fa0746ff532449f933213a68 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
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

View File

@ -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 <gwync@protonmail.com> - 6.3-4
- Upstream patch to support Python 3.10.
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 6.3-3
- Rebuilt for updated systemd-rpm-macros
See https://pagure.io/fesco/issue/2583.