%global commit 2d5dfa1891ac726524495d4ca8a3461be86c12f5 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %define debug_package %{nil} Name: greedy Version: 1.3.0~alpha Release: 9%{?dist} Summary: Fast diffeomorphic image registration tool License: GPL-3.0-or-later URL: https://github.com/pyushkevich/greedy Source0: https://github.com/pyushkevich/greedy/archive/%{commit}/%{name}-%{commit}.tar.gz BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: InsightToolkit5-devel >= 5.4 BuildRequires: vtk-devel >= 9.1 # VTK transitive BuildRequires (VTK cmake config requires these at find_package time) BuildRequires: freetype-devel BuildRequires: pugixml-devel BuildRequires: fmt-devel BuildRequires: utf8cpp-devel BuildRequires: PEGTL-devel BuildRequires: jsoncpp-devel # ITK/VTK transitive BuildRequires BuildRequires: hdf5-devel BuildRequires: python3-devel BuildRequires: qt6-qtdeclarative-devel %if 0%{?fedora} BuildRequires: libminc-devel %endif # 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 Greedy is a fast diffeomorphic image registration tool that implements greedy diffeomorphic registration, an alternative to ANTs SyN. It provides comparable accuracy with significantly faster computation times and includes tools for template averaging and multi-chunk registration. %prep %setup -q -n greedy-%{commit} %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; } export CXXFLAGS="%{optflags} -std=c++17 -include cstdint -fpermissive" %cmake \ -DCMAKE_CXX_STANDARD:STRING=17 \ -DBUILD_SHARED_LIBS:BOOL=OFF \ -DGREEDY_BUILD_AS_SUBPROJECT:BOOL=OFF \ -DBUILD_TESTING:BOOL=OFF \ -DITK_DIR:PATH=%{_prefix}/lib/cmake/ITK-5.4 \ -DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON %cmake_build %install %cmake_install # Remove cmake export files generated in build dir (triggers check-files error) find %{_builddir} -name "GreedyTargets*.cmake" -delete # Remove development files — no -devel subpackage rm -rf %{buildroot}%{_includedir} rm -rf %{buildroot}%{_libdir}/cmake rm -rf %{buildroot}/usr/lib/cmake rm -f %{buildroot}%{_libdir}/*.a rm -f %{buildroot}/usr/lib/*.a rm -f %{buildroot}%{_libdir}/*.so rm -f %{buildroot}/usr/lib/*.so %files %license COPYING.txt %doc README.md %{_bindir}/greedy %{_bindir}/greedy_template_average %{_bindir}/multi_chunk_greedy %{_bindir}/greedy_propagation %changelog * Tue Oct 06 2026 Morgan Hough - 1.3.0~alpha-9 - 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. * Sat Sep 19 2026 Morgan Hough - 1.3.0~alpha-8 - Rebuild against InsightToolkit5 5.4.7-8, which unbundles Eigen3, VXL and double-conversion. No source or spec change; the Release bump is what makes the rebuild reach anyone. COPR adds a sibling at an already-published NVR rather than replacing it, and dnf then serves the older copy -- so a rebuild at the same NVR would leave this package linked against the bundled ITK while appearing to succeed. - Validated against -8 in mhough/neurofedora-itk5-test before this bump. * Sun Aug 23 2026 Morgan Hough - 1.3.0~alpha-7 - 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. * Wed Mar 18 2026 Morgan Hough - 1.3.0~alpha-4 - Remove cmake export target files from build dir (unpackaged files error) - Add VTK transitive BuildRequires (python3-devel, qt6-qtdeclarative-devel) * Wed Mar 18 2026 Morgan Hough - 1.3.0~alpha-1 - Initial package of greedy 1.3.0-alpha (git snapshot %{shortcommit}) - Built against system InsightToolkit5 and VTK with static internal libraries