Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blender: fix runtime crash by adding missing wayland-scanner, enable strict build options #340100

Merged
merged 3 commits into from
Sep 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions pkgs/applications/misc/blender/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
tbb,
wayland,
wayland-protocols,
wayland-scanner,
waylandSupport ? stdenv.isLinux,
zlib,
zstd,
Expand Down Expand Up @@ -149,28 +150,36 @@ stdenv.mkDerivation (finalAttrs: {

cmakeFlags =
[
"-DMaterialX_DIR=${python3Packages.materialx}/lib/cmake/MaterialX"
"-DPYTHON_INCLUDE_DIR=${python3}/include/${python3.libPrefix}"
"-DPYTHON_LIBPATH=${python3}/lib"
"-DPYTHON_LIBRARY=${python3.libPrefix}"
"-DPYTHON_NUMPY_INCLUDE_DIRS=${python3Packages.numpy}/${python3.sitePackages}/numpy/core/include"
"-DPYTHON_NUMPY_PATH=${python3Packages.numpy}/${python3.sitePackages}"
"-DPYTHON_VERSION=${python3.pythonVersion}"
"-DWITH_ALEMBIC=ON"
"-DWITH_BUILDINFO=OFF"
"-DWITH_CODEC_FFMPEG=ON"
"-DWITH_CODEC_SNDFILE=ON"
"-DWITH_CPU_CHECK=OFF"
"-DWITH_CYCLES_DEVICE_OPTIX=${if cudaSupport then "ON" else "OFF"}"
"-DWITH_CYCLES_OSL=OFF"
"-DWITH_FFTW3=ON"
"-DWITH_IMAGE_OPENJPEG=ON"
"-DWITH_INSTALL_PORTABLE=OFF"
"-DMaterialX_DIR=${python3Packages.materialx}/lib/cmake/MaterialX"
"-DWITH_JACK=${if jackaudioSupport then "ON" else "OFF"}"
"-DWITH_LIBS_PRECOMPILED=OFF"
"-DWITH_MOD_OCEANSIM=ON"
"-DWITH_OPENCOLLADA=${if colladaSupport then "ON" else "OFF"}"
"-DWITH_OPENCOLORIO=ON"
"-DWITH_OPENSUBDIV=ON"
"-DWITH_OPENVDB=ON"
"-DWITH_PULSEAUDIO=OFF"
"-DWITH_PYTHON_INSTALL=OFF"
"-DWITH_PYTHON_INSTALL_NUMPY=OFF"
"-DWITH_PYTHON_INSTALL_REQUESTS=OFF"
"-DWITH_SDL=OFF"
"-DWITH_STRICT_BUILD_OPTIONS=ON"
"-DWITH_TBB=ON"
"-DWITH_USD=ON"

Expand All @@ -189,16 +198,13 @@ stdenv.mkDerivation (finalAttrs: {
]
++ lib.optionals stdenv.isDarwin [
"-DLIBDIR=/does-not-exist"
"-DWITH_CYCLES_OSL=OFF" # causes segfault on aarch64-darwin
"-DSSE2NEON_INCLUDE_DIR=${sse2neon}/lib"
"-DWITH_USD=OFF" # currently fails on darwin
]
++ lib.optional stdenv.cc.isClang "-DPYTHON_LINKFLAGS=" # Clang doesn't support "-export-dynamic"
++ lib.optional jackaudioSupport "-DWITH_JACK=ON"
++ lib.optionals cudaSupport [
"-DOPTIX_ROOT_DIR=${optix}"
"-DWITH_CYCLES_CUDA_BINARIES=ON"
"-DWITH_CYCLES_DEVICE_OPTIX=ON"
];

preConfigure = ''
Expand All @@ -223,7 +229,10 @@ stdenv.mkDerivation (finalAttrs: {
addDriverRunpath
cudaPackages.cuda_nvcc
]
++ lib.optionals waylandSupport [ pkg-config ];
++ lib.optionals waylandSupport [
pkg-config
wayland-scanner
];

buildInputs =
[
Expand Down