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

86.2. groff-1.24.1

The roff typesetting system — troff, nroff, eqn, tbl, pic and the PDF, PostScript and HTML output devices

Version 1.24.1, release 1
Shelf doctools — Documentation toolchains, man pages, markup converters and TeX typesetting
Phase 41_system (System), 410 of 1047 in build order
Licence GPL-3.0-or-later
Homepage https://www.gnu.org/software/groff/
Build time 2.5 SBU
Installed size 25.9 MiB in 630 files
Recipe ports/core/doctools/groff/kpkgbuild

About

GNU groff is the roff typesetting system: troff and nroff, the eqn, tbl, pic and refer preprocessors, the man, mdoc, ms, me and mm macro packages, and output drivers for terminals, PostScript, PDF, HTML and DVI. On KDOS manual pages are formatted by mandoc; groff is there for documents written for the full roff language and for typesetting a page to PostScript, PDF or HTML.

Sources

Dependencies

Depends on: perl, m4, bison, texinfo, zlib, uchardet, ghostscript, netpbm, mandoc.

Required by: no port names it.

Patches

build.sh applies these; kpkg applies nothing by itself.

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/41_system/phase.env && kpkg install groff'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/doctools/groff.

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/doctools/groff
echo '74e2819795b6aff431aeac983d63a9c8968eeaba2a2eba7df8ba4c7b41e7cfd8  groff-1.24.1.tar.gz' | 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/groff
SRC=$SRC_ROOT/groff-1.24.1
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf groff-1.24.1.tar.gz -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:

patch -p1 -i "$PORT_SRC/fix-neqn-wrapper.patch"

./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib \
	--disable-rpath \
	--without-x \
	--with-uchardet=yes \
	--with-gs=gs \
	--without-urw-fonts \
	--with-compatibility-wrappers=no
make
make DESTDIR=$PKG install

rm -f "$PKG/usr/bin/soelim" \
	"$PKG/usr/share/man/man1/soelim.1" \
	"$PKG/usr/share/man/man7/roff.7"
rm -f "$PKG/usr/lib/charset.alias"

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/groff, 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 groff-1.24.1-1.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/groff, and runs the triggers its paths call for.

Contents

Installed programs: addftinfo, afmtodit, chem, eqn, eqn2graph, gdiffmk, glilypond, gperl, gpinyin, grap2graph, grn, grodvi, groff, grog, grolbp, grolj4, gropdf, grops, grotty, hpftodit, indxbib, lkbib, lookbib, mmroff, neqn, nroff, pdfmom, pfbtops, pic, pic2graph, post-grohtml, pre-grohtml, preconv, refer, tbl, tfmtodit, troff.

Installed directories: /usr/lib/groff, /usr/share/doc/groff-1.24.1, /usr/share/groff, /usr/share/licenses/groff.

Short descriptions

addftinfo add font metrics to troff fonts for use with groff
afmtodit adapt Adobe Font Metrics files for groff PostScript and PDF output
chem embed chemical structure diagrams in groff documents
eqn format mathematics (equations) for groff or MathML
eqn2graph convert an eqn generic equation into a cropped image
gdiffmk mark differences between groff / nroff / troff files
glilypond embed LilyPond musical notation in groff documents
gperl execute Perl commands in groff documents
gpinyin use Hanyu Pinyin Chinese in groff documents
grap2graph convert a grap diagram into a cropped image
grn embed Gremlin images in groff documents
grodvi groff output driver for TeX DVI format
groff front end to the GNU roff document formatting system
grog "groff guess"—infer the groff command a document requires
grolbp groff output driver for Canon CaPSL printers
grolj4 groff output driver for HP LaserJet 4 and compatible printers
gropdf groff output driver for Portable Document Format
grops groff output driver for PostScript
grotty groff output driver for typewriter-like (terminal) devices
hpftodit create font description files for use with groff and grolj4
indxbib make inverted index of bibliographic databases
lkbib search bibliographic databases
lookbib search bibliographic databases interactively
mmroff reference- and PostScript inclusion-handling front end for GNU roff mm macro package
neqn format equations for character-cell terminal output
nroff format documents with groff for terminal (TTY) devices
pdfmom produce PDF documents using the mom macro package for groff
pfbtops translate PostScript Printer Font Binary files to Printer Font ASCII
pic compile pictures for troff or TeX
pic2graph convert a pic diagram into a cropped image
preconv prepare files for typesetting with groff
refer process bibliographic references for groff
tbl prepare tables for groff documents
tfmtodit adapt TeX Font Metrics files for use with groff and grodvi
troff GNU roff typesetter and document formatter

Notes