#### this file is sourced not run
PKGVER=8.0.5
PKGBUILD=1
PKGARCH=x86_64

# source: BLFS 11.3-648
TARBALL=graphviz-$PKGVER.tar.bz2
MD5SUM=ed97ac0f4a45ee0578ef8216503105a7
SRC_URL=https://gitlab.com/graphviz/graphviz/-/archive/$PKGVER/$TARBALL
BUNDLE=

SLACKREQ='qt5-common gtk2 gtk3 librsvg'
SLACKDESC="graphviz-qt5: graphviz-qt5 $PKGVER (Graph visualisation software)
graphviz-qt5:
graphviz-qt5: Graphviz is open source graph visualization software. Graph
graphviz-qt5: visualization is a way of representing structural information as
graphviz-qt5: diagrams of abstract graphs and networks.
graphviz-qt5:
graphviz-qt5: This is the GUI version of graphviz that depends on Qt5
graphviz-qt5: It can produce standard graphs and includes viewers.
graphviz-qt5:
graphviz-qt5: http://www.graphviz.org/
graphviz-qt5:
"

### default pkg_download
pkg_prepare() {
	local major=${PKGVER%%.*}
	local minor=${PKGVER#*.}; minor=${minor%.*}
	local patch=${PKGVER#"$major.$minor"}; patch=${patch#.}
	pkg_prepare_default &&
	cd tmp/graphviz-* &&
	sed -E -i \
		-e "s/^(GRAPHVIZ_VERSION_MAJOR=).*/\1$major/" \
		-e "s/^(GRAPHVIZ_VERSION_MINOR=).*/\1$minor/" \
		-e "s/^(GRAPHVIZ_VERSION_PATCH=).*/\1$patch/" \
		-e "s/^(GRAPHVIZ_VERSION_DATE=).*/\1$(date +%Y%m%d)/" \
		-e "s/^(GRAPHVIZ_CHANGE_DATE=).*/\1/" \
		autogen.sh
}
### default pkg_package
### build
pkg_build() {
	# qt5
	export PATH="$PATH:/opt/qt5/bin"
	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/qt5/$LIBDIR"
	export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/opt/qt5/$LIBDIR/pkgconfig"
	export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/opt/qt5/include"
	export QT5_PATH="/opt/qt5/bin"
	export QT5_LD_LIBRARY_PATH="/opt/qt5/$LIBDIR"
	export QT5_PKG_CONFIG_PATH="/opt/qt5/$LIBDIR/pkgconfig"
	export QT5_CPLUS_INCLUDE_PATH="/opt/qt5/include"

	cd tmp/graphviz* &&
	./autogen.sh &&
	CONFFLAGS="$CONFFLAGS --with-ipsepcola=yes --with-ghostscript=yes"
	pkg_build_autoconf &&
	pkg_build_slackdesc &&
	rm -fr  /etc/ld.so.cache /var/cache
}
