Blender: Initial support for Haiku
ClosedPublic

Authored by Zoltán Mizsei (miqlas) on Sep 28 2017, 11:13 AM.

Details

Summary

Currently only SDL based Ghost available.

Diff Detail

Generally seems OK.

Main Q is - if we want to support this - even on a basic level like we do for FreeBSD.

CMakeLists.txt
786–790

no indentation.

source/blender/blenlib/intern/fileops.c
630–632

with C99 - the variables can be in the same ifdef

Also prefer brace outside the ifdef - on the next line.

source/blender/blenlib/intern/fileops.c
630–632

On second thoughts. Best to use BLI_is_dir

source/blender/blenlib/intern/fileops.c
632

Does defining _BSD_SOURCE or _DEFAULT_SOURCE in the CMAKE_C_FLAGS resolve this? see: https://stackoverflow.com/questions/9241538 & http://man7.org/linux/man-pages/man3/readdir.3.html

@Zoltán Mizsei (miqlas) are there other changes needed/planned after initial support is added?
If we accept the patch, then need many more changes for good support - I'd rather know this in advance.

@Zoltán Mizsei (miqlas) are there other changes needed/planned after initial support is added?
If we accept the patch, then need many more changes for good support - I'd rather know this in advance.

Yes, native Ghost support. SDL isn't ideal. Here is the earlier patches: https://github.com/haikuports/haikuports/blob/master/media-gfx/blender/patches/blender-2.49b.patch

Lot of things changed, it doesn1t applies cleanly anymore, so i'm plan to try to resurect this.

source/blender/blenlib/intern/fileops.c
632

I suppose : yes.

Campbell Barton (campbellbarton) requested changes to this revision.Oct 4 2017, 6:47 AM
This revision now requires changes to proceed.Oct 4 2017, 6:47 AM

Regarding Ghost - its already quite a bit of overhead to support 4x different backends when updating ghost.
I would really prefer to have Haiku use & improve SDL (or maintain Ghost changes in a branch).

Currently Haiku is a very niche system, so I'd rather not add avoidable maintenance overhead.
Especially when its not clear if there are many/any active users on the platform.

If it becomes more popular with users we can always re-evaluate this.

source/blender/blenlib/intern/fileops.c
632

This can be added to CMAKE_C_FLAGS, CMAKE_CXX_FLAGS then.

Haiku got dirent support with -D_BSD_SOURCE

Bah, the test-build just failed.

As you told, i tried to add -D_BSD_SOURCE to the CFLAGS, but the problem was actually with d_type:
"error: const struct dirent has no member named 'd_type'"
It is just not available on Haiku.

So the current patchset is broken on Haiku. Should i revert it to the earlier version?

Reverted BSD_SOURCE, as dirent still not ok with it.
Sadly it seems this dirent patch actually needed.

CMakeLists.txt
787

Why is this needed here? (Good to add a comment since Blender isn't doing networking.)

Shouldn't this be added to platform_unix.cmake ?

Zoltán Mizsei (miqlas) marked 3 inline comments as done.Oct 30 2017, 8:09 AM
CMakeLists.txt
787

There is no -lsocket on Haiku, so the socket functionality resides in -lnetwork.

Further reduced patchset size

Generally LGTM

source/blender/blenlib/intern/fileops.c
632

Still have a slight preference for BLI_is_dir.

This revision is now accepted and ready to land.Nov 30 2017, 8:02 AM