Hi!
I am trying to build and run Blender from source using the instructions from the official docs. Overall, it’s pretty straightforward – requiring only a few dependencies and then calling make. All needed packages were easy to find in nixpkgs and I’ve installed them in a shell with:
{ pkgs ? import <nixpkgs> {}}:
pkgs.mkShell {
packages = with pkgs; [
python3
git
git-lfs
cmake
subversion
pkg-config
libx11
libxkbcommon
libxxf86vm
libxcursor
libxi
libxrandr
libxinerama
libGL
wayland
dbus
];
}
Executing make update (to install a few pre-compiled libs) and then make to build Blender itself succeeds in producing an executable without issues. However, running it throws the following error:
../build_linux/bin/blender: error while loading shared libraries: libSM.so.6: cannot open shared object file: No such file or directory
From what I understood, dynamic libs should be avoided in NixOS and so tried setting the CMake option WITH_STATIC_LIBS to true and rebuilding, but it leads to exactly the same error.
I’ve had similar issues previously which led me to enable nix-ld and, checking my config, I have libSM there. But it doesn’t seem to resolve the present problem.
I think it might have something to do with the pre-compiled libraries installed (as the official nix derivation for Blender doesn’t use libSM directly it seems), but I don’t know how to verify this without recompiling everything. And I’d like to avoid shooting in the dark as each new attempt takes a good 30-40 min where I can’t use my computer because the compilation uses all my RAM.
So I’d be very grateful if someone more knowledgable could point me in the right direction regarding this. And another more general question, how do you usually go on hacking on projects already in nixpkgs? It seems natural to go look there first – as all dependencies and fixes needed are already there – but from what I understood derivations cannot use cached compilation results by design. And so everything is recompiled each time which is less than ideal for quickly iterating on code.