From c455a4d7de9e4b4b465b6aa447d4b3fe6b8868e9cd482f0fe0a735791f60914a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Wed, 4 Dec 2024 09:19:48 +0100 Subject: [PATCH] Sync from SUSE:SLFO:Main boost revision 5b6bdda0ca81723c93e197bd7d26736d --- boost-python-support-numpy2.patch | 28 ++++++++++++++++++++++++++++ boost.changes | 7 +++++++ boost.spec | 2 ++ 3 files changed, 37 insertions(+) create mode 100644 boost-python-support-numpy2.patch diff --git a/boost-python-support-numpy2.patch b/boost-python-support-numpy2.patch new file mode 100644 index 0000000..475fbb8 --- /dev/null +++ b/boost-python-support-numpy2.patch @@ -0,0 +1,28 @@ +From 0474de0f6cc9c6e7230aeb7164af2f7e4ccf74bf Mon Sep 17 00:00:00 2001 +From: Alexis DUBURCQ +Date: Fri, 15 Mar 2024 14:10:16 +0100 +Subject: [PATCH] Support numpy 2.0.0b1 + +--- + src/numpy/dtype.cpp | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/numpy/dtype.cpp b/src/numpy/dtype.cpp +index 88a20a27b5..da30d1927b 100644 +--- 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(obj)); + } + +-int dtype::get_itemsize() const { return reinterpret_cast(ptr())->elsize;} ++int dtype::get_itemsize() const { ++#if NPY_ABI_VERSION < 0x02000000 ++ return reinterpret_cast(ptr())->elsize; ++#else ++ return PyDataType_ELSIZE(reinterpret_cast(ptr())); ++#endif ++} + + bool equivalent(dtype const & a, dtype const & b) { + // On Windows x64, the behaviour described on diff --git a/boost.changes b/boost.changes index 634cc36..0e1254b 100644 --- a/boost.changes +++ b/boost.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Nov 28 10:41:16 UTC 2024 - Eugenio Paolantonio + +- Add boost-python-support-numpy2.patch: fixes building with + numpy >= 2. + ------------------------------------------------------------------- Thu Dec 14 08:43:05 CET 2023 - aschnell@suse.com @@ -2549,3 +2555,4 @@ Wed Jul 23 14:52:15 CEST 2003 - pthomas@suse.de - Initial package, based on the work by Robert Schiele. - Fix building with Python 2.3 + diff --git a/boost.spec b/boost.spec index 8ddc45f..2bfb2f1 100644 --- a/boost.spec +++ b/boost.spec @@ -243,6 +243,7 @@ Patch18: dynamic_linking.patch Patch20: python_library_name.patch Patch21: boost-remove-cmakedir.patch Patch22: boost-process.patch +Patch23: boost-python-support-numpy2.patch %{?suse_build_hwcaps_libs} BuildRequires: fdupes BuildRequires: gmp-devel @@ -1254,6 +1255,7 @@ find -type f ! \( -name \*.sh -o -name \*.py -o -name \*.pl \) -exec chmod -x {} %patch20 -p1 %patch21 -p1 %patch22 -p2 +%patch23 -p1 %build find . -type f -exec chmod u+w {} +