268.1. poppler-26.09.0
PDF rendering library, and pdftotext with the other poppler utilities
| Version | 26.09.0, release 1 |
| Shelf | documents — PDF, PostScript, DjVu, EPUB, CHM and DOCX viewers, libraries and tools, and ebook managers |
| Phase | 43_toolkits (Toolkits), 86 of 344 in build order |
| Licence | (GPL-2.0-only OR GPL-3.0-only) AND GPL-2.0-or-later |
| Homepage | https://poppler.freedesktop.org/ |
| Build time | 3.2 SBU |
| Installed size | 10.4 MiB in 183 files |
| Recipe | ports/core/documents/poppler/kpkgbuild |
About
Poppler is the PDF rendering library descended from Xpdf, with the pdftotext, pdftoppm, pdfimages, pdfinfo, pdfsig and other command-line utilities. Many programs on KDOS read a PDF through its bindings: the Qt 6 binding is the PDF backend of okular, texstudio, gimagereader, labplot, cantor and krita’s PDF import; the GLib binding is how timg shows a PDF in a terminal; its introspection data is what a PyGObject program imports as Poppler. The utilities matter on their own: recoll indexes a PDF by running pdftotext, and without it reports success over a directory of PDFs while indexing none of them.
Why it is in KDOS
The comment above it in script/phases/43_toolkits/packages.d/documents.txt:
recoll indexes a PDF by running pdftotext. With no poppler it walks a directory of PDFs, reports success, and produces an index containing none of them. It rides the xapian the kiwix stack already needs.
Sources
poppler-26.09.0.tar.xz(1.9 MiB)
sha2568059eadb6805340768f138c465b57f8164c92b4a0773c37ef031ea6c0d987b2e
upstream: https://poppler.freedesktop.org/poppler-26.09.0.tar.xz
archive copy: sources-1/documents--poppler-26.09.0.tar.xz
Dependencies
Depends on: cmake, ninja, pkgconf, freetype2, fontconfig, libjpeg-turbo, libpng, openjpeg, lcms2, zlib, libtiff, harfbuzz, cairo, glib, boost, gpgmepp, qt6-qtbase, gobject-introspection, glib-introspection, poppler-data.
Required by (25): abiword, calibre, calligra, cantor, cups-filters, gdal, gegl, gimagereader, gimp, graphviz, inkscape, kfilemetadata, kicad, kitinerary, krita, labplot, libcupsfilters, libppd, okular, recoll, ripgrep-all, sane-backends, texstudio, timg, yazi.
Optional, off in KDOS
These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.
-DENABLE_QT5=OFF, line 28: qt5-qtbase-DENABLE_LIBCURL=OFF, line 33: curl (explained with the switches below)
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 poppler'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/documents/poppler.
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/documents/poppler
echo '8059eadb6805340768f138c465b57f8164c92b4a0773c37ef031ea6c0d987b2e poppler-26.09.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/poppler
SRC=$SRC_ROOT/poppler-26.09.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf poppler-26.09.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:
mkdir -p build && cd build
cmake .. -G Ninja \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_CPP_TESTS=OFF \
-DBUILD_MANUAL_TESTS=OFF \
-DENABLE_UTILS=ON \
-DENABLE_CPP=ON \
-DENABLE_GLIB=ON \
-DENABLE_GOBJECT_INTROSPECTION=ON \
-DENABLE_GTK_DOC=OFF \
-DBUILD_GTK_TESTS=OFF \
-DENABLE_UNSTABLE_API_ABI_HEADERS=ON \
-DENABLE_QT5=OFF \
-DENABLE_QT6=ON \
-DBUILD_QT6_TESTS=OFF \
-DENABLE_BOOST=ON \
-DENABLE_GPGME=ON \
-DENABLE_LIBCURL=OFF \
-DENABLE_NSS3=OFF \
-DENABLE_LCMS=ON \
-DENABLE_LIBJPEG=ON \
-DENABLE_LIBTIFF=ON \
-DENABLE_HARFBUZZ=ON \
-DWITH_Cairo=ON \
-DWITH_PNG=ON \
-DENABLE_LIBOPENJPEG=openjpeg2
ninja
DESTDIR=$PKG ninja install
[ -f "$PKG/usr/lib/pkgconfig/poppler-glib.pc" ] || {
echo 'poppler: the glib binding was not built; timg would lose PDF support' >&2
exit 1
}
[ -f "$PKG/usr/lib/girepository-1.0/Poppler-0.18.typelib" ] || {
echo 'poppler: the Poppler typelib was not built; PyGObject programs could not import it' >&2
exit 1
}
[ -f "$PKG/usr/lib/pkgconfig/poppler-qt6.pc" ] || {
echo 'poppler: the Qt6 binding was not built; Okular and the other Qt readers need it' >&2
exit 1
}
The switches, and why each is set:
-DENABLE_UTILS=ON— Build and install the command-line utilities,pdftotextamong them.-DENABLE_CPP=ON— The C++ binding,poppler-cpp.-DENABLE_GLIB=ON,-DENABLE_GOBJECT_INTROSPECTION=ON— The GLib binding, which needs only glib and cairo (GTK is looked for only to build a demo), and thePoppler-0.18GIR and typelib generated for it.-DENABLE_GTK_DOC=OFF— No gtk-doc reference for the GLib binding.-DENABLE_QT6=ON,-DENABLE_QT5=OFF— The Qt 6 binding only; nothing in the tree builds poppler against Qt 5.-DBUILD_CPP_TESTS=OFF,-DBUILD_MANUAL_TESTS=OFF,-DBUILD_GTK_TESTS=OFF,-DBUILD_QT6_TESTS=OFF— Poppler’s test programs are gated by these, one per binding, not byBUILD_TESTING, and every one defaults to on.-DENABLE_UNSTABLE_API_ABI_HEADERS=ON— Install the private Xpdf-derived headers (/usr/include/poppler/*.h), which gdal’s PDF driver compiles against. Upstream gives them no stability promise.-DENABLE_BOOST=ON— Use boost’s headers for the small containers in the Splash rasteriser; nothing links boost at run time.-DENABLE_GPGME=ON,-DENABLE_NSS3=OFF— Signature verification and signing through the GPG backend, gpgmepp, as the only backend. With NSS also enabled, poppler makes NSS, the first backend it adds, the default forpdfsigand for every reader that signs.-DENABLE_LIBCURL=OFF— Leave out poppler’s libcurl-based loader for documents fetched over HTTP.-DENABLE_LCMS=ON,-DENABLE_LIBJPEG=ON,-DENABLE_LIBTIFF=ON,-DENABLE_HARFBUZZ=ON— Colour management through lcms2, DCT (JPEG) streams through libjpeg-turbo, TIFF output frompdfimagesandpdftocairo, and font subsetting through harfbuzz. With each option on, a missing library fails the configure.-DENABLE_LIBOPENJPEG=openjpeg2— JPEG 2000 (JPX) streams through openjpeg. The option is a boolean;openjpeg2is not one of CMake’s false constants, so CMake reads it as on.-DWITH_Cairo=ON,-DWITH_PNG=ON— Let poppler search for cairo and libpng, the defaults of its optional package searches; the cairo output backend (pdftocairo, and the GLib binding) and PNG output need them.
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/poppler, 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 poppler-26.09.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/poppler, and runs the triggers its paths call for.
Contents
Installed programs: pdfattach, pdfdetach, pdffonts, pdfimages, pdfinfo, pdfseparate, pdfsig, pdftocairo, pdftohtml, pdftoppm, pdftops, pdftotext, pdfunite.
Installed libraries: libpoppler-cpp.so, libpoppler-glib.so, libpoppler-qt6.so, libpoppler.so.
Installed directories: /usr/include/poppler, /usr/share/licenses/poppler.
Short descriptions
pdfattach |
Portable Document Format (PDF) document embedded file creator (version 3.03) |
pdfdetach |
Portable Document Format (PDF) document embedded file extractor (version 3.03) |
pdffonts |
Portable Document Format (PDF) font analyzer (version 3.03) |
pdfimages |
Portable Document Format (PDF) image extractor (version 3.03) |
pdfinfo |
Portable Document Format (PDF) document information extractor (version 3.03) |
pdfseparate |
Portable Document Format (PDF) page extractor |
pdfsig |
Portable Document Format (PDF) digital signatures tool |
pdftocairo |
Portable Document Format (PDF) to PNG/JPEG/TIFF/PDF/PS/EPS/SVG using cairo |
pdftohtml |
program to convert PDF files into HTML, XML and PNG images |
pdftoppm |
Portable Document Format (PDF) to Portable Pixmap (PPM) converter (version 3.03) |
pdftops |
Portable Document Format (PDF) to PostScript converter (version 3.03) |
pdftotext |
Portable Document Format (PDF) to text converter (version 3.03) |
pdfunite |
Portable Document Format (PDF) page merger |
poppler.pc |
PDF rendering library |
poppler-cpp.pc |
cpp backend for Poppler PDF rendering library |
poppler-glib.pc |
GLib wrapper for poppler |
poppler-qt6.pc |
Qt6 bindings for poppler |
Notes
The three checks after the install stop the build unless poppler-glib.pc, the Poppler-0.18.typelib and poppler-qt6.pc are in the package. Poppler’s CMake turns the GLib binding and its introspection data off without an error when cairo, GLib or gobject-introspection is not found, so the first two lines make a missing one a failed build instead of a reader that cannot open a PDF. A missing Qt 6 already stops the configure under -DENABLE_QT6=ON; the third line checks that the binding reached the package.
Because the unstable headers carry no promise, a version bump of poppler has to be test-built with gdal as well: its PDF driver may fail to compile against the new headers.