about summary refs log tree commit diff
path: root/pkgs/applications/misc
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2023-09-27 06:01:00 +0000
committerGitHub <noreply@github.com>2023-09-27 06:01:00 +0000
commit9a4dae4abd518bc804832dce0e8ee22ca2aaaa0a (patch)
tree38e88f76f9989ee735a4b85e039454e32796bcce /pkgs/applications/misc
parentf80bca67219eb379bb01e6f40c2515046c1c2a98 (diff)
parentbbf12a916929e8b361a159f44a1e31d59b6c2d2a (diff)
Merge master into staging-next
Diffstat (limited to 'pkgs/applications/misc')
-rw-r--r--pkgs/applications/misc/appcleaner/default.nix35
-rw-r--r--pkgs/applications/misc/blender/default.nix46
2 files changed, 78 insertions, 3 deletions
diff --git a/pkgs/applications/misc/appcleaner/default.nix b/pkgs/applications/misc/appcleaner/default.nix
new file mode 100644
index 0000000000000..eff32c76f988a
--- /dev/null
+++ b/pkgs/applications/misc/appcleaner/default.nix
@@ -0,0 +1,35 @@
+{ lib
+, stdenvNoCC
+, fetchurl
+, unzip
+}:
+stdenvNoCC.mkDerivation (finalAttrs: {
+  pname = "appcleaner";
+  version = "3.6.8";
+
+  src = fetchurl {
+    url = "https://freemacsoft.net/downloads/AppCleaner_${finalAttrs.version}.zip";
+    hash = "sha256-4BL3KUQkc8IOfM4zSwAYJSHktmcupoGzSTGxgP6z1r4=";
+  };
+  dontUnpack = true;
+
+  nativeBuildInputs = [ unzip ];
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/Applications
+    unzip -d $out/Applications $src
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Uninstall unwanted apps";
+    homepage = "https://freemacsoft.net/appcleaner";
+    license = licenses.unfree;
+    sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
+    maintainers = with maintainers; [ emilytrau Enzime ];
+    platforms = platforms.darwin;
+  };
+})
diff --git a/pkgs/applications/misc/blender/default.nix b/pkgs/applications/misc/blender/default.nix
index b0dddb974115f..24797b0602c8f 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";
   };
-}
+})