## START: Set by rpmautospec ## (rpmautospec version 0.7.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 7; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # Use forge macros for pulling from GitHub %global forgeurl https://github.com/BlueBrain/MorphIO %global _description %{expand: MorphIO is a library for reading and writing neuron morphology files. It supports the following formats: - SWC - ASC (aka. neurolucida) - H5 v1 - H5 v2 is not supported anymore It provides 3 C++ classes that are the starting point of every morphology analysis: - Soma: contains the information related to the soma. - Section: a section is the succession of points between two bifurcations. To the bare minimum the Section object will contain the section type, the position and diameter of each point. - Morphology: the morphology object contains general information about the loaded cell but also provides accessors to the different sections. One important concept is that MorphIO is split into a read-only part and a read/write one. } %global pretty_name MorphIO # cpp tests %bcond_without tests # python tests %bcond_without pytests Name: morphio Version: 3.3.9 Release: %autorelease Summary: A python and C++ library for reading and writing neuronal morphologies %forgemeta # The entire source is Apache-2.0 except the following, which is BSD-3-Clause: # - CMake/CodeCoverage.cmake # The “effective license” remains Apache-2.0. License: Apache-2.0 AND BSD-3-Clause URL: %forgeurl Source0: %forgesource # Patches # https://github.com/sanjayankur31/MorphIO/tree/fedora-3.3.2 # Some sent upstream: https://github.com/BlueBrain/MorphIO/pull/293 # Do not let cmake use $FLAGS env var Patch: stop-them-using-a-random-env-var.patch # Remove more hard-coded compiler flags Patch: remove-upstreams-flags.patch # Add install target for the compiled python module Patch: install-python-shared-object.patch # Stop setup.py from running the cmake build, we’ll run it ourselves Patch: stop-setup.py-from-cmake-build.patch # Some Python tests are failing because “expected” results are float32 and then # promoted back to float64 for comparison with the actual results. We are not # sure why upstream is not experiencing this. Patch: pytest-float32.patch # use LIB_INSTALL_DIR which is defined by %%cmake Patch: use-lib_install_dir.patch # Allow use of external ghc_filesystem Patch: allow_use_of_external_ghc_filesystem.patch # Above patch fails with: #CMake Error at src/CMakeLists.txt:64 (target_include_directories): # Error evaluating generator expression: # # $ # # Target "ghc_filesystem" not found. # So let's circumvent CMake foo for ghc_filesystem Patch: dont_use_cmake_for_finding_ghc_filesystem.patch # Fix a test regression with pybind11 2.11.2, 2.12.1, 2.13.6+ # https://github.com/BlueBrain/MorphIO/pull/515 Patch: %{forgeurl}/pull/515.patch # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} BuildRequires: hdf5-devel BuildRequires: boost-devel %if %{with tests} BuildRequires: cmake(Catch2) < 3 %endif BuildRequires: gcc-c++ BuildRequires: cmake # Our choice: the make backend works fine too BuildRequires: ninja-build BuildRequires: lcov # Header-only libraries; -static required by guidelines for tracking BuildRequires: cmake(gsl-lite) BuildRequires: gsl-lite-static BuildRequires: cmake(highfive) BuildRequires: highfive-static BuildRequires: lexertl14-devel BuildRequires: lexertl14-static BuildRequires: cmake(ghc_filesystem) BuildRequires: gulrak-filesystem-static # We cannot currently figure out how to unbundle this: BuildRequires: cmake(pybind11) BuildRequires: pybind11-static %description %_description %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} Provides: %{name}-static = %{version}-%{release} # A gsl header is included from the public morphio/types.h header. Requires: gsl-lite-devel%{?_isa} Requires: gsl-lite-static # A HighFive header is included from the public morphio/morphology.h header. Requires: highfive-devel%{?_isa} Requires: highfive-static # Note that packages using this -devel package should ideally also BR # gsl-lite-static and highfive-static for header-only library tracking. %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %package -n python3-%{name} Summary: Python bindings for %{name} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-setuptools_scm %if %{with pytests} # tests/requirements-tests.txt BuildRequires: %{py3_dist h5py} >= 2.9.0 BuildRequires: %{py3_dist pytest} >= 6.0 BuildRequires: %{py3_dist numpy} >= 1.14.2 BuildRequires: %{py3_dist requests} >= 2.25.1 %endif # Note that this package does not depend at all on the base package (it does # not link against the shared library). %description -n python3-%{name} This package includes the Python 3 bindings for %{name}. %package doc Summary: Documentation for %{name} BuildArch: noarch %description doc This package provides documentation for %{name} %prep %autosetup -n %{pretty_name}-%{version} -p1 # Unbundle gsl-lite rm -rvf 3rdparty/GSL_LITE sed -r -i '/GSL_LITE/d' MANIFEST.in sed -r -i '/director.*\(.*(gsl-lite|GSL_LITE).*\)/d' 3rdparty/CMakeLists.txt sed -r -i \ -e '/TARGET_PROPERTY:gsl-lite,INTERFACE_INCLUDE_DIRECTORIES/d' \ -e 's/PUBLIC[[:blank:]]+gsl-lite[[:blank:]]+(PRIVATE)/\1/' \ src/CMakeLists.txt # Update includes. Note that this affects the public API headers. # # The grep-then-sed pattern means we only modify those files that need it, # preserving the mtimes on the others. grep -ErIl '#[[:blank:]]*include[[:blank:]]+["<]gsl/gsl[">]' . | xargs -r sed -r -i \ 's@(#[[:blank:]]*include[[:blank:]]+["<]gsl/gsl)([">])@\1-lite\.hpp\2@' # Unbundle lexertl rm -rvf '3rdparty/lexertl' ln -s '%{_includedir}/lexertl' '3rdparty/' # Some of these could make it into the installed package: find . -type f -name .gitignore -print -delete %build export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}' %cmake \ -DEXTERNAL_PYBIND11:BOOL=TRUE \ -DEXTERNAL_HIGHFIVE:BOOL=TRUE \ -DEXTERNAL_GHC_FILESYSTEM:BOOL=TRUE \ -DMORPHIO_USE_DOUBLE:BOOL=TRUE \ -DBUILD_BINDINGS:BOOL=TRUE \ -DMorphIO_CXX_WARNINGS:BOOL=FALSE \ -DMORPHIO_TESTS:BOOL=%{?with_tests:TRUE}%{?!with_tests:FALSE} \ -DEXTERNAL_CATCH2:BOOL=TRUE \ -DMORPHIO_ENABLE_COVERAGE:BOOL=TRUE \ -DMORPHIO_USE_DOUBLE:BOOL=TRUE \ -DMORPHIO_VERSION_STRING:STRING="%{version}" \ -GNinja \ -Wno-dev %cmake_build # Build pure python bits %py3_build %install export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}' %cmake_install # Install pure python bits %py3_install # Move module to sitearch so that the binding can be correctly imported. if [ '%{python3_sitelib}' != '%{python3_sitearch}' ] then mv -v %{buildroot}%{python3_sitelib}/%{name}/* \ %{buildroot}%{python3_sitearch}/%{name} mv -v %{buildroot}%{python3_sitelib}/%{name}*egg-info \ %{buildroot}%{python3_sitearch}/ fi %check export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}' %if %{with tests} # From ci/cpp_test.sh %ctest -VV %endif %if %{with pytests} # We will change directories so that the “un-built” package is not imported xdir="$(basename "${PWD}")" # From ci/python_test.sh cd .. # Fetches from the Internet: k='not test_v2' # Still fails in 3.3.6 # TODO: Is this a real problem? The answer is only slightly outside tolerances. # # > assert_array_almost_equal(neuron.markers[0].points, # np.array([[81.58, -77.98, -20.32]], dtype=np.float32)) # E AssertionError: # E Arrays are not almost equal to 6 decimals # E # E Mismatched elements: 2 / 3 (66.7%) # E Max absolute difference: 3.35693359e-06 # E Max relative difference: 4.30486464e-08 # E x: array([[ 81.58, -77.98, -20.32]]) # E y: array([[ 81.58, -77.98, -20.32]], dtype=float32) k="${k} and not test_neurolucida_markers" # Still fails to 3.3.6 # TODO: Is this a real problem? The answer is only slightly outside tolerances. # # > assert_array_equal(m.markers[0].points, np.array([[ -0.97 , -141.169998, 84.769997]], # dtype=np.float32)) # E AssertionError: # E Arrays are not equal # E # E Mismatched elements: 3 / 3 (100%) # E Max absolute difference: 3.35693359e-06 # E Max relative difference: 3.96004922e-08 # E x: array([[ -0.97, -141.17, 84.77]]) # E y: array([[ -0.97, -141.17, 84.77]], dtype=float32) k="${k} and not test_marker_with_string" # In the same vein as above, failing since 3.3.6 k="${k} and not test_mitochondria" k="${k} and not test_mitochondria_read" # TODO: pytest segfaults while writing a temporary file.. k="${k} and not test_dendritic_spine_round_trip_empty_postsynaptic_density" %pytest "${xdir}/tests" -k "${k}" -v %endif %files %license LICENSE.txt %{_libdir}/libmorphio.so.0.0.0 %files devel %{_includedir}/%{name} %{_libdir}/libmorphio.so %{_libdir}/cmake/%{pretty_name} %files -n python3-%{name} %license LICENSE.txt %{python3_sitearch}/%{name} %{python3_sitearch}/%{name}-%{version}-py%{python3_version}.egg-info %files doc %license LICENSE.txt %doc AUTHORS.txt CHANGELOG.md CONTRIBUTING.md README.rst examples %changelog ## START: Generated by rpmautospec * Thu Nov 21 2024 Benjamin A. Beasley - 3.3.9-7 - Fix a test regression with pybind11 2.11.2, 2.12.1, 2.13.6+ * Fri Oct 25 2024 Orion Poplawski - 3.3.9-6 - Rebuild for hdf5 1.14.5 * Mon Aug 26 2024 Benjamin A. Beasley - 3.3.9-5 - Rebuilt with lexertl14-0.1.0^20240506gitbca1359 * Thu Jul 18 2024 Fedora Release Engineering - 3.3.9-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Sat Jun 08 2024 Python Maint - 3.3.9-3 - Rebuilt for Python 3.13 * Wed Apr 24 2024 Packit - 3.3.9-1 - Update to 3.3.9 upstream release - Resolves: rhbz#2276897 * Thu Jan 25 2024 Fedora Release Engineering - 3.3.7-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Sun Jan 21 2024 Fedora Release Engineering - 3.3.7-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Tue Dec 12 2023 Sandro - 3.3.7-2 - Additional changes for 3.3.7 - Change license to Apache-2.0 (follow upstream) - Remove obsolete patches (merged upstream) - Amend remaining patches as required - New license is in `LICENSE.txt` - Add `AUTHORS.txt` to doc sub package * Mon Dec 11 2023 Packit - 3.3.7-1 - [packit] 3.3.7 upstream release - Resolves rhbz#2253995 * Fri Sep 22 2023 Sandro - 3.3.6-6 - Include the actual patch * Fri Sep 22 2023 Sandro - 3.3.6-5 - Rebase patch onto 3.3.6 * Fri Sep 22 2023 Sandro - 3.3.6-4 - Make test more robust and increase verbosity * Tue Sep 19 2023 Sandro - 3.3.6-3 - Stop building for i686 * Tue Sep 19 2023 Sandro - 3.3.6-2 - Add Packit config * Tue Sep 19 2023 Sandro - 3.3.6-1 - Update to 3.3.6 (RHBZ#2161602) - Use forge macros - Drop patch numbering - Refresh patches - Unbundle ghc_filesystem (gulrak-filesytem) - Untie ghc_filesystem from CMake * Tue Sep 19 2023 Sandro - 3.3.4-1 - Update to 3.3.4 (RHBZ#2161602) - Update 0007-pytest-float32.patch * Mon Sep 04 2023 Benjamin A. Beasley - 3.3.3-8 - Rebuild with lexertl14-0.1.0^20230826git5bd3180 * Thu Jul 20 2023 Fedora Release Engineering - 3.3.3-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Wed Jul 12 2023 Python Maint - 3.3.3-6 - Rebuilt for Python 3.12 * Fri Mar 10 2023 Benjamin A. Beasley - 3.3.3-5 - Use the catch2 v2 compat package as needed (close RHBZ#2176133) * Thu Jan 19 2023 Fedora Release Engineering - 3.3.3-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Thu Jul 21 2022 Fedora Release Engineering - 3.3.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Tue Jun 14 2022 Python Maint - 3.3.3-2 - Rebuilt for Python 3.11 * Thu Mar 03 2022 Ankur Sinha (Ankur Sinha Gmail) - 3.3.3-1 - feat: update to 3.3.3 (fixes rhbz#2060432) * Thu Mar 03 2022 Ankur Sinha (Ankur Sinha Gmail) - 3.3.2-3 - feat: clean up spec * Mon Feb 28 2022 Benjamin A. Beasley - 3.3.2-2 - Rebuild for lexertl14 cd5a1f1 (Unicode 15) * Mon Feb 21 2022 Ankur Sinha (Ankur Sinha Gmail) - 3.3.2-1 - feat: update to 3.3.2 (fixes rhbz#2021598) * Thu Jan 20 2022 Fedora Release Engineering - 3.3.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Sun Nov 21 2021 Orion Poplawski - 3.3.0-3 - Rebuild for hdf5 1.12.1 * Fri Nov 05 2021 Benjamin A. Beasley - 3.3.0-2 - Rebuild with gsl-lite 0.40.0 * Wed Aug 25 2021 Benjamin A. Beasley - 3.3.0-1 - Update to 3.3.0 - Use cmake(…) dependencies where appropriate - Unbundle lexertl14 - Remove ExcludeArch on i686 and armv7hl since these are fixed in highfive (and an additional problem on armv7hl is fixed here) - Add license files to -doc subpackage; drop text doc files from others - Enable Sphinx documentation (with an alternative theme) - Use SETUPTOOLS_SCM_PRETEND_VERSION instead of a local git repo - Enable Python tests - Add header-only dependencies present in the public API to the -devel package * Thu Jul 22 2021 Fedora Release Engineering - 3.0.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Fri Jun 04 2021 Python Maint - 3.0.2-2 - Rebuilt for Python 3.10 * Thu Apr 22 2021 Ankur Sinha - 3.0.2-1 - Add excludearch because of highfive - do not carry licenses in devel package, since it depends on the main package already * Wed Apr 21 2021 Ankur Sinha - 3.0.2-1 - Enable tests * Sat Apr 17 2021 Ankur Sinha - 3.0.2-1 - Initial build ## END: Generated by rpmautospec