From 27578856bfa817ad92c4fd0dcd87a67749ea3a5d Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Fri, 28 Feb 2020 13:55:13 -0500 Subject: [PATCH] blender: fix enableNumpy option, enable it unconditionally Workarounds https://developer.blender.org/T74304 Audaspace requires numpy, we already have to provide numpy unconditionally via PYTHON_NUMPY_PATH. --- pkgs/applications/misc/blender/default.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/misc/blender/default.nix b/pkgs/applications/misc/blender/default.nix index 277bb5fe1f25..75f5b8302e6f 100644 --- a/pkgs/applications/misc/blender/default.nix +++ b/pkgs/applications/misc/blender/default.nix @@ -7,7 +7,7 @@ , jackaudioSupport ? false, libjack2 , cudaSupport ? config.cudaSupport or false, cudatoolkit , colladaSupport ? true, opencollada -, enableNumpy ? false, makeWrapper +, makeWrapper , pugixml, SDL, Cocoa, CoreGraphics, ForceFeedback, OpenAL, OpenGL }: @@ -117,11 +117,13 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - postInstall = optionalString enableNumpy - '' - wrapProgram $out/bin/blender \ - --prefix PYTHONPATH : ${python3Packages.numpy}/${python.sitePackages} - ''; + blenderExecutable = + placeholder "out" + (if stdenv.isDarwin then "/Blender.app/Contents/MacOS/Blender" else "/bin/blender"); + # --python-expr is used to workaround https://developer.blender.org/T74304 + postInstall = '' + wrapProgram $blenderExecutable \ + --add-flags '--python-expr "import sys; sys.path.append(\"${python3Packages.numpy}/${python.sitePackages}\")"' + ''; # Set RUNPATH so that libcuda and libnvrtc in /run/opengl-driver(-32)/lib can be # found. See the explanation in libglvnd.