# Template file for 'ilmbase'
pkgname=ilmbase
version=2.3.0
revision=1
build_style=gnu-configure
short_desc="Base libraries from ILM for OpenEXR"
maintainer="Juan RP <xtraeme@voidlinux.org>"
license="BSD"
homepage="http://www.openexr.com"
distfiles="https://github.com/openexr/openexr/releases/download/v${version}/ilmbase-${version}.tar.gz"
checksum=456978d1a978a5f823c7c675f3f36b0ae14dba36638aeaa3c4b0e784f12a3862

LDFLAGS="-lpthread"

pre_build() {
	if [ -n "$CROSS_BUILD" ]; then
		# Copy shell script header generators - slow but working
		cp ${FILESDIR}/*.sh ${wrksrc}/Half
		sed -i Half/Makefile \
			-e "/eLut.h: eLut/s;$;.sh;" \
			-e "s;\./eLut > eLut.h;sh eLut.sh > eLut.h;" \
			-e "/toFloat.h: toFloat/s;$;.sh;" \
			-e "s;\./toFloat > toFloat.h;sh toFloat.sh > toFloat.h;"
	fi
}
post_install() {
	vlicense LICENSE
}

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