# Disable LTO - causes linker issues with ITK on Fedora 43+ %global _lto_cflags %{nil} %global commit 3bd8e038024b5a0684bf8284d4af0ac69cc0eb3c %global shortcommit %(c=%{commit}; echo ${c:0:8}) %global snapdate 20260301 Name: SlicerExecutionModel Version: 2.0.0 Release: 0.1.%{snapdate}git%{shortcommit}%{?dist} Summary: CMake macros and tools for building 3D Slicer CLI modules # Main code: 3D-Slicer-1.0 (BSD-style) # Bundled tclap: MIT License: 3D-Slicer-1.0 AND MIT URL: https://github.com/Slicer/SlicerExecutionModel Source0: %{url}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: make BuildRequires: InsightToolkit5-devel BuildRequires: expat-devel # Bundled tclap (header-only library, Slicer-modified version) Provides: bundled(tclap) %description SlicerExecutionModel is a CMake-based project that provides macros and associated tools allowing to easily build 3D Slicer CLI (Command Line Interface) modules. These are self-describing executables that automatically generate XML descriptions of their command-line arguments, which 3D Slicer uses to construct graphical user interfaces. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} Requires: cmake Requires: InsightToolkit5-devel Requires: expat-devel %description devel Development headers, CMake config files, and the GenerateCLP tool for building applications that use %{name}. %prep %autosetup -n %{name}-%{commit} # Uncomment install-tree config generation (upstream has it as TODO) sed -i '/^#configure_file(/,/^# )/{s/^#//}' \ ModuleDescriptionParser/GenerateModuleDescriptionParserConfig.cmake %build # GCC 15 / Fedora 43+ fixes export CXXFLAGS="$(echo "%{optflags}" | sed 's/-flto=auto//') -std=c++17 -include cstdint" export CFLAGS="$(echo "%{optflags}" | sed 's/-flto=auto//') -std=gnu17" %cmake \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_TESTING=OFF \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_CXX_STANDARD_REQUIRED=ON \ -DCMAKE_SKIP_INSTALL_RPATH=ON \ -DSlicerExecutionModel_INSTALL_BIN_DIR=%{_bindir} \ -DSlicerExecutionModel_INSTALL_LIB_DIR=%{_libdir}/%{name} \ -DSlicerExecutionModel_INSTALL_NO_DEVELOPMENT=OFF \ -DSlicerExecutionModel_USE_JSONCPP=OFF \ -DSlicerExecutionModel_USE_UTF8=OFF \ -DITK_DIR=%{_prefix}/lib/cmake/ITK-5.4 %cmake_build %install %cmake_install %files %license License.txt tclap/COPYING %doc README.md NOTICE %{_libdir}/%{name}/libModuleDescriptionParser.so %files devel %{_bindir}/GenerateCLP %{_bindir}/GenerateCLPLauncher %{_includedir}/ModuleDescriptionParser/ %{_includedir}/tclap/ %dir %{_libdir}/%{name} %{_libdir}/GenerateCLP/ %{_libdir}/ModuleDescriptionParser/ %{_libdir}/tclap/ %changelog * Wed Mar 04 2026 Morgan Hough - 2.0.0-0.1.20260301git3bd8e038 - Initial package (git snapshot) - Uses system ITK 5.4.x from COPR - Bundled tclap (Slicer-modified version)