From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 957331382C5 for ; Fri, 4 Jun 2021 11:23:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 80D04E083B; Fri, 4 Jun 2021 11:23:58 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 61E5EE083B for ; Fri, 4 Jun 2021 11:23:58 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 40EF0340E70 for ; Fri, 4 Jun 2021 11:23:57 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6171B79D for ; Fri, 4 Jun 2021 11:23:55 +0000 (UTC) From: "Marek Szuba" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Marek Szuba" Message-ID: <1622805824.7efabb81f9bbfc7ea149285949a27400ea6db736.marecki@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/zbar/files/, media-gfx/zbar/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-gfx/zbar/files/zbar-0.23.1_python_tp_print.patch media-gfx/zbar/zbar-0.23.1.ebuild X-VCS-Directories: media-gfx/zbar/files/ media-gfx/zbar/ X-VCS-Committer: marecki X-VCS-Committer-Name: Marek Szuba X-VCS-Revision: 7efabb81f9bbfc7ea149285949a27400ea6db736 X-VCS-Branch: master Date: Fri, 4 Jun 2021 11:23:55 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 438cc317-336d-4000-8362-795f0e7283b1 X-Archives-Hash: 2b8a85f087ff4ac0baca64cd688b2188 commit: 7efabb81f9bbfc7ea149285949a27400ea6db736 Author: Marek Szuba gentoo org> AuthorDate: Fri Jun 4 11:21:30 2021 +0000 Commit: Marek Szuba gentoo org> CommitDate: Fri Jun 4 11:23:44 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7efabb81 media-gfx/zbar: fix python3_9 compilation failure Backported upstream fix. Tested against python3_8 and python3_9, compiles fine against both. Reported-by: PhobosK fastmail.fm> Closes: https://bugs.gentoo.org/788703 Signed-off-by: Marek Szuba gentoo.org> .../zbar/files/zbar-0.23.1_python_tp_print.patch | 55 ++++++++++++++++++++++ media-gfx/zbar/zbar-0.23.1.ebuild | 1 + 2 files changed, 56 insertions(+) diff --git a/media-gfx/zbar/files/zbar-0.23.1_python_tp_print.patch b/media-gfx/zbar/files/zbar-0.23.1_python_tp_print.patch new file mode 100644 index 00000000000..8d4d821426d --- /dev/null +++ b/media-gfx/zbar/files/zbar-0.23.1_python_tp_print.patch @@ -0,0 +1,55 @@ +From 938d39716488b545b92c28f48acc94a7b8fc9138 Mon Sep 17 00:00:00 2001 +From: Mauro Carvalho Chehab +Date: Tue, 28 Jul 2020 10:27:30 +0200 +Subject: [PATCH] python: enum: make it compatible with Python 3.9 + +As reported by: + https://github.com/mchehab/zbar/issues/92 + +python bindings don't build with Python 3.9, because it is +using tp_print, which has been silently ignored since Python +3.0, according with[1]: + + "The tp_print slot of PyTypeObject has been removed. + It was used for printing objects to files in Python 2.7 + and before. + Since Python 3.0, it has been ignored and unused." + +[1] https://docs.python.org/3.9/whatsnew/3.9.html#id3 + +Signed-off-by: Mauro Carvalho Chehab +--- + python/enum.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/python/enum.c b/python/enum.c +index a1135531..dfe1b1ef 100644 +--- a/python/enum.c ++++ b/python/enum.c +@@ -76,6 +76,8 @@ enumitem_str (zbarEnumItem *self) + return(self->name); + } + ++#if PY_MAJOR_VERSION < 3 ++/* tp_print was dropped on Python 3.9 */ + static int + enumitem_print (zbarEnumItem *self, + FILE *fp, +@@ -83,6 +85,7 @@ enumitem_print (zbarEnumItem *self, + { + return(self->name->ob_type->tp_print(self->name, fp, flags)); + } ++#endif + + static PyObject* + enumitem_repr (zbarEnumItem *self) +@@ -115,7 +118,9 @@ PyTypeObject zbarEnumItem_Type = { + .tp_new = (newfunc)enumitem_new, + .tp_dealloc = (destructor)enumitem_dealloc, + .tp_str = (reprfunc)enumitem_str, ++#if PY_MAJOR_VERSION < 3 + .tp_print = (printfunc)enumitem_print, ++#endif + .tp_repr = (reprfunc)enumitem_repr, + }; + diff --git a/media-gfx/zbar/zbar-0.23.1.ebuild b/media-gfx/zbar/zbar-0.23.1.ebuild index d74a878a969..7b07b269b68 100644 --- a/media-gfx/zbar/zbar-0.23.1.ebuild +++ b/media-gfx/zbar/zbar-0.23.1.ebuild @@ -87,6 +87,7 @@ PATCHES=( "${FILESDIR}/${PN}-0.23_fix_Qt5X11Extras_detect.patch" "${FILESDIR}/${PN}-0.23_fix_python_detect.patch" "${FILESDIR}/${P}-autoconf-2.70.patch" + "${FILESDIR}/${PN}-0.23.1_python_tp_print.patch" ) DOCS=( README.md NEWS.md TODO.md HACKING.md TODO.md ChangeLog )