# Template file for 'hdf5'
pkgname=hdf5
version=1.14.6
revision=1
build_style=gnu-configure
configure_args="--enable-cxx"
hostmakedepends="perl autoconf"
makedepends="zlib-devel"
short_desc="Data model, library, and file format for storing and managing data"
maintainer="pulux <pulux@pf4sh.de>"
license="custom:BSD-3-Clause-LBNL-alike"
homepage="https://www.hdfgroup.org/solutions/hdf5/"
changelog="https://github.com/HDFGroup/hdf5/releases"
distfiles="https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5_${version}.tar.gz"
checksum=09ee1c671a87401a5201c06106650f62badeea5a3b3941e9b1e2e1e08317357f

if [ -z "$CROSS_BUILD" ]; then
	# fortran support needs to run programs to configure
	configure_args+=" --enable-fortran"
	hostmakedepends+=" gcc-fortran"
fi

pre_configure() {
	autoconf
}

post_install() {
	vlicense COPYING
}

hdf5-devel_package() {
	depends="${makedepends} ${sourcepkg}-${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove "usr/lib/*.a"
		vmove "usr/lib/*.so"
		vmove usr/share
	}
}
