257.9. kdoctools-6.31.0
KDE Frameworks: DocBook to HTML and manual page tools (meinproc6)
| Version | 6.31.0, release 1 |
| Shelf | kf6 — KDE Frameworks 6: every port whose homepage is under invent.kde.org/frameworks, whatever it does |
| Phase | 43_toolkits (Toolkits), 36 of 344 in build order |
| Licence | (LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL) AND GPL-2.0-or-later AND LGPL-2.1-or-later |
| Homepage | https://invent.kde.org/frameworks/kdoctools |
| Build time | 0.1 SBU |
| Installed size | 1.6 MiB in 1006 files |
| Recipe | ports/core/kf6/kdoctools/kpkgbuild |
About
KDocTools turns the DocBook XML handbooks of KDE programs into HTML and manual pages. Its meinproc6 command transforms a handbook with the KDE stylesheets over libxslt, and checkXML6 validates one against the DocBook DTD. It also carries the CMake macros kdoctools_create_handbook() and kdoctools_create_manpage() that a KDE project calls, so a KDE application that installs a handbook needs this port at build time. A recipe can make it a requirement with -DCMAKE_REQUIRE_FIND_PACKAGE_KF6DocTools=ON, so that a missing one stops the configure.
Why it is in KDOS
The comment above the 61 ports from karchive to kfilemetadata in script/phases/43_toolkits/packages.d/kf6.txt:
The libraries KDE applications are built on, without Plasma.
Sources
kdoctools-6.31.0.tar.xz(452.8 KiB)
sha2566a54b0319d775b8d0d5ebaffd1149b7862621e997fec564da0fb2fcbd694a060
upstream: https://download.kde.org/stable/frameworks/6.31/kdoctools-6.31.0.tar.xz
archive copy: sources-3/kf6--kdoctools-6.31.0.tar.xz
Dependencies
Depends on: cmake, ninja, extra-cmake-modules, qt6-qtbase, karchive, ki18n, libxml2, libxslt, perl, perl-uri, docbook-xml, docbook-xsl, gettext.
Required by (155): akonadi-calendar-tools, akonadi-import-wizard, akonadiconsole, akregator, ark, artikulate, audiocd-kio, blinken, bluedevil, bomber, bovo, calligra, cantor, dolphin, filelight, ghostwriter, granatier, grantlee-editor, gwenview, juk, k3b, kaddressbook, kajongg, kalarm, kalgebra, kalzium, kamera, kamoso, kanagram, kapman, kapptemplate, kate, katomic, kbackup, kblackbox, kblocks, kbounce, kbreakout, kbruch, kcachegrind, kcalc, kcharselect, kcron, kde-cli-tools, kde-dev-scripts, kded, kdenlive, kdevelop, kdf, kdiamond, kdiff3, kdominate, keditbookmarks, kfind, kfourinline, kgeography, kget, kgoldrunner, kgpg, kgraphviewer, khangman, khelpcenter, kig, kigo, killbots, kimagemapeditor, kinfocenter, kio, kio-extras, kio-gdrive, kiriki, kiten, kjumpingcube, kldap, kleopatra, klettres, klickety, klines, kmahjongg, kmail, kmenuedit, kmines, kmix, kmouth, kmplot, knavalbattle, knetwalk, knights, kolf, kollision, kolourpaint, kompare, konqueror, konquest, konsole, kontact, kontrast, konversation, korganizer, kpackage, kpat, krdc, kreversi, krfb, kruler, kservice, kshisen, ksirk, ksnakeduel, kspaceduel, ksquares, ksshaskpass, ksudoku, ksystemlog, kteatime, ktimer, ktorrent, ktouch, ktuberling, kturtle, kubrick, kwallet, kwalletmanager, kwave, kwin, kwordquiz, labplot, libkcddb, lokalize, lskat, marble, minuet, neochat, okular, palapeli, parley, partitionmanager, picmi, pim-data-exporter, pim-sieve-editor, plasma-desktop, plasma-pa, plasma-sdk, plasma-workspace, powerdevil, poxml, rkward, rocs, skanlite, skladnik, spectacle, step, sweeper, systemsettings, umbrello.
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 kdoctools'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/kf6/kdoctools.
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/kf6/kdoctools
echo '6a54b0319d775b8d0d5ebaffd1149b7862621e997fec564da0fb2fcbd694a060 kdoctools-6.31.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/kdoctools
SRC=$SRC_ROOT/kdoctools-6.31.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf kdoctools-6.31.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:
cmake -S . -B build -G Ninja \
-D CMAKE_INSTALL_PREFIX=/usr \
-D KDE_INSTALL_LIBDIR=lib \
-D CMAKE_BUILD_TYPE=Release \
-D KDE_INSTALL_USE_QT_SYS_PATHS=ON \
-D KF_SKIP_PO_PROCESSING=ON \
-D BUILD_TESTING=OFF \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
The switches, and why each is set:
-D KF_SKIP_PO_PROCESSING=ON— Build none of the gettext catalogues underpo/, whichki18n_install()would compile into.mofiles. The strings in the source are English, and the package-wide English-only rule (see Size and language policy) would remove every catalogue in another language. The switch does not reachkdoctools_install(), which still builds the translated manual pages ofcheckXML6,meinproc6,kf6optionsandqt6options; the same rule removes them from the package.
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/kdoctools, 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 kdoctools-6.31.0-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/kdoctools, and runs the triggers its paths call for.
Contents
Installed programs: checkXML6, meinproc6.
Installed libraries: libKF6DocTools.so.
Installed directories: /usr/include/KF6/KDocTools, /usr/lib/cmake/KF6DocTools, /usr/share/doc/HTML/en/kdoctools6-common, /usr/share/kf6/kdoctools, /usr/share/licenses/kdoctools.
Short descriptions
checkXML6 |
An XML lint tool for KDE DocBook XML documents |
meinproc6 |
KDE translator for XML |
Notes
The configure looks up the DocBook 4.5 DTD of docbook-xml and the stylesheets of docbook-xsl in their installed directories and writes their paths into the files it installs (the KDE DocBook DTD, kdedbx45.dtd, and the stylesheets that import DocBook XSL’s), so both have to be installed before this port builds. It also needs xmllint from libxml2 and stops without it. perl and perl-uri are in depends because the configure URI-encodes the DTD directory by running perl -MURI::Escape.
The same DTD and stylesheets are read at run time, not only at configure: meinproc6 and the KIO help worker behind help:/ (what F1 and KDE Help Center open) load kdedbx45.dtd, which reads the docbook-xml DTD, and the KDE stylesheets, which xsl:import docbook-xsl’s /usr/share/xml/docbook/xsl-stylesheets-1.79.2/html/chunk.xsl and the rest. No file of the package links or names them in a way kpkg needs measures, so the recipe names both in runtime =, which records them as need lines and makes imageset.py --verify fail an image that keeps this port without them. Neither is in ports/buildonly, so the base closure and a prebuilt kdos update install follow this port’s depends = into both. Without them every DocBook handbook fails with “could not be parsed”.