1SUMMARY="Simple interface for Graphviz"
2DESCRIPTION="This package facilitates the creation and rendering of graph descriptions in the \
3DOT_ language of the Graphviz_ graph drawing software (upstream repo_) from Python.
4
5Create a graph object, assemble the graph by adding nodes and edges, and retrieve its DOT source \
6code string. Save the source code to a file and render it with the Graphviz installation of your \
7system.
8
9Use the view option/method to directly inspect the resulting (PDF, PNG, SVG, etc.) file with \
10its default application.
11
12Graphs can also be rendered and displayed within Jupyter notebooks_ (formerly known as IPython \
13notebooks_, example <notebook_>_, nbviewer <notebook-nbviewer_>_) as well as the \
14Jupyter QtConsole_."
15HOMEPAGE="https://github.com/xflr6/graphviz"
16COPYRIGHT="2013-2022 Sebastian Bank"
17LICENSE="MIT"
18REVISION="3"
19SOURCE_URI="$HOMEPAGE/archive/refs/tags/$portVersion.tar.gz"
20CHECKSUM_SHA256="815346b8c2fcd8ccede29623a67bfc30abdbb75749e96128b9d414573d6d8f04"
21SOURCE_FILENAME="graphviz-$portVersion.tar.gz"
22SOURCE_DIR="graphviz-$portVersion"
23
24ARCHITECTURES="all !x86_gcc2"
25SECONDARY_ARCHITECTURES="x86"
26
27PROVIDES="
28	$portName = $portVersion
29	"
30REQUIRES="
31	haiku$secondaryArchSuffix
32	"
33
34BUILD_REQUIRES="
35	haiku${secondaryArchSuffix}_devel
36	"
37
38PYTHON_PACKAGES=(python39 python310)
39PYTHON_VERSIONS=(3.9 3.10)
40for i in "${!PYTHON_PACKAGES[@]}"; do
41pythonPackage=${PYTHON_PACKAGES[i]}
42pythonVersion=${PYTHON_VERSIONS[$i]}
43eval "PROVIDES_${pythonPackage}=\"\
44	${portName}_$pythonPackage = $portVersion\
45	\"; \
46REQUIRES_$pythonPackage=\"\
47	haiku\n\
48	cmd:python$pythonVersion\n\
49	graphviz$secondaryArchSuffix\n\
50	\""
51if [ "$targetArchitecture" = "x86_gcc2" ]; then
52	eval "PROVIDES_${pythonPackage}+=\"\n\
53		python_graphviz_$pythonPackage = $portVersion\
54		\""
55fi
56BUILD_REQUIRES="$BUILD_REQUIRES
57	setuptools_$pythonPackage"
58BUILD_PREREQUIRES="$BUILD_PREREQUIRES
59	cmd:python$pythonVersion"
60done
61
62INSTALL()
63{
64	for i in "${!PYTHON_PACKAGES[@]}"; do
65		pythonPackage=${PYTHON_PACKAGES[i]}
66		pythonVersion=${PYTHON_VERSIONS[$i]}
67
68		python=python$pythonVersion
69		installLocation="$prefix"/lib/$python/vendor-packages/
70		export PYTHONPATH=$installLocation:$PYTHONPATH
71		mkdir -p "$installLocation"
72		rm -rf build
73		$python setup.py build install \
74			--root=/ --prefix="$prefix"
75
76		install -m 755 -d "$docDir"
77		install -m 644 -t "$docDir" README.rst
78
79		packageEntries  $pythonPackage \
80			"$prefix"/lib/$python \
81			"$docDir"
82	done
83}
84