# Template file for 'assimp'
pkgname=assimp
version=5.2.5
revision=2
build_style=cmake
configure_args="-DASSIMP_BUILD_SAMPLES=OFF -DASSIMP_WARNINGS_AS_ERRORS=OFF"
hostmakedepends="pkg-config"
makedepends="libgomp-devel devil-devel minizip-devel zziplib-devel"
depends="libassimp>=${version}_${revision}"
short_desc="Import library for various well-known 3D model formats"
maintainer="Orphaned <orphan@voidlinux.org>"
license="BSD-3-Clause"
homepage="https://github.com/assimp/assimp"
distfiles="https://github.com/assimp/assimp/archive/v${version}.tar.gz>${pkgname}-${version}.tar.gz"
checksum=b5219e63ae31d895d60d98001ee5bb809fb2c7b2de1e7f78ceeb600063641e1a

post_install() {
	# Copy contrib/stb_image header file (required for assimp_qt_viewer)
	vmkdir usr/include/assimp/contrib/stb_image
	vcopy contrib/stb/stb_image.h usr/include/assimp/contrib/stb_image

	# Create command documentation
	cd doc
	vmkdir usr/share/doc/${pkgname}
	vcopy AssimpCmdDoc_Html/* usr/share/doc/${pkgname}

	# Create library documentation
	vmkdir usr/share/doc/${pkgname}/lib
	vcopy AssimpDoc_Html/* usr/share/doc/${pkgname}/lib
}

libassimp_package() {
	short_desc+=" - libraries"
	pkg_install() {
		vmove usr/lib/*.so.*
		vlicense LICENSE
	}
}
libassimp-devel_package() {
	short_desc+=" - development files"
	depends="libassimp>=${version}_${revision} zlib-devel"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/*.so
		vmove usr/lib/cmake
		vmove usr/lib/pkgconfig
		vmkdir usr/share/doc/libassimp
		mv ${DESTDIR}/usr/share/doc/${sourcepkg}/lib/* \
			${PKGDESTDIR}/usr/share/doc/libassimp/
	}
}
