Skip to content

Commit

Permalink
Merge pull request #98215 from gebner/blender290
Browse files Browse the repository at this point in the history
blender: 2.83.5 -> 2.90.0
  • Loading branch information
Ma27 authored Sep 18, 2020
2 parents 05f5001 + 6b74f99 commit 03bf040
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 5 deletions.
15 changes: 10 additions & 5 deletions pkgs/applications/misc/blender/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
, colladaSupport ? true, opencollada
, makeWrapper
, pugixml, SDL, Cocoa, CoreGraphics, ForceFeedback, OpenAL, OpenGL
, embree
}:

with lib;
Expand All @@ -17,11 +18,11 @@ let python = python3Packages.python; in

stdenv.mkDerivation rec {
pname = "blender";
version = "2.83.5";
version = "2.90.0";

src = fetchurl {
url = "https://download.blender.org/source/${pname}-${version}.tar.xz";
sha256 = "0xyawly00a59hfdb6b7va84k5fhcv2mxnzd77vs22bzi9y7sap43";
sha256 = "08qkvgdfrqh4ljqw5m64bbki1dsfcs4xnwzq6829z3ddhiwrxw84";
};

patches = lib.optional stdenv.isDarwin ./darwin.patch;
Expand All @@ -35,6 +36,7 @@ stdenv.mkDerivation rec {
(opensubdiv.override { inherit cudaSupport; })
tbb
makeWrapper
embree
]
++ (if (!stdenv.isDarwin) then [
libXi libX11 libXext libXrender
Expand All @@ -50,8 +52,11 @@ stdenv.mkDerivation rec {
++ optional cudaSupport cudatoolkit
++ optional colladaSupport opencollada;

postPatch =
if stdenv.isDarwin then ''
postPatch = ''
# allow usage of dynamically linked embree
rm build_files/cmake/Modules/FindEmbree.cmake
'' +
(if stdenv.isDarwin then ''
: > build_files/cmake/platform/platform_apple_xcode.cmake
substituteInPlace source/creator/CMakeLists.txt \
--replace '${"$"}{LIBDIR}/python' \
Expand All @@ -77,7 +82,7 @@ stdenv.mkDerivation rec {
'set(OPENEXR_INCLUDE_DIRS "${openexr.dev}/include/OpenEXR") #'
'' else ''
substituteInPlace extern/clew/src/clew.c --replace '"libOpenCL.so"' '"${ocl-icd}/lib/libOpenCL.so"'
'';
'');

cmakeFlags =
[
Expand Down
37 changes: 37 additions & 0 deletions pkgs/development/libraries/embree/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{ stdenv, fetchFromGitHub, cmake, pkgconfig, ispc, tbb, glfw,
openimageio, libjpeg, libpng, libpthreadstubs, libX11 }:

stdenv.mkDerivation rec {
pname = "embree";
version = "3.11.0";

src = fetchFromGitHub {
owner = "embree";
repo = "embree";
rev = "v${version}";
sha256 = "0v5gqi8jp09xxcbyyknji83412bq4l0w35b6hnrqxycgdrnf7hkr";
};

postPatch = ''
# Fix duplicate /nix/store/.../nix/store/.../ paths
sed -i "s|SET(EMBREE_ROOT_DIR .*)|set(EMBREE_ROOT_DIR $out)|" \
common/cmake/embree-config.cmake
sed -i "s|$""{EMBREE_ROOT_DIR}/||" common/cmake/embree-config.cmake
'';

cmakeFlags = [
"-DEMBREE_TUTORIALS=OFF"
"-DEMBREE_RAY_MASK=ON"
];

nativeBuildInputs = [ ispc pkgconfig cmake ];
buildInputs = [ tbb glfw openimageio libjpeg libpng libX11 libpthreadstubs ];

meta = with stdenv.lib; {
description = "High performance ray tracing kernels from Intel";
homepage = "https://embree.github.io/";
maintainers = with maintainers; [ hodapp gebner ];
license = licenses.asl20;
platforms = platforms.unix;
};
}
1 change: 1 addition & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3468,6 +3468,7 @@ in
python = python3;
};

embree = callPackage ../development/libraries/embree { };
embree2 = callPackage ../development/libraries/embree/2.x.nix { };

emem = callPackage ../applications/misc/emem { };
Expand Down

0 comments on commit 03bf040

Please sign in to comment.