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
freecad-1.1.3.tar.gz(93.6 MiB)
sha2564813a5cd12be05253cd40cc1dc3995b1aaa1aa06f7dfbc15c7ffa99c1c3903b7
upstream: https://github.com/FreeCAD/FreeCAD/releases/download/1.1.3/freecad_source_1.1.3.tar.gz
archive copy: sources-1/cad--freecad-1.1.3.tar.gz
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.
UnlimitedUnsigned.h-cstdint.patch— adds#include <cstdint>tosrc/Base/UnlimitedUnsigned.h, which usesint32_twithout including the header that declares it. It compiles only where some other included header happens to pull<cstdint>in.no-execinfo.patch— Remove dependency on execinfo.hpyside612-pyobjectwrapper.patch— adds#include <pyobjectwrapper.h>tosrc/Gui/PythonWrapper.cpp. The PySide6 the tree carries declaresPySide::PyObjectWrapperin that header, andsignalmanager.h, the PySide header the file already includes, does not pull it in. The file registers a converter fromPyObjectWrappertoBase::Quantity, which does not compile without the declaration.
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:
-DCMAKE_INSTALL_PREFIX=$_prefix— install into/usr/lib/freecad, which is upstream’s own default prefix on Linux. FreeCAD finds its modules relative to its executable, so the program tree stays together there, with the libraries in/usr/lib/freecad/lib(CMAKE_INSTALL_LIBDIR) and the headers in/usr/lib/freecad/include(CMAKE_INSTALL_INCLUDEDIR);build.shlinksFreeCAD,FreeCADCmdandfreecad-thumbnailer, and the lower-casefreecadandfreecadcmd, into/usr/bin.-DCMAKE_INSTALL_BINDIR=$_prefix/bin— the programs’ directory, given as an absolute path because upstream writes it into theTryExecandExeclines of the installedFreeCAD.thumbnailer, which a file manager runs to draw a.FCStdfile’s preview.-DCMAKE_INSTALL_DATADIR=/usr/share/freecad— withCMAKE_INSTALL_DATAROOTDIR=/usr/shareandCMAKE_INSTALL_DOCDIR=/usr/share/doc/freecad, put the shared data, the desktop files and icons, and the documentation under/usr/sharerather than inside the prefix. FreeCAD compiles the data and documentation directories into the program (RESOURCEDIRandDOCDIRinConfigureCMakeVariables.cmake), so these absolute paths are where it looks at run time./usr/share/doc/freecadholds the pages the About dialog shows, which is why the tree’s HTML prune leaves that directory alone.-DPython3_EXECUTABLE=/usr/bin/python3— the interpreter FreeCAD embeds and builds its modules for, and the one it runs at configure time to ask Pivy for its versions.-Dpybind11_DIR="$(python3 -m pybind11 --cmakedir)"— where pybind11’s CMake package is. The python3-pybind11 port installs it inside the Python package, where CMake does not search on its own.-DCOIN3D_VERSION="$_coin"— withCOIN3D_MAJOR_VERSION,COIN3D_MINOR_VERSIONandCOIN3D_MICRO_VERSION, Coin’s version aspkg-config --modversion Coinreports it. Left unset,SetupCoin3D.cmakereads the three numbers out ofInventor/C/basic.hwith a pattern that takes one digit for each, so a two-digit micro version is truncated. The configure then compares that with the Coin version Pivy reports (FREECAD_CHECK_PIVY, below) and stops on a mismatch.-DFREECAD_QT_VERSION=6— build against Qt 6. Upstream’s default isAuto, which takes Qt 5 when both are installed.-DBUILD_GUI=ON— the graphical program, upstream’s default, named.-DBUILD_TEST=OFF— leave out the Test workbench, and with-DENABLE_DEVELOPER_TESTS=OFFthe C++ unit-test suite. Both are on by default upstream.-DBUILD_ADDONMGR=OFF— leave out the Addon Manager, the workbench that downloads and updates third-party workbenches, macros and preference packs from FreeCAD’s addon repository on GitHub. It is on by default upstream.-DBUILD_FEM=ON— the FEM workbench, upstream’s default;-DBUILD_FEM_NETGEN=ONadds the Netgen mesher to it, which upstream builds by default only on Windows. The FEM solver it drives, calculix, is a run-time dependency.-DBUILD_DESIGNER_PLUGIN=OFF— no plugin for Qt Designer; upstream’s default, named.-DFREECAD_USE_PCL=OFF— leave out the point-cloud features built on the Point Cloud Library, which the tree does not carry. Upstream’s default, named.-DFREECAD_USE_3DCONNEXION_LEGACY=ON— on Linux, 3D-mouse support through libspnav, which is independs; it is compiled in when the library is found. It is upstream’s default.-DFREECAD_USE_FREETYPE=ON— compile the Part module’s text-to-geometry code (FT2FC.cpp, behindPart.makeWireString) against FreeType; upstream’s default, named.-DFREECAD_USE_EXTERNAL_FMT=ON— use the fmt port. When it is off or the library is not found, upstream downloads fmt’s source from GitHub during the configure, which the build’s lack of network would turn into a failure.-DFREECAD_USE_EXTERNAL_SMESH=OFF— build the SALOME SMESH mesh library from the copy undersrc/3rdParty/salomesmesh, upstream’s default. No SMESH port exists; the bundled copy reads MED files through libmed and hdf5.-DFREECAD_USE_PYSIDE=ON— link the PySide6 and, with-DFREECAD_USE_SHIBOKEN=ON, Shiboken6 libraries at build time instead of importing their Python modules at run time. Both are upstream’s defaults; upstream turns each off with only a warning when its headers are missing.-DFREECAD_CHECK_PIVY=ON— at configure time, import Pivy (the Python binding of Coin) and stop if the Coin version it was built against is not the one FreeCAD links. It is upstream’s default.-DAPPDATA_RELEASE_DATE=$_date— the release date written into the AppStream metadata. Upstream takes it fromgit login a checkout and from the day of the build otherwise, so without the switch two builds of one recipe would differ.
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.