Add Haiku support
This fixes and upstreams a port by @puckipedia done some years ago.
Didn't check the premake stuff yet (it seems we have a recipe for 4.4 but not 5 yet), but the Scons-built test do work.
Thanks for sharing this pull request with me and apologies for taking so long to get back.
I don't have the Haiku experience to review or maintain but I am willing to maintain a contrib-haiku branch which merges Haiku updates from contributors.
Before I do this I would like to know if you are interested in supporting Haiku via premake when premake5 comes available (maybe it has by now)?
Oh I didn't reply yet… you're not the only one lagging ;-)
Not sure why you want to keep this in a separate branch…
We still have premake 4.4 in haikuports. Looks like 5 is now alpha, I guess someone will update the recipe…
I managed to build premake 5 alpha13 (alpha14 has a missing file).
But of course it won't work…
I actually installed HaikuOS onto virtualbox tonight and attempted to compile it. I noticed this PR uses the deprecated Scons approach to compiling. Unfortunately, it also failed to build tests with link errors: undefined reference to 'operator new[](unsigned long). This is because gcc is being used to link instead of g++.
I haven't looked at the source code yet.
Is there any will to get this cleaned up? I would consider merging it if the code was of a maintainable quality and just worked for anyone who wanted to build it and its tests.
The first order of business is moving over to the existing Premake system. Let me know.
I got premake working but I still have to squash the PR…
It's possible it doesn't link with the C++ library by default. You might want to try to build after running setarch x86 which will use the newer gcc than the 2.95.
It doesn't work on my fresh install.
Let me know when premake support is in there and it works from a fresh checkout and provides build instructions that works from a fresh install and I'll check it out.
This PR has merge conflicts and doesn’t build, and has had no comments in a week. In the interest of keeping NFD’s github page current, I’d like to hear a commitment to move this forward with a specific timeframe, or we can close this and try again later with a different PR.
Well I spent the time rebasing the PR on premake… time spent somewhere is not spent on project that's already been waiting for months.
I'll rebase and see.
Wait, which version did you install, beta, nightly? Did you take the gcc2h or a 64bit one?
I rebased but I can't get premake 5 alpha13 to work so I can't add the haiku-specific part yet:
Error: [string "src/base/_foundation.lua"]:57: [string "d/tools/dmd.lua"]:106: attempt to index a nil value
I'll try to make an alpha14 package with my patches…
I finally managed to get a usable premake5 package… but now I have to implement NFD_PickFolder…
It should build now with gcc > 2.95 (I suppose you didn't use the official gcc2 hybrid image which is why you had the missing new()), but I'd still like to get gcc2 working. However it seems premake itself uses options that it doesn't understand properly.
I'll check it out. What are the exact commands I should type in after doing a fresh install of the OS to get this fully built?
On latest nightly (gcc2h, I don't think the buildbot generated a premake package for the other ones) you should be able to:
pkgman install cmd:gcc_x86 cmd:ld_x86 premake_x86
setarch x86
cd build
premake5 --verbose dist
cd gmake_haiku
make verbose=1
I noticed ImHex that I want to port actually uses this as a git submodule… Just rebased and fixed the build.
Oddly premake munges all the OBJDIR from all makefiles to remove the ../ for some reason, not sure what to do about this…