diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2023-09-28 00:12:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-28 00:12:12 +0000 |
commit | 6982839dbfbfda6b2f2776498dae8022733f2969 (patch) | |
tree | a14203958ff0af74fdb130d8caeae1c88b949698 /pkgs/applications/misc/blender/default.nix | |
parent | 43dece63bf5dc936a2fc2fde69751730285c35f8 (diff) | |
parent | e515dce8924197fceb090d9ba46cbb926a5784eb (diff) | |
download | nixpkgs-6982839dbfbfda6b2f2776498dae8022733f2969.tar nixpkgs-6982839dbfbfda6b2f2776498dae8022733f2969.tar.gz nixpkgs-6982839dbfbfda6b2f2776498dae8022733f2969.tar.bz2 nixpkgs-6982839dbfbfda6b2f2776498dae8022733f2969.tar.lz nixpkgs-6982839dbfbfda6b2f2776498dae8022733f2969.tar.xz nixpkgs-6982839dbfbfda6b2f2776498dae8022733f2969.tar.zst nixpkgs-6982839dbfbfda6b2f2776498dae8022733f2969.zip |
Merge master into haskell-updates
Diffstat (limited to 'pkgs/applications/misc/blender/default.nix')
-rw-r--r-- | pkgs/applications/misc/blender/default.nix | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/pkgs/applications/misc/blender/default.nix b/pkgs/applications/misc/blender/default.nix index b0dddb97411..24797b0602c 100644 --- a/pkgs/applications/misc/blender/default.nix +++ b/pkgs/applications/misc/blender/default.nix @@ -15,6 +15,8 @@ , potrace , openxr-loader , embree, gmp, libharu +, mesa +, runCommand }: let @@ -26,7 +28,7 @@ let }; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: rec { pname = "blender"; version = "3.6.3"; @@ -184,7 +186,45 @@ stdenv.mkDerivation rec { done ''; - passthru = { inherit python; }; + passthru = { + inherit python; + + tests = { + render = runCommand "${pname}-test" { } '' + set -euo pipefail + + export LIBGL_DRIVERS_PATH=${mesa.drivers}/lib/dri + export __EGL_VENDOR_LIBRARY_FILENAMES=${mesa.drivers}/share/glvnd/egl_vendor.d/50_mesa.json + + cat <<'PYTHON' > scene-config.py + import bpy + bpy.context.scene.eevee.taa_render_samples = 32 + bpy.context.scene.cycles.samples = 32 + if ${if stdenv.isAarch64 then "True" else "False"}: + bpy.context.scene.cycles.use_denoising = False + bpy.context.scene.render.resolution_x = 100 + bpy.context.scene.render.resolution_y = 100 + bpy.context.scene.render.threads_mode = 'FIXED' + bpy.context.scene.render.threads = 1 + PYTHON + + mkdir $out + for engine in BLENDER_EEVEE CYCLES; do + echo "Rendering with $engine..." + # Beware that argument order matters + ${finalAttrs.finalPackage}/bin/blender \ + --background \ + -noaudio \ + --factory-startup \ + --python-exit-code 1 \ + --python scene-config.py \ + --engine "$engine" \ + --render-output "$out/$engine" \ + --render-frame 1 + done + ''; + }; + }; meta = with lib; { description = "3D Creation/Animation/Publishing System"; @@ -198,4 +238,4 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ goibhniu veprbl ]; mainProgram = "blender"; }; -} +}) |