From 09c5cdd109bee006a6208b2760538437e9c2d646 Mon Sep 17 00:00:00 2001 From: rizitis Date: Fri, 5 Jul 2024 19:50:47 +0200 Subject: [PATCH] graphics/zbar: Added a patch for python 3.11.x. Signed-off-by: Matteo Bernardini --- graphics/zbar/zbar-0.23.90-python3.11.patch | 27 +++++++++++++++++++++ graphics/zbar/zbar.SlackBuild | 2 ++ 2 files changed, 29 insertions(+) create mode 100644 graphics/zbar/zbar-0.23.90-python3.11.patch diff --git a/graphics/zbar/zbar-0.23.90-python3.11.patch b/graphics/zbar/zbar-0.23.90-python3.11.patch new file mode 100644 index 0000000000..150f84ac22 --- /dev/null +++ b/graphics/zbar/zbar-0.23.90-python3.11.patch @@ -0,0 +1,27 @@ +diff -ruN a/python/enum.c b/python/enum.c +--- a/python/enum.c 2021-02-14 17:03:07.000000000 +0100 ++++ b/python/enum.c 2023-04-06 20:43:21.153825509 +0200 +@@ -52,7 +52,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 */ ++#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 +147,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 */ ++#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); + diff --git a/graphics/zbar/zbar.SlackBuild b/graphics/zbar/zbar.SlackBuild index ee8c4e64df..aed021bdb6 100644 --- a/graphics/zbar/zbar.SlackBuild +++ b/graphics/zbar/zbar.SlackBuild @@ -84,6 +84,8 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; +patch -p1 < $CWD/zbar-0.23.90-python3.11.patch + autoreconf -fi CFLAGS="$SLKCFLAGS" \