Page 1 of 1

OpenBSD as an officially supported platform?

PostPosted: 16 Dec 2021, 03:38
by Monkey
Hi all,

I played STK quite a few years ago but stopped as I had completed the single player stuff and there was no online multiplayer mode at that time. Recently, I thought I'd revisit STK and was really pleased to see that so much progress has been made, especially regarding the online multiplayer situation. I think originally I played on Linux although I'm not sure. Anyway, I use OpenBSD as my only OS and have done for many years. STK is in the OpenBSD software repository but it's only version 0.9.3 (which of course is a bit old now and doesn't even have multiplayer online capability). To get it to run on OpenBSD, some devs have had to patch it a bit too (IIRC there is about 5 small patches to make it work). Anyway, I would really like to play the latest stable version, 1.3, but I've tried to compile it from source and I've run into some hurdles, some of which I can get around and some of which I can't. Note that I'm neither an OpenBSD dev nor an expert programmer, however I have successfully compiled some other games from source.

What I am suggesting here is to make OpenBSD another one of the officially supported platforms. OpenBSD's user base is growing quite quickly and gaming has recently become something of great interest to many people that use it, including some of the devs! Wouldn't it be cool to have another platform officially supported and so easily at that. Also, from what I've seen, OpenBSD devs really appreciate upstream devs that incorporate their patches/code.

One important thing to note is that OpenBSD is not like Linux (kernel + third party userland); OpenBSD is pretty much an entire operating system. This means that FreeBSD, NetBSD and OpenBSD aren't *BSD distros, they are independent OSs (basically, you can't really say you support *BSD).

So, what do you think?

Re: OpenBSD as an officially supported platform?

PostPosted: 16 Dec 2021, 15:12
by benau
What compiling errors are you having?

Re: OpenBSD as an officially supported platform?

PostPosted: 17 Dec 2021, 04:31
by Monkey
I downloaded STK 1.3 (source code and data in the .tar.xz file). I read the files README.md and INSTALL.md. I believe that I have installed all of the packages that are required to build/compile STK 1.3. I made a "cmake-build" directory within the STK source directory. I entered that directory and typed:
{l Code}: {l Select All Code}
cmake -DBUILD_RECORDER=off ..

So, the first issue is that OpenBSD does not have a Bluetooth stack at all and cmake complained with the following error:
{l Code}: {l Select All Code}
CMake Error at /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Bluez (missing: BLUEZ_LIBRARY BLUEZ_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  lib/wiiuse/cmake/FindBluez.cmake:65 (find_package_handle_standard_args)
  lib/wiiuse/CMakeLists.txt:53 (find_package)

I realised that I might be able to disable the check for Bluetooth so I grepped for files containing "Bluez" and commented out a couple of lines in lib/wiiuse/CMakeLists.txt. This allowed cmake to complete but on typing "make", the following error(s) occured:
{l Code}: {l Select All Code}
In file included from /usr/local/third-party/SuperTuxKart-1.3-src/lib/wiiuse/src/classic.c:34:
In file included from /usr/local/third-party/SuperTuxKart-1.3-src/lib/wiiuse/src/classic.h:37:
/usr/local/third-party/SuperTuxKart-1.3-src/lib/wiiuse/src/wiiuse_internal.h:64:2: error: "Platform not yet supported!"
#error "Platform not yet supported!"
 ^
In file included from /usr/local/third-party/SuperTuxKart-1.3-src/lib/wiiuse/src/classic.c:34:
In file included from /usr/local/third-party/SuperTuxKart-1.3-src/lib/wiiuse/src/classic.h:37:
In file included from /usr/local/third-party/SuperTuxKart-1.3-src/lib/wiiuse/src/wiiuse_internal.h:280:
/usr/local/third-party/SuperTuxKart-1.3-src/lib/wiiuse/src/wiiuse.h:94:2: error: "Platform not yet supported!"
#error "Platform not yet supported!"
 ^
In file included from /usr/local/third-party/SuperTuxKart-1.3-src/lib/wiiuse/src/classic.c:34:
In file included from /usr/local/third-party/SuperTuxKart-1.3-src/lib/wiiuse/src/classic.h:37:
/usr/local/third-party/SuperTuxKart-1.3-src/lib/wiiuse/src/wiiuse_internal.h:406:66: warning: implicitly declaring library function 'memcpy' with type 'void *(void *, const void *, unsigned long)' [-Wimplicit-function-declaration]
INLINE_UTIL void to_big_endian_uint8_t(byte *buf, uint8_t val) { memcpy(buf, &val, 1); }
                                                                 ^
/usr/local/third-party/SuperTuxKart-1.3-src/lib/wiiuse/src/wiiuse_internal.h:406:66: note: include the header <string.h> or explicitly provide a declaration for 'memcpy'
1 warning and 2 errors generated.
*** Error 1 in . (lib/wiiuse/src/CMakeFiles/wiiuse.dir/build.make:76 'lib/wiiuse/src/CMakeFiles/wiiuse.dir/classic.c.o': cd /usr/local/third...)
*** Error 2 in . (CMakeFiles/Makefile2:597 'lib/wiiuse/src/CMakeFiles/wiiuse.dir/all': make -s -f lib/wiiuse/src/CMakeFiles/wiiuse.dir/build...)
*** Error 2 in /usr/local/third-party/SuperTuxKart-1.3-src/cmake-build (Makefile:136 'all': make -s -f CMakeFiles/Makefile2 all)

These are clearly related to Bluetooth/Bluez. So, I guess I need some proper way to disable the requirement for Bluetooth/Bluez. Would one of the STK devs be able to do that or is there some way to do it?

Re: OpenBSD as an officially supported platform?

PostPosted: 17 Dec 2021, 07:20
by benau
Try add -DUSE_WIIUSE=0 to cmake

Re: OpenBSD as an officially supported platform?

PostPosted: 17 Dec 2021, 20:38
by Monkey
Thanks for that.

So, the next compile error is:
{l Code}: {l Select All Code}
In file included from /usr/local/third-party/SuperTuxKart-1.3-src/lib/irrlicht/source/Irrlicht/CIrrDeviceSDL.cpp:9:
In file included from /usr/local/third-party/SuperTuxKart-1.3-src/lib/irrlicht/source/Irrlicht/CIrrDeviceSDL.h:20:
/usr/local/include/SDL2/SDL_syswm.h:69:10: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
         ^~~~~~~~~~~~
1 error generated.
*** Error 1 in . (lib/irrlicht/CMakeFiles/stkirrlicht.dir/build.make:790 'lib/irrlicht/CMakeFiles/stkirrlicht.dir/source/Irrlicht/CIrrDeviceSDL.cpp.o')
*** Error 2 in . (CMakeFiles/Makefile2:537 'lib/irrlicht/CMakeFiles/stkirrlicht.dir/all': make -s -f lib/irrlicht/CMakeFiles/stkirrlicht.dir...)
*** Error 2 in /usr/local/third-party/SuperTuxKart-1.3-src/cmake-build (Makefile:136 'all': make -s -f CMakeFiles/Makefile2 all)

Now, on OpenBSD, Xlib.h is located at /usr/X11R6/include/X11/Xlib.h which should be ok, no?

Re: OpenBSD as an officially supported platform?

PostPosted: 18 Dec 2021, 02:20
by benau
you need to add that include cflags manually