# Template file for 'OpenSubdiv'
pkgname=OpenSubdiv
version=3.6.0
revision=1
build_style=cmake
# TODO: CUDA/OpenCL support
# NO_GLTESTS: skip tests which require X11 & $DISPLAY environment variable
configure_args="-DOpenGL_GL_PREFERENCE=GLVND -DNO_GLTESTS=1 -DNO_CUDA=1"
makedepends="libXrandr-devel libXinerama-devel libXcursor-devel zlib-devel
 libgomp-devel glfw-devel glew-devel tbb-devel libXxf86vm-devel"
short_desc="Open-Source subdivision surface library"
maintainer="John <me@johnnynator.dev>"
license="Apache-2.0"
homepage="http://graphics.pixar.com/opensubdiv/docs/intro.html"
distfiles="https://github.com/PixarAnimationStudios/OpenSubdiv/archive/v${version//./_}.tar.gz"
checksum=bebfd61ab6657a4f4ff27845fb66a167d00395783bfbd253254d87447ed1d879

if [ "$CROSS_BUILD" ]; then
	hostmakedepends+=" OpenSubdiv"
	configure_args+=" -DSTRINGIFY_LOCATION=/usr/bin/stringify"
fi


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