File solvespace.spec of Package solvespace
#
# spec file for package solvespace
#
# Copyright (c) 2026 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define soname 1
%define _name com.solvespace.SolveSpace
%if 0%{?suse_version} == 1600 && 0%{?is_opensuse}
%bcond_without system_eigen3
%endif
Name: solvespace
Version: @SERVICE@
Release: 0
Summary: Parametric 2d/3d CAD
License: GPL-3.0-or-later
Group: Productivity/Graphics/CAD
URL: https://github.com/solvespace/solvespace
Source0: %{name}-%{version}.tar.xz
BuildRequires: cmake
BuildRequires: desktop-file-utils
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: hicolor-icon-theme
BuildRequires: pkgconfig
BuildRequires: cmake(Qt6Core)
BuildRequires: cmake(Qt6Gui)
BuildRequires: cmake(Qt6OpenGLWidgets)
BuildRequires: cmake(Qt6Widgets)
BuildRequires: pkgconfig(cairo)
%{?with_system_eigen3:BuildRequires: pkgconfig(eigen3)}
BuildRequires: pkgconfig(fontconfig)
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(json-c)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(opengl)
BuildRequires: pkgconfig(zlib)
ExclusiveArch: %{ix86} x86_64
Provides: bundled(libdxfrw)
Provides: bundled(libmimalloc)
%description
SOLVESPACE is a free (GPLv3) parametric 3d CAD tool.
Applications include:
* modeling 3d parts — draw with extrudes, revolves, helixes and Boolean
(union / difference / intersection) operations
* modeling 2d parts — draw the part as a single section, and export DXF,
PDF, SVG; use 3d assembly to verify fit
* 3d-printed parts — export the STL or other triangle mesh expected by
most 3d printers
* preparing CAM data — export 2d vector art for a waterjet machine or
laser cutter; or generate STEP or STL, for import into third-party CAM
software for machining
* mechanism design — use the constraint solver to simulate planar or
spatial linkages, with pin, ball, or slide joints
* plane and solid geometry — replace hand-solved trigonometry and
spreadsheets with a live dimensioned drawing
%package -n libslvs%{soname}
Summary: Geometric kernel of %{name}
Group: System/Libraries
%description -n libslvs%{soname}
Parametric 2d/3d CAD.
Contains the geometric kernel of %{name}, built as a library.
%package -n libslvs-devel
Summary: Development files for libslvs
Group: Development/Libraries/C and C++
Requires: libslvs%{soname} = %{version}
%description -n libslvs-devel
Development files for libslvs including headers and libraries
%prep
%autosetup -p1
sed -i '/include(GetGitCommitHash)/s/^/#/' CMakeLists.txt
%build
%cmake_qt6 \
-DUSE_QT_GUI=ON \
-DENABLE_OPENMP=ON \
-DENABLE_LTO=ON \
%{?with_system_eigen3:-DEIGEN3_INCLUDE_DIRS=%{_includedir}/eigen3}
%{nil}
%qt6_build
%install
%qt6_install
desktop-file-edit --set-key=Categories --set-value="Graphics;3DGraphics;Engineering;" \
%{buildroot}%{_datadir}/applications/%{name}-qt.desktop
%fdupes -s %{buildroot}%{_datadir}
%check
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}-qt.desktop
%ldconfig_scriptlets -n libslvs%{soname}
%files
%doc README.md
%{_bindir}/%{name}-cli
%{_bindir}/%{name}-qt
%{_datadir}/%{name}
%{_datadir}/applications/%{name}-qt.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.??g
%{_datadir}/icons/hicolor/*/mimetypes/application-x-%{name}.??g
%{_datadir}/metainfo/%{_name}.metainfo.xml
%dir %{_datadir}/thumbnailers
%{_datadir}/thumbnailers/%{name}.thumbnailer
%{_datadir}/mime/packages/%{name}-slvs.xml
%license COPYING.txt
%files -n libslvs%{soname}
%{_libdir}/libslvs.so.*
%files -n libslvs-devel
%{_includedir}/slvs.h
%{_libdir}/libslvs.so
%changelog