From 7235e9075d7c4bf399f15ca2d51a3907ea901859 Mon Sep 17 00:00:00 2001 From: VuiMuich Date: Fri, 22 Nov 2024 08:15:20 +0100 Subject: [PATCH] blender : 4.2.3 -> 4.3.0 --- pkgs/applications/misc/blender/default.nix | 17 +++++++++++---- pkgs/applications/misc/blender/draco.patch | 25 ++++++++++++++-------- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/misc/blender/default.nix b/pkgs/applications/misc/blender/default.nix index e2af0b3f9338..398fca214ef4 100644 --- a/pkgs/applications/misc/blender/default.nix +++ b/pkgs/applications/misc/blender/default.nix @@ -72,10 +72,13 @@ python3Packages, # must use instead of python3.pkgs, see https://github.com/NixOS/nixpkgs/issues/211340 rocmPackages, # comes with a significantly larger closure size runCommand, + shaderc, spaceNavSupport ? stdenv.hostPlatform.isLinux, sse2neon, stdenv, tbb, + vulkan-headers, + vulkan-loader, wayland, wayland-protocols, wayland-scanner, @@ -90,6 +93,7 @@ let openImageDenoiseSupport = (!stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux) || stdenv.hostPlatform.isDarwin; openUsdSupport = !stdenv.hostPlatform.isDarwin; + vulkanSupport = !stdenv.hostPlatform.isDarwin; python3 = python3Packages.python; pyPkgsOpenusd = python3Packages.openusd.override { withOsl = false; }; @@ -108,20 +112,20 @@ in stdenv.mkDerivation (finalAttrs: { pname = "blender"; - version = "4.2.3"; + version = "4.3.0"; srcs = [ (fetchzip { name = "source"; url = "https://download.blender.org/source/blender-${finalAttrs.version}.tar.xz"; - hash = "sha256-58wgduTHGfuYohaPjNuAnLFrpXOosEYOk5gJvbxTlQk="; + hash = "sha256-eB67wn5TXiB1+yS3ZF40uzliO/jcm55anffdJT++O24="; }) (fetchgit { name = "assets"; url = "https://projects.blender.org/blender/blender-assets.git"; rev = "v${finalAttrs.version}"; fetchLFS = true; - hash = "sha256-vepK0inPMuleAJBSipwoI99nMBBiFaK/eSMHDetEtjY="; + hash = "sha256-3w/SHhbwXkHp8UlCGjxvm1znT1yfuZSnXSWWRTe/C0s="; }) ]; @@ -325,7 +329,12 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optional colladaSupport opencollada ++ lib.optional jackaudioSupport libjack2 - ++ lib.optional spaceNavSupport libspnav; + ++ lib.optional spaceNavSupport libspnav + ++ lib.optionals vulkanSupport [ + shaderc + vulkan-headers + vulkan-loader + ]; pythonPath = let diff --git a/pkgs/applications/misc/blender/draco.patch b/pkgs/applications/misc/blender/draco.patch index df6729c445cc..a5abed18453f 100644 --- a/pkgs/applications/misc/blender/draco.patch +++ b/pkgs/applications/misc/blender/draco.patch @@ -1,26 +1,33 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 97596dbee8d..d1ad6ac5de0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -898,11 +898,6 @@ set_and_warn_dependency(WITH_PYTHON WITH_CYCLES OFF) +@@ -1237,13 +1237,6 @@ set_and_warn_dependency(WITH_PYTHON WITH_CYCLES OFF) set_and_warn_dependency(WITH_PYTHON WITH_DRACO OFF) set_and_warn_dependency(WITH_PYTHON WITH_MOD_FLUID OFF) --if(WITH_DRACO AND NOT WITH_PYTHON_INSTALL) -- message(STATUS "WITH_DRACO requires WITH_PYTHON_INSTALL to be ON, disabling WITH_DRACO for now") -- set(WITH_DRACO OFF) +-if(NOT WITH_PYTHON_MODULE) +- if(WITH_DRACO AND NOT WITH_PYTHON_INSTALL) +- message(STATUS "WITH_DRACO requires WITH_PYTHON_INSTALL to be ON, disabling WITH_DRACO for now") +- set(WITH_DRACO OFF) +- endif() -endif() - # enable boost for cycles, audaspace or i18n # otherwise if the user disabled ---- a/scripts/addons_core/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py -+++ b/scripts/addons_core/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py -@@ -17,7 +17,7 @@ def dll_path() -> Path: +diff --git a/scripts/addons_core/io_scene_gltf2/io/com/draco.py b/scripts/addons_core/io_scene_gltf2/io/com/draco.py +index 75e23162c67..875596c3d2f 100644 +--- a/scripts/addons_core/io_scene_gltf2/io/com/draco.py ++++ b/scripts/addons_core/io_scene_gltf2/io/com/draco.py +@@ -31,8 +31,8 @@ def dll_path() -> Path: + :return: DLL path. """ lib_name = 'extern_draco' - blender_root = Path(bpy.app.binary_path).parent -+ blender_root = Path(bpy.app.binary_path).parent.parent - python_lib = Path('{v[0]}.{v[1]}/python/lib'.format(v=bpy.app.version)) -+ python_lib = Path('share/blender/{v[0]}.{v[1]}/python-ext/lib'.format(v=bpy.app.version)) ++ blender_root = Path(bpy.app.binary_path).parent.parent ++ python_lib = Path('share/blender/{v[0]}.{v[1]}/python/lib'.format(v=bpy.app.version)) python_version = 'python{v[0]}.{v[1]}'.format(v=sys.version_info) path = os.environ.get('BLENDER_EXTERN_DRACO_LIBRARY_PATH')