# brainvisa-cmake -- the CMake build system of the BrainVISA suite (AIMS, # Anatomist, Axon, Morphologist, ...). Every BrainVISA component is configured # through its macros (BRAINVISA_PROJECT, BRAINVISA_FIND_PACKAGE, # BRAINVISA_ADD_SIP_PYTHON_MODULE, ...), so this is a build dependency only. # # Layout facts the spec depends on (checked against the pinned commit): # - Upstream's CMake install puts the modules in # share/brainvisa-cmake-6.0/{cmake,share,scripts}. find_package(brainvisa-cmake) # finds the config there through CMake's /share/*/cmake/ search, # and the SIP macro reads its pyproject.toml template from ../share relative # to the config, so the tree is kept exactly as upstream installs it. # - The same install also drops bv_maker, its Python package and a bash # completion into $prefix/bin, $prefix/python and $prefix/etc. bv_maker is # upstream's developer workflow (git checkouts, pixi environments, Jenkins); # packaged builds call CMake directly, so it is not shipped. bv_sip4make is: # the SIP binding rules run it to generate the bindings. # - No tags since 5.1.2; BrainVISA 6.0 builds from master. %global commit 850b6f3c2d80c6afcde81d47971d34bb55892ddc %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global snapdate 20260918 %global bvver 6.0 Name: brainvisa-cmake Version: 6.0.0^%{snapdate}git%{shortcommit} Release: 3%{?dist} Summary: CMake build system of the BrainVISA neuroimaging suite License: CECILL-B URL: https://github.com/brainvisa/brainvisa-cmake Source0: %{url}/archive/%{commit}/brainvisa-cmake-%{shortcommit}.tar.gz # bv_sip4make: read pyproject.toml with tomllib (Fedora has no python3-toml); # FindSIP: fall back to the value of SIP_EXECUTABLE, not the literal string # "$SIP_EXECUTABLE"; FindLibKDTree: look for kdtree++/kdtree.hpp, so the # system libkdtree++ is found and AIMS stops installing its bundled copy; # FindQtVersion: take moc/lupdate/lrelease from Qt 6's CMake targets (the # qmake-relative search finds none on Fedora); FindSIP: create include/ # before sip-module --sip-h; BRAINVISA_ADD_MOC_FILES: pass the compiler's # predefined macros to moc, without which Fedora's multilib qconfig.h makes # moc take Qt-5 branches. The last three were needed to build Anatomist # against the installed AIMS. All on an upstream branch by the packager. Patch0: brainvisa-cmake-sip4make-fixes.patch BuildArch: noarch BuildRequires: cmake BuildRequires: make BuildRequires: gcc-c++ BuildRequires: python3-devel Requires: cmake # bv_sip4make wraps sip-build (SIP 6) for the BrainVISA binding rules. Requires: sip6 Requires: python3 %description brainvisa-cmake is the CMake build system shared by the components of the BrainVISA neuroimaging suite: AIMS, Anatomist, Axon, Morphologist and the others. It provides the CMake macros those projects are configured with, the find modules for their dependencies, and bv_sip4make, the wrapper the SIP binding rules use to generate the Python bindings. It is needed only to build BrainVISA components. %prep %autosetup -n brainvisa-cmake-%{commit} -p1 %build # Unix Makefiles, as upstream builds: the generated rules contain shell # syntax (if [ -n "$(BRAINVISA_INSTALL_PREFIX)" ]; ...) that Ninja rejects. %cmake -G "Unix Makefiles" \ -DBRAINVISA_CMAKE_BUILD_TYPE=brainvisa-cmake-only \ -DDISABLE_FILE_INSTALLATION_LIST=YES %cmake_build %install %cmake_install # Keep the build system and the SIP wrapper; drop the bv_maker workflow. rm -rf %{buildroot}%{_prefix}/python %{buildroot}%{_prefix}/etc find %{buildroot}%{_bindir} -mindepth 1 ! -name bv_sip4make -delete sed -i '1s|^#!.*|#!%{python3}|' %{buildroot}%{_bindir}/bv_sip4make chmod 0755 %{buildroot}%{_bindir}/bv_sip4make # Helper scripts are run by CMake with an interpreter; no shebang needed. find %{buildroot}%{_datadir}/brainvisa-cmake-%{bvver} -name '*.py' -exec sed -i '1{/^#!/d}' {} + find %{buildroot}%{_datadir}/brainvisa-cmake-%{bvver} -type f -exec chmod 0644 {} + %check d=%{buildroot}%{_datadir}/brainvisa-cmake-%{bvver} test -f $d/cmake/brainvisa-cmake-config.cmake test -f $d/cmake/brainvisa-compilation.cmake test -f $d/cmake/modules/FindSIP.cmake test -f $d/share/pyproject.toml.in grep -q 'set( SIP4MAKE_EXECUTABLE "${SIP_EXECUTABLE}"' $d/cmake/modules/FindSIP.cmake grep -q 'import tomllib' %{buildroot}%{_bindir}/bv_sip4make # A project can find the build system from the installed tree. mkdir check && cd check cat > CMakeLists.txt <<'EOF' cmake_minimum_required(VERSION 3.20) project(bvcheck CXX) find_package(brainvisa-cmake REQUIRED) message(STATUS "brainvisa-cmake found in ${brainvisa-cmake_DIR}") EOF cmake -S . -B b -DCMAKE_PREFIX_PATH=%{buildroot}%{_prefix} > cmake.log 2>&1 || { cat cmake.log; exit 1; } grep "brainvisa-cmake found in %{buildroot}%{_datadir}/brainvisa-cmake-%{bvver}/cmake" cmake.log %files %license LICENCE.txt %doc README.md %{_bindir}/bv_sip4make %{_datadir}/brainvisa-cmake-%{bvver}/ %changelog * Thu Oct 15 2026 Morgan Hough - 6.0.0^20260918git850b6f3-3 - Qt 6 tools found through Qt's CMake targets, sip.h generated into a fresh build tree, and moc given the compiler's predefined macros; needed to build Anatomist on its own against brainvisa-aims-devel. * Thu Oct 15 2026 Morgan Hough - 6.0.0^20260918git850b6f3-2 - FindLibKDTree looked for kdtree.hpp directly under /usr/include and never found Fedora's libkdtree++; brainvisa-aims-devel then shipped AIMS's bundled copy in /usr/include/kdtree++, conflicting with libkdtree++-devel. * Thu Oct 15 2026 Morgan Hough - 6.0.0^20260918git850b6f3-1 - Initial package: the BrainVISA build system and bv_sip4make, for building AIMS and Anatomist. Two fixes submitted upstream (tomllib in bv_sip4make, the FindSIP fallback).