From 33ecbbb562ff9ef20ac1ad8397f218169ed72686 Mon Sep 17 00:00:00 2001 From: Markus Date: Jun 21 2021 17:33:36 +0000 Subject: fix ctypes for Python 3.10 (RHBZ #1973621) --- diff --git a/grass.spec b/grass.spec index 5f93298..17e5bc3 100644 --- a/grass.spec +++ b/grass.spec @@ -3,7 +3,7 @@ Name: grass Version: 7.8.5 -Release: 7%{?dist} +Release: 8%{?dist} Summary: GRASS GIS - Geographic Resources Analysis Support System %if 0%{?fedora} >= 33 || 0%{?rhel} >= 9 @@ -27,6 +27,7 @@ Source0: https://grass.osgeo.org/%{name}%{shortver}/source/%{name}-%{version}.ta Patch1: grass-7.8.0-buildroot.diff # Fix typename collision with custom "bool" type and bool from stdbool.h Patch2: grass-bool.patch +Patch3: grass78_ctypes_py3_10.diff BuildRequires: bison %if %{with flexiblas} @@ -180,6 +181,7 @@ GRASS GIS development headers %patch1 -p1 %patch2 -p1 +%patch3 -p1 # Correct mysql_config query sed -i -e 's/--libmysqld-libs/--libs/g' configure @@ -383,6 +385,9 @@ fi %{_libdir}/%{name}%{shortver}/include %changelog +* Mon Jun 21 2021 Markus Neteler - 7.8.5-8 +- fix ctypes for Python 3.10 (RHBZ #1973621) + * Fri May 07 2021 Sandro Mani - 7.8.5-7 - Rebuild (gdal) diff --git a/grass78_ctypes_py3_10.diff b/grass78_ctypes_py3_10.diff new file mode 100644 index 0000000..b5207bf --- /dev/null +++ b/grass78_ctypes_py3_10.diff @@ -0,0 +1,22 @@ +diff --git grass-7.8.5/lib/python/ctypes/ctypesgencore/parser/lex.py grass-7.8.5-new/lib/python/ctypes/ctypesgencore/parser/lex.py +index 294d902d9..0d1447400 100644 +--- grass-7.8.5/lib/python/ctypes/ctypesgencore/parser/lex.py ++++ grass-7.8.5-new/lib/python/ctypes/ctypesgencore/parser/lex.py +@@ -348,7 +348,7 @@ class Lexer: + break + + # if func not callable, it means it's an ignored token +- if not isinstance(func, collections.Callable): ++ if not isinstance(func, collections.abc.Callable): + break + + # If token is processed by a function, call it +@@ -720,7 +720,7 @@ def lex(module=None, object=None, debug=0, optimize=0, + states, tokname = _statetoken(f, stateinfo) + toknames[f] = tokname + +- if isinstance(t, collections.Callable): ++ if isinstance(t, collections.abc.Callable): + for s in states: + funcsym[s].append((f, t)) + elif (isinstance(t, bytes) or isinstance(t, str)):