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 on Darwin #31637
blender: fix on Darwin #31637
Conversation
I really don't want 405-line cmake files in the Nixpkgs source tree. This will make maintaining Blender in Nixpkgs a huge pain. Why is it needed anyway? |
The main issue is how the platform_apple.cmake was originally done. It doesn't use any of the find_package stuff you usually see in cmake files and instead just hardcodes all of the paths. Apparently not many people build Blender on MacOS from source so it's very hacky. https://github.com/dfelinto/blender/blob/master/build_files/cmake/platform/platform_apple.cmake I'll see if we can force Blender to use "platform_unix.cmake" which is written much better (but might be incompatible with MacOS). |
5081968
to
d5a44d5
Compare
Okay, so I've reworked this to utilize patches instead. The platform_apple.cmake patch is still about 400 lines but that's a little bit better than having a .cmake file. Either way this is about as good as we can get it to work properly on Darwin. Does this look okay to merge? It certainly adds more complexity, but you can always just get rid of the broken patch files on update. |
d5a44d5
to
b1f3d5d
Compare
@@ -11,7 +11,9 @@ stdenv.mkDerivation rec { | |||
|
|||
outputs = [ "bin" "out" "dev" ]; | |||
|
|||
buildInputs = [ cmake unzip ]; | |||
buildInputs = [ cmake unzip ] ++ lib.optional stdenv.isDarwin boost; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit strange, why does opencolorio depend on Boost on macOS but not on other platforms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah boost is an optional dependency of opencolorio. It will be used by opencolorio automatically if it's found. MacOS builds seem to need it for some compatibility libraries while Linux seems to not need it.
Could the patches be upstreamed? |
The isfinite patch could be but the others are build system related. I’d like to convince blender to change their bizaare Mac build process but I don’t think it would be easy because it probably just works for them. |
I do not see why would they mind, if it made the build process more portable. I already changed the build process of several programs and the maintainers accepted it, sometimes even asking me to change their other programs. Although none of the changes were as extensive as this. |
adds some darwin specific patches
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: blender Partial log (click to expand)
|
Failure on x86_64-darwin (full log) Attempted: blender Partial log (click to expand)
|
Failure on x86_64-linux (full log) Attempted: blender Partial log (click to expand)
|
Motivation for this change
This commit set adds some hacks to get Blender to compile on Darwin.
NOTE: still waiting for Blender to finish compiling but hopeful it will work. Wait to merge until then.