commit:     f944309d71a76746425bb339d9cdbdf960c855d2
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 24 06:35:40 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jun 24 23:01:42 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f944309d

dev-python/shiboken2: fix build w/ numpy 1.23

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/shiboken2-5.15.2-numpy-1.23.patch        | 28 ++++++++++++++++++++++
 dev-python/shiboken2/shiboken2-5.15.2-r1.ebuild    |  6 ++++-
 2 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/dev-python/shiboken2/files/shiboken2-5.15.2-numpy-1.23.patch 
b/dev-python/shiboken2/files/shiboken2-5.15.2-numpy-1.23.patch
new file mode 100644
index 000000000000..6cd9feab800b
--- /dev/null
+++ b/dev-python/shiboken2/files/shiboken2-5.15.2-numpy-1.23.patch
@@ -0,0 +1,28 @@
+Backport of 
https://code.qt.io/cgit/pyside/pyside-setup.git/commit/?id=1422cf4a7f277fb13fd209f24a90d6c02641497d.
+
+From 1422cf4a7f277fb13fd209f24a90d6c02641497d Mon Sep 17 00:00:00 2001
+From: Friedemann Kleint <[email protected]>
+Date: Thu, 23 Jun 2022 10:44:01 +0200
+Subject: libshiboken: Fix build with numpy 1.23.0
+
+Pick-to: 6.3 6.2 5.15
+Change-Id: I885c332d6c948820140946c73ae1926e88834143
+Reviewed-by: Christian Tismer <[email protected]>
+--- a/libshiboken/sbknumpyarrayconverter.cpp
++++ b/libshiboken/sbknumpyarrayconverter.cpp
+@@ -116,8 +116,13 @@ std::ostream &operator<<(std::ostream &str, PyArrayObject 
*o)
+             str << " NPY_ARRAY_NOTSWAPPED";
+         if ((flags & NPY_ARRAY_WRITEABLE) != 0)
+             str << " NPY_ARRAY_WRITEABLE";
+-        if ((flags & NPY_ARRAY_UPDATEIFCOPY) != 0)
+-            str << " NPY_ARRAY_UPDATEIFCOPY";
++#if NPY_VERSION >= 0x00000010 // NPY_1_23_API_VERSION
++        if ((flags & NPY_ARRAY_WRITEBACKIFCOPY) != 0)
++            str << " NPY_ARRAY_WRITEBACKIFCOPY";
++#else
++         if ((flags & NPY_ARRAY_UPDATEIFCOPY) != 0)
++             str << " NPY_ARRAY_UPDATEIFCOPY";
++#endif
+     } else {
+         str << '0';
+     }

diff --git a/dev-python/shiboken2/shiboken2-5.15.2-r1.ebuild 
b/dev-python/shiboken2/shiboken2-5.15.2-r1.ebuild
index 594d5f6bf09f..c8e150bc7ed5 100644
--- a/dev-python/shiboken2/shiboken2-5.15.2-r1.ebuild
+++ b/dev-python/shiboken2/shiboken2-5.15.2-r1.ebuild
@@ -60,7 +60,11 @@ DEPEND="${RDEPEND}
 "
 
 DOCS=( AUTHORS )
-PATCHES=( "${FILESDIR}/${P}-python310.patch" )
+
+PATCHES=(
+       "${FILESDIR}/${P}-python310.patch"
+       "${FILESDIR}/${P}-numpy-1.23.patch"
+)
 
 # Ensure the path returned by get_llvm_prefix() contains clang as well.
 llvm_check_deps() {

Reply via email to