# 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.4.%{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 in MDP (upstream has it as TODO) sed -i '/^#configure_file(/,/^# )/{s/^#//}' \ ModuleDescriptionParser/GenerateModuleDescriptionParserConfig.cmake # GenerateCLP/CMakeLists.txt installs ${BINARY_DIR}/GenerateCLPConfig.cmake_install # and UseGenerateCLP.cmake_install, but upstream never produces those files. # Append two configure_file calls so the install rule has something to install. cat >> GenerateCLP/GenerateGenerateCLPConfig.cmake <<'EOF' # Fedora packaging: produce install-tree config + use file (upstream omits these). configure_file(${GenerateCLP_SOURCE_DIR}/GenerateCLPInstallConfig.cmake.in ${GenerateCLP_BINARY_DIR}/GenerateCLPConfig.cmake_install @ONLY) configure_file(${GenerateCLP_SOURCE_DIR}/UseGenerateCLP.cmake.in ${GenerateCLP_BINARY_DIR}/UseGenerateCLP.cmake_install @ONLY) EOF %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 %dir %{_libdir}/%{name} %{_libdir}/%{name}/libModuleDescriptionParser.so %files devel %{_bindir}/GenerateCLP %{_bindir}/GenerateCLPLauncher %{_includedir}/ModuleDescriptionParser/ %dir %{_libdir}/%{name} # Note: cmake configs install under /usr/lib/ (not %{_libdir} = /usr/lib64/) # because GenerateCLP/CMakeLists.txt hardcodes "lib/" without LIB_SUFFIX. %{_prefix}/lib/GenerateCLP/ %{_prefix}/lib/ModuleDescriptionParser/ %changelog * Tue May 05 2026 Morgan Hough - 2.0.0-0.4.20260301git3bd8e038 - Fix %%files: cmake configs install to /usr/lib/ (not %%{_libdir}=/usr/lib64/), drop nonexistent tclap install dirs (tclap is header-only bundled, not exported) * Tue May 05 2026 Morgan Hough - 2.0.0-0.3.20260301git3bd8e038 - Append explicit configure_file blocks to GenerateGenerateCLPConfig.cmake for GenerateCLPConfig.cmake_install and UseGenerateCLP.cmake_install (upstream's CMakeLists installs these files but never produces them) * Mon May 04 2026 Morgan Hough - 2.0.0-0.2.20260301git3bd8e038 - Extend configure_file uncomment to GenerateCLP/Generate*Config.cmake (fixes "file INSTALL cannot find GenerateCLPConfig.cmake_install") * 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)