blender: add option for OptiX

This commit is contained in:
NomisIV 2020-12-14 09:41:47 +01:00
parent 1e8ca69151
commit 8b41a83a35

View file

@ -1,4 +1,4 @@
{ config, stdenv, lib, fetchurl, boost, cmake, ffmpeg, gettext, glew
{ config, stdenv, lib, fetchurl, fetchzip, boost, cmake, ffmpeg, gettext, glew
, ilmbase, libXi, libX11, libXext, libXrender
, libjpeg, libpng, libsamplerate, libsndfile
, libtiff, libGLU, libGL, openal, opencolorio, openexr, openimagedenoise, openimageio2, openjpeg, python3Packages
@ -6,6 +6,7 @@
, zlib, fftw, opensubdiv, freetype, jemalloc, ocl-icd, addOpenGLRunpath
, jackaudioSupport ? false, libjack2
, cudaSupport ? config.cudaSupport or false, cudatoolkit
, optixSupport ? config.optixSupport or false
, colladaSupport ? true, opencollada
, makeWrapper
, pugixml, llvmPackages, SDL, Cocoa, CoreGraphics, ForceFeedback, OpenAL, OpenGL
@ -13,10 +14,14 @@
}:
with lib;
let
python = python3Packages.python;
optix = fetchzip {
url = "https://developer.download.nvidia.com/redist/optix/v7.0/OptiX-7.0.0-include.zip";
sha256 = "1b3ccd3197anya2bj3psxdrvrpfgiwva5zfv2xmyrl73nb2dvfr7";
};
let python = python3Packages.python; in
stdenv.mkDerivation rec {
in stdenv.mkDerivation rec {
pname = "blender";
version = "2.91.0";
@ -111,7 +116,11 @@ stdenv.mkDerivation rec {
# Clang doesn't support "-export-dynamic"
++ optional stdenv.cc.isClang "-DPYTHON_LINKFLAGS="
++ optional jackaudioSupport "-DWITH_JACK=ON"
++ optional cudaSupport "-DWITH_CYCLES_CUDA_BINARIES=ON";
++ optional cudaSupport "-DWITH_CYCLES_CUDA_BINARIES=ON"
++ optional optixSupport [
"-DWITH_CYCLES_DEVICE_OPTIX=ON"
"-DOPTIX_ROOT_DIR=${optix}"
];
NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR -I${python}/include/${python.libPrefix}";