Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blender: install with python3Packages.requests, fixes #97250 #118987

Merged
merged 3 commits into from
Apr 12, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions pkgs/applications/misc/blender/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ stdenv.mkDerivation rec {

patches = lib.optional stdenv.isDarwin ./darwin.patch;

nativeBuildInputs = [ cmake makeWrapper ] ++ optional cudaSupport addOpenGLRunpath;
nativeBuildInputs =
[ cmake makeWrapper python3Packages.wrapPython ]
ju1m marked this conversation as resolved.
Show resolved Hide resolved
++ optional cudaSupport addOpenGLRunpath;
ju1m marked this conversation as resolved.
Show resolved Hide resolved
buildInputs =
[ boost ffmpeg gettext glew ilmbase
freetype libjpeg libpng libsamplerate libsndfile libtiff
Expand Down Expand Up @@ -63,6 +65,7 @@ stdenv.mkDerivation rec {
++ optional cudaSupport cudatoolkit
++ optional colladaSupport opencollada
++ optional spaceNavSupport libspnav;
pythonPath = with python3Packages; [ numpy requests ];

postPatch = ''
# allow usage of dynamically linked embree
Expand Down Expand Up @@ -109,6 +112,7 @@ stdenv.mkDerivation rec {
"-DWITH_PYTHON_INSTALL_NUMPY=OFF"
"-DPYTHON_NUMPY_PATH=${python3Packages.numpy}/${python.sitePackages}"
"-DPYTHON_NUMPY_INCLUDE_DIRS=${python3Packages.numpy}/${python.sitePackages}/numpy/core/include"
"-DWITH_PYTHON_INSTALL_REQUESTS=OFF"
"-DWITH_OPENVDB=ON"
"-DWITH_TBB=ON"
"-DWITH_IMAGE_OPENJPEG=ON"
Expand Down Expand Up @@ -137,10 +141,11 @@ stdenv.mkDerivation rec {

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 = ''
buildPythonPath "$pythonPath"
wrapProgram $blenderExecutable \
--prefix PYTHONPATH : ${python3Packages.numpy}/${python.sitePackages} \
--prefix PATH : $program_PATH \
--prefix PYTHONPATH : "$program_PYTHONPATH" \
--add-flags '--python-use-system-env'
'';

Expand Down