# NOTE: Please update also the version and rebuild yafaray if blender is updated # LTS versioning infos: https://www.blender.org/download/lts/ # branch: blender3.3.1 # commit: b292cfe5a936f816f9a3567b39995ba3c7b82f8a # comment out when not git-snapshot %define git git20240226 # # use 'define gitfinal 1' if the git-snapshot is also a final release # comment out 'define gitfinal' when the git-snapshot is not a final release %define gitfinal 1 # default to build with OSL %define oslapi 1.11 %bcond_without openshading # default to build with opensubdiv %bcond_without opensubdiv # build with embree and oidn only available on x86_64 arch %ifarch x86_64 %bcond_without embree %bcond_without oidn %else %bcond_with embree %bcond_with oidn %endif # build with openxr support %bcond_without openxr # build with/without usd support # (https://docs.blender.org/manual/en/3.3/files/import_export/usd.html) # # Note that it's not said that the latest USD works as the one to be bundled with this # blender package. Please check it matches with blender upstream version of USD lib (or pretty close) # before updating. # Note also that the USD lib is patched with internal blender's usd.diff patch, before being used with # blender. %define usdver 22.05b %ifnarch %{arm} %{ix86} #aarch64 %bcond_without usd # the usd support is provided through a bundled library # (without = use usd as bundled, with = use usd as system shared lib) %bcond_without usd_bundled %else # disable USD for armv7 and aarch64 %bcond_with usd %bcond_with usd_bundled %endif %define rel 1 Name: blender Version: 3.3.16 Release: %mkrel %{?git:%{?gitfinal:%{rel}}%{!?gitfinal:0.%git.%{rel}}} Summary: A fully functional 3D modeling/rendering/animation package License: GPLv2+ Group: Graphics/3D URL: https://www.blender.org/ Source0: https://download.blender.org/source/%{name}-%{version}%{?git:-%git}.tar.%{?git:gz}%{!?git:xz} # Script to download and update to git branch 3.3 build the tarball Source1: get_git_blender-3.3_and_build_tgz.sh # internal USD library Source10: https://github.com/PixarAnimationStudios/USD/archive/v%{usdver}/USD-%{usdver}.tar.gz Source11: build_usd_bundled.sh # https://github.com/PixarAnimationStudios/USD/issues/1592 Source12: USD-22.05b-disable-malloc-hooks.patch # Source13: USD-22.05b-fix-array.patch # Patch0: blender-2.93-localedir.patch Patch2: blender-2.82-static-lib.patch Patch5: blender-2.80-sse2.patch #Patch6: blender-2.83-link.patch Patch7: blender-2.80-add-blenderplayer-manpage.patch #Patch8: blender-2.93-fix-non-sse-build.patch Patch9: blender-2.93-embree3-shared.patch # fix internal usb.diff against USD-22.05b Patch10: fix-usb-diff.patch # Upstream patches (100-200) # # Blender doesn't officially support 32-bit build since 2.80. See also: # https://developer.blender.org/T67184 ExcludeArch: %{arm} BuildRequires: cmake BuildRequires: git-core BuildRequires: boost-devel BuildRequires: ffmpeg-devel BuildRequires: libgomp-devel BuildRequires: lzo-devel %if %{with embree} BuildRequires: embree3-devel %endif %if %{with opensubdiv} BuildRequires: opensubdiv-devel %endif %if %{with openshading} BuildRequires: openshadinglanguage%{oslapi} BuildRequires: libopenshadinglanguage%{oslapi}-devel %endif %if %{with oidn} BuildRequires: cmake(OpenImageDenoise) %endif %if %{with openxr} BuildRequires: pkgconfig(openxr) %endif %if %{without usd_bundled} && %{with usd} BuildRequires: usd-devel %endif BuildRequires: libharu-devel # versions < 7.0.0 have linkage problems BuildRequires: openvdb-devel >= 7.0.0 BuildRequires: potrace-devel BuildRequires: python3-numpy-devel BuildRequires: spnav-devel BuildRequires: cmake(Alembic) BuildRequires: cmake(OpenCOLLADA) BuildRequires: pkgconfig(audaspace) BuildRequires: pkgconfig(eigen3) BuildRequires: pkgconfig(fftw3) BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(glew) BuildRequires: pkgconfig(glu) BuildRequires: pkgconfig(gmp) BuildRequires: pkgconfig(gmpxx) BuildRequires: pkgconfig(jack) BuildRequires: pkgconfig(jemalloc) BuildRequires: pkgconfig(libjpeg) BuildRequires: pkgconfig(libopenjp2) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(libtiff-4) BuildRequires: pkgconfig(libzstd) BuildRequires: pkgconfig(OpenColorIO) >= 2.0 BuildRequires: pkgconfig(OpenEXR) BuildRequires: pkgconfig(OpenImageIO) BuildRequires: pkgconfig(openal) BuildRequires: pkgconfig(opus) BuildRequires: pkgconfig(python3) >= 3.9 BuildRequires: pkgconfig(samplerate) BuildRequires: pkgconfig(sdl2) BuildRequires: pkgconfig(sndfile) BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xi) BuildRequires: pkgconfig(xxf86vm) BuildRequires: python3dist(requests) Requires: python(abi) >= 3.9 Requires: python3dist(requests) Requires: python3dist(numpy) Requires: python3dist(audaspace) Requires(post,preun): GConf2 %description Blender is the in-house software of a high quality animation studio. It has proven to be an extremely fast and versatile design instrument. The software has a personal touch, offering a unique approach to the world of three dimensions. Blender can be used to create TV commercials, to make technical visualizations or business graphics, to do some morphing, or to design user interfaces. Developers can easily build and manage complex environments. The renderer is versatile and extremely fast. All basic animation principles (curves and keys) are implemented. %prep %setup -q -n %{name}-%{version}%{?git:-%git} %autopatch -p1 find -name '.svn' -print | xargs rm -rf %build export LD=%{_bindir}/ld.gold # build internal USD lib %if %{with usd_bundled} export BUNDLED_LIBDIRS=$(pwd)/libraries install -m 755 %{SOURCE11} . ./build_usd_bundled.sh \ --target ${BUNDLED_LIBDIRS} \ --source %{SOURCE10} \ --patch %{SOURCE12} \ --patch2 $(pwd)/build_files/build_environment/patches/usd.diff \ --patch3 %{SOURCE13} \ --version %{usdver} \ --libdir %{_libdir} \ --cxxflags "%{optflags}" %endif %ifarch %{ix86} # build non-sse flavour %cmake \ -DCMAKE_SKIP_RPATH:BOOL=ON \ -DBUILD_SHARED_LIBS:BOOL=OFF \ -DOpenGL_GL_PREFERENCE=GLVND \ -DWITH_INSTALL_PORTABLE:BOOL=OFF \ -DWITH_PYTHON:BOOL=ON \ -DPYTHON_VERSION:STRING=%{python3_version} \ -DWITH_PYTHON_INSTALL:BOOL=OFF \ -DWITH_CODEC_FFMPEG:BOOL=ON \ -D_ffmpeg_INCLUDE_DIR=%{_includedir} \ -DWITH_CODEC_SNDFILE:BOOL=ON \ -DWITH_IMAGE_OPENJPEG:BOOL=ON \ -DWITH_OPENCOLLADA:BOOL=ON \ -DWITH_FFTW3:BOOL=ON \ -DWITH_MOD_OCEANSIM:BOOL=ON \ -DWITH_CYCLES:BOOL=ON \ %if %{with embree} -DWITH_CYCLES_EMBREE:BOOL=ON \ %else -DWITH_CYCLES_EMBREE:BOOL=OFF \ %endif %if %{with openshading} -DWITH_CYCLES_OSL:BOOL=ON \ %endif %if %{with opensubdiv} -DWITH_OPENSUBDIV:BOOL=ON \ %endif %if %{with oidn} -DWITH_OPENIMAGEDENOISE:BOOL=ON \ %else -DWITH_OPENIMAGEDENOISE:BOOL=OFF \ %endif %if %{with openxr} -DWITH_XR_OPENXR:BOOL=ON \ %endif %if %{with usd} -DWITH_USD:BOOL=ON \ %endif %if %{with usd_bundled} -DUSD_LIBRARY:FILEPATH=${BUNDLED_LIBDIRS}/usd/lib/libusd_usd_m.a \ -DUSD_INCLUDE_DIR:FILEPATH=${BUNDLED_LIBDIRS}/usd/include \ %else -DUSD_LIBRARY=%{_libdir}/libusd_usd_ms.so \ %endif -DWITH_CXX_GUARDEDALLOC:BOOL=OFF \ -DWITH_MEM_JEMALLOC:BOOL=ON \ -DWITH_OPENCOLORIO:BOOL=ON \ -DWITH_SDL:BOOL=ON \ -DWITH_ALEMBIC:BOOL=ON \ -DWITH_OPENVDB:BOOL=ON \ -DWITH_OPENVDB_BLOSC:BOOL=ON \ -DWITH_DOC_MANPAGE:BOOL=ON \ -DWITH_INPUT_NDOF:BOOL=ON \ -DWITH_SYSTEM_AUDASPACE:BOOL=ON \ -DWITH_SYSTEM_EIGEN3:BOOL=ON \ -DWITH_SYSTEM_LZO:BOOL=ON \ -DWITH_SYSTEM_GLEW:BOOL=ON \ -DWITH_CPU_SIMD:BOOL=OFF \ -DCXX_HAS_SSE:BOOL=OFF \ -DCXX_HAS_AVX:BOOL=OFF \ -DCXX_HAS_AVX2:BOOL=OFF \ -DSUPPORT_SSE2_BUILD:BOOL=OFF \ -DSUPPORT_SSE_BUILD:BOOL=OFF \ -DWITH_JACK:BOOL=ON %cmake_build mv %{_vpath_builddir} non-sse %endif #build sse flavour %cmake \ -DCMAKE_SKIP_RPATH:BOOL=ON \ -DBUILD_SHARED_LIBS:BOOL=OFF \ -DOpenGL_GL_PREFERENCE=GLVND \ -DWITH_INSTALL_PORTABLE:BOOL=OFF \ -DWITH_PYTHON:BOOL=ON \ -DPYTHON_VERSION:STRING=%{python3_version} \ -DWITH_PYTHON_INSTALL:BOOL=OFF \ -DWITH_CODEC_FFMPEG:BOOL=ON \ -D_ffmpeg_INCLUDE_DIR=%{_includedir} \ -DWITH_CODEC_SNDFILE:BOOL=ON \ -DWITH_IMAGE_OPENJPEG:BOOL=ON \ -DWITH_OPENCOLLADA:BOOL=ON \ -DWITH_FFTW3:BOOL=ON \ -DWITH_MOD_OCEANSIM:BOOL=ON \ -DWITH_CYCLES:BOOL=ON \ %if %{with embree} -DWITH_CYCLES_EMBREE:BOOL=ON \ %else -DWITH_CYCLES_EMBREE:BOOL=OFF \ %endif %if %{with openshading} -DWITH_CYCLES_OSL:BOOL=ON \ %endif %if %{with opensubdiv} -DWITH_OPENSUBDIV:BOOL=ON \ %endif %if %{with oidn} -DWITH_OPENIMAGEDENOISE:BOOL=ON \ %endif %if %{with openxr} -DWITH_XR_OPENXR:BOOL=ON \ %endif %if %{with usd} -DWITH_USD:BOOL=ON \ %endif %if %{with usd_bundled} -DUSD_LIBRARY:FILEPATH=${BUNDLED_LIBDIRS}/usd/lib/libusd_usd_m.a \ -DUSD_INCLUDE_DIR:FILEPATH=${BUNDLED_LIBDIRS}/usd/include \ %endif -DWITH_CXX_GUARDEDALLOC:BOOL=OFF \ -DWITH_MEM_JEMALLOC:BOOL=ON \ -DWITH_OPENCOLORIO:BOOL=ON \ -DWITH_SDL:BOOL=ON \ -DWITH_ALEMBIC:BOOL=ON \ -DWITH_OPENVDB:BOOL=ON \ -DWITH_OPENVDB_BLOSC:BOOL=ON \ -DWITH_DOC_MANPAGE:BOOL=ON \ -DWITH_INPUT_NDOF:BOOL=ON \ -DWITH_SYSTEM_AUDASPACE:BOOL=ON \ -DWITH_SYSTEM_EIGEN3:BOOL=ON \ -DWITH_SYSTEM_LZO:BOOL=ON \ -DWITH_SYSTEM_GLEW:BOOL=ON \ %ifarch %{ix86} -DSUPPORT_SSE2_BUILD:BOOL=ON \ -DCXX_HAS_AVX:BOOL=OFF \ -DCXX_HAS_AVX2:BOOL=OFF \ %endif %ifarch %{ix86} x86_64 -DWITH_CYCLES:BOOL=ON \ %else -DWITH_CYCLES:BOOL=OFF \ %endif -DWITH_JACK:BOOL=ON %cmake_build %install #install sse flavour %cmake_install %ifarch %{ix86} mv %{buildroot}%{_bindir}/%{name} %{buildroot}%{_bindir}/%{name}.sse #install non-sse flavour rm -fr %{_vpath_builddir} mv non-sse %{_vpath_builddir} %cmake_install mv %{buildroot}%{_bindir}/%{name} %{buildroot}%{_bindir}/%{name}.nonsse # install wrapper cat >> %{buildroot}%{_bindir}/blender <