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

198.1. curaengine-5.13.0

The slicer behind Cura, also usable on its own from the command line

Version 5.13.0, release 2
Shelf fabrication — 3D-printing slicers and hosts, and CNC control
Phase 42_graphics (Graphics Stack), 89 of 189 in build order
Licence AGPL-3.0-or-later
Homepage https://github.com/Ultimaker/CuraEngine
Build time 11.2 SBU
Installed size 5.8 MiB in 2 files
Recipe ports/core/fabrication/curaengine/kpkgbuild

About

CuraEngine is the slicer behind Cura: it turns a 3D model and a printer’s settings into the G-code a 3D printer runs. Cura starts it as /usr/bin/CuraEngine and drives it over Arcus, its socket protocol; it also runs on its own from the command line, reading machine definitions from the directories CURA_ENGINE_SEARCH_PATH names (the cura port installs them under /usr/share/cura/resources).

Sources

Dependencies

Depends on: cmake, ninja, pkgconf, libarcus, protobuf, abseil-cpp, polyclipping, range-v3, rapidjson, boost, spdlog, fmt, onetbb, libpng, zlib.

Required by (1): cura.

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/42_graphics/phase.env && kpkg install curaengine'

What kpkg does

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

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/curaengine
echo '287450f5f4d1afaab6954272cc986e1a4ba5c7b71a28303a70f45996c786980e  curaengine-5.13.0.tar.gz' | sha256sum -c -
echo 'b35b9b112085c299ee5e9e5e15612e5e065d07220d0c9954b776b15cfa5095b5  conan-ultimaker-index-c4077fc3e719b436d1cdc2032bf3f851b6f089bb.tar.gz' | sha256sum -c -
echo '0b6737514ba08f68750263c5198ee0e36597ffbbe241ced89c9dd90bd99b05d3  scripta-b96045cd9b531d97f42dec8c9a0ef52f773f6b90.tar.gz' | sha256sum -c -
echo 'd00921d49b06af62aa6bfb97c1b136bec661dd11dd4eecbcb0da1f6da7cedb4c  stb-5736b15f7ea0ffb08dd38af21067c314d6a3aae9.tar.gz' | sha256sum -c -
echo '88c41eaba03107ebe79052fdbd66e419e903d331a2616a51849018e13648ab83  wagyu-0.5.0.tar.gz' | sha256sum -c -
echo '9d750d34576069bcc4f39677af08cde2862fbe4b8c0d9af504877c2fae2ae273  geometry.hpp-2.0.3.tar.gz' | sha256sum -c -
echo '7059f4420d504c4bc96f8a462a0f6d029c5be914ba55cc030a0a773366dd7bc8  variant-1.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/curaengine
SRC=$SRC_ROOT/curaengine-5.13.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf curaengine-5.13.0.tar.gz -C "$SRC" --strip-components=1
tar --no-same-permissions --warning=no-unknown-keyword -xf conan-ultimaker-index-c4077fc3e719b436d1cdc2032bf3f851b6f089bb.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf scripta-b96045cd9b531d97f42dec8c9a0ef52f773f6b90.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf stb-5736b15f7ea0ffb08dd38af21067c314d6a3aae9.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf wagyu-0.5.0.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf geometry.hpp-2.0.3.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf variant-1.2.0.tar.gz -C "$SRC_ROOT"

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 _index, _scripta, _stb, _wagyu, _geometry, _variant and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

patch -d "$SRC_ROOT/wagyu-$_wagyu" -p1 -i "$PORT_SRC/wagyu-execinfo.patch"

patch -p1 -i "$PORT_SRC/include-iomanip.patch"

_shim="$SRC_ROOT/shim"
mkdir -p "$_shim"
printf 'include("%s")\n' \
	"$SRC_ROOT/conan-ultimaker-index-$_index/recipes/standardprojectsettings/all/StandardProjectSettings.cmake" \
	> "$_shim/standardprojectsettings-config.cmake"

_iface() {
	_pkg=$1 _tgt=$2; shift 2
	{
		printf 'if(NOT TARGET %s)\n' "$_tgt"
		printf '\tadd_library(%s INTERFACE IMPORTED)\n' "$_tgt"
		printf '\tset_target_properties(%s PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "%s")\n' \
			"$_tgt" "$*"
		printf 'endif()\n'
	} > "$_shim/$_pkg-config.cmake"
}
_iface scripta scripta::scripta "$SRC_ROOT/Scripta_public-$_scripta/include"
_iface stb stb::stb "$SRC_ROOT/stb-$_stb"
_iface mapbox-wagyu mapbox-wagyu::mapbox-wagyu \
	"$SRC_ROOT/wagyu-$_wagyu/include;$SRC_ROOT/geometry.hpp-$_geometry/include;$SRC_ROOT/variant-$_variant/include"

cat > "$_shim/clipper-config.cmake" <<'CMAKE'
find_package(PkgConfig REQUIRED)
pkg_check_modules(POLYCLIPPING REQUIRED IMPORTED_TARGET polyclipping)
if(NOT TARGET clipper::clipper)
	add_library(clipper::clipper INTERFACE IMPORTED)
	target_link_libraries(clipper::clipper INTERFACE PkgConfig::POLYCLIPPING)
endif()
CMAKE

cat > "$_shim/aliases.cmake" <<'CMAKE'
find_package(Boost CONFIG REQUIRED)
add_library(boost::boost INTERFACE IMPORTED)
target_link_libraries(boost::boost INTERFACE Boost::headers)
find_package(TBB CONFIG REQUIRED)
add_library(onetbb::onetbb INTERFACE IMPORTED)
target_link_libraries(onetbb::onetbb INTERFACE TBB::tbb)
find_path(RAPIDJSON_SHIM_INCLUDE rapidjson/rapidjson.h REQUIRED)
add_library(rapidjson INTERFACE IMPORTED)
set_target_properties(rapidjson PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${RAPIDJSON_SHIM_INCLUDE}")
CMAKE

cmake -S . -B build -G Ninja -Wno-dev \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_CXX_STANDARD=20 \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCURA_ENGINE_VERSION="$version" \
	-DENABLE_ARCUS=ON \
	-DENABLE_PLUGINS=OFF \
	-DENABLE_REMOTE_PLUGINS=OFF \
	-DENABLE_SENTRY=OFF \
	-DENABLE_TESTING=OFF \
	-DENABLE_BENCHMARKS=OFF \
	-DEXTENSIVE_WARNINGS=OFF \
	-DENABLE_MORE_COMPILER_OPTIMIZATION_FLAGS=OFF \
	-DENABLE_THREADING=ON \
	-Dprotobuf_MODULE_COMPATIBLE=ON \
	-Dstandardprojectsettings_DIR="$_shim" \
	-Dscripta_DIR="$_shim" \
	-Dstb_DIR="$_shim" \
	-Dmapbox-wagyu_DIR="$_shim" \
	-Dclipper_DIR="$_shim" \
	-DCMAKE_PROJECT_INCLUDE="$_shim/aliases.cmake"
ninja -C build CuraEngine

install -Dm755 build/CuraEngine "$PKG/usr/bin/CuraEngine"

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

Contents

Installed programs: CuraEngine.

Installed directories: /usr/share/licenses/curaengine.

Notes