Fix 3.11 FTBFS.

epel9
Gwyn Ciesla 3 years ago
parent cc085ac4be
commit 8a571d93a8

@ -0,0 +1,35 @@
--- python/enum.c~ 2022-01-12 10:07:02.151116991 -0600
+++ python/enum.c 2022-01-12 10:14:04.093001534 -0600
@@ -23,6 +23,12 @@
#include "zbarmodule.h"
+#if PY_VERSION_HEX < 0x030900A4 && !defined(Py_SET_SIZE)
+static inline void _Py_SET_SIZE(PyVarObject *ob, Py_ssize_t size)
+{ ob->ob_size = size; }
+#define Py_SET_SIZE(ob, size) _Py_SET_SIZE((PyVarObject*)(ob), size)
+#endif
+
static char enumitem_doc[] = PyDoc_STR(
"simple enumeration item.\n"
"\n"
--- python/enum.c~ 2022-01-12 10:16:29.670271662 -0600
+++ python/enum.c 2022-01-12 10:52:11.671258442 -0600
@@ -58,7 +58,7 @@
/* 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_SIZE(&self->val) = Py_SIZE(longval);
+ Py_SET_SIZE(&self->val, longval);
self->val.ob_digit[0] = longval->ob_digit[0];
Py_DECREF(longval);
#else
@@ -148,7 +148,7 @@
/* 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_SIZE(&self->val) = Py_SIZE(longval);
+ Py_SET_SIZE(&self->val, longval);
self->val.ob_digit[0] = longval->ob_digit[0];
Py_DECREF(longval);

@ -1,6 +1,6 @@
Name: zbar
Version: 0.23
Release: 11%{?dist}
Release: 12%{?dist}
Summary: Bar code reader
License: LGPLv2+
@ -8,6 +8,7 @@ URL: http://zbar.sourceforge.net/
Source0: https://linuxtv.org/downloads/%{name}/%{name}-%{version}.tar.bz2
Patch0: use_python3_on_python_script.patch
Patch1: zbar-tp_print.patch
Patch2: py311.patch
BuildRequires: make
BuildRequires: autoconf automake libtool gettext-devel
@ -95,6 +96,7 @@ on Java Native Interface (JNI) applications using ZBar.
%setup -q
%patch0 -p1
%patch1 -p0
%patch2 -p0
%build
%configure --with-python=python3 --with-gtk=auto --docdir=%{_docdir}/%{name}-%{version} --with-graphicsmagick
@ -187,6 +189,9 @@ rm -rf $RPM_BUILD_ROOT/usr/share/doc/zbar-%{version}/
%{_docdir}/test_python.py
%changelog
* Wed Jan 12 2022 Gwyn Ciesla <gwync@protonmail.com> - 0.23-12
- Fix 3.11 FTBFS.
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.23-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

Loading…
Cancel
Save