%bcond_without python %ifarch %{java_arches} %bcond_without java %else %bcond_with java %endif # most of the tests failed, disabled for now # https://koji.fedoraproject.org/koji/taskinfo?taskID=100720047 %bcond_with tests %global forgeurl https://github.com/f3d-app/f3d Version: 2.1.0 %forgemeta Name: f3d Release: %autorelease Summary: Fast and minimalist 3D viewer License: BSD-3-Clause URL: %{forgeurl} Source0: %{forgesource} # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: ninja-build BuildRequires: json-devel BuildRequires: cxxopts-devel BuildRequires: vtk-devel BuildRequires: lapack-devel # generate manpage BuildRequires: help2man BuildRequires: assimp-devel # imported target "draco::draco_static" references the file "/usr/lib64/libdraco.a" does not exist. # https://bugzilla.redhat.com/show_bug.cgi?id=2193023 BuildRequires: draco-static BuildRequires: alembic-devel BuildRequires: opencascade-devel BuildRequires: imath-devel BuildRequires: desktop-file-utils BuildRequires: libappstream-glib Requires: hicolor-icon-theme Requires: shared-mime-info %description F3D (pronounced `/fɛd/`) is a fast and minimalist 3D viewer. It supports many file formats, from digital content to scientific datasets (including glTF, 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. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{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/ %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 \ %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.gz %{_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.cpython-*.so %endif %if %{with java} %files java %{_libdir}/libf3d-java.so %{_javadir}/f3d.jar %endif %changelog %autochangelog