# Template file for 'python3-h5py'
pkgname=python3-h5py
version=3.16.0
revision=1
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=a0dbaad796840ccaa67a4c144a0d0c8080073c34c76d5a6941d6818678ef2738
# 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. Circumvent detection on affected platforms.
		vsed -i setup_build.py -e 's/\(complex256_support =\).*/\1 False/'
	fi
}

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

post_install() {
	vlicense LICENSE
}
