Merge pull request #81313 from veprbl/pr/blender_numpy_fix

blender: fix enableNumpy option
This commit is contained in:
Gabriel Ebner 2020-03-03 14:31:11 +01:00 committed by GitHub
commit f29c0e4526
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,10 +117,12 @@ 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