# Feature toggles: Python bindings enabled by default %bcond_without python %global soversion 3 %global forgeurl https://github.com/elalish/manifold Version: 3.2.1 %forgemeta Name: manifold Release: %autorelease Summary: Geometry library for topological robustness # svd.h is under MIT license # https://github.com/elalish/manifold/blob/master/src/svd.h # disjoint_sets.h is under Zlib license # https://github.com/elalish/manifold/blob/master/src/disjoint_sets.h License: Apache-2.0 AND MIT AND Zlib URL: %{forgeurl} Source: %{forgesource} # Build dependencies # Manifold requires static files BuildRequires: polyclipping2-static BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: openvdb-devel >= 11 BuildRequires: pkgconfig(assimp) BuildRequires: pkgconfig(gtest) BuildRequires: pkgconfig(tbb) # Only 64 bit architectures ExclusiveArch: aarch64 x86_64 ppc64le s390x %description Manifold provides robust operations on watertight triangle meshes with guaranteed manifold output. Features include parallelized algorithms, support for arbitrary vertex attributes, and material mapping for rendering applications. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Development files for %{name}, including headers, CMake config, and pkg-config files. %if %{with python} %package -n python3-%{name}3d Summary: Python bindings for %{name} BuildRequires: python3-devel BuildRequires: python3-nanobind-devel %description -n python3-%{name}3d Python interface for %{name} geometry library %endif %prep %forgeautosetup #Use macro instead of hardcoded line sed -i "s|python|%{python3}|" \ bindings/python/CMakeLists.txt %build %cmake \ -DBUILD_SHARED_LIBS=ON \ -DCMAKE_SKIP_BUILD_RPATH=ON \ -DCMAKE_SKIP_INSTALL_RPATH=ON \ -DMANIFOLD_EXPORT=ON \ -DMANIFOLD_PAR=ON \ -DMANIFOLD_PYBIND=%{?with_python:ON}%{!?with_python:OFF} \ -DMANIFOLD_CBIND=ON %cmake_build %install %cmake_install # Disable test for s390x architectures due to # python failure %ifnarch s390x %check %ctest --test-dir %{_vpath_builddir} %endif %files %license LICENSE %doc README.md CONTRIBUTING.md %{_libdir}/libmanifold.so.%{soversion}* %{_libdir}/libmanifoldc.so.%{soversion}* %files devel %doc README.md CONTRIBUTING.md %{_includedir}/%{name}/ %{_libdir}/libmanifold.so %{_libdir}/libmanifoldc.so %{_libdir}/pkgconfig/%{name}.pc %{_libdir}/cmake/%{name}/ %if %{with python} %files -n python3-%{name}3d %license %{_licensedir}/%{name}/LICENSE %{python3_sitearch}/manifold3d.*.so %{python3_sitearch}/manifold3d.pyi %endif %changelog %autochangelog