commit:     7c4165b90a91bb690c3a21dc686ab72ce2c741af
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri May 31 22:34:43 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 31 22:35:49 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c4165b9

dev-libs/boost: fix build w/ numpy-2

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

 dev-libs/boost/boost-1.85.0.ebuild                 |  1 +
 .../boost/files/boost-1.85.0-python-numpy-2.patch  | 26 ++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/dev-libs/boost/boost-1.85.0.ebuild 
b/dev-libs/boost/boost-1.85.0.ebuild
index 30577a1da191..dfa9b09e6ad2 100644
--- a/dev-libs/boost/boost-1.85.0.ebuild
+++ b/dev-libs/boost/boost-1.85.0.ebuild
@@ -51,6 +51,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-1.81.0-disable_icu_rpath.patch
        "${FILESDIR}"/${PN}-1.79.0-build-auto_index-tool.patch
        "${FILESDIR}"/${PN}-1.85.0-bcp-filesystem.patch
+       "${FILESDIR}"/${PN}-1.85.0-python-numpy-2.patch
 )
 
 create_user-config.jam() {

diff --git a/dev-libs/boost/files/boost-1.85.0-python-numpy-2.patch 
b/dev-libs/boost/files/boost-1.85.0-python-numpy-2.patch
new file mode 100644
index 000000000000..e7a7d98b8573
--- /dev/null
+++ b/dev-libs/boost/files/boost-1.85.0-python-numpy-2.patch
@@ -0,0 +1,26 @@
+https://bugs.gentoo.org/932459
+https://github.com/boostorg/python/issues/431
+https://github.com/boostorg/python/pull/432
+
+From 33ac06ca59a68266d3d26edf08205d31ddab4a6c Mon Sep 17 00:00:00 2001
+From: Alexis DUBURCQ <[email protected]>
+Date: Fri, 15 Mar 2024 14:10:16 +0100
+Subject: [PATCH] Support numpy 2.0.0b1
+
+--- a/libs/python/src/numpy/dtype.cpp
++++ b/libs/python/src/numpy/dtype.cpp
+@@ -98,7 +98,13 @@ python::detail::new_reference dtype::convert(object const & 
arg, bool align)
+   return python::detail::new_reference(reinterpret_cast<PyObject*>(obj));
+ }
+ 
+-int dtype::get_itemsize() const { return 
reinterpret_cast<PyArray_Descr*>(ptr())->elsize;}
++int dtype::get_itemsize() const {
++#if NPY_ABI_VERSION < 0x02000000
++  return reinterpret_cast<PyArray_Descr*>(ptr())->elsize;
++#else
++  return PyDataType_ELSIZE(reinterpret_cast<PyArray_Descr*>(ptr()));
++#endif
++}
+ 
+ bool equivalent(dtype const & a, dtype const & b) {
+     // On Windows x64, the behaviour described on 

Reply via email to