%global plugdir %{buildroot}%{_libdir}/usd/plugin # Enable Cuda Build %bcond cuda 1 Name: cycles Version: 4.3.0 Release: %autorelease Summary: The Cycles Render Engine License: Apache-2.0 URL: https://www.cycles-renderer.org/ Source0: https://projects.blender.org/blender/cycles/archive/main.tar.gz BuildRequires: cmake >= 3.10 BuildRequires: gcc-c++ BuildRequires: chrpath BuildRequires: usd-devel BuildRequires: python3-devel BuildRequires: imath-devel BuildRequires: cmake(pugixml) BuildRequires: openjpeg-devel BuildRequires: libtiff-devel BuildRequires: libpng-devel BuildRequires: cmake(OpenJPEG) BuildRequires: cmake(OpenImageDenoise) BuildRequires: libepoxy-devel BuildRequires: cmake(SDL2) BuildRequires: openshadinglanguage-common-headers Patch: usd-monolithic.patch %if %{with cuda} BuildRequires: nvidia-sdk-optix %endif %description Cycles is a path tracing renderer focused on interactivity and ease of use, while supporting many production features. %package -n usd-hdcycles Summary: Cycles Hydra Delegate Requires: cycles%{?_isa} = %{version}-%{release} Requires: usd # Needed by USD BuildRequires: tbb2020.3-devel BuildRequires: cmake(Alembic) BuildRequires: hdf5-devel BuildRequires: draco-devel BuildRequires: openshadinglanguage BuildRequires: pkgconfig(oslexec) BuildRequires: cmake(OpenImageIO) BuildRequires: libX11-devel BuildRequires: libglvnd-devel BuildRequires: opensubdiv-devel BuildRequires: openvdb-devel BuildRequires: pkgconfig(ptex) BuildRequires: cmake(OpenColorIO) BuildRequires: embree-devel BuildRequires: double-conversion-devel BuildRequires: pkgconfig(liblz4) BuildRequires: pkgconfig(libavif) %description -n usd-hdcycles Cycles Hydra Delegate %prep %autosetup -p1 -n %{name}-main rm -r lib # curl -L https://projects.blender.org/blender/cycles/pulls/1.patch | patch -p1 sed -i 's|find_package(OptiX 7.3.0)|find_package(OptiX 8.0.0)|g' \ src/CMakeLists.txt sed -i 's|"$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 7.3.0"|"$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 8.0.0"|g' \ src/cmake/Modules/FindOptiX.cmake sed -i 's|0|99|g' \ src/hydra/resources/plugInfo.json %build %if %{with cuda} export NVCC_PREPEND_FLAGS='-allow-unsupported-compiler' %endif %cmake \ -DWITH_CYCLES_STANDALONE_GUI=ON \ -DWITH_CYCLES_OSL=ON \ -DOPTIX_INCLUDE_DIR=/usr/include/optix \ -DWITH_CYCLES_CUDA_BINARIES=OFF \ -DCMAKE_SKIP_INSTALL_RPATH=YES \ -DWITH_CYCLES_NANOVDB=OFF \ -DWITH_CYCLES_HYDRA_RENDER_DELEGATE=ON \ -DWITH_CYCLES_USD=ON \ -DPXR_ROOT=/usr \ -DBUILD_SHARED_LIBS=OFF \ -DPYTHON_VERSION=%{python3_version} %cmake_build %install %cmake_install chrpath --delete %{buildroot}/usr/hydra/hdCycles.so mkdir -p %{buildroot}%{_bindir} mv %{buildroot}/usr/cycles %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_libdir}/usd/plugin mv %{buildroot}/usr/hydra/* %{buildroot}%{_libdir}/usd/plugin mkdir -p %{buildroot}/usr/share/licenses/%{name} mv %{buildroot}/usr/license/* %{buildroot}/usr/share/licenses/%{name} mkdir -p %{buildroot}%{_libdir}/%{name} mv %{buildroot}/usr/shader %{buildroot}%{_libdir}/%{name} mkdir -p %{buildroot}%{_includedir}/%{name} mv %{buildroot}/usr/source/* %{buildroot}%{_includedir}/%{name} %files /usr/share/licenses/%{name} %{_bindir}/cycles %{_libdir}/cycles %{_includedir}/%{name} %files -n usd-hdcycles %{_libdir}/usd %changelog %autochangelog