hi, I’ve been trying to compile LÖVR on sailfish and I’m stucked because the following libraries are missing: “libxcb-glx0-dev libx11-xcb-dev”. I wonder if there are any alternative to those libraries that could eventually work.
LÖVR actually runs on android, so I believe it should be possible to build it on sailfish and I developed / ported myself a few games to it and I think it would be interesting as it would allow to add vr games to the sailfish games catalogue.
As it states in the main site, the main focus of LÖVR is obviously Vr but it contains a 3d engine and it is actually possible to build normal 3d games with it and / or turn Vr games into normal 3d games.
those are x11 libraries. They’re unavailable on sfos cause sfos is pure wayland. No they cannot be made available and even if they could they wouldn’t work. You have to patch out the dependency out of the lovr
1 Like
Thanks for clarifying, I was suspecting that. So basically even if it compiles on arm it was never created with wayland in mind and would requires to rewrite part of the framework to work with wayland. It does not sound easy at all and I don’t have the skills for that.
its usually just matter of removing the x11 dependency. If it already works on wayland, all you have to do is remove x11 dependency and it should just work. I’ve done it multiple times
I tried to compile it without those libraries and never succeed, I’m not sure if getting into depth about this would be of interest of the sailfish community. I can share with you in private my results, maybe you can have some guidelines that works (if there’s any progress I can share it here as it would be much more interesting).
No progress I’m afraid, compilation fails with:
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake: 230 (message): Could NOT find X11 (mixxing: X11_X11_INCLUDE_PATH X11_X11_LIB)
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake: 600 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake/Modules/FindX11.cmake:665 (find_package_handle_standard_args)
deps/glfw/src/CMakeList.txt:182 (find_package)
– Configuring incomplete, errors occurred!
I’m leaving that log here just in case someone with more experience than me compiling knows a way to replace X11 with wayland.
As stated above I think this framework would be interesting as it would extend the game catalogue of sailfish with new interesting Vr games.
Are you configuring with -DLOVR_USE_GLFW=OFF
?
And just from reading the CMakeLists file, if you manage to build the glfw library without X11 and with wayland support, maybe using -DLOVR_SYSTEM_GLFW
will make it build.
I guess modification of the cmakelists would then still be necessary, as AFAICS it has some logic which causes linking to X11 if Linux is detected as target OS.
2 Likes
I’ve just made what you suggested and compilation progressed a lot more, I was thinking it would actually compile but after a few seconds I got this new error:
Checking for one of the modules ‘wayland-client’
– BUILD WITH_XLIB HEADERS: OFF
– BUILD WITH_XCB_HEADERS: OFF
– BUILD_WITH_WAYLAND_HEADERS: OFF
Cmake Eroor at deps/openxr/src/cmake/presentation.cmake:48 (message):
xlib backend selected, but BUILD_WITH_XLIB_HEADERS either disabled or unavailable due to missing dependencies.
Call Stack (most recent call first):
deps/openxr/src/CmakeList.txt: 254 (include)
– Configuring incomplete, errors ocurred!
I think this is some progress… but I don’t know how to proceed now…
here is the cmakelist in case anyone want to have a look: lovr/CMakeLists.txt at dev · bjornbytes/lovr · GitHub
1 Like
Similar issue:
Again you can either set -DLOVR_ENABLE_HEADSET=OFF
, or try to compile openxr yourself without X11 (if that is possible) and then use -DLOVR_SYSTEM_OPENXR=ON
.
If you encounter similar errors, try to find in the CMake definition whether one of the options is causing the dependency, and turn that option OFF.
You can find the available options and their defaults at the top of the file:
Once you got it to build, you can turn them on again one by one and try to fix the dependency issues.
It might not be possible in the end, not sure.
2 Likes
setting headset to off did not work, it gave me the same error, I asked gpt and provided this solution which worked:
I modified the section where openxr to set BUILD_WITH_WAYLAND_HEADERS to ON and BUILD_WITH_XLIB_HEADERS to OFF
OpenXR
if(LOVR_ENABLE_HEADSET)if(LOVR_SYSTEM_OPENXR AND NOT ANDROID)pkg_search_module(OPENXR openxr REQUIRED)list(APPEND LOVR_INCLUDES ${OPENXR_INCLUDE_DIRS})list(APPEND LOVR_LIB_DIRS ${OPENXR_LIBRARY_DIRS})set(LOVR_OPENXR ${OPENXR_LIBRARIES})else()set(DYNAMIC_LOADER ON CACHE BOOL “” FORCE)set(BUILD_WITH_WAYLAND_HEADERS ON CACHE BOOL “Enable Wayland backend for OpenXR” FORCE)set(BUILD_WITH_XLIB_HEADERS OFF CACHE BOOL “Disable Xlib backend for OpenXR” FORCE)add_subdirectory(deps/openxr openxr)set(LOVR_OPENXR openxr_loader)endif()endif()
Lövr compiled on sailfish os!
1 Like
Just for kicks, a working build (as in it compiles, not tested!) of no-x11 yes-wayland GLFW is now here:
1 Like
Thanks! I’ll test it later.
Just a quick note for anyone trying to run the games I’ve built with LÖVR: most of them were made for version 0.15. The newer versions introduced quite a few major API changes, and I haven’t kept up with them since these were side projects.
So if you want to play most of my games, you’ll need LÖVR 0.15 specifically.
If I get everything working smoothly, I might also provide builds of LÖVR 0.15 to make things easier.
1 Like
… aaand a build for OpenXR is here:
Again, provided in “it compiles, ship it” untested state.
1 Like
your builds of openxr and glfw install, I installed them with no issues. If they actually work I can not tell because I was too optimistic, lovr builds but almost at the end of compilation errors arise:
lovr/src/core/os_linux.c:13:10 fatal error: xcb/xcb.h: No such file or directory
13 | #include <xcb/xcb.h>
If anyone manage to compile it I would ask for a binary of version 0.15, making my games compliant with latest API changes may never happen as it is too much work. Even better, if you have a working CMakeList please share it so that anyone can generate builds.
I’m still testing changes on the CMakeList but I’m not sure I will manage to have a build that compiles without issues.
Do you have your current source tree online somewhere?
I’m planning to create a repository once I make it compile, I’m close to achieve it, it almost reach 90%. Unless you want to work on my current cmakelist and changes I will let you know once it works and provide the repository url.
For that, try setting -DLOVR_USE_LINUX_EGL=ON
thanks, that problem was resolved on my latest attempt, I’ve been making some progress in the meantime, but after resolving that, new errors arise and I never reached 100%. since I’ve sent you the modified source with the changes I’ve been adding, feel free to add what you think it could work, or if you think I made wrong changes feel free to start from original source. I’m actually not having more progress I’m afraid.
Just to report some findings:
GLFW needs to be less than 3.3.8, because this removed wl_shell
support. There may be some fixes between 3.3.7 and that commit worth taking, but I have not yet tried that.
OpenGL/OpenGLES2/EGL ist still a problem. I have a working lovr binary linked against GLFW 3.3.7, but that fails with:
GLFW error 65545: EGL: Failed to find a suitable EGLConfig
which hints to a problem with OpenGLES.
I have backported triangle-opengles, and that runs Okay (yay!). (All other examples do not…)
So, next step is to modify lovr
to go via OpenGLES. Lets see how that goes.
1 Like