%bcond_without python %ifarch %{java_arches} %bcond_without java %else %bcond_with java %endif # most of the tests failed, disabled for now %bcond_with tests %global forgeurl https://github.com/f3d-app/f3d Version: 2.3.0 %forgemeta Name: f3d Release: %autorelease Summary: Fast and minimalist 3D viewer License: BSD-3-Clause URL: %{forgeurl} Source0: %{forgesource} # Add missing header for GCC 14 Patch0: https://github.com/f3d-app/f3d/pull/1225.patch BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: ninja-build BuildRequires: json-devel BuildRequires: cxxopts-devel BuildRequires: vtk-devel BuildRequires: lapack-devel BuildRequires: assimp-devel BuildRequires: cmake(draco) BuildRequires: draco-static BuildRequires: alembic-devel BuildRequires: opencascade-devel #BuildRequires: cmake(pxr) BuildRequires: imath-devel BuildRequires: help2man BuildRequires: desktop-file-utils BuildRequires: libappstream-glib Requires: hicolor-icon-theme Requires: shared-mime-info %description F3D is a fast and minimalist 3D viewer desktop application. It supports many file formats, from digital content to scientific datasets (including glTF, USD, STL, STEP, PLY, OBJ, FBX, Alembic), can show animations and support thumbnails and many rendering and texturing options including real time physically based rendering and raytracing. It is fully controllable from the command line and support configuration files. It can provide thumbnails, support interactive hotkeys, drag&drop and integration into file managers. F3D also contains the libf3d, a simple library to render meshes, with C++ and Python Bindings, as well as experimental Java and Javascript bindings. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel This package contains development files for %{name}. %if %{with python} %package python3 Summary: Python 3 bindings for the %{name} BuildRequires: python3-devel BuildRequires: python3-pybind11 Requires: %{name}%{?_isa} = %{version}-%{release} Provides: python3-%{name} = %{version}-%{release} %description python3 This package contains Python 3 bindings for %{name}. %endif %if %{with java} %package java Summary: Java bindings for the %{name} BuildRequires: javapackages-tools BuildRequires: java-devel Requires: javapackages-tools Requires: %{name}%{?_isa} = %{version}-%{release} %description java This package contains Java bindings for %{name}. %endif %prep %forgeautosetup -p1 # remove bundled libraries of cxxopts and nlohmann_json rm -rf external/ # fix install location for -java sub-package sed -i 's|${CMAKE_INSTALL_LIBDIR}|${CMAKE_INSTALL_LIBDIR}/f3d|' java/CMakeLists.txt sed -i 's|share/java|%{_jnidir}|' java/CMakeLists.txt %build %cmake \ -GNinja \ -DCMAKE_BUILD_TYPE=Release \ -DF3D_PLUGINS_STATIC_BUILD=OFF \ -DF3D_PLUGINS_INSTALL_DIR=%{_libdir}/f3d/plugins \ -DF3D_USE_EXTERNAL_CXXOPTS=ON \ -DF3D_USE_EXTERNAL_NLOHMANN_JSON=ON \ -DF3D_LINUX_INSTALL_DEFAULT_CONFIGURATION_FILE_IN_PREFIX=ON \ -DF3D_LINUX_GENERATE_MAN=ON \ -DF3D_MODULE_RAYTRACING=OFF \ -DF3D_MODULE_EXTERNAL_RENDERING=OFF \ -DF3D_PLUGIN_BUILD_ALEMBIC=ON \ -DF3D_PLUGIN_BUILD_ASSIMP=ON \ -DF3D_PLUGIN_BUILD_DRACO=ON \ -DF3D_PLUGIN_BUILD_EXODUS=ON \ -DF3D_PLUGIN_BUILD_OCCT=ON \ -DF3D_PLUGIN_BUILD_USD=OFF \ -DF3D_PLUGIN_OCCT_COLORING_SUPPORT=ON \ -DF3D_PLUGIN_BUILD_VDB=OFF \ %if %{with python} -DF3D_BINDINGS_PYTHON=ON \ %endif %if %{with java} -DF3D_BINDINGS_JAVA=ON \ %endif %if %{with check} -DBUILD_TESTING=ON \ %endif -DCMAKE_SKIP_INSTALL_RPATH=ON \ %cmake_build %install %cmake_install %cmake_install --component mimetypes %cmake_install --component sdk %cmake_install --component configuration rm -r %{buildroot}%{_datadir}/doc/F3D rm %{buildroot}%{_libdir}/libVTKExtensions*.a %check %if %{with tests} %ctest %endif desktop-file-validate %{buildroot}/%{_datadir}/applications/*.desktop appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.metainfo.xml %files %license LICENSE.md %doc README.md %{_bindir}/f3d %{bash_completions_dir}/f3d %{zsh_completions_dir}/_f3d %{fish_completions_dir}/f3d.fish %{_datadir}/icons/hicolor/*/apps/f3d.png %{_datadir}/icons/hicolor/scalable/apps/f3d.svg %{_datadir}/applications/f3d-plugin-*.desktop %{_datadir}/applications/f3d.desktop %{_datadir}/mime/packages/f3d-*.xml %dir %{_datadir}/f3d %dir %{_datadir}/f3d/configs %dir %{_datadir}/f3d/configs/config.d %dir %{_datadir}/f3d/configs/thumbnail.d %dir %{_datadir}/f3d/plugins %{_datadir}/f3d/configs/config.d/*.json %{_datadir}/f3d/configs/thumbnail.d/*.json %{_datadir}/f3d/plugins/*.json %{_datadir}/thumbnailers/f3d-plugin-*.thumbnailer %{_mandir}/man1/f3d.1* %{_metainfodir}/app.f3d.F3D.metainfo.xml %{_libdir}/libf3d.so.2* %dir %{_libdir}/f3d %dir %{_libdir}/f3d/plugins %{_libdir}/f3d/plugins/libf3d-plugin-*.so %files devel %{_libdir}/libf3d.so %dir %{_includedir}/f3d %{_includedir}/f3d/*.h %dir %{_libdir}/cmake/f3d %{_libdir}/cmake/f3d/*.cmake %{_libdir}/cmake/f3d/*.in %if %{with python} %files python3 %{python3_sitearch}/f3d/ %endif %if %{with java} %files java %{_libdir}/f3d/libf3d-java.so %{_jnidir}/f3d.jar %endif %changelog %autochangelog