308.1. solvespace-3.2
Parametric 2D and 3D CAD with a constraint solver (Qt 6 interface)
| Version | 3.2, release 1 |
| Shelf | cad — Mechanical, architectural and 2D CAD, geometry kernels, meshing and FEM |
| Phase | 44_apps (Applications), 22 of 422 in build order |
| Licence | GPL-3.0-or-later |
| Homepage | https://solvespace.com/ |
| Build time | 1.7 SBU |
| Installed size | 13.0 MiB in 111 files |
| Recipe | ports/core/cad/solvespace/kpkgbuild |
About
SolveSpace is a parametric CAD program: a part is drawn as 2D sketches held by constraints, which its solver keeps satisfied as dimensions change, then extruded, lathed or combined into a solid and exported as DXF, STEP, STL or a mesh. The port builds its Qt 6 window, solvespace-qt, and the command-line solvespace-cli, which exports and regenerates files without a display.
Sources
solvespace-3.2.tar.xz(51.1 MiB)
sha256d93e816667b6c6f05fabc3f3cb6d783fad2a3805c46d24e28f2ebd91bc36de76
upstream: https://github.com/solvespace/solvespace/releases/download/v3.2/solvespace-3.2.tar.xz
archive copy: sources-1/cad--solvespace-3.2.tar.xz
Dependencies
Depends on: cmake, ninja, pkgconf, qt6-qtbase, qt6-qtwayland, eigen, zlib, libpng, freetype2, fontconfig, cairo, pixman, mesa, libglvnd.
Required by: no port names it.
Patches
build.sh applies these; kpkg applies nothing by itself.
eigen5-cxx14.patch— raisesCMAKE_CXX_STANDARDin the topCMakeLists.txtfrom 11 to 14. The system Eigen stops with#error Eigen requires at least c++14 support.inEigen/src/Core/util/Macros.hunder any older standard, and SolveSpace pins its standard withCMAKE_CXX_STANDARD_REQUIRED, so no compiler default can lift it.
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 solvespace'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/cad/solvespace.
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/solvespace
echo 'd93e816667b6c6f05fabc3f3cb6d783fad2a3805c46d24e28f2ebd91bc36de76 solvespace-3.2.tar.xz' | 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/solvespace
SRC=$SRC_ROOT/solvespace-3.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf solvespace-3.2.tar.xz -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 five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/eigen5-cxx14.patch"
mkdir -p build && cd build
cmake .. -G Ninja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib \
-DENABLE_GUI=ON \
-DUSE_QT_GUI=ON \
-DENABLE_CLI=ON \
-DENABLE_TESTS=OFF \
-DENABLE_OPENMP=ON \
-DENABLE_LTO=OFF \
-DFORCE_VENDORED_Eigen3=OFF \
-DEIGEN3_INCLUDE_DIRS=/usr/include/eigen3 \
-DCMAKE_DISABLE_FIND_PACKAGE_SpaceWare=ON
ninja
DESTDIR=$PKG ninja install
cat > "$PKG/usr/share/applications/solvespace-qt.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=SolveSpace
GenericName=Parametric CAD
Comment=Constraint-based 2D sketches and 3D parts
Exec=solvespace-qt %f
Icon=solvespace
Terminal=false
StartupWMClass=solvespace-qt
MimeType=application/x-solvespace;
Categories=Graphics;3DGraphics;Engineering;Qt;
Keywords=parametric;cad;2d;3d;sketch;constraint;dxf;step;stl;solvespace;
DESKTOP
chmod 644 "$PKG/usr/share/applications/solvespace-qt.desktop"
The switches, and why each is set:
-DUSE_QT_GUI=ON— build the graphical program on Qt 6 (find_package(Qt6 … OpenGLWidgets Widgets)), installed assolvespace-qt. Upstream’s default is off, which on Linux builds the GTK 3 interface through gtkmm and json-c instead.-DENABLE_GUI=ON— build a graphical program at all. It is upstream’s default, named besideUSE_QT_GUI.-DENABLE_CLI=ON— buildsolvespace-cli, upstream’s default on a native build. Because the command-line program renders through Cairo, this is what makes cairo a required dependency even with the Qt interface.-DENABLE_TESTS=OFF— leave out the test suite, which upstream builds and runs by default on a native build.-DENABLE_OPENMP=ON— parallelise the geometric operations with OpenMP. Off by default upstream.-DENABLE_LTO=OFF— no interprocedural optimisation; upstream’s default, named.-DFORCE_VENDORED_Eigen3=OFF— prefer the system Eigen to the copy underextlib/eigen. Upstream’s default, named.-DEIGEN3_INCLUDE_DIRS=/usr/include/eigen3— where the system Eigen’s headers are. SolveSpace uses the system copy only whenfind_package(Eigen3 CONFIG)leaves this variable set, and the eigen port’s package configuration defines only theEigen3::Eigentarget, not the variable; without the switch the build would fall back to the bundled copy in silence.-DCMAKE_DISABLE_FIND_PACKAGE_SpaceWare=ON— skip the search forlibspnav, the 3D-mouse library (upstream’scmake/FindSpaceWare.cmake). The search is unconditional, so without the switch the program would link libspnav whenever it happened to be in the build root, and it is not independs.
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/solvespace, 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 solvespace-3.2-1.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/solvespace, and runs the triggers its paths call for.
Contents
Installed programs: solvespace-cli, solvespace-qt.
Installed libraries: libslvs.so.
Installed directories: /usr/share/licenses/solvespace, /usr/share/solvespace.
Notes
The release archive carries its own copies of several libraries under extlib/. On Linux the build takes zlib, libpng, FreeType and Cairo from the system, and Eigen through the two switches above; the allocator, mimalloc, and the DXF library, libdxfrw, are always the bundled ones, compiled into the programs.
Upstream installs a solvespace-qt.desktop generated from res/freedesktop/solvespace.desktop.in. build.sh writes over it, adding StartupWMClass=solvespace-qt and its own comment, categories and keywords.