Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

244.1. graphviz-16.1.0

Graph layout and rendering — dot, neato, sfdp and the cgraph/gvc libraries

Version 16.1.0, release 2
Shelf graphics-libs — 2D rendering, vector and SVG, text layout, colour management and graph drawing libraries
Phase 43_toolkits (Toolkits), 104 of 344 in build order
Licence EPL-2.0
Homepage https://graphviz.org/
Build time 2.2 SBU
Installed size 6.3 MiB in 270 files
Recipe ports/core/graphics-libs/graphviz/kpkgbuild

About

Graphviz lays out and draws graphs described in the DOT language: dot for hierarchies, neato, fdp and sfdp for force-directed layouts, circo and twopi, and the cgraph and gvc libraries that programs link to do the same. Output formats are plugins under /usr/lib/graphviz. In the tree, gramps draws family trees with it and yosys draws circuits.

Sources

Dependencies

Depends on: pkgconf, bison, flex, libtool, expat, zlib, cairo, pango, fontconfig, freetype2, libgd, libpng, libjpeg-turbo, libwebp, librsvg, poppler, glib, gts.

Required by (5): gramps, kcachegrind, kgraphviewer, umbrello, yosys.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/43_toolkits/phase.env && kpkg install graphviz'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/graphics-libs/graphviz.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/graphics-libs/graphviz
echo '0f661718f3e5268dc3bad0fb53ab646605d26db70f4080799aff1dc2f61783c3  graphviz-16.1.0.tar.xz' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/graphviz
SRC=$SRC_ROOT/graphviz-16.1.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf graphviz-16.1.0.tar.xz -C "$SRC" --strip-components=1

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib \
	--disable-static \
	--disable-man-pdfs \
	--enable-ltdl \
	--disable-ltdl-install \
	--without-included-ltdl \
	--enable-swig=no \
	--enable-sharp=no --enable-d=no --enable-go=no --enable-guile=no \
	--enable-java=no --enable-javascript=no --enable-lua=no \
	--enable-perl=no --enable-php=no --enable-python=no \
	--enable-python3=no --enable-r=no --enable-ruby=no --enable-tcl=no \
	--without-x \
	--with-expat=yes \
	--with-pangocairo=yes \
	--with-freetype2=yes \
	--with-libgd=yes \
	--with-webp=yes \
	--with-rsvg=yes \
	--with-gdk-pixbuf=no \
	--with-poppler=yes \
	--with-ghostscript=no \
	--with-lasi=no \
	--with-gdk=no \
	--with-gtk=no --with-gtkgl=no --with-gtkglext=no --with-glade=no \
	--with-qt=no \
	--with-glut=no \
	--with-smyrna=no \
	--with-gts=yes \
	--with-ann=no \
	--with-devil=no \
	--with-aalib=no \
	--with-sfdp=yes \
	--with-ortho=yes \
	--with-digcola=yes \
	--with-ipsepcola=yes
make
make DESTDIR=$PKG install
for p in core dot_layout neato_layout pango gd rsvg poppler webp; do
	test -e "$PKG/usr/lib/graphviz/libgvplugin_$p.so"
done
readelf -d "$PKG/usr/lib/graphviz/libgvplugin_neato_layout.so" | grep -q 'NEEDED.*\[libgts-'
GVBINDIR="$PKG/usr/lib/graphviz" LD_LIBRARY_PATH="$PKG/usr/lib" \
	"$PKG/usr/bin/dot" -c
test -s "$PKG/usr/lib/graphviz/config8"

The switches, and why each is set:

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/graphviz, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf graphviz-16.1.0-2.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/graphviz, and runs the triggers its paths call for.

Contents

Installed programs: acyclic, bcomps, ccomps, circo, cluster, dijkstra, dot, dot2gxl, dot_builtins, dot_sandbox, edgepaint, fdp, gc, gml2gv, graphml2gv, gv2gml, gv2gxl, gvcolor, gvgen, gvmap, gvmap.sh, gvpack, gvpr, gxl2dot, gxl2gv, mm2gv, neato, nop, osage, patchwork, prune, sccmap, sfdp, tred, twopi, unflatten.

Installed libraries: libcdt.so, libcgraph.so, libgvc.so, libgvpr.so, libpathplan.so, libxdot.so.

Installed directories: /usr/include/graphviz, /usr/lib/graphviz, /usr/share/doc/graphviz, /usr/share/graphviz, /usr/share/licenses/graphviz.

Short descriptions

acyclic make directed graph acyclic
bcomps biconnected components filter for graphs
ccomps connected components filter for graphs
cluster find clusters in a graph and augment the graph with this information.
dijkstra single-source distance filter for Graphviz
dot filter for drawing directed graphs neato - filter for drawing undirected graphs twopi - filter for radial layouts of graphs circo - filter for circular layout of graphs fdp - filter for drawing undirected graphs sfdp - filter for drawing large undirected graphs
dot_sandbox Graphviz sandbox
edgepaint edge coloring to disambiguate crossing edges
gc count graph components
gml2gv GML-DOT converters
graphml2gv GRAPHML-DOT converter
gvcolor flow colors through a ranked digraph
gvgen generate graphs
gvmap find clusters and create a geographical map highlighting clusters.
gvmap.sh pipeline for running gvmap
gvpack merge and pack disjoint graphs
gvpr graph pattern scanning and processing language
gxl2gv GXL-GV converters
mm2gv Matrix Market-DOT converters
nop pretty-print graph file
osage filter for drawing clustered graphs
patchwork filter for drawing clustered graphs as treemaps
prune Prune directed graphs
sccmap extract strongly connected components of directed graphs
tred transitive reduction filter for directed graphs
unflatten adjust directed graphs to improve layout aspect ratio
libcdt.pc Container DataType library
libcgraph.pc Graph library (file i/o, dot language parsing, graph, subgraph, node, edge, attribute, data structure manipulation)
libgvc.pc The GraphVizContext library
libgvpr.pc The GVPR library
libpathplan.pc Library for planning polyline and bezier paths around polygon obstacles
libxdot.pc Library for parsing graphs in xdot format

Notes

Every renderer is a pkg-config probe in configure that drops its plugin without a word when the library is missing, even when asked for with =yes. build.sh therefore checks after the install that the core, dot, neato, pango, gd, rsvg, poppler and webp plugins exist, and that the neato plugin links libgts; a missing one fails the build.

The plugin index, /usr/lib/graphviz/config8, is written in build.sh with dot -c, run against the staged plugins through GVBINDIR. Upstream’s install hook runs dot -c only when DESTDIR is empty, and without the index dot loads no plugin and knows no output format. Every plugin is in this one package, so the index is complete when the package is built.