# Template file for 'graphviz'
pkgname=graphviz
version=2.42.2
revision=1
wrksrc="graphviz-stable_release_${version}"
build_style=cmake
hostmakedepends="perl flex pkg-config libltdl-devel"
makedepends="libpng-devel gd-devel gtk+-devel librsvg-devel libltdl-devel
 libXaw-devel"
short_desc="Graph Visualization Software"
maintainer="Orphaned <orphan@voidlinux.org>"
license="EPL-1.0"
homepage="http://www.graphviz.org"
distfiles="https://gitlab.com/graphviz/graphviz/-/archive/stable_release_${version}/graphviz-stable_release_${version}.tar.gz"
checksum=3134255f7bc49efac08a6e8a4fbaf32bdfe27b480cc630af51ce420ef994d78a
replaces="graphviz-libs<2.38.0_3"
LDFLAGS="-lm"

pre_configure() {
	vsed -e '/Git REQUIRED/d' -i CMakeLists.txt
}

post_install() {
	vlicense epl-v10.txt LICENSE
}

graphviz-libs_package() {
	short_desc+=" - runtime libraries"
	replaces="graphviz<2.28.0_6"
	pkg_install() {
		vmove "usr/lib/*.so.*"
	}
}

graphviz-devel_package() {
	depends="graphviz-libs>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove "usr/lib/*.so"
		vmove usr/lib/pkgconfig
		vmove  usr/share/man/man3
	}
}
