# Newest tag is ver-0-4-4; master is well past it and is what the ACES tree # builds from. configure.ac says 0.4.9. %global commit 1e2850ca4bc36a003adf55597c8be7bd30cec110 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global date 20190507 Name: oobicpl Version: 0.4.9 Release: 1.%{date}git%{shortcommit}%{?dist} Summary: Object-oriented interface to bicpl, and the vertstats tools # oobicpl's own COPYING is the classic MNI/BIC permissive notice (Jason Lerch, # Steve Robbins) -- tier 1 in docs/civet-licensing.md. # # But it links libarguments, which is GPL-2.0-or-later, so the binaries this # package ships are GPL-covered. The License field states the effective licence # of the built result, which is what it is for. Same shape as the ITK/FFTW # question in docs/licensing/itk-fftw-gpl.md. License: GPL-2.0-or-later AND HPND URL: https://github.com/aces/oobicpl Source0: %{url}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz # m4/ is a git submodule (BIC-MNI/mni-acmacros) and absent from the archive. Source1: https://github.com/BIC-MNI/mni-acmacros/archive/master.tar.gz#/mni-acmacros.tar.gz # Maps the pre-VIO_ volume_io spellings this code uses onto current libminc. Source2: mni-volume-io-compat.h # A std::regex implementation of the pcre++ API this package uses -- see %%prep. Source3: oobicpl-pcrepp-stdregex.h # An infinite loop in loadOldStyleFile(): operator precedence means the column # counter never terminates. docs/upstream/oobicpl-oldstyle-hang.md Patch0: oobicpl-oldstyle-column-count-hang.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: libtool BuildRequires: make BuildRequires: arguments-devel BuildRequires: bicpl-devel BuildRequires: libminc-devel BuildRequires: netcdf-devel BuildRequires: zlib-devel Requires: bicpl Requires: minc-tools %description oobicpl is an object-oriented C++ layer over bicpl, together with the vertstats command line tools: per-vertex statistics files for cortical surfaces, and the programs that create, query, combine and map them onto objects and volumes. CIVET's surface statistics steps are built on these. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} Requires: bicpl-devel Requires: arguments-devel %description devel Headers and link-time library for building applications against %{name}. %prep %autosetup -p1 -n %{name}-%{commit} # Supply the mni-acmacros submodule that the tarball cannot carry. mkdir -p m4 tar -xf %{SOURCE1} --strip-components=1 -C m4 test -f m4/smr_WITH_BUILD_PATH.m4 # src/mniVertstatsFile.cc is the only file in the tree that uses regular # expressions, and it reaches them through pcre++ 0.9.5 (2005), a C++ wrapper # around PCRE1. Neither is a dependency worth taking: pcre++ is unpackaged in # Fedora and unmaintained for twenty years, and PCRE1 is superseded by PCRE2. # The API surface used is five methods on one class, so Source3 implements them # with std::regex and is placed ahead of the include path as pcre++.h -- the # source itself needs no edit. docs/upstream/oobicpl-pcrepp.md has the details, # including the one behavioural difference (ECMAScript rather than PCRE syntax). mkdir -p compat/volume_io cp %{SOURCE3} compat/pcre++.h # Sources here include , which libminc 2.x no # longer installs; the public header carries everything they use. Same one-line # shim conglomerate.spec puts on the include path. cat > compat/volume_io/internal_volume_io.h <<'SHIM' /* libminc 2.x installs no volume_io/internal_volume_io.h; the public header carries the same declarations for every use in this package. */ #ifndef MNI_COMPAT_INTERNAL_VOLUME_IO_H #define MNI_COMPAT_INTERNAL_VOLUME_IO_H #include #endif SHIM # ... and drop the two configure probes for the libraries we are replacing. python3 - <<'PYEOF' import re s = open('configure.ac').read() start = s.index('# the regular expression C library') end = s.index('# the arguments library') open('configure.ac', 'w').write(s[:start] + s[end:]) PYEOF ! grep -q 'pcre' configure.ac grep -q 'arguments' configure.ac %build autoreconf -ifv -I m4 # Fedora's libminc names its volume_io library libminc_io, not libvolume_io2. sed -i 's/volume_io2/minc_io/g' configure grep -q 'minc_io' configure cp %{SOURCE2} compat_minc.h export CXXFLAGS="%{optflags} -std=gnu++17 -fpermissive -I$(pwd)/compat \ -I%{_includedir}/libminc -include $(pwd)/compat_minc.h" export CFLAGS="%{optflags} -std=gnu17 -I$(pwd)/compat -I%{_includedir}/libminc \ -Wno-error=implicit-function-declaration -Wno-error=implicit-int \ -Wno-error=incompatible-pointer-types -Wno-error=int-conversion \ -include $(pwd)/compat_minc.h" %configure \ --with-minc2 \ --with-build-path=%{_prefix} \ LIBS="-larguments -lbicpl -lminc_io -lminc2 -lnetcdf -lhdf5 -lz -lm" %make_build %install %make_install find %{buildroot} -name '*.la' -delete %check # The third test, multiple_columns_file_test, is what caught the Patch0 hang: # it loads an old-style (headerless) vertstats file, which is the path that # never terminated. It must complete, so bound it rather than let a regression # sit on a builder until the build timeout. # # Upstream ships three tests of the vertstats file format, which is exactly the # code path the regex shim serves: parsing tagged headers and column names. timeout 600 make check # And confirm the shim is what got used, not a stray system pcre++. ! ldd src/.libs/liboobicpl.so | grep -q pcre %files %license COPYING %doc AUTHORS ChangeLog NEWS README TODO %{_libdir}/liboobicpl.so.* %{_bindir}/create_lines %{_bindir}/obj_colour_to_texture %{_bindir}/object_hemispheres %{_bindir}/surface_area_roi %{_bindir}/surface_probability_map %{_bindir}/surface_volume_coordinates %{_bindir}/vertstat_to_volume %{_bindir}/vertstats_average %{_bindir}/vertstats_colour_object %{_bindir}/vertstats_extract %{_bindir}/vertstats_find_peaks %{_bindir}/vertstats_info %{_bindir}/vertstats_math %{_bindir}/vertstats_stats %{_bindir}/white_cortex_validity %{_bindir}/check_white_cortex_validity %files devel %{_includedir}/*.h %{_libdir}/liboobicpl.so %changelog * Thu Sep 24 2026 Morgan Hough - 0.4.9-1.20190507git1e2850c - Initial package, the last CIVET/MNI component that can be built. pcre++ and PCRE1 are replaced by a std::regex implementation of the five methods used, so neither dead dependency is needed. License is GPL-2.0-or-later AND HPND: permissive code linked against GPL-2 libarguments.