commit:     157b305159385f7913a3cb3add46dd10f7a31aa7
Author:     Michael Schubert <mschu.dev <AT> gmail <DOT> com>
AuthorDate: Sun Jul 13 19:38:33 2025 +0000
Commit:     Nowa Ammerlaan <nowa <AT> gentoo <DOT> org>
CommitDate: Fri Jul 18 09:19:10 2025 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=157b3051

dev-python/numcodecs: fix gcc15 build

Signed-off-by: Michael Schubert <mschu.dev <AT> gmail.com>
Part-of: https://github.com/gentoo/sci/pull/1368
Signed-off-by: Nowa Ammerlaan <nowa <AT> gentoo.org>

 .../numcodecs/files/c-blosc-1.21.4-c23.patch       | 46 ++++++++++++++++++++++
 .../numcodecs/files/numcodecs-0.11.0-nocov.patch   | 11 ------
 dev-python/numcodecs/numcodecs-0.15.1.ebuild       |  7 +++-
 dev-python/numcodecs/numcodecs-0.16.0.ebuild       |  7 +++-
 4 files changed, 56 insertions(+), 15 deletions(-)

diff --git a/dev-python/numcodecs/files/c-blosc-1.21.4-c23.patch 
b/dev-python/numcodecs/files/c-blosc-1.21.4-c23.patch
new file mode 100644
index 000000000..d1a086a7d
--- /dev/null
+++ b/dev-python/numcodecs/files/c-blosc-1.21.4-c23.patch
@@ -0,0 +1,46 @@
+https://bugs.gentoo.org/946283
+https://github.com/Blosc/c-blosc/pull/392
+
+From 774f6a0ebaa0c617f7f13ccf6bc89d17eba04654 Mon Sep 17 00:00:00 2001
+From: Georg Semmler <[email protected]>
+Date: Thu, 17 Apr 2025 10:19:25 +0200
+Subject: [PATCH] Drop a slightly outdated type def for boolean type
+
+This cases compilation errors with gcc 15 with the following error
+message:
+
+c-blosc/blosc/shuffle.c:26:15: error: 'bool' cannot be defined via 'typedef'
+      | typedef _Bool bool;
+      |               ^~~~
+c-blosc/blosc/shuffle.c:26:15: note: 'bool' is a keyword with '-std=c23' 
onwards
+
+See https://gcc.gnu.org/gcc-15/porting_to.html for details
+
+I've choosen to remove the typedef as it seems to be unused in this
+file.
+---
+ blosc/shuffle.c | 10 ----------
+ 1 file changed, 10 deletions(-)
+
+diff --git a/blosc/shuffle.c b/blosc/shuffle.c
+index e680a173..9e3ee3e3 100644
+--- a/c-blosc/blosc/shuffle.c
++++ b/c-blosc/blosc/shuffle.c
+@@ -20,16 +20,6 @@
+ #include <pthread.h>
+ #endif
+ 
+-/* Visual Studio < 2013 does not have stdbool.h so here it is a replacement: 
*/
+-#if defined __STDC__ && defined __STDC_VERSION__ && __STDC_VERSION__ >= 
199901L
+-/* have a C99 compiler */
+-typedef _Bool bool;
+-#else
+-/* do not have a C99 compiler */
+-typedef unsigned char bool;
+-#endif
+-
+-
+ #if !defined(__clang__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && \
+     __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
+ #define HAVE_CPU_FEAT_INTRIN
+

diff --git a/dev-python/numcodecs/files/numcodecs-0.11.0-nocov.patch 
b/dev-python/numcodecs/files/numcodecs-0.11.0-nocov.patch
deleted file mode 100644
index 2d5e7f86e..000000000
--- a/dev-python/numcodecs/files/numcodecs-0.11.0-nocov.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/pyproject.toml
-+++ b/pyproject.toml
-@@ -87,7 +87,7 @@ exclude_lines = [
- ]
- 
- [tool.pytest.ini_options]
--addopts = "--cov=numcodecs --cov-report xml --doctest-modules 
--doctest-glob=*.pyx"
-+addopts = "--pyargs numcodecs --doctest-modules --doctest-glob=*.pyx"
- doctest_optionflags = [
-     "NORMALIZE_WHITESPACE",
-     "ELLIPSIS",

diff --git a/dev-python/numcodecs/numcodecs-0.15.1.ebuild 
b/dev-python/numcodecs/numcodecs-0.15.1.ebuild
index 93391928a..494960906 100644
--- a/dev-python/numcodecs/numcodecs-0.15.1.ebuild
+++ b/dev-python/numcodecs/numcodecs-0.15.1.ebuild
@@ -34,7 +34,10 @@ BDEPEND="
        )
 "
 
-PATCHES=( "${FILESDIR}/${P}-nocov.patch" )
+PATCHES=(
+       "${FILESDIR}/${P}-nocov.patch"
+       "${FILESDIR}/c-blosc-1.21.4-c23.patch"
+)
 
 distutils_enable_tests pytest
 
@@ -53,6 +56,6 @@ python_compile() {
 python_test() {
        local PY_BUILD_DIR=$(${EPYTHON} -c "import sysconfig; print('lib.' + 
sysconfig.get_platform() +
                '-cpython-' + sysconfig.get_python_version().replace('.', 
''))") || die
-       cd "${BUILD_DIR}/build/${PY_BUILD_DIR}" || die
+       cd "${BUILD_DIR}"/build*/"${PY_BUILD_DIR}" || die
        epytest --pyargs numcodecs
 }

diff --git a/dev-python/numcodecs/numcodecs-0.16.0.ebuild 
b/dev-python/numcodecs/numcodecs-0.16.0.ebuild
index 3b13933cb..52c5fb53d 100644
--- a/dev-python/numcodecs/numcodecs-0.16.0.ebuild
+++ b/dev-python/numcodecs/numcodecs-0.16.0.ebuild
@@ -29,7 +29,10 @@ DEPEND="
        )
 "
 
-PATCHES=( "${FILESDIR}/${PN}-0.15.1-nocov.patch" )
+PATCHES=(
+       "${FILESDIR}/${PN}-0.15.1-nocov.patch"
+       "${FILESDIR}/c-blosc-1.21.4-c23.patch"
+)
 
 distutils_enable_tests pytest
 
@@ -48,6 +51,6 @@ python_compile() {
 python_test() {
        local PY_BUILD_DIR=$(${EPYTHON} -c "import sysconfig; print('lib.' + 
sysconfig.get_platform() +
                '-cpython-' + sysconfig.get_python_version().replace('.', 
''))") || die
-       cd "${BUILD_DIR}/build/${PY_BUILD_DIR}" || die
+       cd "${BUILD_DIR}/build${#DISTUTILS_WHEELS}/${PY_BUILD_DIR}" || die
        epytest --pyargs numcodecs
 }

Reply via email to