# Template file for 'opencamlib'
pkgname=opencamlib
version=2019.07
revision=13
build_style=cmake
configure_args="-DVERSION_STRING=${version}"
makedepends="boost-devel libgomp-devel"
short_desc="Open source computer aided manufacturing algorithms library"
maintainer="Karl Nilsson <karl.robert.nilsson@gmail.com>"
license="LGPL-2.1-or-later"
homepage="http://www.anderswallin.net/CAM"
distfiles="https://github.com/aewallin/opencamlib/archive/${version}.tar.gz"
checksum=e08ab50672e24b51d30938ac60a6caa38bd8f5fb5f8fa3375dec0e69031cb620

subpackages="opencamlib-devel"
# opencamlib-python3 cannot be cross compiled because of vtk-python3
if [ -z "$CROSS_BUILD" ] && [ "$XBPS_TARGET_WORDSIZE" -eq 64 ]; then
	subpackages+=" opencamlib-python3"
	configure_args+=" -DBUILD_PY_LIB=ON -DUSE_PY_3=ON"
	hostmakedepends="python3"
	makedepends+=" python3-devel boost-python3"
else
	configure_args+=" -DBUILD_PY_LIB=OFF"
fi

opencamlib-devel_package() {
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
	}
}

opencamlib-python3_package() {
	short_desc+=" - Python3 bindings"
	depends="${sourcepkg}>=${version}_${revision} vtk-python3"
	pkg_install() {
		vmove "usr/lib/python3*"
	}
}
