From 62ed25ea1a51138b7a047b4442c67aedec7549b223085d6360714a91bfaca157 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 29 Jun 2024 20:22:15 +0000 Subject: [PATCH] add patch from upstream to prevent build failure once numpy-2, currently in d:l:python:numeric, reaches Factory / Tumbleweed OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/boost?expand=0&rev=328 --- boost-1.85.0-python-numpy-2.patch | 26 ++++++++++++++++++++++++++ boost.changes | 5 +++++ boost.spec | 3 +++ 3 files changed, 34 insertions(+) create mode 100644 boost-1.85.0-python-numpy-2.patch diff --git a/boost-1.85.0-python-numpy-2.patch b/boost-1.85.0-python-numpy-2.patch new file mode 100644 index 0000000..66fae4b --- /dev/null +++ b/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 +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(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 ae6718d..2dd695c 100644 --- a/boost.changes +++ b/boost.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Jun 29 09:13:57 CEST 2024 - Friedrich Haubensak + +- add patch boost-1.85.0-python-numpy-2.patch from upstream + ------------------------------------------------------------------- Tue Apr 23 09:50:52 CEST 2024 - aschnell@suse.com diff --git a/boost.spec b/boost.spec index 1b9aff3..fd2626b 100644 --- a/boost.spec +++ b/boost.spec @@ -244,6 +244,8 @@ Patch20: python_library_name.patch Patch21: boost-remove-cmakedir.patch Patch22: boost-process.patch Patch23: boost-charconv-quadmath.patch +# PATCH-FIX-UPSTREAM boost-1.85.0-python-numpy-2.patch -- gh#boostorg/python/pull/432 +Patch24: boost-1.85.0-python-numpy-2.patch %{?suse_build_hwcaps_libs} BuildRequires: fdupes BuildRequires: gcc-c++ @@ -1271,6 +1273,7 @@ find -type f ! \( -name \*.sh -o -name \*.py -o -name \*.pl \) -exec chmod -x {} %patch -P 21 -p1 %patch -P 22 -p2 %patch -P 23 -p1 +%patch -P 24 -p1 %build find . -type f -exec chmod u+w {} +