diff --git a/0001-Fix-fedabipkgdiff-configure-check-for-Python-3.12.patch b/0001-Fix-fedabipkgdiff-configure-check-for-Python-3.12.patch new file mode 100644 index 0000000..4c2daa4 --- /dev/null +++ b/0001-Fix-fedabipkgdiff-configure-check-for-Python-3.12.patch @@ -0,0 +1,40 @@ +From 020f008cc58f9cb61baaa175ae1fcb6c4faca55b Mon Sep 17 00:00:00 2001 +From: Yaakov Selkowitz +Date: Fri, 7 Jul 2023 13:57:28 -0400 +Subject: [PATCH] Fix fedabipkgdiff configure check for Python 3.12 + +importlib is the Python 3 replacement to imp, which was deprecated in +Python 3.4 and removed in 3.12. + + * configure.ac (REQUIRED_PYTHON_MODULES_FOR_FEDABIPKGDIFF): + Test for importlib.machinery instead of imp with python3. + +Signed-off-by: Yaakov Selkowitz +--- + configure.ac | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index b4e7e38e..b3f97ba2 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -739,13 +739,15 @@ if test x$CHECK_DEPS_FOR_FEDABIPKGDIFF = xyes; then + # urllib.parse. Oh well. + if test x$PYTHON = xpython3; then + URLPARSE_MODULE=urllib.parse ++ IMPORT_MODULE=importlib.machinery + else + URLPARSE_MODULE=urlparse ++ IMPORT_MODULE=imp + fi + + REQUIRED_PYTHON_MODULES_FOR_FEDABIPKGDIFF="\ + argparse logging os re subprocess sys $URLPARSE_MODULE \ +- xdg koji mock rpm imp tempfile mimetypes shutil six" ++ xdg koji mock rpm $IMPORT_MODULE tempfile mimetypes shutil six" + + AX_CHECK_PYTHON_MODULES([$REQUIRED_PYTHON_MODULES_FOR_FEDABIPKGDIFF], + [$PYTHON], +-- +2.41.0 + diff --git a/libabigail.spec b/libabigail.spec index db6eb1c..8597570 100644 --- a/libabigail.spec +++ b/libabigail.spec @@ -9,6 +9,9 @@ Summary: Set of ABI analysis tools License: ASL 2.0 URL: https://sourceware.org/libabigail/ Source0: http://mirrors.kernel.org/sourceware/libabigail/%{tarball_name}.tar.xz +# fix configure for removal of 'imp' in Python 3.12; code already fixed +# https://sourceware.org/pipermail/libabigail/2023q3/005581.html +Patch0: 0001-Fix-fedabipkgdiff-configure-check-for-Python-3.12.patch BuildRequires: binutils-devel @@ -92,6 +95,7 @@ them manually. %prep %setup -n %{tarball_name} +%patch -P 0 -p1 %build %configure --enable-ctf --disable-silent-rules --disable-zip-archive --disable-static @@ -115,7 +119,7 @@ make -C doc/manuals install-man-and-info-doc DESTDIR=%{buildroot} %if 0%{?fedora} # Explicitly use Python 3 as the interpreter -pathfix.py -i %{__python3} -pn %{buildroot}%{_bindir}/fedabipkgdiff +%py3_shebang_fix %{buildroot}%{_bindir}/fedabipkgdiff %endif %check