From da73a0f031f66d2176cb8fb02f4806e3147ed250 Mon Sep 17 00:00:00 2001 From: eaglegai Date: Fri, 15 Apr 2022 16:45:45 +0800 Subject: [PATCH] delete useless files and support python3.10 --- backport-support-3.10.patch | 33 +++++++++++++++++++++++++++++++++ brltty.spec | 16 +++++++++++----- 2 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 backport-support-3.10.patch diff --git a/backport-support-3.10.patch b/backport-support-3.10.patch new file mode 100644 index 0000000..a01edba --- /dev/null +++ b/backport-support-3.10.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 e684f2c..ff55607 100644 --- a/brltty.spec +++ b/brltty.spec @@ -7,7 +7,7 @@ Name: brltty Version: 6.1 -Release: 4 +Release: 5 Summary: Braille display driver for Linux/Unix License: LGPLv2+ URL: http://brltty.app/ @@ -21,7 +21,9 @@ Patch0: brltty-6.1-loadLibrary.patch Patch1: brltty-5.0-libspeechd.patch %endif -BuildRequires: brltty tcl-brltty byacc glibc-kernheaders bluez-libs-devel systemd gettext +Patch2: backport-support-3.10.patch + +BuildRequires: byacc glibc-kernheaders bluez-libs-devel systemd gettext BuildRequires: python3-devel autoconf at-spi2-core-devel alsa-lib-devel BuildRequires: automake @@ -163,8 +165,6 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/libbrlapi.a %find_lang %{name} cp -p %{name}.lang ../ -cp -a %{_libdir}/libbrlapi.so.* %{buildroot}%{_libdir} -cp -a %{_libdir}/tcl8.6/brlapi-* %{buildroot}%{_libdir}/tcl8.6 /usr/bin/2to3 -wn ${RPM_BUILD_ROOT}/etc/brltty/Contraction/latex-access.ctb sed -i 's|/usr/bin/python|/usr/bin/python3|g' ${RPM_BUILD_ROOT}/etc/brltty/Contraction/latex-access.ctb @@ -244,7 +244,6 @@ fi %files -n tcl-%{name} %{tcl_sitearch}/brlapi-%{api_ver} -%{tcl_sitearch}/brlapi-0.6.7 %files -n python3-%{name} %{python3_sitearch}/brlapi.cpython-*.so @@ -269,6 +268,13 @@ fi %changelog +* Fri Apr 15 2022 gaihuiying - 6.1-5 +- Type:bugfix +- Id:NA +- SUG:NA +- DESC:delete useless files + fix to support python3.10 + * Thu Jul 22 2021 lijingyuan - 6.1-4 - Type:requirement - Id:NA