Name: anima Version: 4.2 Release: 5%{?dist} Summary: Inria medical image analysis toolbox (registration, diffusion, segmentation) # Anima public library — AGPL-3.0 (Inria). License: AGPL-3.0-or-later URL: https://github.com/Inria-Empenn/Anima-Public Source0: %{url}/archive/v%{version}/Anima-Public-%{version}.tar.gz # Forward-compat fixes for GCC 15+/ITK 5.4: legacy code that newer toolchains reject. Patch0: anima-gcc-fixes.patch # Two targets link ITK's bundled VXL by name (itkvnl), which unbundled ITK # (InsightToolkit5 >= 5.4.7-4) no longer ships; use the module's variable, # which names the right libraries in both modes. Not yet reported upstream. Patch1: anima-itk-vnl-libraries.patch BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: ninja-build # Anima superbuilds these; we use the system versions instead (no superbuild). BuildRequires: InsightToolkit5-devel BuildRequires: vtk-devel BuildRequires: boost-devel BuildRequires: NLopt-devel BuildRequires: tinyxml2-devel BuildRequires: tclap-devel # RPI ships the ITK-extension headers Anima's SVF registration needs # (itkStationaryVelocityFieldTransform, itkFixedPointInverseDisplacementField...) # in %%{_includedir}/RegistrationAddOn. The superbuild gets these from RPI. BuildRequires: RPI-devel # VTK cmake config pulls these at find_package time. BuildRequires: freetype-devel pugixml-devel fmt-devel utf8cpp-devel BuildRequires: PEGTL-devel jsoncpp-devel nlohmann-json-devel hdf5-devel BuildRequires: double-conversion-devel expat-devel glew-devel lz4-devel BuildRequires: libxml2-devel libtiff-devel libjpeg-turbo-devel libpng-devel # 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. A >= floor does not help -- 9.7.0 satisfies >= 9.6.2 -- so this is an exact # match. %%vtk_abi comes from vtk-devel's macros.vtk, so it re-pins on every rebuild. # # The missing-macro check lives in %%build, deliberately, NOT at parse time. A # parse-time %%error cannot distinguish "COPR is generating the SRPM" from "this is a # real buildroot": rpkg srpm parses the spec with no buildroot and therefore no # vtk-devel, so a parse-time guard killed every SCM build of every guarded package # before any chroot existed (python-simpleitk 10980296 failed in 0 minutes with # "can't parse specfile"). Expanding to UNSET keeps the SRPM parse alive, and the # %%build test still fails loudly in a buildroot lacking vtk-devel, so no RPM carrying # the placeholder can ever be produced. Requires: vtk(abi) = %{?vtk_abi}%{!?vtk_abi:UNSET} # itk(abi): ITK_LEGACY_REMOVE changes class layouts at unchanged sonames, so the itk_ver floor alone let a # consumer built against the removed state install over the present one (python3-simpleitk -11 on ITK -23 # returned all-zero images). Equality on the legacy-state token; see InsightToolkit5.spec. Requires: itk(abi) = %{?itk_abi}%{!?itk_abi:UNSET} %description Anima is a set of libraries and command-line tools for medical image analysis developed by the Empenn (formerly VisAGeS) team at Inria. It covers image registration, diffusion imaging (DTI/multi-compartment models, tractography), quantitative MRI (relaxometry, MR fingerprinting), segmentation and a large collection of image-processing utilities (the anima* tools). This build uses the system ITK, VTK, Boost, NLopt, TinyXML2 and TCLAP rather than the upstream superbuild. %prep %autosetup -p1 -n Anima-Public-%{version} %build # Pin the ITK layout state this build sees (see the Requires above). test -n "%{?itk_abi}" || { echo "ERROR: itk_abi undefined - needs InsightToolkit5-devel >= 5.4.7-24 (macros.itk)" >&2; exit 1; } # vtk_abi comes from vtk-devel's macros.vtk. Absent means BuildRequires: vtk-devel is # missing, and the Requires above would ship as the vacuous "vtk(abi) = UNSET". test -n "%{?vtk_abi}" || { echo "ERROR: vtk_abi undefined - add 'BuildRequires: vtk-devel'" >&2; exit 1; } # Build the inner Anima project directly (Anima/), bypassing the superbuild. mkdir -p anima-build cd anima-build cmake -GNinja ../Anima \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DCMAKE_INSTALL_LIBDIR=%{_lib} \ -DCMAKE_CXX_FLAGS="%{optflags} -fpermissive -include cstdint -I%{_includedir}/vtk -I%{_includedir}/RegistrationAddOn" \ -DCMAKE_C_FLAGS="%{optflags}" \ -DBUILD_SHARED_LIBS:BOOL=ON \ -DUSE_VTK:BOOL=ON \ -DUSE_NLOPT:BOOL=ON \ -DUSE_RPI:BOOL=OFF \ -DBUILD_ANIMA_TESTING:BOOL=OFF \ -DBUILD_ANIMA_DOCUMENTATION:BOOL=OFF \ -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=OFF \ -DCMAKE_INSTALL_RPATH='$ORIGIN:$ORIGIN/../%{_lib}/anima' cmake --build . %{?_smp_mflags} --verbose %install DESTDIR=%{buildroot} cmake --install anima-build # The private libAnima*.so libraries install to %{_libdir}/anima; binaries find # them via the baked $ORIGIN-relative RPATH. Nothing else to relocate. %check test -x %{buildroot}%{_bindir}/animaDTIEstimator %files %license License.txt %{_bindir}/anima* %dir %{_libdir}/anima %{_libdir}/anima/lib*.so %changelog * Tue Oct 06 2026 Morgan Hough - 4.2-5 - Pin the ITK layout state: Requires: itk(abi) = %%{itk_abi}, from InsightToolkit5-devel's macros.itk, plus a %%build guard. ITK -23 flipped ITK_LEGACY_REMOVE back off, which changes class layouts at unchanged sonames; this package was built against -10..-21 (legacy removed) and the itk_ver floor let it install over -23, giving silent wrong results or crashes. Rebuild against ITK >= 5.4.7-24. * Wed Sep 16 2026 Morgan Hough - 4.2-4 - Patch1: link ${ITKVNL_LIBRARIES} instead of the hardcoded itkvnl, which InsightToolkit5 5.4.7-4 and later no longer ship ("cannot find -litkvnl"; consumer test rebuild in mhough/neurofedora-itk5-test). * Tue Sep 15 2026 Morgan Hough - 4.2-3 - Rebuild to resolve an ambiguous published NVR. 4.2-2 exists TWICE in the f44 aarch64 repo, and the two copies disagree about VTK: one Requires vtk(aarch-64) 9.6.2, the other vtk(abi) 9.7. COPR does not replace a build that produced an already-published NVR, it adds a sibling, and dnf then has no version basis to prefer either -- so an install could get the VTK 9.6-era binary against a repo serving VTK 9.7, which fails at load with undefined symbols and nothing reporting a problem. - A Release bump is the reversible remedy: -3 supersedes both copies. Deleting the superseded build would also work but is permanent. * Sun Aug 23 2026 Morgan Hough - 4.2-2 - Rebuild against VTK 9.7.0. VTK here installs unversioned sonames (libvtk*.so.1), so 9.7 replaces 9.6 in place and every consumer must be rebuilt or it fails at runtime with undefined symbols. * Tue Jun 16 2026 Morgan Hough - 4.2-1 - Initial package: Anima medical image analysis tools (Inria), built against system ITK/VTK/Boost/NLopt/TinyXML2/TCLAP with the superbuild disabled.