commit:     7de87c817a7c9b669a7849dbeec776ff423cb3f1
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon May  1 17:48:48 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon May  1 17:50:25 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7de87c81

media-libs/vigra: enable py3.11

Closes: https://bugs.gentoo.org/897016
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../vigra/files/vigra-1.11.1-python-syntax.patch   | 64 ++++++++++++++++++++++
 .../{vigra-9999.ebuild => vigra-1.11.1-r9.ebuild}  | 15 +++--
 media-libs/vigra/vigra-9999.ebuild                 |  2 +-
 3 files changed, 76 insertions(+), 5 deletions(-)

diff --git a/media-libs/vigra/files/vigra-1.11.1-python-syntax.patch 
b/media-libs/vigra/files/vigra-1.11.1-python-syntax.patch
new file mode 100644
index 000000000000..111bc06d5716
--- /dev/null
+++ b/media-libs/vigra/files/vigra-1.11.1-python-syntax.patch
@@ -0,0 +1,64 @@
+https://github.com/ukoethe/vigra/commit/aba7e731bdde39516b5470673ce40a0036665201
+https://github.com/ukoethe/vigra/commit/c949d3640266f515eb1e3ecca2b752e13e0c3804
+
+From aba7e731bdde39516b5470673ce40a0036665201 Mon Sep 17 00:00:00 2001
+From: Mark Harfouche <mark.harfou...@gmail.com>
+Date: Mon, 5 Sep 2022 15:10:08 -0400
+Subject: [PATCH] Avoid using `is not` when comparing to an integer
+
+---
+ vigranumpy/lib/__init__.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vigranumpy/lib/__init__.py b/vigranumpy/lib/__init__.py
+index 072a797c6..f598e0a8d 100644
+--- a/vigranumpy/lib/__init__.py
++++ b/vigranumpy/lib/__init__.py
+@@ -1780,7 +1780,7 @@ def handle_click(self, event):
+                         for yo in range(-1*bs, bs+1):
+                             xx = x+xo
+                             yy = y+yo
+-                            if xo is not 0 or yo is not 0:
++                            if (xo != 0) or (yo != 0):
+                                 if  xx >=0 and xx<shape[0] and \
+                                     yy >=0 and yy<shape[0]:
+                                     otherLabel = labels[xx, yy]
+
+From c949d3640266f515eb1e3ecca2b752e13e0c3804 Mon Sep 17 00:00:00 2001
+From: Omari Stephens <x...@xsdg.org>
+Date: Tue, 28 Dec 2021 21:54:51 +0000
+Subject: [PATCH] Updates doc generation config for Python 3 compatibility
+
+---
+ vigranumpy/docsrc/conf.py.cmake2.in | 2 +-
+ vigranumpy/docsrc/conf.py.in        | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/vigranumpy/docsrc/conf.py.cmake2.in 
b/vigranumpy/docsrc/conf.py.cmake2.in
+index e4266a636..175dfb39f 100644
+--- a/vigranumpy/docsrc/conf.py.cmake2.in
++++ b/vigranumpy/docsrc/conf.py.cmake2.in
+@@ -23,7 +23,7 @@ _original_getargspec = inspect.getargspec
+ def _getargspec_workaround(*args, **kw):
+     try:
+         return _original_getargspec(*args, **kw)
+-    except TypeError, e:
++    except TypeError as e:
+         if str(e).startswith('arg is not a Python function'):
+             return inspect.ArgSpec([], None, None, None)
+         else:
+diff --git a/vigranumpy/docsrc/conf.py.in b/vigranumpy/docsrc/conf.py.in
+index 607559352..ac2261d20 100644
+--- a/vigranumpy/docsrc/conf.py.in
++++ b/vigranumpy/docsrc/conf.py.in
+@@ -22,7 +22,7 @@ _original_getargspec = inspect.getargspec
+ def _getargspec_workaround(*args, **kw):
+     try:
+         return _original_getargspec(*args, **kw)
+-    except TypeError, e:
++    except TypeError as e:
+         if str(e).startswith('arg is not a Python function'):
+             return inspect.ArgSpec([], None, None, None)
+         else:
+
+

diff --git a/media-libs/vigra/vigra-9999.ebuild 
b/media-libs/vigra/vigra-1.11.1-r9.ebuild
similarity index 87%
copy from media-libs/vigra/vigra-9999.ebuild
copy to media-libs/vigra/vigra-1.11.1-r9.ebuild
index ccc20c7bd4e7..691ce34a6ce1 100644
--- a/media-libs/vigra/vigra-9999.ebuild
+++ b/media-libs/vigra/vigra-1.11.1-r9.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-PYTHON_COMPAT=( python3_{9..10} )
+PYTHON_COMPAT=( python3_{9..11} )
 PYTHON_REQ_USE="threads(+),xml(+)"
 inherit cmake flag-o-matic python-r1
 
@@ -58,10 +58,17 @@ RDEPEND="${PYTHON_DEPS}
 RESTRICT="test"
 
 PATCHES=(
+       # git master
+       "${FILESDIR}/${P}-fix-incorrect-template-parameter-type.patch"
+       "${FILESDIR}/${P}-boost-python.patch"
+       "${FILESDIR}/${P}-python3.7.patch" # bug 701208
+       "${FILESDIR}/${P}-gcc-10.patch" # bug 723302
        # TODO: upstream
-       "${FILESDIR}/${PN}-1.11.1-lib_suffix.patch"
-       "${FILESDIR}/${PN}-1.11.1-cmake-module-dir.patch"
-       "${FILESDIR}/${PN}-1.11.1-sphinx.ext.pngmath.patch" # thanks to Debian; 
bug 678308
+       "${FILESDIR}/${P}-lib_suffix.patch"
+       "${FILESDIR}/${P}-cmake-module-dir.patch"
+       "${FILESDIR}/${P}-sphinx.ext.pngmath.patch" # thanks to Debian; bug 
678308
+       "${FILESDIR}/${P}-openexr3.patch"
+       "${FILESDIR}/${P}-python-syntax.patch"
 )
 
 pkg_setup() {

diff --git a/media-libs/vigra/vigra-9999.ebuild 
b/media-libs/vigra/vigra-9999.ebuild
index ccc20c7bd4e7..9d414e9529c7 100644
--- a/media-libs/vigra/vigra-9999.ebuild
+++ b/media-libs/vigra/vigra-9999.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-PYTHON_COMPAT=( python3_{9..10} )
+PYTHON_COMPAT=( python3_{9..11} )
 PYTHON_REQ_USE="threads(+),xml(+)"
 inherit cmake flag-o-matic python-r1
 

Reply via email to