# Template file for 'python3-h5py'.
pkgname=python3-h5py
version=3.13.0
revision=2
build_style=python3-module
build_helper="numpy"
hostmakedepends="python3-setuptools python3-Cython python3-pkgconfig hdf5-devel"
makedepends="python3-devel hdf5-devel"
depends="python3-numpy"
short_desc="HDF5 for Python"
maintainer="Andrew J. Hesford <ajh@sideband.org>"
license="BSD-3-Clause"
homepage="http://www.h5py.org/"
distfiles="${PYPI_SITE}/h/h5py/h5py-${version}.tar.gz"
checksum=1870e46518720023da85d0895a1960ff2ce398c5671eac3b1a41ec696b7105c3
# Tests require unpackaged pytest-mpi
make_check=no

post_patch() {
	if [ -n "$CROSS_BUILD" ] && [ "$XBPS_TARGET_WORDSIZE" = "32" ]; then
		# numpy.complex256 is N/A on 32 bit; it is misdetected if host is 64 bit
		# we need `DEF COMPLEX256_SUPPORT = False`, this seems the easiest way
		vsed -e 's/{complex256_support}/False/' -i setup_build.py
	fi
}

pre_build() {
	# Build in parallel
	make_build_args+=" ${makejobs}"
}

post_install() {
	vlicense LICENSE
}
