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
graphviz-16.1.0.tar.xz(20.0 MiB)
sha2560f661718f3e5268dc3bad0fb53ab646605d26db70f4080799aff1dc2f61783c3
upstream: https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-releases/16.1.0/graphviz-16.1.0.tar.xz
archive copy: sources-2/graphics-libs--graphviz-16.1.0.tar.xz
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:
--disable-man-pdfs— Make no PDF copies of the manual pages. Left at its default,auto, configure makes them whenevergroffandps2pdfhappen to be installed.--enable-ltdl,--disable-ltdl-install,--without-included-ltdl— Load the plugins on demand through libltdl, and use the libltdl of libtool rather than building or installing the copy bundled in the source.--enable-swig=noand--enable-sharp=noto--enable-tcl=no— Build no language bindings: no SWIG wrappers for C#, D, Go, Guile, Java, JavaScript, Lua, Perl, PHP, Python, R, Ruby or Tcl.--without-x— No X11 support, which only adds the-Txlibpreview window.--with-ghostscript=no— No Ghostscript plugin. configure builds it only together with Xrender, which--without-xleaves out.--with-expat=yes,--with-pangocairo=yes,--with-freetype2=yes,--with-libgd=yes,--with-webp=yes,--with-rsvg=yes,--with-poppler=yes— The XML parser for HTML-like labels and the renderers: Cairo with Pango for PNG, PDF, SVG and PostScript output, libgd for its bitmap formats, WebP, SVG images in nodes through librsvg, and PDF images in nodes through poppler.--with-gts=yes— Link the GNU Triangulated Surface library, gts, into the neato layout plugin. It is what givessfdpandneatotheoverlap=prismoverlap removal.--with-sfdp=yes,--with-ortho=yes,--with-digcola=yes,--with-ipsepcola=yes— Thesfdplayout, orthogonal edge routing, and neato’s hierarchical (mode=hier) and constrained (mode=ipsep) layouts.--with-gdk-pixbuf=no,--with-gdk=no— No GdkPixbuf or GDK plugins; the gd, rsvg and poppler plugins already load the image formats they would.--with-gtk=no,--with-gtkgl=no,--with-gtkglext=no,--with-glade=no,--with-qt=no,--with-glut=no,--with-smyrna=no— No graphical programs:gveditis a Qt program andsmyrnaan OpenGL viewer built on GTK and GLUT.--with-lasi=no,--with-devil=no,--with-ann=no,--with-aalib=no— No LASi PostScript text plugin, no DevIL image plugin, no ANN library (used by themingleedge-bundling tool) and no AAlib ASCII-art output. LASi, DevIL and ANN are not ports.
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.