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

308.4. openscad-2026.09.27

The programmer's solid 3D CAD modeller: models written as scripts, rendered with Manifold and CGAL

Version 2026.09.27, release 2
Shelf cad — Mechanical, architectural and 2D CAD, geometry kernels, meshing and FEM
Phase 44_apps (Applications), 25 of 422 in build order
Licence GPL-2.0-or-later
Homepage https://openscad.org/
Build time 16.8 SBU
Installed size 22.8 MiB in 176 files
Recipe ports/core/cad/openscad/kpkgbuild

About

OpenSCAD is a solid 3D modeller in which the model is a program: a script of primitives, transformations and boolean operations, which OpenSCAD previews with OpenCSG and renders to a mesh with the Manifold or CGAL geometry kernels, then exports as STL, 3MF, OFF, DXF or SVG. The port builds the Qt 6 editor and viewer, openscad, from a commit of upstream’s main branch, with the three submodules it needs fetched as sources of their own.

Sources

Dependencies

Depends on: cmake, ninja, pkgconf, flex, bison, gettext, boost, eigen, gmp, mpfr, cgal, manifold, clipper2, onetbb, opencsg, harfbuzz, fontconfig, freetype2, glib, double-conversion, libzip, libxml2, openssl, cairo, hidapi, libspnav, lib3mf, zlib, font-liberation, mesa, libglvnd, libX11, qt6-qtbase, qt6-qt5compat, qt6-qtmultimedia, qt6-qtsvg, qt6-qtwayland, qscintilla, glu.

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.

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

What kpkg does

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

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/cad/openscad
echo 'd465b52ef63ffef7cf537278e9f1cfcdacd49296e3091b871713b358dd11f531  openscad-2026.09.27.tar.gz' | sha256sum -c -
echo '98f25152be7305263189e1167c7b65a79328b335d1cf4861f592318a36d031ae  sanitizers-cmake-bcb1fc68616e9645ca5acea2992412606373ab04.tar.gz' | sha256sum -c -
echo '7ced84a659a95454ce08b725af56331164e6b8673310e5a9a5c612576145456f  mimalloc-30b2d9d89099bee08e9f67a1ffb3e12e7ba45227.tar.gz' | sha256sum -c -
echo '3d04077d369814638c3f018fecc39439011a47f545026f43c1a465bce1773f57  MCAD-1ea402208c3127ffb443931e9bb1681c191dacca.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/openscad
SRC=$SRC_ROOT/openscad-2026.09.27
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf openscad-2026.09.27.tar.gz -C "$SRC" --strip-components=1
tar --no-same-permissions --warning=no-unknown-keyword -xf sanitizers-cmake-bcb1fc68616e9645ca5acea2992412606373ab04.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf mimalloc-30b2d9d89099bee08e9f67a1ffb3e12e7ba45227.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf MCAD-1ea402208c3127ffb443931e9bb1681c191dacca.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 _commit, _sancommit, _micommit, _mcadcommit and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

rmdir submodules/sanitizers-cmake submodules/mimalloc libraries/MCAD
mv "$SRC_ROOT/sanitizers-cmake-$_sancommit" submodules/sanitizers-cmake
mv "$SRC_ROOT/mimalloc-$_micommit" submodules/mimalloc
mv "$SRC_ROOT/MCAD-$_mcadcommit" libraries/MCAD

mkdir -p build && cd build
cmake .. -G Ninja -Wno-dev -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib \
	-DOPENSCAD_VERSION=$version \
	-DOPENSCAD_COMMIT=${_commit:0:9} \
	-DUSE_QT6=ON \
	-DHEADLESS=OFF \
	-DEXPERIMENTAL=OFF \
	-DENABLE_TESTS=OFF \
	-DENABLE_GUI_TESTS=OFF \
	-DENABLE_PYTHON=OFF \
	-DOFFLINE_DOCS=OFF \
	-DUSE_CCACHE=OFF \
	-DUSE_GLAD=ON \
	-DUSE_GLEW=OFF \
	-DENABLE_EGL=ON \
	-DENABLE_GLX=ON \
	-DENABLE_CGAL=ON \
	-DENABLE_MANIFOLD=ON \
	-DUSE_BUILTIN_MANIFOLD=OFF \
	-DUSE_BUILTIN_CLIPPER2=OFF \
	-DUSE_BUILTIN_OPENCSG=OFF \
	-DUSE_MIMALLOC=ON \
	-DENABLE_CAIRO=ON \
	-DENABLE_HIDAPI=ON \
	-DHIDAPI_INCLUDE_DIR="$(pkg-config --variable=includedir hidapi-hidraw)/hidapi" \
	-DHIDAPI_LIBRARY="$(pkg-config --variable=libdir hidapi-hidraw)/libhidapi-hidraw.so" \
	-DENABLE_SPNAV=ON \
	-DENABLE_QTDBUS=ON \
	-DENABLE_GAMEPAD=OFF \
	-DCMAKE_REQUIRE_FIND_PACKAGE_Lib3MF=ON
ninja
DESTDIR=$PKG ninja install

rm -rf "$PKG/usr/share/openscad/locale"
rm -rf "$PKG/usr/share/openscad/fonts/Liberation-2.00.1"

cat > "$PKG/usr/share/applications/openscad.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=OpenSCAD
GenericName=Script-based 3D CAD
Comment=Write solid 3D models as code and export STL, 3MF, OFF, DXF and SVG
Exec=openscad %f
Icon=openscad
Terminal=false
StartupWMClass=openscad
MimeType=application/x-openscad;
Categories=Graphics;3DGraphics;Engineering;Development;Qt;
Keywords=cad;3d;csg;script;stl;solid;model;print;openscad;
DESKTOP
chmod 644 "$PKG/usr/share/applications/openscad.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/openscad, 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 openscad-2026.09.27-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/openscad, and runs the triggers its paths call for.

Contents

Installed programs: openscad.

Installed directories: /usr/share/licenses/openscad, /usr/share/openscad.

Short descriptions

openscad script file based graphical CAD environment

Notes

The source is the archive of one commit (_commit in the recipe), not a release tarball, so every git submodule is an empty directory in it. Three of them are needed and are not ports: sanitizers-cmake, whose CMake module upstream loads with find_package(Sanitizers) on every build, sanitising or not; mimalloc; and libraries/MCAD, the OpenSCAD part library installed for scripts to use. Each is its own source = line, pinned to the submodule commit upstream records (_sancommit, _micommit, _mcadcommit), and the first lines of build.sh replace the empty directories with them. A version bump has to read the new commit’s submodule pins and update all three. The other submodules, Manifold, Clipper2 and OpenCSG, stay empty, because the switches above take all three from ports.

Two things are removed from the installed resources. locale holds the translations, which the tree’s language policy would remove in any case. fonts/Liberation-2.00.1 is upstream’s copy of the Liberation faces; the font-liberation port, in depends, installs them system-wide, and the 10-liberation.conf OpenSCAD keeps beside them still makes Liberation the default face for text in a model.