# ShapeWorks is statically linked (huge unstripped binaries); debuginfo is not useful %global debug_package %{nil} # Bundled / vendored components (pinned commits) %global gc_commit 8b20898f6c7be1eab827a9f720c8fd45e58ae63c %global gc_short 8b20898 %global happly_commit 88f79725d32d78e0e637ebf42d8432d519e1c7d0 %global happly_short 88f7972 %global libigl_version 2.3.0 # Eigen: ITK's public headers include Eigen in every ITK-including translation # unit, so ShapeWorks must compile against the same Eigen as ITK. Since # InsightToolkit5 5.4.7-4 that is the system eigen3 (5.0.x), not ITK's bundled # itkeigen, which is no longer installed. Name: shapeworks Version: 6.7.0 Release: 4%{?dist} Summary: Statistical shape modeling: particle-based correspondence and PCA # ShapeWorks core: MIT. Bundled: geometry-central (MIT), happly (MIT), # libigl core (MPL-2.0) + its copyleft helpers (GPL-3.0-or-later), and in-tree # ExternalLibs (trimesh2, tinyxml, robin_hood, optparse, # ordered_map - BSD/MIT/Zlib). License: MIT AND MPL-2.0 AND GPL-3.0-or-later AND BSD-3-Clause AND Zlib URL: https://shapeworks.sci.utah.edu/ Source0: https://github.com/SCIInstitute/ShapeWorks/archive/v%{version}/ShapeWorks-%{version}.tar.gz # geometry-central pinned commit (ShapeWorks' FindGEOMETRYCENTRAL expects this old API) Source1: https://github.com/nmwsharp/geometry-central/archive/%{gc_commit}/geometry-central-%{gc_short}.tar.gz # happly is a geometry-central git submodule, absent from the archive Source2: https://github.com/nmwsharp/happly/archive/%{happly_commit}/happly-%{happly_short}.tar.gz # libigl 2.3.0: bundled full source tree (ShapeWorks' FindLIBIGL needs its cmake module) Source4: https://github.com/libigl/libigl/archive/refs/tags/v%{libigl_version}/libigl-%{libigl_version}.tar.gz # Use system libraries; disable Studio GUI (needs out-of-tree patched JKQTPlotter # Qt5 fork); relax the Python 3.12 EXACT pin and move it after project(); skip the # git-lfs sentinel; add geometry-central include dir globally. See patch comments. Patch0: shapeworks-cmake-system-libs.patch BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: ninja-build BuildRequires: make BuildRequires: chrpath BuildRequires: python3-devel BuildRequires: pybind11-devel # Core ShapeWorks dependencies BuildRequires: InsightToolkit5-devel # header-only; -static per Fedora guidelines for tracking header-only use BuildRequires: eigen3-static BuildRequires: InsightToolkit5-vtk-devel BuildRequires: vtk-devel BuildRequires: openvdb-devel BuildRequires: blosc-devel BuildRequires: imath-devel BuildRequires: tbb-devel BuildRequires: acvd-devel BuildRequires: xlnt-devel BuildRequires: boost-devel BuildRequires: json-devel BuildRequires: spdlog-devel BuildRequires: qt5-qtbase-devel BuildRequires: qt5-qtsvg-devel BuildRequires: libomp-devel BuildRequires: libminc-devel # VTK find_package() transitively resolves these at configure time BuildRequires: freetype-devel BuildRequires: pugixml-devel BuildRequires: fmt-devel BuildRequires: utf8cpp-devel BuildRequires: PEGTL-devel BuildRequires: jsoncpp-devel BuildRequires: hdf5-devel BuildRequires: double-conversion-devel BuildRequires: expat-devel BuildRequires: glew-devel BuildRequires: lz4-devel BuildRequires: libxml2-devel BuildRequires: libtiff-devel BuildRequires: libjpeg-turbo-devel BuildRequires: libpng-devel BuildRequires: libX11-devel BuildRequires: libXt-devel BuildRequires: libtheora-devel BuildRequires: libogg-devel BuildRequires: proj-devel BuildRequires: gdal-devel BuildRequires: netcdf-devel BuildRequires: netcdf-cxx-devel BuildRequires: sqlite-devel BuildRequires: libharu-devel BuildRequires: cli11-devel BuildRequires: viskores-devel BuildRequires: gl2ps-devel BuildRequires: gdcm-devel BuildRequires: qt6-qtbase-devel BuildRequires: qt6-qtdeclarative-devel # Vendored components compiled into the binaries Provides: bundled(geometry-central) = 0^git%{gc_short} Provides: bundled(happly) = 0^git%{happly_short} Provides: bundled(libigl) = %{libigl_version} Provides: bundled(trimesh2) Provides: bundled(tinyxml) Provides: bundled(robin_hood) # 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} %description ShapeWorks (SCI Institute, University of Utah) is a statistical shape modeling toolkit. It builds compact statistical models of anatomical shape populations using a particle-based optimization that places dense, corresponding landmarks across a cohort, then performs population-level PCA. It is widely used for subcortical shape analysis (complementing FSL FIRST), morphometrics, and shape-based hypothesis testing. This package provides the command-line tools and the Python API. The Qt Studio GUI is not built (it depends on an out-of-tree patched Qt5 plotting library). %package -n python3-shapeworks Summary: Python API for ShapeWorks %{?python_provide:%python_provide python3-shapeworks} Requires: %{name} = %{version}-%{release} %description -n python3-shapeworks The shapeworks_py Python module exposing the ShapeWorks Image, Mesh, Optimize, Groom and Analyze APIs for scripting shape-modeling pipelines. %package devel Summary: Development headers and CMake config for ShapeWorks Requires: %{name} = %{version}-%{release} %description devel C++ headers and CMake package configuration for building against ShapeWorks. %prep %setup -q -n ShapeWorks-%{version} %patch -P0 -p1 # --- Vendored source trees (kept out of the ShapeWorks source dir proper) --- mkdir -p _vendor # geometry-central (pinned commit) + its happly submodule tar -xzf %{SOURCE1} -C _vendor tar -xzf %{SOURCE2} -C _vendor # place happly into geometry-central's deps/happly (submodule, absent from archive) cp -a _vendor/happly-%{happly_commit}/. _vendor/geometry-central-%{gc_commit}/deps/happly/ # libigl 2.3.0 full source tree, laid out as FindLIBIGL expects: