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

334.5. hplip-3.26.4

HP printer and scanner drivers — hpcups, the hp backend, PPDs and the hpaio SANE backend

Version 3.26.4, release 1
Shelf printing — Printing, printer drivers, labels, scanning and OCR
Phase 44_apps (Applications), 347 of 422 in build order
Licence GPL-2.0-or-later AND MIT AND BSD-3-Clause
Homepage https://developers.hp.com/hp-linux-imaging-and-printing
Build time 2.0 SBU
Installed size 31.0 MiB in 1649 files
Recipe ports/core/printing/hplip/kpkgbuild

About

HPLIP is HP’s printing and scanning software for Linux. This port ships its print and scan path only: the hpcups CUPS filter, the hp CUPS backend for USB and network printers, the printer descriptions as a CUPS driver file and as PPDs, and the hpaio SANE backend. The Qt toolbox, fax support and the hp-* Python tools are not built or are removed after the install; among those tools is hp-plugin, which downloads HP’s closed plugin, and the system does not carry it.

Sources

Dependencies

Depends on: cups, cups-filters, ghostscript, libusb, libjpeg-turbo, dbus, sane-backends, python3, zlib, net-snmp, avahi, openssl.

Required by: no port names it.

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.

Patches

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

The header, prototype, type, cast, macro and void-return patches correct C that GCC rejects as an error by default.

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/44_apps/phase.env && kpkg install hplip'

What kpkg does

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

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/printing/hplip
echo 'b9c61252754f35b4a237396ca8961e7b3e0c56db76d66a6712b7bf3e30e69463  hplip-3.26.4.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/hplip
SRC=$SRC_ROOT/hplip-3.26.4
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf hplip-3.26.4.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:

for p in fix-memmove disable_upgrade more-imageprocessor-removes no-empty-glob \
	types-musl python3 add-cast add-const-to-cast add-missing-headers-and-macros \
	add-missing-prototypes add-missing-type-to-variable-decl \
	dont-return-value-from-void-func fix-func-decl-missing-arg use-correct-macro \
	hplip-no-urlopener; do
	patch -p1 -i "$PORT_SRC/$p.patch"
done

GNUMAKEFLAGS="CFLAGS=-std=c++11" save_CFLAGS="$CFLAGS" ./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib \
	--with-docdir=/usr/share/doc/hplip \
	--disable-doc-build \
	--disable-gui-build \
	--disable-fax-build \
	--disable-qt3 --disable-qt4 --disable-qt5 \
	--disable-policykit \
	--disable-imageProcessor-build \
	--enable-network-build \
	--enable-scan-build \
	--enable-dbus-build \
	--enable-hpcups-install \
	--disable-class-driver \
	--enable-cups-drv-install \
	--enable-cups-ppd-install
make
make -j1 DESTDIR=$PKG install

rm -rf "$PKG/usr/bin" "$PKG/etc/udev" "$PKG/etc/sane.d" "$PKG/usr/share/hal" \
	"$PKG/usr/lib/systemd" "$PKG/usr/share/applications" "$PKG/etc/xdg" \
	"$PKG/usr/lib/cups/filter/pstotiff" "$PKG/usr/share/doc"
rm -f "$PKG"/usr/share/man/man1/hp-*.1
install -Dm644 /dev/stdin "$PKG/etc/sane.d/dll.d/hpaio" <<'CONF'
hpaio
CONF

if find "$PKG" -name 'libImageProcessor*' -o -name 'hbpl1-*.so' -o -name 'lj-*.so' | grep -q .; then
	echo 'hplip: a prebuilt HP object reached the package' >&2
	exit 1
fi
test -f "$PKG/usr/share/ipp-usb/quirks/HPLIP.conf"

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/hplip, 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 hplip-3.26.4-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/hplip, and runs the triggers its paths call for.

Contents

Installed libraries: libhpdiscovery.so, libhpip.so, libhpipp.so, libhpmud.so.

Installed directories: /etc/hp, /usr/share/cups/drv/hp, /usr/share/hplip, /usr/share/licenses/hplip, /usr/share/ppd/HP.

Notes

After the install build.sh removes /usr/bin (the hp-* tools) and their manual pages, the udev rules, the HAL and systemd files, the desktop entries and the XDG autostart entry, the pstotiff filter, and the documentation. It also removes /etc/sane.d, whose dll.conf belongs to sane-backends, and enables hpaio instead through a file of its own, /etc/sane.d/dll.d/hpaio.

The tarball carries prebuilt closed objects: libImageProcessor and the hbpl1-* and lj-* printer plugins. None of them may reach the package, so build.sh fails the build if a file by any of those names is in $PKG, and checks that HPLIP.conf, the quirks file for ipp-usb, is.

make install runs with -j1, overriding the tree’s parallel MAKEFLAGS for that one step; see A parallel install race.