Hello there! Now that Haiku is in beta, I want to help in some way. Looking through the repos on my machine, I found NXEngine-evo, which has Linux build instructions here. I have installed the required libraries from HaikuDepot, however these errors pop up when running cmake -DCMAKE_BUILD_TYPE=Release .. in the terminal:
CMake Error at /boot/system/data/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find SDL2 (missing: SDL2_INCLUDE_DIR)
Call Stack (most recent call first):
I apologize if this seems trivial to some out there. This is my first time trying to compile programs for Haiku. I want to contribute in some way to Haiku and learn something new; this is something that (if successful) would fulfill both aims.
Running pkgman search sdl | grep "S " shows that the necessary SDL 2 packages are already installed:
S libsdl2 Simple Direct Media Layer 2.0
S libsdl2_devel Simple Direct Media Layer 2.0 (development files)
S sdl2_mixer SDL2 mixing library
S sdl2_mixer_devel SDL2 mixing library (development files)
S sdl2_ttf A TrueType font rendering library for SDL2
S sdl2_ttf_devel A TrueType font rendering library for SDL2 (development files)
Note: There are seven spaces between S and the enclosing " in the grep part of the command. Discourse seems to skip displaying more spaces between characters unless they are in a codeblock. Here is the actual command:
i guess that i’m too used to Linux when talking about ‘development packages’. What i meant in Haiku, is that there is no package installed with the sources for sdl2, which should be the ‘source’ suffixed package.
Unfortunately, neither haikudepot nor pkgman can install it for my Haiku version, so… outta luck.
This is kinda the stuff that should be fixed for normal development of apps in Haiku.
Seems like i’m being a Haiku-noob here, as the devel packages do work and generated the include files. Sorry again for noobness.
This is probably related to a misconfiguration on cmake default params
It is a bit weird that it is complaining about missing files when none of the sort happens in Linux. Maybe it is defaulting to Windows? The original NXEngine was only for Windows until it was later ported to multiple other operating systems and platforms.
Addendum: Output from the compiler
Scanning dependencies of target nx
[ 1%] Building CXX object CMakeFiles/nx.dir/src/ObjManager.cpp.o
In file included from /boot/home/nxengine-evo/src/ObjManager.cpp:2:
/boot/home/nxengine-evo/src/nx.h:5: SDL.h: No such file or directory
In file included from /boot/home/nxengine-evo/src/nx.h:14,
/boot/home/nxengine-evo/src/common/basics.h:5: cstdint: No such file or directory
In file included from /boot/home/nxengine-evo/src/siflib/sif.h:5,
/boot/home/nxengine-evo/src/siflib/../common/misc.h:4: cstdint: No such file or directory
In file included from /boot/home/nxengine-evo/src/object.h:4,
/boot/home/nxengine-evo/src/floattext.h:4: SDL.h: No such file or directory
In file included from /boot/home/nxengine-evo/src/player.h:8,
/boot/home/nxengine-evo/src/input.h:4: SDL.h: No such file or directory
In file included from /boot/home/nxengine-evo/src/graphics/sprites.h:9,
/boot/home/nxengine-evo/src/graphics/nxsurface.h:5: SDL.h: No such file or directory
In file included from /boot/home/nxengine-evo/src/game.h:7,
/boot/home/nxengine-evo/src/TextBox/TextBox.h:4: cstdint: No such file or directory
/boot/home/nxengine-evo/src/TextBox/TextBox.h:6: array: No such file or directory
CMakeFiles/nx.dir/build.make:62: recipe for target 'CMakeFiles/nx.dir/src/ObjManager.cpp.o' failed
make: *** [CMakeFiles/nx.dir/src/ObjManager.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/nx.dir/all' failed
make: *** [CMakeFiles/nx.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Unless there are recipes for x86_64 for libsdl… nothing.
Thanks. Good to know the answer to that problem. Guess that a recipe might just take cmake params to solve it, with some sys variables for archs.
In any case @win8linux , good find on a game/engine to port. If you get to pass the variables that the engine expects & the application compiles, you can follow the running instructions and get the engine running
I’ve added the necessary changes to the CMake files for the modules in this repo.
Addendum: Looking through HaikuPorts reveals a recipe for NXEngine here in HaikuPorts. However, it uses an older engine. Perhaps I’ll modify it to build the newer NXEngine-evo in lieu of starting from scratch.
If it’s the NxEngine but not evo, recipe should be in another directory in the tree. Like scummvm having both folders for libretro and normal scummvm.
What i dont like about this game engine is that (if i am not wrong) looks for a folder ‘data’ where the nx binary is located instead of the current path. (Unless i tested wrongly).
And you shouldnt bundle the engine with the game data, so that should be fixed in the source code too (that should go to original coder or in a code patch, which i dont want to do as first option now hehe)
Licenses are weird, i wouldnt mess with that. You can include a command to download and extract the game, if required.
Engine should work from the path it’s run and not where it’s physically located, so you can do a symbolic link to the executable in the game data folder (wherever it is, maybe in your home, your desktop… whatever) and work there. Including this in haiku binaries folder should be a nono. If you look around in your bin directory (/system/bin) you would see that there are only binaries only.
Installed packages and binaries and info are treated as readonly and mounted at boot (if i understand correctly), so you may be increasing that somehow. Not sure about this.
But i’m still a newbie on Haiku sys functionality, elders may explain if i’m right or saying nonsense