From 4dbf1080fdf68d07f142e76363482692549258ae Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Sun, 7 Jul 2024 22:28:43 +0200 Subject: [PATCH] blender: format Signed-off-by: Florian Brandes --- pkgs/applications/misc/blender/default.nix | 33 ++++++++++++---------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/pkgs/applications/misc/blender/default.nix b/pkgs/applications/misc/blender/default.nix index 3cbab926ecd5..2e1294a4080c 100644 --- a/pkgs/applications/misc/blender/default.nix +++ b/pkgs/applications/misc/blender/default.nix @@ -117,7 +117,7 @@ stdenv.mkDerivation (finalAttrs: { url = "https://projects.blender.org/blender/blender/commit/ae35b5758791bebb21741f9b505b9fca347ae50e.patch"; hash = "sha256-xUi55+7aiwEjtjqOi8to1YxdPlsBUThCCkCa5T6LIQc="; }) - ] ++ lib.optional stdenv.isDarwin ./darwin.patch; + ] ++ lib.optional stdenv.isDarwin ./darwin.patch; postPatch = ( @@ -183,7 +183,9 @@ stdenv.mkDerivation (finalAttrs: { "-DWITH_GHOST_WAYLAND_DYNLOAD=OFF" "-DWITH_GHOST_WAYLAND_LIBDECOR=ON" ] - ++ lib.optionals (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux) [ "-DWITH_CYCLES_EMBREE=OFF" ] + ++ lib.optionals (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux) [ + "-DWITH_CYCLES_EMBREE=OFF" + ] ++ lib.optionals stdenv.isDarwin [ "-DLIBDIR=/does-not-exist" "-DWITH_CYCLES_OSL=OFF" # causes segfault on aarch64-darwin @@ -326,15 +328,16 @@ stdenv.mkDerivation (finalAttrs: { # Set RUNPATH so that libcuda and libnvrtc in /run/opengl-driver(-32)/lib can be # found. See the explanation in libglvnd. - postFixup = lib.optionalString cudaSupport '' - for program in $out/bin/blender $out/bin/.blender-wrapped; do - isELF "$program" || continue - addOpenGLRunpath "$program" - done - '' - + lib.optionalString stdenv.isDarwin '' - makeWrapper $out/Applications/Blender.app/Contents/MacOS/Blender $out/bin/blender - ''; + postFixup = + lib.optionalString cudaSupport '' + for program in $out/bin/blender $out/bin/.blender-wrapped; do + isELF "$program" || continue + addOpenGLRunpath "$program" + done + '' + + lib.optionalString stdenv.isDarwin '' + makeWrapper $out/Applications/Blender.app/Contents/MacOS/Blender $out/bin/blender + ''; passthru = { python = python3; @@ -348,9 +351,7 @@ stdenv.mkDerivation (finalAttrs: { }; tests = { - render = runCommand "${finalAttrs.pname}-test" { - nativeBuildInputs = [ mesa.llvmpipeHook ]; - } '' + render = runCommand "${finalAttrs.pname}-test" { nativeBuildInputs = [ mesa.llvmpipeHook ]; } '' set -euo pipefail cat <<'PYTHON' > scene-config.py import bpy @@ -402,7 +403,9 @@ stdenv.mkDerivation (finalAttrs: { # They comment two licenses: GPLv2 and Blender License, but they # say: "We've decided to cancel the BL offering for an indefinite period." # OptiX, enabled with cudaSupport, is non-free. - license = with lib.licenses; [ gpl2Plus ] ++ lib.optional cudaSupport (unfree // { shortName = "NVidia OptiX EULA"; }); + license = + with lib.licenses; + [ gpl2Plus ] ++ lib.optional cudaSupport (unfree // { shortName = "NVidia OptiX EULA"; }); platforms = [ "aarch64-linux"