From d5b34494c9c59c4855461b2319facc99defebef2 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Jul 07 2023 09:37:10 +0000 Subject: Fix FTBFS with python 3.12 (rhbz#2220630) --- diff --git a/py312.patch b/py312.patch new file mode 100644 index 0000000..77e51fa --- /dev/null +++ b/py312.patch @@ -0,0 +1,26 @@ +--- python/enum.c~ 2023-07-07 11:08:43.137150103 +0200 ++++ python/enum.c 2023-07-07 11:24:06.010655717 +0200 +@@ -59,7 +59,11 @@ + /* we assume the "fast path" for a single-digit ints (see longobject.c) */ + /* this also holds if we get a small_int preallocated long */ + Py_SET_SIZE(&self->val, longval); ++#if PY_MINOR_VERSION >= 12 ++ self->val.long_value.ob_digit[0] = longval->long_value.ob_digit[0]; ++#else + self->val.ob_digit[0] = longval->ob_digit[0]; ++#endif + Py_DECREF(longval); + #else + self->val.ob_ival = val; +@@ -150,7 +154,11 @@ + /* we assume the "fast path" for a single-digit ints (see longobject.c) */ + /* this also holds if we get a small_int preallocated long */ + Py_SET_SIZE(&self->val, longval); ++#if PY_MINOR_VERSION >= 12 ++ self->val.long_value.ob_digit[0] = longval->long_value.ob_digit[0]; ++#else + self->val.ob_digit[0] = longval->ob_digit[0]; ++#endif + Py_DECREF(longval); + + self->name = PyUnicode_FromString(name); diff --git a/zbar.spec b/zbar.spec index 8905f8b..719c8d2 100644 --- a/zbar.spec +++ b/zbar.spec @@ -6,7 +6,7 @@ Name: zbar Version: 0.23.90 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Bar code reader License: LGPL-2.1-or-later @@ -14,6 +14,7 @@ URL: http://zbar.sourceforge.net/ Source0: https://linuxtv.org/downloads/%{name}/%{name}-%{version}.tar.bz2 Patch0: use_python3_on_python_script.patch Patch1: py311.patch +Patch2: py312.patch BuildRequires: autoconf BuildRequires: automake @@ -118,8 +119,9 @@ on Java Native Interface (JNI) applications using ZBar. %prep %setup -q -%patch0 -p1 -%patch1 -p0 +%patch 0 -p1 +%patch 1 -p0 +%patch 2 -p0 %build %configure --with-python=python3 --with-gtk=auto --with-dbusconfdir=%{_sysconfdir} --docdir=%{_docdir}/%{name}-%{version} --with-graphicsmagick --without-xshm --without-xv --enable-codes=ean,databar,code128,code93,code39,codabar,i25,qrcode,sqcode,pdf417 @@ -215,6 +217,9 @@ rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/ %{_docdir}/test_python.py %changelog +* Fri Jul 07 2023 Michael J Gruber - 0.23.90-10 +- Fix FTBFS with python 3.12 (rhbz#2220630) + * Thu Jun 15 2023 Python Maint - 0.23.90-9 - Rebuilt for Python 3.12