summary refs log tree commit diff
path: root/pkgs/applications/misc/blender
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-01-09 01:00:25 +0000
committerGitHub <noreply@github.com>2021-01-09 01:00:25 +0000
commite251591528ebecb21626f098e6ce62562568489d (patch)
treeb10d92cc925da3fc1eec8b04ba8352e09c31e4db /pkgs/applications/misc/blender
parentf89e74dbcc1398d1747039313b1f5f89110d9db8 (diff)
parent9ff1aa8d2ce70fa2c4417eab055d182623f98429 (diff)
downloadnixpkgs-e251591528ebecb21626f098e6ce62562568489d.tar
nixpkgs-e251591528ebecb21626f098e6ce62562568489d.tar.gz
nixpkgs-e251591528ebecb21626f098e6ce62562568489d.tar.bz2
nixpkgs-e251591528ebecb21626f098e6ce62562568489d.tar.lz
nixpkgs-e251591528ebecb21626f098e6ce62562568489d.tar.xz
nixpkgs-e251591528ebecb21626f098e6ce62562568489d.tar.zst
nixpkgs-e251591528ebecb21626f098e6ce62562568489d.zip
Merge master into staging-next
Diffstat (limited to 'pkgs/applications/misc/blender')
-rw-r--r--pkgs/applications/misc/blender/default.nix20
1 files changed, 15 insertions, 5 deletions
diff --git a/pkgs/applications/misc/blender/default.nix b/pkgs/applications/misc/blender/default.nix
index 6174dceaef9..905e765185c 100644
--- a/pkgs/applications/misc/blender/default.nix
+++ b/pkgs/applications/misc/blender/default.nix
@@ -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
@@ -13,9 +13,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
-
+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"
+      "-DWITH_CYCLES_DEVICE_OPTIX=ON"
+      "-DOPTIX_ROOT_DIR=${optix}"
+    ];
 
   NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR -I${python}/include/${python.libPrefix}";
 
@@ -142,7 +151,8 @@ stdenv.mkDerivation rec {
     homepage = "https://www.blender.org";
     # They comment two licenses: GPLv2 and Blender License, but they
     # say: "We've decided to cancel the BL offering for an indefinite period."
-    license = licenses.gpl2Plus;
+    # OptiX, enabled with cudaSupport, is non-free.
+    license = with licenses; [ gpl2Plus ] ++ optional cudaSupport unfree;
     platforms = [ "x86_64-linux" "x86_64-darwin" ];
     maintainers = with maintainers; [ goibhniu veprbl ];
   };