# SlicerExtraMarkups: two extra markups types for 3D Slicer. "Label" draws an # arrow with a text label; "Shape" draws parametric primitives (disk, ring, # sphere, tube, cylinder, cone, arc, ellipsoid, toroid and a set of classic # surfaces) driven by ordinary control points in slice and 3D views. # # C++ loadable modules (MRML, Logic, VTKWidgets, Widgets per module), built # NON-superbuild against the system 3dslicer foundation. No bundled external # projects. SlicerVMTK's StenosisMeasurement3D builds against the Shape MRML # library (vtkMRMLMarkupsShapeNode), so -devel ships its headers and an # install-tree ExtraMarkupsConfig.cmake. %global commit 054b1d328dfb70221615336c5961f1c786737700 %global shortcommit %(c=%{commit}; echo ${c:0:8}) %global snapdate 20260907 %global slicer_inst %{_prefix}/lib/slicer %global slicer_subdir Slicer-5.12 Name: 3dslicer-extramarkups Version: 0 Release: 0.1.%{snapdate}git%{shortcommit}%{?dist} Summary: Label and Shape markups for 3D Slicer (SlicerExtraMarkups) License: CECILL-B URL: https://github.com/chir-set/SlicerExtraMarkups Source0: %{url}/archive/%{commit}/SlicerExtraMarkups-%{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 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 SlicerExtraMarkups adds two markups node types to 3D Slicer. A Label node draws an arrow with a text label. A Shape node draws defined primitives (disk, ring, sphere, tube, cylinder, cone, arc, ellipsoid, toroid and several classic parametric surfaces) controlled by placing ordinary control points in slice and 3D views. Both are saved with the scene and reloaded. %package devel Summary: Headers and CMake config for building against SlicerExtraMarkups Requires: %{name}%{?_isa} = %{version}-%{release} Requires: 3dslicer-devel %description devel Public headers of the Label and Shape module libraries and an install-tree ExtraMarkupsConfig.cmake, so other Slicer extensions (SlicerVMTK) can find_package(ExtraMarkups) and use vtkMRMLMarkupsShapeNode. %prep %autosetup -n SlicerExtraMarkups-%{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 # vtkMRMLMarkupsLabelNode.h includes , but a module MRML library gets no # Qt include path from the install-tree Slicer targets ("fatal error: QString: No # such file or directory"). Same top-scope Qt6 shim as 3dslicer-igt. 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 # Upstream's Slicer_EXTENSION_GENERATE_CONFIG writes ExtraMarkupsConfig.cmake into # the build tree only, and the module libraries' headers are installed only with # Slicer_DEVELOPMENT_INSTALL, which Slicer never defines. Ship both for -devel: the # public headers (sources plus the generated *Export.h) under their own include # dir, and a relocatable config with the variables the build-tree one defines # (ExtraMarkups_Module{MRML,Logic,VTKWidgets,Widgets}_INCLUDE_DIRS and the per- # library _INCLUDE_DIRS) plus imported targets for the libraries. _inc=%{buildroot}%{slicer_inst}/include/%{slicer_subdir}/ExtraMarkups mkdir -p "$_inc" for _m in Label Shape; do for _k in MRML Logic VTKWidgets Widgets; do [ -d "$_m/$_k" ] || continue find "$_m/$_k" -maxdepth 1 -name '*.h' -exec cp -an {} "$_inc/" \; done done find %{_vpath_builddir} -name '*Export.h' -path '*/Label/*' -exec cp -an {} "$_inc/" \; find %{_vpath_builddir} -name '*Export.h' -path '*/Shape/*' -exec cp -an {} "$_inc/" \; test -f "$_inc/vtkMRMLMarkupsShapeNode.h" \ || { echo "ERROR: vtkMRMLMarkupsShapeNode.h not staged for -devel" >&2; exit 1; } test -f "$_inc/vtkSlicerShapeModuleMRMLExport.h" \ || { echo "ERROR: generated vtkSlicerShapeModuleMRMLExport.h not staged for -devel" >&2; exit 1; } _qlm=%{buildroot}%{slicer_inst}/lib/%{slicer_subdir}/qt-loadable-modules _libs=$(cd "$_qlm" && ls lib*.so | sed -n 's/^lib\(vtkSlicer\(Label\|Shape\)Module[A-Za-z]*\)\.so$/\1/p' | sort) test -n "$_libs" || { echo "ERROR: no ExtraMarkups module libraries in qt-loadable-modules" >&2; exit 1; } echo "ExtraMarkups libraries exported: $_libs" _cfg=%{buildroot}%{slicer_inst}/lib/%{slicer_subdir}/ExtraMarkupsConfig.cmake { cat <<'EMCFG' # Relocatable install-tree ExtraMarkupsConfig.cmake (Fedora 3dslicer-extramarkups-devel). get_filename_component(_em_libdir "${CMAKE_CURRENT_LIST_DIR}/qt-loadable-modules" ABSOLUTE) get_filename_component(_em_incdir "${CMAKE_CURRENT_LIST_DIR}/../../include/Slicer-5.12/ExtraMarkups" ABSOLUTE) foreach(_k ModuleMRML ModuleLogic ModuleVTKWidgets ModuleWidgets) set(ExtraMarkups_${_k}_INCLUDE_DIRS "${_em_incdir}") endforeach() set(ExtraMarkups_INCLUDE_DIRS "${_em_incdir}") EMCFG for _t in $_libs; do cat < "$_cfg" grep -q 'add_library(vtkSlicerShapeModuleMRML SHARED IMPORTED)' "$_cfg" \ || { echo "ERROR: ExtraMarkupsConfig.cmake lacks vtkSlicerShapeModuleMRML" >&2; exit 1; } # Runtime file list: files + symlinks only, so the shared module dirs 3dslicer # owns are never claimed; -devel takes the headers and the config. ( cd %{buildroot} && find . \( -type f -o -type l \) | sed 's|^\.||' ) \ | grep -v -e '^%{slicer_inst}/include/' -e '/ExtraMarkupsConfig\.cmake$' \ > %{_builddir}/extramarkups.files %files -f %{_builddir}/extramarkups.files %license LICENSE.txt %doc README.md %files devel %{slicer_inst}/include/%{slicer_subdir}/ExtraMarkups/ %{slicer_inst}/lib/%{slicer_subdir}/ExtraMarkupsConfig.cmake %changelog * Sat Oct 10 2026 Morgan Hough - 0-0.1.20260907git054b1d32 - Initial package. SlicerExtraMarkups (Label and Shape markups) built non-superbuild against the system 3dslicer. -devel ships the module headers and an install-tree ExtraMarkupsConfig.cmake for SlicerVMTK.