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 on Darwin #31637

Closed
wants to merge 1 commit into from
Closed

Conversation

matthewbauer
Copy link
Member

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.

@matthewbauer matthewbauer changed the title Blender: fix on Darwin [wip] blender: fix on Darwin Nov 14, 2017
@edolstra
Copy link
Member

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?

@matthewbauer
Copy link
Member Author

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).

@c0bw3b c0bw3b added 6.topic: darwin Running or building packages on Darwin 8.has: package (update) labels Nov 15, 2017
@matthewbauer matthewbauer changed the title [wip] blender: fix on Darwin blender: fix on Darwin Nov 18, 2017
@matthewbauer
Copy link
Member Author

matthewbauer commented Nov 26, 2017

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.

@@ -11,7 +11,9 @@ stdenv.mkDerivation rec {

outputs = [ "bin" "out" "dev" ];

buildInputs = [ cmake unzip ];
buildInputs = [ cmake unzip ] ++ lib.optional stdenv.isDarwin boost;
Copy link
Member

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?

Copy link
Member Author

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.

@jtojnar
Copy link
Contributor

jtojnar commented Feb 2, 2018

Could the patches be upstreamed?

@matthewbauer
Copy link
Member Author

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.

@jtojnar
Copy link
Contributor

jtojnar commented Feb 2, 2018

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.

@matthewbauer matthewbauer changed the title blender: fix on Darwin [wip] blender: fix on Darwin Mar 7, 2018
adds some darwin specific patches
@GrahamcOfBorg
Copy link

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)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: blender

Partial log (click to expand)

Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


-- Configuring incomplete, errors occurred!
See also "/tmp/nix-build-openimageio-1.8.8.drv-0/source/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/nix-build-openimageio-1.8.8.drv-0/source/build/CMakeFiles/CMakeError.log".
builder for '/nix/store/afcvpahd0hcdv9n9n4sf5215ljxdbyh6-openimageio-1.8.8.drv' failed with exit code 1
cannot build derivation '/nix/store/gynk8l0mrg93ah7r053cjcgfhnshxcsf-blender-2.79a.drv': 1 dependencies couldn't be built
�[31;1merror:�[0m build of '/nix/store/gynk8l0mrg93ah7r053cjcgfhnshxcsf-blender-2.79a.drv' failed

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: blender

Partial log (click to expand)

[ 50%] Building C object source/blender/blenkernel/CMakeFiles/bf_blenkernel.dir/intern/object_deform.c.o
[ 50%] Building C object source/blender/blenkernel/CMakeFiles/bf_blenkernel.dir/intern/object_dupli.c.o
[ 50%] Building C object source/blender/blenkernel/CMakeFiles/bf_blenkernel.dir/intern/object_update.c.o
[ 50%] Building C object source/blender/blenkernel/CMakeFiles/bf_blenkernel.dir/intern/ocean.c.o
[ 50%] Building C object source/blender/blenkernel/CMakeFiles/bf_blenkernel.dir/intern/outliner_treehash.c.o
[ 50%] Building C object source/blender/blenkernel/CMakeFiles/bf_blenkernel.dir/intern/packedFile.c.o
[ 50%] Building C object source/blender/blenkernel/CMakeFiles/bf_blenkernel.dir/intern/paint.c.o
[ 50%] Building C object source/blender/blenkernel/CMakeFiles/bf_blenkernel.dir/intern/particle.c.o
building of '/nix/store/9al2p1bk2mql1ncjnl781idv3yx2lsy8-blender-2.79a.drv' timed out after 3600 seconds
error: build of '/nix/store/9al2p1bk2mql1ncjnl781idv3yx2lsy8-blender-2.79a.drv' failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants