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

308.5. freecad-1.1.3

Parametric 3D CAD modeller: Part Design, Sketcher, TechDraw, FEM, CAM, BIM and Assembly

Version 1.1.3, release 4
Shelf cad — Mechanical, architectural and 2D CAD, geometry kernels, meshing and FEM
Phase 44_apps (Applications), 26 of 422 in build order
Licence LGPL-2.0-or-later
Homepage https://www.freecad.org/
Build time 5.9 SBU
Installed size 390.2 MiB in 4825 files
Recipe ports/core/cad/freecad/kpkgbuild

About

FreeCAD is a parametric 3D modeller for mechanical design: parts are built from constrained sketches and features in the Part Design and Sketcher workbenches, and other workbenches turn the same model into drawings (TechDraw), finite-element studies (FEM), toolpaths (CAM), buildings (BIM) and assemblies. It is C++ with many of its workbenches written in Python, on Qt 6 through PySide6, drawing its 3D view with Coin and modelling with OpenCASCADE.

Sources

Dependencies

Depends on: cmake, ninja, swig, boost, eigen, xerces-c, yaml-cpp, fmt, zlib, freetype2, hdf5, libmed, vtk, opencascade, coin, pivy, mesa, libglvnd, glu, python3, python3-pybind11, python3-pyside6, qt6-qtbase, qt6-qtsvg, qt6-qttools, qt6-qtwayland, numpy, matplotlib, python3-yaml, python3-ply, python3-packaging, netgen, calculix, ifcopenshell, libspnav.

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/44_apps/phase.env && kpkg install freecad'

What kpkg does

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

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/freecad
echo '4813a5cd12be05253cd40cc1dc3995b1aaa1aa06f7dfbc15c7ffa99c1c3903b7  freecad-1.1.3.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/freecad
SRC=$SRC_ROOT/freecad-1.1.3
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf freecad-1.1.3.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 _date and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

mkdir -p unpacked
tar xf "$PORT_SRC/$name-$version.tar.gz" -C unpacked
cd unpacked

patch -p1 -i "$PORT_SRC/no-execinfo.patch"
patch -p1 -i "$PORT_SRC/UnlimitedUnsigned.h-cstdint.patch"
patch -p1 -i "$PORT_SRC/pyside612-pyobjectwrapper.patch"

_coin=$(pkg-config --modversion Coin)
_prefix=/usr/lib/freecad
mkdir -p build && cd build
cmake .. -G Ninja -Wno-dev -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=$_prefix \
	-DCMAKE_INSTALL_BINDIR=$_prefix/bin \
	-DCMAKE_INSTALL_LIBDIR=lib \
	-DCMAKE_INSTALL_INCLUDEDIR=include \
	-DCMAKE_INSTALL_DATAROOTDIR=/usr/share \
	-DCMAKE_INSTALL_DATADIR=/usr/share/freecad \
	-DCMAKE_INSTALL_DOCDIR=/usr/share/doc/freecad \
	-DPython3_EXECUTABLE=/usr/bin/python3 \
	-Dpybind11_DIR="$(python3 -m pybind11 --cmakedir)" \
	-DCOIN3D_VERSION="$_coin" \
	-DCOIN3D_MAJOR_VERSION="${_coin%%.*}" \
	-DCOIN3D_MINOR_VERSION="$(echo "$_coin" | cut -d. -f2)" \
	-DCOIN3D_MICRO_VERSION="${_coin##*.}" \
	-DFREECAD_QT_VERSION=6 \
	-DBUILD_GUI=ON \
	-DBUILD_TEST=OFF \
	-DENABLE_DEVELOPER_TESTS=OFF \
	-DBUILD_ADDONMGR=OFF \
	-DBUILD_FEM=ON \
	-DBUILD_FEM_NETGEN=ON \
	-DBUILD_DESIGNER_PLUGIN=OFF \
	-DFREECAD_USE_PCL=OFF \
	-DFREECAD_USE_3DCONNEXION_LEGACY=ON \
	-DFREECAD_USE_FREETYPE=ON \
	-DFREECAD_USE_EXTERNAL_FMT=ON \
	-DFREECAD_USE_EXTERNAL_SMESH=OFF \
	-DFREECAD_USE_PYSIDE=ON \
	-DFREECAD_USE_SHIBOKEN=ON \
	-DFREECAD_CHECK_PIVY=ON \
	-DAPPDATA_RELEASE_DATE=$_date
ninja
DESTDIR=$PKG ninja install

install -d "$PKG/usr/bin"
for b in FreeCAD FreeCADCmd freecad-thumbnailer; do
	ln -s "../lib/freecad/bin/$b" "$PKG/usr/bin/$b"
done
ln -s FreeCAD "$PKG/usr/bin/freecad"
ln -s FreeCADCmd "$PKG/usr/bin/freecadcmd"

install -Dm644 "$SRC/unpacked/LICENSE" "$PKG/usr/share/licenses/$name/LICENSE"
_tp="$SRC/unpacked/src/3rdParty"
install -Dm644 "$_tp/libkdtree/COPYING" "$PKG/usr/share/licenses/$name/libkdtree-COPYING"
install -Dm644 "$_tp/lru-cache/LICENSE" "$PKG/usr/share/licenses/$name/lru-cache-LICENSE"
install -Dm644 "$_tp/GSL/LICENSE" "$PKG/usr/share/licenses/$name/GSL-LICENSE"
install -Dm644 "$_tp/OndselSolver/LICENSE" "$PKG/usr/share/licenses/$name/OndselSolver-LICENSE"
install -Dm644 "$_tp/libE57Format/LICENSE.md" "$PKG/usr/share/licenses/$name/libE57Format-LICENSE.md"
install -Dm644 "$_tp/libE57Format/extern/CRCpp/LICENSE" "$PKG/usr/share/licenses/$name/CRCpp-LICENSE"
install -Dm644 "$_tp/salomesmesh/LICENCE.lgpl.txt" "$PKG/usr/share/licenses/$name/salomesmesh-LICENCE.lgpl.txt"

cat > "$PKG/usr/share/applications/org.freecad.FreeCAD.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=FreeCAD
GenericName=Parametric CAD Modeller
Comment=Design parts and assemblies, drawings, FEM and CAM from parametric 3D models
Exec=FreeCAD --single-instance %F
Icon=org.freecad.FreeCAD
Terminal=false
StartupNotify=true
StartupWMClass=org.freecad.FreeCAD
MimeType=application/x-extension-fcstd;
Categories=Graphics;Science;Engineering;3DGraphics;Qt;
Keywords=cad;3d;parametric;modeling;sketch;step;stl;fem;cam;bim;freecad;
DESKTOP
chmod 644 "$PKG/usr/share/applications/org.freecad.FreeCAD.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/freecad, 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 freecad-1.1.3-4.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/freecad, and runs the triggers its paths call for.

Contents

Installed programs: FreeCAD, FreeCADCmd, freecad, freecad-thumbnailer, freecadcmd.

Installed directories: /usr/lib/freecad, /usr/lib/python3.14/site-packages/freecad, /usr/share/doc/freecad, /usr/share/freecad, /usr/share/licenses/freecad.

Short descriptions

OndselSolver.pc Assembly Constraints and Multibody Dynamics code

Notes

The source is the release tarball rather than the tag archive, because only the tarball carries the OndselSolver, GSL and AddonManager submodules. It has no top-level directory: its files sit at the root of the archive. kpkg strips one directory from the first source as it unpacks it, which would take the top of FreeCAD’s tree with it, so build.sh unpacks the tarball again, whole, into unpacked/ and builds there.

no-execinfo.patch carries its own description: it removes the <execinfo.h> include, which musl does not provide, from src/App/Application.cpp, and the include and the backtrace() calls from the bundled SMESH’s Basics_Utils.cpp.

The Python side is part of depends, not a vendor bundle: PySide6, Pivy, NumPy, Matplotlib, PyYAML, PLY and packaging are each a port, and ifcopenshell gives the BIM workbench its IFC import and export.

The desktop entry build.sh writes runs FreeCAD --single-instance, so opening a file from the file manager while FreeCAD is running hands it to the open window.