blender: 2.93.5 -> 3.1.0 (#164987)

blender 3.1 now requires python 3.10 and zstd to build. also pin
cudatoolkit to 11 and optix to 7.3 as requested by the blender build
instructions for 3.1
This commit is contained in:
pennae 2022-03-20 20:30:54 +00:00 committed by GitHub
parent bef8290da1
commit e2f381b2f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,11 +1,11 @@
{ config, stdenv, lib, fetchurl, fetchzip, boost, cmake, ffmpeg, gettext, glew { config, stdenv, lib, fetchurl, fetchzip, boost, cmake, ffmpeg, gettext, glew
, ilmbase, libXi, libX11, libXext, libXrender , ilmbase, libXi, libX11, libXext, libXrender
, libjpeg, libpng, libsamplerate, libsndfile , libjpeg, libpng, libsamplerate, libsndfile
, libtiff, libGLU, libGL, openal, opencolorio, openexr, openimagedenoise, openimageio2, openjpeg, python39Packages , libtiff, libGLU, libGL, openal, opencolorio, openexr, openimagedenoise, openimageio2, openjpeg, python310Packages
, openvdb, libXxf86vm, tbb, alembic , openvdb, libXxf86vm, tbb, alembic
, zlib, fftw, opensubdiv, freetype, jemalloc, ocl-icd, addOpenGLRunpath , zlib, zstd, fftw, opensubdiv, freetype, jemalloc, ocl-icd, addOpenGLRunpath
, jackaudioSupport ? false, libjack2 , jackaudioSupport ? false, libjack2
, cudaSupport ? config.cudaSupport or false, cudatoolkit , cudaSupport ? config.cudaSupport or false, cudatoolkit_11
, colladaSupport ? true, opencollada , colladaSupport ? true, opencollada
, spaceNavSupport ? stdenv.isLinux, libspnav , spaceNavSupport ? stdenv.isLinux, libspnav
, makeWrapper , makeWrapper
@ -17,30 +17,31 @@
with lib; with lib;
let let
python = python39Packages.python; python = python310Packages.python;
optix = fetchzip { optix = fetchzip {
url = "https://developer.download.nvidia.com/redist/optix/v7.0/OptiX-7.0.0-include.zip"; # url taken from the archlinux blender PKGBUILD
sha256 = "1b3ccd3197anya2bj3psxdrvrpfgiwva5zfv2xmyrl73nb2dvfr7"; url = "https://developer.download.nvidia.com/redist/optix/v7.3/OptiX-7.3.0-Include.zip";
sha256 = "0max1j4822mchj0xpz9lqzh91zkmvsn4py0r174cvqfz8z8ykjk8";
}; };
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "blender"; pname = "blender";
version = "2.93.5"; version = "3.1.0";
src = fetchurl { src = fetchurl {
url = "https://download.blender.org/source/${pname}-${version}.tar.xz"; url = "https://download.blender.org/source/${pname}-${version}.tar.xz";
sha256 = "1fsw8w80h8k5w4zmy659bjlzqyn5i198hi1kbpzfrdn8psxg2bfj"; sha256 = "1d0476bzcz86lwdnyjn7hyzkmhfiqh47ls5h09jlbm7v7k9x69hw";
}; };
patches = lib.optional stdenv.isDarwin ./darwin.patch; patches = lib.optional stdenv.isDarwin ./darwin.patch;
nativeBuildInputs = [ cmake makeWrapper python39Packages.wrapPython llvmPackages.llvm.dev ] nativeBuildInputs = [ cmake makeWrapper python310Packages.wrapPython llvmPackages.llvm.dev ]
++ optionals cudaSupport [ addOpenGLRunpath ]; ++ optionals cudaSupport [ addOpenGLRunpath ];
buildInputs = buildInputs =
[ boost ffmpeg gettext glew ilmbase [ boost ffmpeg gettext glew ilmbase
freetype libjpeg libpng libsamplerate libsndfile libtiff freetype libjpeg libpng libsamplerate libsndfile libtiff
opencolorio openexr openimagedenoise openimageio2 openjpeg python zlib fftw jemalloc opencolorio openexr openimagedenoise openimageio2 openjpeg python zlib zstd fftw jemalloc
alembic alembic
(opensubdiv.override { inherit cudaSupport; }) (opensubdiv.override { inherit cudaSupport; })
tbb tbb
@ -62,10 +63,10 @@ stdenv.mkDerivation rec {
llvmPackages.openmp SDL Cocoa CoreGraphics ForceFeedback OpenAL OpenGL llvmPackages.openmp SDL Cocoa CoreGraphics ForceFeedback OpenAL OpenGL
]) ])
++ optional jackaudioSupport libjack2 ++ optional jackaudioSupport libjack2
++ optional cudaSupport cudatoolkit ++ optional cudaSupport cudatoolkit_11
++ optional colladaSupport opencollada ++ optional colladaSupport opencollada
++ optional spaceNavSupport libspnav; ++ optional spaceNavSupport libspnav;
pythonPath = with python39Packages; [ numpy requests ]; pythonPath = with python310Packages; [ numpy requests ];
postPatch = '' postPatch = ''
# allow usage of dynamically linked embree # allow usage of dynamically linked embree
@ -84,7 +85,7 @@ stdenv.mkDerivation rec {
--replace '${"$"}{LIBDIR}/opencollada' \ --replace '${"$"}{LIBDIR}/opencollada' \
'${opencollada}' \ '${opencollada}' \
--replace '${"$"}{PYTHON_LIBPATH}/site-packages/numpy' \ --replace '${"$"}{PYTHON_LIBPATH}/site-packages/numpy' \
'${python39Packages.numpy}/${python.sitePackages}/numpy' '${python310Packages.numpy}/${python.sitePackages}/numpy'
'' else '' '' else ''
substituteInPlace extern/clew/src/clew.c --replace '"libOpenCL.so"' '"${ocl-icd}/lib/libOpenCL.so"' substituteInPlace extern/clew/src/clew.c --replace '"libOpenCL.so"' '"${ocl-icd}/lib/libOpenCL.so"'
''); '');
@ -106,8 +107,8 @@ stdenv.mkDerivation rec {
"-DPYTHON_VERSION=${python.pythonVersion}" "-DPYTHON_VERSION=${python.pythonVersion}"
"-DWITH_PYTHON_INSTALL=OFF" "-DWITH_PYTHON_INSTALL=OFF"
"-DWITH_PYTHON_INSTALL_NUMPY=OFF" "-DWITH_PYTHON_INSTALL_NUMPY=OFF"
"-DPYTHON_NUMPY_PATH=${python39Packages.numpy}/${python.sitePackages}" "-DPYTHON_NUMPY_PATH=${python310Packages.numpy}/${python.sitePackages}"
"-DPYTHON_NUMPY_INCLUDE_DIRS=${python39Packages.numpy}/${python.sitePackages}/numpy/core/include" "-DPYTHON_NUMPY_INCLUDE_DIRS=${python310Packages.numpy}/${python.sitePackages}/numpy/core/include"
"-DWITH_PYTHON_INSTALL_REQUESTS=OFF" "-DWITH_PYTHON_INSTALL_REQUESTS=OFF"
"-DWITH_OPENVDB=ON" "-DWITH_OPENVDB=ON"
"-DWITH_TBB=ON" "-DWITH_TBB=ON"