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

122.1. printrun-2.2.0

pronsole and printcore — send a sliced job to a printer over USB serial

The build-state snapshot was taken from 2.2.0-1; this recipe is 2.2.0-2, so the size, time and contents below describe the earlier build.

Version 2.2.0, release 2
Shelf fabrication — 3D-printing slicers and hosts, and CNC control
Phase 41_system (System), 493 of 1047 in build order
Licence GPL-3.0-or-later
Homepage https://github.com/kliment/Printrun
Build time 0.3 SBU
Installed size 2.3 MiB in 127 files
Recipe ports/core/fabrication/printrun/kpkgbuild

About

Printrun is host software for 3D printers that take G-code over a serial line, as most Marlin, Prusa and RepRap firmware does. The port installs its console half: pronsole, an interactive console that connects to the printer, sends a sliced job and reports progress and temperatures, and printcore, the library and command under it, which streams a G-code file to a printer with no interface at all. With a slicer it is what sends the job down the USB cable. The printer’s port is a USB serial device, which the dialout group opens; the kdos user is in it through fs/etc/group.

Why it is in KDOS

The comment above it in script/phases/41_system/packages.d/fabrication.txt:

The stick can slice and had no way to send: pronsole pushes the gcode down a USB serial line. Needs the dialout group, which fs/etc/group already grants.

Sources

Dependencies

Depends on: python3, python3-setuptools, python3-pip, python3-cython, python3-pyserial, python3-platformdirs, python3-psutil.

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 printrun'

What kpkg does

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

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/fabrication/printrun
echo '4a2c25106db139a940aa45cf04ddeedf2afd775801c0ec6f008886230e1b5e3b  printrun-2.2.0.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/printrun
SRC=$SRC_ROOT/printrun-2.2.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf printrun-2.2.0.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/no-wx-on-console.patch"

pip3 install --ignore-installed --no-deps --no-index --no-build-isolation --root=$PKG --prefix=/usr .

rm -f $PKG/usr/bin/pronterface.py $PKG/usr/bin/plater.py
rm -f $PKG/usr/bin/__pycache__/pronterface.*.pyc $PKG/usr/bin/__pycache__/plater.*.pyc

rm -f $PKG/usr/share/applications/pronterface.desktop \
      $PKG/usr/share/applications/plater.desktop \
      $PKG/usr/share/applications/pronsole.desktop \
      $PKG/usr/share/metainfo/pronterface.appdata.xml \
      $PKG/usr/share/metainfo/plater.appdata.xml

ln -s pronsole.py $PKG/usr/bin/pronsole
ln -s printcore.py $PKG/usr/bin/printcore

cat > "$PKG/usr/share/applications/pronsole.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Pronsole
GenericName=3D Printing Console
Comment=Send G-code to a RepRap machine and follow the print from a terminal
Exec=pronsole
Icon=pronsole
Terminal=true
Categories=Utility;Graphics;3DGraphics;ConsoleOnly;
Keywords=3d;printing;reprap;gcode;g-code;printrun;pronsole;
DESKTOP
chmod 644 "$PKG/usr/share/applications/pronsole.desktop"

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

Contents

Installed programs: printcore, printcore.py, pronsole, pronsole.py.

Installed directories: /usr/lib/python3.14/site-packages/printrun, /usr/lib/python3.14/site-packages/printrun-2.2.0.dist-info, /usr/share/licenses/printrun, /usr/share/pronterface.

Notes