# SlicerMarkupsToModel: build surface and tube models from markups in 3D Slicer. # One C++ loadable module (MRML node, logic, widget), built NON-superbuild against # the system 3dslicer foundation. SegmentEditorExtraEffects' Surface cut effect and # SlicerHeart call its logic from Python (slicer.modules.markupstomodel.logic()). %global commit 0be642172cbf23f2da81a2fa30f0a7fd7e0022a9 %global shortcommit %(c=%{commit}; echo ${c:0:8}) %global snapdate 20260514 %global slicer_inst %{_prefix}/lib/slicer %global slicer_subdir Slicer-5.12 Name: 3dslicer-markupstomodel Version: 0 Release: 0.1.%{snapdate}git%{shortcommit}%{?dist} Summary: Build surface and tube models from markups in 3D Slicer (MarkupsToModel) License: BSD-3-Clause URL: https://github.com/SlicerIGT/SlicerMarkupsToModel Source0: %{url}/archive/%{commit}/SlicerMarkupsToModel-%{shortcommit}.tar.gz BuildRequires: cmake >= 3.20.6 BuildRequires: ninja-build BuildRequires: gcc-c++ BuildRequires: python3-devel BuildRequires: git-core BuildRequires: 3dslicer-devel >= 5.12.4 # Full Qt6 set find_package(Slicer)'s Qt check demands. BuildRequires: cmake(Qt6Core) BuildRequires: cmake(Qt6Gui) BuildRequires: cmake(Qt6Widgets) BuildRequires: cmake(Qt6Network) BuildRequires: cmake(Qt6Sql) BuildRequires: cmake(Qt6Svg) BuildRequires: cmake(Qt6Xml) BuildRequires: cmake(Qt6OpenGL) BuildRequires: cmake(Qt6OpenGLWidgets) BuildRequires: cmake(Qt6PrintSupport) BuildRequires: cmake(Qt6Multimedia) BuildRequires: cmake(Qt6MultimediaWidgets) BuildRequires: cmake(Qt6Core5Compat) BuildRequires: cmake(Qt6StateMachine) BuildRequires: cmake(Qt6WebEngineCore) BuildRequires: cmake(Qt6WebEngineWidgets) BuildRequires: cmake(Qt6WebChannel) BuildRequires: cmake(Qt6Qml) BuildRequires: cmake(Qt6Quick) BuildRequires: cmake(Qt6QuickWidgets) BuildRequires: cmake(Qt6Test) BuildRequires: cmake(Qt6UiTools) BuildRequires: qt6-qttools-devel BuildRequires: InsightToolkit5-devel >= 5.4.6-7 BuildRequires: InsightToolkit5-vtk-devel BuildRequires: vtk-devel >= 9.6 # Defines %%vtk_abi on Fedora's vtk (via vtk-abi-compat); our vtk provides it itself. BuildRequires: vtk(abi) BuildRequires: ctk-devel BuildRequires: qttesting-devel BuildRequires: vtkAddon-devel BuildRequires: qRestAPI-devel BuildRequires: python-pythonqt-devel BuildRequires: commontk-applauncher-devel BuildRequires: dcmtk-devel BuildRequires: SlicerExecutionModel-devel BuildRequires: rapidjson-devel BuildRequires: libcurl-devel BuildRequires: jsoncpp-devel # Loading the foundation SlicerConfig.cmake triggers find_package(Teem). BuildRequires: teem-devel Requires: 3dslicer # Pin the exact VTK ABI this package was built against. VTK freezes its soname at # libvtk*.so.1 across all of 9.x, so rpm cannot tell 9.5 from 9.6 from 9.7: a consumer # built against one installs cleanly against another and fails at LOAD with undefined # symbols. %%vtk_abi comes from vtk-devel's macros.vtk; the %%build test catches a # buildroot without it (see 3dslicer-igt.spec for why the check is not at parse time). Requires: vtk(abi) = %{?vtk_abi}%{!?vtk_abi:UNSET} %description MarkupsToModel creates a model from markup points in 3D Slicer: a closed surface (Delaunay or convex hull) through the points, or a tube along a curve with an adjustable radius. The model updates live as the points move. Other extensions use its logic, among them SegmentEditorExtraEffects (Surface cut) and SlicerHeart. %prep %autosetup -n SlicerMarkupsToModel-%{commit} # Distro build: install modules directly, not as an Extension-Manager bundle, so # skip SlicerExtensionCPack (wants README/license + the s4ext description template # the install tree doesn't ship). sed -i '/include(${Slicer_EXTENSION_CPACK})/d' CMakeLists.txt ! grep -q 'Slicer_EXTENSION_CPACK' CMakeLists.txt || { echo "ERROR: CPack include left" >&2; exit 1; } # Same top-scope Qt6 shim as 3dslicer-igt and 3dslicer-extramarkups: module MRML and # Logic libraries get no Qt include path from the install-tree Slicer targets. sed -i '/^find_package(Slicer REQUIRED)/a find_package(Qt6 COMPONENTS Core Gui Widgets Xml REQUIRED)\nlink_libraries(Qt6::Core Qt6::Gui Qt6::Widgets Qt6::Xml)' CMakeLists.txt grep -q '^link_libraries(Qt6::Core' CMakeLists.txt || { echo "ERROR: Qt6 shim not applied" >&2; exit 1; } %build test -n "%{?vtk_abi}" || { echo "ERROR: vtk_abi undefined - add 'BuildRequires: vtk-devel'" >&2; exit 1; } %cmake -G Ninja \ -DSlicer_DIR:PATH=%{slicer_inst}/lib/%{slicer_subdir} \ -DBUILD_TESTING:BOOL=OFF \ -DSlicer_SKIP_SlicerBlockAdditionalLauncherSettings:BOOL=TRUE \ -DCMAKE_INSTALL_PREFIX:PATH=%{slicer_inst} %cmake_build %install %cmake_install # Catch-all file list (files + symlinks only, so the shared module dirs that # 3dslicer owns are never claimed). No headers: nothing builds against it. ( cd %{buildroot} && find . \( -type f -o -type l \) | sed 's|^\.||' ) \ | grep -v '^%{slicer_inst}/include/' > %{_builddir}/3dslicer-markupstomodel.files # The loadable module and its Python-wrapped logic must both be there: the # consumers reach the logic through slicer.modules.markupstomodel. _qlm=%{buildroot}%{slicer_inst}/lib/%{slicer_subdir}/qt-loadable-modules test -f "$_qlm/libqSlicerMarkupsToModelModule.so" || { echo "ERROR: loadable module missing" >&2; exit 1; } ls "$_qlm"/vtkSlicerMarkupsToModelModuleLogicPython*.so >/dev/null 2>&1 || ls "$_qlm"/Python/vtkSlicerMarkupsToModelModuleLogic*.py >/dev/null 2>&1 \ || { echo "ERROR: MarkupsToModel logic is not Python-wrapped" >&2; exit 1; } %files -f %{_builddir}/3dslicer-markupstomodel.files %license LICENSE %doc README.md %changelog * Sat Oct 10 2026 Morgan Hough - 0-0.1.%{snapdate}git%{shortcommit} - Initial package. SlicerMarkupsToModel built non-superbuild against the system 3dslicer.