diff mbox series

[meta-oe,scarthgap] python3-h5py: backport fixes for incompatible-pointer-types issues

Message ID 20250708160909.3890019-1-martin.jansa@gmail.com
State New
Headers show
Series [meta-oe,scarthgap] python3-h5py: backport fixes for incompatible-pointer-types issues | expand

Commit Message

Martin Jansa July 8, 2025, 4:09 p.m. UTC
From: Martin Jansa <martin.jansa@gmail.com>

Needed in scarthgap for native build on hosts with gcc-14 and newer.

It was in master since:
https://git.openembedded.org/meta-openembedded/diff/meta-python/recipes-devtools/python/python3-h5py_3.11.0.bb?id=f0c767407d033e3f39ceeccc2f7e03a1ca7a6443
and then removed as fixed in 3.11.0 by:
https://git.openembedded.org/meta-openembedded/commit/?id=4b990b6dbabaeb65df5bf46546a873c69032a040
but scarthgap has older 3.10.0, backport necessary changes.

Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
---
 ...ast-arguments-to-H5Lunpack_elink_val.patch | 25 +++++++++++++++++++
 ...002-Use-libc.stdint-instead-of-numpy.patch | 25 +++++++++++++++++++
 .../python/python3-h5py_3.10.0.bb             |  8 ++++--
 3 files changed, 56 insertions(+), 2 deletions(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-h5py/0001-Properly-cast-arguments-to-H5Lunpack_elink_val.patch
 create mode 100644 meta-python/recipes-devtools/python/python3-h5py/0002-Use-libc.stdint-instead-of-numpy.patch
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-h5py/0001-Properly-cast-arguments-to-H5Lunpack_elink_val.patch b/meta-python/recipes-devtools/python/python3-h5py/0001-Properly-cast-arguments-to-H5Lunpack_elink_val.patch
new file mode 100644
index 0000000000..c39d9b1950
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-h5py/0001-Properly-cast-arguments-to-H5Lunpack_elink_val.patch
@@ -0,0 +1,25 @@ 
+From 30a59c233fbe149109f378837642dc02b2caf3f5 Mon Sep 17 00:00:00 2001
+From: Orion Poplawski <orion@nwra.com>
+Date: Thu, 15 Feb 2024 20:47:50 -0700
+Subject: [PATCH] Properly cast arguments to H5Lunpack_elink_val
+
+Upstream-Status: Backport [https://github.com/h5py/h5py/pull/2380/commits/704e13ac83b42898514610c4df9f32f367e767e4]
+
+Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
+---
+ h5py/h5l.pyx | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/h5py/h5l.pyx b/h5py/h5l.pyx
+index 60b252f..af725bd 100644
+--- a/h5py/h5l.pyx
++++ b/h5py/h5l.pyx
+@@ -184,7 +184,7 @@ cdef class LinkProxy:
+             if info.type == H5L_TYPE_SOFT:
+                 py_retval = buf
+             else:
+-                H5Lunpack_elink_val(buf, buf_size, &wtf, &ext_file_name, &ext_obj_name)
++                H5Lunpack_elink_val(buf, buf_size, &wtf, <const char **>&ext_file_name, <const char **>&ext_obj_name)
+                 py_retval = (bytes(ext_file_name), bytes(ext_obj_name))
+         finally:
+             efree(buf)
diff --git a/meta-python/recipes-devtools/python/python3-h5py/0002-Use-libc.stdint-instead-of-numpy.patch b/meta-python/recipes-devtools/python/python3-h5py/0002-Use-libc.stdint-instead-of-numpy.patch
new file mode 100644
index 0000000000..35263d8315
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-h5py/0002-Use-libc.stdint-instead-of-numpy.patch
@@ -0,0 +1,25 @@ 
+From 8b4de2f6946b1c1f68279ecadc05c2817ae82189 Mon Sep 17 00:00:00 2001
+From: Orion Poplawski <orion@nwra.com>
+Date: Thu, 22 Feb 2024 08:41:17 -0700
+Subject: [PATCH] Use libc.stdint instead of numpy
+
+Upstream-Status: Backport [https://github.com/h5py/h5py/pull/2382/commits/387a22b8c1513800c0401f496b4ed512c1639798]
+
+Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
+---
+ h5py/api_types_ext.pxd | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/h5py/api_types_ext.pxd b/h5py/api_types_ext.pxd
+index 91acb12..55a239f 100644
+--- a/h5py/api_types_ext.pxd
++++ b/h5py/api_types_ext.pxd
+@@ -20,7 +20,7 @@ from libc.string cimport strlen, strchr, strcpy, strncpy, strcmp,\
+ ctypedef long size_t
+ from libc.time cimport time_t
+ 
+-from numpy cimport int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t
++from libc.stdint cimport int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t
+ 
+ IF UNAME_SYSNAME != "Windows":
+     cdef extern from "unistd.h":
diff --git a/meta-python/recipes-devtools/python/python3-h5py_3.10.0.bb b/meta-python/recipes-devtools/python/python3-h5py_3.10.0.bb
index 8a9158525e..3ba5ea7396 100644
--- a/meta-python/recipes-devtools/python/python3-h5py_3.10.0.bb
+++ b/meta-python/recipes-devtools/python/python3-h5py_3.10.0.bb
@@ -6,8 +6,12 @@  LIC_FILES_CHKSUM = "file://LICENSE;md5=113251d71fb0384712c719b567261c5c"
 
 SRC_URI[sha256sum] = "d93adc48ceeb33347eb24a634fb787efc7ae4644e6ea4ba733d099605045c049"
 
-SRC_URI += "file://0001-setup_build.py-avoid-absolute-path.patch \
-            file://0001-Fix-Cython-3-compatibility.patch"
+SRC_URI += " \
+    file://0001-setup_build.py-avoid-absolute-path.patch \
+    file://0001-Fix-Cython-3-compatibility.patch \
+    file://0001-Properly-cast-arguments-to-H5Lunpack_elink_val.patch \
+    file://0002-Use-libc.stdint-instead-of-numpy.patch \
+"
 
 inherit pkgconfig pypi setuptools3