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

248.1. uranium-5.13.0

The Python and Qt Quick application framework Cura is built on

Version 5.13.0, release 1
Shelf fabrication — 3D-printing slicers and hosts, and CNC control
Phase 43_toolkits (Toolkits), 127 of 344 in build order
Licence LGPL-3.0-or-later
Homepage https://github.com/Ultimaker/Uranium
Build time 1.0 SBU
Installed size 4.9 MiB in 605 files
Recipe ports/core/fabrication/uranium/kpkgbuild

About

Uranium is Ultimaker’s Python application framework for 3D printing software: the scene graph, mesh handling, settings containers, plugin system and Qt Quick interface (through python3-pyqt6) that cura is built on. It installs no program of its own; Cura’s launcher imports it.

Sources

Dependencies

Depends on: python3, python3-pip, python3-setuptools, python3-setuptools-scm, python3-cython, python3-wheel, python3-typing-extensions, python3-pyqt6, python3-pyqt6-sip, qt6-qtbase, qt6-qtdeclarative, qt6-qtsvg, qt6-qtwayland, numpy, scipy, python3-cryptography, python3-pyarcus, python3-pyuvula.

Required by (1): cura.

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

What kpkg does

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

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/uranium
echo '1c50ddb3469ad01e7edade548991699d0762b61523ce3d5564ae6f8a3763ef9a  uranium-5.13.0.tar.gz' | sha256sum -c -
echo 'b345e168212d7a587768cb6a85f0d3cdb8effe3ebb2c97818f326169066432fd  uranium-vendor-5.13.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/uranium
SRC=$SRC_ROOT/uranium-5.13.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf uranium-5.13.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 recipe’s helpers pyrequirements, pyruntime and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

mkdir -p vendor
tar -xf "$PORT_SRC/$name-vendor-$version.tar.xz" --strip-components=1 -C vendor

pip3 install --ignore-installed --no-deps --no-index --find-links=vendor --no-build-isolation \
	--root=$PKG --prefix=/usr pyclipper numpy-stl python-utils colorlog
rm -f "$PKG/usr/bin/stl" "$PKG/usr/bin/stl2ascii" "$PKG/usr/bin/stl2bin"
rmdir "$PKG/usr/bin"

_site=$(python3 -c 'import sysconfig; print(sysconfig.get_path("purelib", vars={"base": "/usr"}))')
install -d "$PKG$_site" "$PKG/usr/lib/uranium/plugins" "$PKG/usr/share/uranium"
cp -r UM "$PKG$_site/"
for p in plugins/*; do
	[ "${p##*/}" = UpdateChecker ] && continue
	cp -r "$p" "$PKG/usr/lib/uranium/plugins/"
done
cp -r resources "$PKG/usr/share/uranium/"
rm -rf "$PKG/usr/share/uranium/resources/i18n"
find "$PKG$_site/UM" "$PKG/usr/lib/uranium" -depth -type d \
	\( -name tests -o -name __pycache__ \) -exec rm -rf {} +
find "$PKG$_site/UM" "$PKG/usr/lib/uranium" "$PKG/usr/share/uranium" -type f -exec chmod 644 {} +
python3 -m compileall -q -s "$PKG" -p / "$PKG$_site/UM" "$PKG/usr/lib/uranium"

test -f "$PKG$_site/UM/Qt/qml/UM/qmldir"
test -f "$PKG/usr/lib/uranium/plugins/FileHandlers/STLReader/plugin.json"
ls "$PKG$_site"/pyclipper* "$PKG$_site"/stl >/dev/null

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

Contents

Installed directories: /usr/lib/python3.14/site-packages/UM, /usr/lib/python3.14/site-packages/colorlog, /usr/lib/python3.14/site-packages/colorlog-6.12.0.dist-info, /usr/lib/python3.14/site-packages/numpy_stl-3.2.0.dist-info, /usr/lib/python3.14/site-packages/pyclipper, /usr/lib/python3.14/site-packages/pyclipper-1.4.0.dist-info, /usr/lib/python3.14/site-packages/python_utils, /usr/lib/python3.14/site-packages/python_utils-3.9.1.dist-info, /usr/lib/python3.14/site-packages/stl, /usr/lib/uranium, /usr/share/licenses/uranium, /usr/share/uranium.

Notes

Uranium’s CMakeLists.txt installs only through paths that Conan, the C++ package manager Ultimaker builds with, provides, so build.sh lays the framework out by hand where Uranium itself looks for it relative to the launcher’s prefix (/usr, the parent of /usr/bin): the UM package in site-packages, the plugins under /usr/lib/uranium/plugins, and the resources under /usr/share/uranium/resources. The two test lines and the ls at the end stop the build unless the QML module’s qmldir, the STL reader’s plugin.json and the two vendored modules are in place.

Three things are left out on purpose. The UpdateChecker plugin, which asks ultimaker.com for new releases at every start, is not copied. The translation catalogues under resources/i18n are removed, so the interface keeps its English source strings. The tests and __pycache__ directories are removed, and compileall then writes fresh byte code with the package root stripped from the recorded paths (-s "$PKG" -p /).

The vendor bundle holds the four modules only Uranium imports, named in pypackages with their versions: pyclipper (polygon offsetting), numpy-stl with its python-utils (the STL reader) and colorlog. Their build backends are ports, so the install runs with --no-build-isolation and fetches nothing; see The three Python keys. numpy-stl’s three command-line converters (stl, stl2ascii, stl2bin) are deleted, and the rmdir of /usr/bin after them fails the build if a vendored module ever installs a program there.