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
openscad-2026.09.27.tar.gz(24.2 MiB)
sha256d465b52ef63ffef7cf537278e9f1cfcdacd49296e3091b871713b358dd11f531
upstream: https://github.com/openscad/openscad/archive/cc19000e0f9c9ea761fdefd826e4811c8d55c738.tar.gz
archive copy: sources-1/cad--openscad-2026.09.27.tar.gzsanitizers-cmake-bcb1fc68616e9645ca5acea2992412606373ab04.tar.gz(7.3 KiB)
sha25698f25152be7305263189e1167c7b65a79328b335d1cf4861f592318a36d031ae
upstream: https://github.com/arsenm/sanitizers-cmake/archive/bcb1fc68616e9645ca5acea2992412606373ab04.tar.gz
archive copy: sources-1/cad--sanitizers-cmake-bcb1fc68616e9645ca5acea2992412606373ab04.tar.gzmimalloc-30b2d9d89099bee08e9f67a1ffb3e12e7ba45227.tar.gz(1.3 MiB)
sha2567ced84a659a95454ce08b725af56331164e6b8673310e5a9a5c612576145456f
upstream: https://github.com/microsoft/mimalloc/archive/30b2d9d89099bee08e9f67a1ffb3e12e7ba45227.tar.gz
archive copy: sources-1/cad--mimalloc-30b2d9d89099bee08e9f67a1ffb3e12e7ba45227.tar.gzMCAD-1ea402208c3127ffb443931e9bb1681c191dacca.tar.gz(55.6 KiB)
sha2563d04077d369814638c3f018fecc39439011a47f545026f43c1a465bce1773f57
upstream: https://github.com/openscad/MCAD/archive/1ea402208c3127ffb443931e9bb1681c191dacca.tar.gz
archive copy: sources-1/cad--MCAD-1ea402208c3127ffb443931e9bb1681c191dacca.tar.gz
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.
-DENABLE_PYTHON=OFF, line 28: python3 (explained with the switches below)-DUSE_GLEW=OFF, line 32: glew
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:
-DOPENSCAD_VERSION=$version— the version the program reports. A release tarball carries it inVERSION.txt; a commit archive has none, and without the switchcmake/Modules/openscad_version.cmaketakes the date of the build, so two builds of one recipe would report different versions.-DOPENSCAD_COMMIT=${_commit:0:9}— the commit shown beside the version. Upstream reads it fromCOMMIT.txtor fromgit log, and the unpacked archive has neither.-DUSE_QT6=ON— the interface on Qt 6, with-DHEADLESS=OFFkeeping the GUI; both are upstream’s defaults, named.-DEXPERIMENTAL=OFF— leave out the features upstream marks experimental; its default, named.-DENABLE_TESTS=OFF— skip the test suite, which upstream configures by default;-DENABLE_GUI_TESTS=OFFlikewise leaves out the special test build of the GUI.-DENABLE_PYTHON=OFF— no embedded Python interpreter, an experimental feature that is off by default upstream.-DOFFLINE_DOCS=OFF— do not download the manual at build time, which the build, with no network, could not do. It is upstream’s default, named.-DUSE_CCACHE=OFF— do not wrap the compiler in ccache, which upstream does by default when it finds it.-DUSE_GLAD=ON— load OpenGL entry points with GLAD, the loader in OpenSCAD’s own tree, and with-DUSE_GLEW=OFFnot with GLEW. Left unset, upstream picks GLAD unless the OpenCSG it finds is older than 1.6. An OpenCSG older than 1.6 links glew whatever the two switches say, because that OpenCSG itself loads OpenGL through GLEW; the opencsg port is newer, so the program carries GLAD alone.-DENABLE_EGL=ON— compile the EGL and, with-DENABLE_GLX=ON, the GLX ways of making an offscreen OpenGL context for command-line rendering. Each is used only when CMake finds it. Both are upstream’s defaults.-DENABLE_CGAL=ON— build both geometry kernels, CGAL and, with-DENABLE_MANIFOLD=ON, Manifold. Both are upstream’s defaults.-DUSE_BUILTIN_MANIFOLD=OFF— link the manifold port instead of thesubmodules/manifoldcopy, and with-DUSE_BUILTIN_CLIPPER2=OFFthe clipper2 port instead ofsubmodules/Clipper2. Upstream’s default for both is the submodule, and the commit archive carries both submodule directories empty.-DUSE_BUILTIN_OPENCSG=OFF— link the opencsg port. It is upstream’s default.-DUSE_MIMALLOC=ON— replacemallocwith mimalloc, upstream’s default. The mimalloc it uses is the submodule, which the recipe fetches at the commit upstream pins; it is built as a static library and overrides the allocator for the whole program.-DENABLE_CAIRO=ON— the PDF export, which draws through Cairo (src/io/export_pdf.cc). Upstream’s default isAUTO, which uses Cairo only if it finds it;ONmakes a missing cairo a configure error.-DENABLE_HIDAPI=ON— the HIDAPI input driver, which talks to a 3D mouse directly rather than through a daemon, as a hard requirement instead of upstream’sAUTO.-DHIDAPI_INCLUDE_DIR="$(pkg-config --variable=includedir hidapi-hidraw)/hidapi"— with-DHIDAPI_LIBRARY=…, point the HIDAPI driver at the hidraw backend. Upstream’sFindHidAPI.cmakelooks for the pkg-config nameshidapiandhidapi-libusband the libraries of those names, and the hidapi port builds onlylibhidapi-hidraw, so the finder alone does not find it.-DENABLE_SPNAV=ON— the libspnav input driver, for 3D mice through thespacenavddaemon, required instead ofAUTO.-DENABLE_QTDBUS=ON— the D-Bus input driver, which upstream describes as “not for actual devices but for remote control”: another program zooms, rotates and moves the view over D-Bus. It is upstream’s default on a GUI build.-DENABLE_GAMEPAD=OFF— no gamepad input driver. It exists only on Qt 5 (Qt5Gamepad), and upstream stops the configure with an error if it isONon Qt 6.-DCMAKE_REQUIRE_FIND_PACKAGE_Lib3MF=ON— make a missing lib3mf a configure error, so the 3MF import and export cannot drop out. It is upstream’s default, named.
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.