Accepting request 1083477 from home:dirkmueller:Factory
- add py311.patch to fix build against python 3.11 OBS-URL: https://build.opensuse.org/request/show/1083477 OBS-URL: https://build.opensuse.org/package/show/Application:Geo/zbar?expand=0&rev=53
This commit is contained in:
parent
6978bf239f
commit
753eface5e
60
py311.patch
Normal file
60
py311.patch
Normal file
@ -0,0 +1,60 @@
|
||||
From 9bb0cc43f7f9e9c676e07b2e511f03bfa1c491cb Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
|
||||
<congdanhqx@gmail.com>
|
||||
Date: Wed, 21 Sep 2022 10:32:11 +0700
|
||||
Subject: [PATCH] python: enum: fix build for Python 3.11
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Python 3.9 introduced Py_SET_SIZE function to set size instead of
|
||||
relying on Py_SIZE() as a macro [3.9].
|
||||
|
||||
Python 3.10 started to encourage to use Py_SET_SIZE instead of
|
||||
assigning into return value of Py_SIZE [3.10].
|
||||
|
||||
Python 3.11 flips the switch, turn Py_SIZE into a function [3.11],
|
||||
thus Py_SIZE(obj) will be a rvalue. We need to use Py_SET_SIZE
|
||||
to set size now.
|
||||
|
||||
[3.9]: https://docs.python.org/3.9/c-api/structures.html#c.Py_SET_SIZE
|
||||
[3.10]: https://docs.python.org/3.10/c-api/structures.html#c.Py_SIZE
|
||||
[3.11]: https://docs.python.org/3.11/c-api/structures.html#c.Py_SIZE
|
||||
|
||||
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
|
||||
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
|
||||
---
|
||||
python/enum.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
Index: zbar-0.23.90/python/enum.c
|
||||
===================================================================
|
||||
--- zbar-0.23.90.orig/python/enum.c
|
||||
+++ zbar-0.23.90/python/enum.c
|
||||
@@ -49,10 +49,13 @@ enumitem_new (PyTypeObject *type,
|
||||
Py_DECREF(self);
|
||||
return(NULL);
|
||||
}
|
||||
-
|
||||
/* we assume the "fast path" for a single-digit ints (see longobject.c) */
|
||||
/* this also holds if we get a small_int preallocated long */
|
||||
+#if PY_VERSION_HEX >= 0x030900A4
|
||||
+ Py_SET_SIZE(&self->val, Py_SIZE(longval));
|
||||
+#else
|
||||
Py_SIZE(&self->val) = Py_SIZE(longval);
|
||||
+#endif
|
||||
self->val.ob_digit[0] = longval->ob_digit[0];
|
||||
Py_DECREF(longval);
|
||||
#else
|
||||
@@ -143,7 +146,11 @@ zbarEnumItem_New (PyObject *byname,
|
||||
|
||||
/* we assume the "fast path" for a single-digit ints (see longobject.c) */
|
||||
/* this also holds if we get a small_int preallocated long */
|
||||
+#if PY_VERSION_HEX >= 0x030900A4
|
||||
+ Py_SET_SIZE(&self->val, Py_SIZE(longval));
|
||||
+#else
|
||||
Py_SIZE(&self->val) = Py_SIZE(longval);
|
||||
+#endif
|
||||
self->val.ob_digit[0] = longval->ob_digit[0];
|
||||
Py_DECREF(longval);
|
||||
|
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 28 08:21:42 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- add py311.patch to fix build against python 3.11
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Dec 19 15:04:25 UTC 2022 - pgajdos@suse.com
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package zbar
|
||||
#
|
||||
# Copyright (c) 2022 SUSE LLC
|
||||
# Copyright (c) 2023 SUSE LLC
|
||||
# Copyright (c) 2010 Carlos Goncalves <cgoncalves@opensuse.org>.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
@ -28,6 +28,8 @@ Group: Productivity/Other
|
||||
URL: https://github.com/mchehab/zbar
|
||||
Source0: https://linuxtv.org/downloads/%{name}/%{name}-%{version}.tar.bz2
|
||||
Source98: baselibs.conf
|
||||
# PATCH-FIX-UPSTREAM: fix build against python 3.11 - https://github.com/mchehab/zbar/commit/9bb0cc43f7f9e9c676e07b2e511f03bfa1c491cb
|
||||
Patch1: py311.patch
|
||||
BuildRequires: libjpeg-devel
|
||||
BuildRequires: pkgconfig >= 0.9.0
|
||||
BuildRequires: xmlto
|
||||
|
Loading…
Reference in New Issue
Block a user