summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorAndrew Marshall <andrew@johnandrewmarshall.com>2023-11-17 20:45:35 -0500
committerGitHub <noreply@github.com>2023-11-17 20:45:35 -0500
commitaa6db6ac9d110aca53341679f903c681f7ee59f2 (patch)
treef8aa6654e76b81d814192e1667d66dc671c0226b /pkgs/applications
parentc64a7d15f07b3bb1c8375a6e22c1ff188f35bc7e (diff)
downloadnixpkgs-aa6db6ac9d110aca53341679f903c681f7ee59f2.tar
nixpkgs-aa6db6ac9d110aca53341679f903c681f7ee59f2.tar.gz
nixpkgs-aa6db6ac9d110aca53341679f903c681f7ee59f2.tar.bz2
nixpkgs-aa6db6ac9d110aca53341679f903c681f7ee59f2.tar.lz
nixpkgs-aa6db6ac9d110aca53341679f903c681f7ee59f2.tar.xz
nixpkgs-aa6db6ac9d110aca53341679f903c681f7ee59f2.tar.zst
nixpkgs-aa6db6ac9d110aca53341679f903c681f7ee59f2.zip
blender: 3.6.5 -> 4.0.1 (#267511)
As noted in comment, Blender is now using private libdecor APIs not in
the headers, so need to patch to build against it. I think it probably
works when Blender does dynamic loading at runtime since it uses the fn
defs it defines in that case, but we don’t want to do that, it seems (as
we already set `-DWITH_GHOST_WAYLAND_DYNLOAD=OFF`).
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/misc/blender/default.nix14
-rw-r--r--pkgs/applications/misc/blender/libdecor.patch34
2 files changed, 43 insertions, 5 deletions
diff --git a/pkgs/applications/misc/blender/default.nix b/pkgs/applications/misc/blender/default.nix
index 7a6db59bf66..24ea7287160 100644
--- a/pkgs/applications/misc/blender/default.nix
+++ b/pkgs/applications/misc/blender/default.nix
@@ -3,7 +3,7 @@
 , libjpeg, libpng, libsamplerate, libsndfile
 , libtiff, libwebp, libGLU, libGL, openal, opencolorio, openexr, openimagedenoise, openimageio, openjpeg, python310Packages
 , openvdb, libXxf86vm, tbb, alembic
-, zlib, zstd, fftw, opensubdiv, freetype, jemalloc, ocl-icd, addOpenGLRunpath
+, zlib, zstd, fftw, fftwFloat, opensubdiv, freetype, jemalloc, ocl-icd, addOpenGLRunpath
 , jackaudioSupport ? false, libjack2
 , cudaSupport ? config.cudaSupport, cudaPackages ? { }
 , hipSupport ? false, rocmPackages # comes with a significantly larger closure size
@@ -30,15 +30,19 @@ let
     url = "https://developer.download.nvidia.com/redist/optix/v7.3/OptiX-7.3.0-Include.zip";
     sha256 = "0max1j4822mchj0xpz9lqzh91zkmvsn4py0r174cvqfz8z8ykjk8";
   };
+  libdecor' = libdecor.overrideAttrs (old: {
+    # Blender uses private APIs, need to patch to expose them
+    patches = (old.patches or [ ]) ++ [ ./libdecor.patch ];
+  });
 
 in
 stdenv.mkDerivation (finalAttrs: rec {
   pname = "blender";
-  version = "3.6.5";
+  version = "4.0.1";
 
   src = fetchurl {
     url = "https://download.blender.org/source/${pname}-${version}.tar.xz";
-    hash = "sha256-QAHA/pn22HLsfH6VX4Sp7r25raFxAPS1Gergjez38kM=";
+    hash = "sha256-/jLU0noX5RxhQ+26G16nGFylm65Lzfm9s11oCWCC43Q=";
   };
 
   patches = [
@@ -53,7 +57,7 @@ stdenv.mkDerivation (finalAttrs: rec {
   buildInputs =
     [ boost ffmpeg gettext glew ilmbase
       freetype libjpeg libpng libsamplerate libsndfile libtiff libwebp
-      opencolorio openexr openimageio openjpeg python zlib zstd fftw jemalloc
+      opencolorio openexr openimageio openjpeg python zlib zstd fftw fftwFloat jemalloc
       alembic
       (opensubdiv.override { inherit cudaSupport; })
       tbb
@@ -65,7 +69,7 @@ stdenv.mkDerivation (finalAttrs: rec {
       openpgl
     ]
     ++ lib.optionals waylandSupport [
-      wayland wayland-protocols libffi libdecor libxkbcommon dbus
+      wayland wayland-protocols libffi libdecor' libxkbcommon dbus
     ]
     ++ lib.optionals (!stdenv.isAarch64) [
       openimagedenoise
diff --git a/pkgs/applications/misc/blender/libdecor.patch b/pkgs/applications/misc/blender/libdecor.patch
new file mode 100644
index 00000000000..73c32f983cc
--- /dev/null
+++ b/pkgs/applications/misc/blender/libdecor.patch
@@ -0,0 +1,34 @@
+diff --git a/src/libdecor-plugin.h b/src/libdecor-plugin.h
+index ba80ce6..59199dd 100644
+--- a/src/libdecor-plugin.h
++++ b/src/libdecor-plugin.h
+@@ -132,12 +132,6 @@ struct libdecor_plugin_interface {
+ struct wl_surface *
+ libdecor_frame_get_wl_surface(struct libdecor_frame *frame);
+ 
+-int
+-libdecor_frame_get_content_width(struct libdecor_frame *frame);
+-
+-int
+-libdecor_frame_get_content_height(struct libdecor_frame *frame);
+-
+ enum libdecor_window_state
+ libdecor_frame_get_window_state(struct libdecor_frame *frame);
+ 
+diff --git a/src/libdecor.h b/src/libdecor.h
+index af67e2f..b5eba41 100644
+--- a/src/libdecor.h
++++ b/src/libdecor.h
+@@ -532,6 +532,12 @@ bool
+ libdecor_configuration_get_window_state(struct libdecor_configuration *configuration,
+ 					enum libdecor_window_state *window_state);
+ 
++int
++libdecor_frame_get_content_width(struct libdecor_frame *frame);
++
++int
++libdecor_frame_get_content_height(struct libdecor_frame *frame);
++
+ #ifdef __cplusplus
+ }
+ #endif