Skip to content

Commit

Permalink
blender: add materialx
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
  • Loading branch information
gador committed May 7, 2024
1 parent b9ca769 commit 4428608
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkgs/applications/misc/blender/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
libxkbcommon,
llvmPackages,
makeWrapper,
materialx,
mesa,
ocl-icd,
openal,
Expand Down Expand Up @@ -118,7 +119,8 @@ stdenv.mkDerivation (finalAttrs: {
: > build_files/cmake/platform/platform_apple_xcode.cmake
substituteInPlace source/creator/CMakeLists.txt \
--replace-fail '${"$"}{LIBDIR}/python' \
'${python3}'
'${python3}' \
--replace-fail '${"$"}{LIBDIR}/materialx/' '${materialx}/'
substituteInPlace build_files/cmake/platform/platform_apple.cmake \
--replace-fail '${"$"}{LIBDIR}/brotli/lib/libbrotlicommon-static.a' \
'${lib.getLib brotli}/lib/libbrotlicommon.dylib' \
Expand Down Expand Up @@ -151,6 +153,7 @@ stdenv.mkDerivation (finalAttrs: {
"-DWITH_FFTW3=ON"
"-DWITH_IMAGE_OPENJPEG=ON"
"-DWITH_INSTALL_PORTABLE=OFF"
"-DMaterialX_DIR=${materialx}/lib/cmake/MaterialX"
"-DWITH_MOD_OCEANSIM=ON"
"-DWITH_OPENCOLLADA=${if colladaSupport then "ON" else "OFF"}"
"-DWITH_OPENCOLORIO=ON"
Expand Down Expand Up @@ -221,6 +224,7 @@ stdenv.mkDerivation (finalAttrs: {
libsndfile
libtiff
libwebp
materialx
opencolorio
openexr
openimageio
Expand Down Expand Up @@ -286,6 +290,7 @@ stdenv.mkDerivation (finalAttrs: {
ps = python3Packages;
in
[
materialx
ps.numpy
ps.requests
ps.zstandard
Expand Down
2 changes: 2 additions & 0 deletions pkgs/by-name/ma/materialx/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ python3Packages.buildPythonPackage rec {
cmakeFlags = [
(lib.cmakeBool "MATERIALX_BUILD_OIIO" true)
(lib.cmakeBool "MATERIALX_BUILD_PYTHON" true)
# don't build MSL shader back-end on x86_x64-darwin, as it requires a newer SDK with metal support
(lib.cmakeBool "MATERIALX_BUILD_GEN_MSL" (stdenv.isLinux || (stdenv.isAarch64 && stdenv.isDarwin)))
];

pythonImportsCheck = [ "MaterialX" ];
Expand Down

0 comments on commit 4428608

Please sign in to comment.