blender: Optionally enable numpy support

This is required by some included addons (such as ANT landscape). Note
that we can't use -DWITH_PYTHON_INSTALL_NUMPY=ON because it's
conditional on -DWITH_PYTHON_INSTALL=ON.
This commit is contained in:
Eelco Dolstra 2018-03-30 21:58:28 +02:00
parent 514e3e8a07
commit 854e069107
2 changed files with 12 additions and 2 deletions

View File

@ -1,15 +1,18 @@
{ stdenv, lib, fetchurl, boost, cmake, ffmpeg, gettext, glew
, ilmbase, libXi, libX11, libXext, libXrender
, libjpeg, libpng, libsamplerate, libsndfile
, libtiff, libGLU_combined, openal, opencolorio, openexr, openimageio, openjpeg_1, python
, libtiff, libGLU_combined, openal, opencolorio, openexr, openimageio, openjpeg_1, pythonPackages
, zlib, fftw, opensubdiv, freetype, jemalloc, ocl-icd
, jackaudioSupport ? false, libjack2
, cudaSupport ? false, cudatoolkit
, colladaSupport ? true, opencollada
, enableNumpy ? false, makeWrapper
}:
with lib;
let python = pythonPackages.python; in
stdenv.mkDerivation rec {
name = "blender-2.79b";
@ -24,6 +27,7 @@ stdenv.mkDerivation rec {
freetype libjpeg libpng libsamplerate libsndfile libtiff libGLU_combined openal
opencolorio openexr openimageio openjpeg_1 python zlib fftw jemalloc
(opensubdiv.override { inherit cudaSupport; })
makeWrapper
]
++ optional jackaudioSupport libjack2
++ optional cudaSupport cudatoolkit
@ -70,6 +74,12 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
postInstall = optionalString enableNumpy
''
wrapProgram $out/bin/blender \
--prefix PYTHONPATH : ${pythonPackages.numpy}/lib/python${python.majorVersion}/site-packages
'';
meta = with stdenv.lib; {
description = "3D Creation/Animation/Publishing System";
homepage = https://www.blender.org;

View File

@ -14904,7 +14904,7 @@ with pkgs;
blender = callPackage ../applications/misc/blender {
cudaSupport = config.cudaSupport or false;
python = python35;
pythonPackages = python35Packages;
stdenv = overrideCC stdenv gcc6;
};