diff --git a/pkgs/applications/misc/blender/default.nix b/pkgs/applications/misc/blender/default.nix index 3dfa6d9ab513..93185f2dd5ce 100644 --- a/pkgs/applications/misc/blender/default.nix +++ b/pkgs/applications/misc/blender/default.nix @@ -136,17 +136,16 @@ stdenv.mkDerivation rec { NIX_LDFLAGS = optionalString cudaSupport "-rpath ${stdenv.cc.cc.lib}/lib"; blenderExecutable = - placeholder "out" + (if stdenv.isDarwin then "/Blender.app/Contents/MacOS/Blender" else "/bin/blender"); - postInstall = '' + placeholder "out" + (if stdenv.isDarwin then "/Applications/Blender.app/Contents/MacOS/Blender" else "/bin/blender"); + postInstall = lib.optionalString stdenv.isDarwin '' + mkdir $out/Applications + mv $out/Blender.app $out/Applications + '' + '' buildPythonPath "$pythonPath" wrapProgram $blenderExecutable \ --prefix PATH : $program_PATH \ --prefix PYTHONPATH : "$program_PYTHONPATH" \ --add-flags '--python-use-system-env' - '' + lib.optionalString stdenv.isDarwin '' - mkdir -p $out/Applications/Blender.app - ln -s $out/Blender.app $out/Applications/Blender.app - ln -s $out/Blender.app/Contents/MacOS $out/bin ''; # Set RUNPATH so that libcuda and libnvrtc in /run/opengl-driver(-32)/lib can be