Build SDL with low glibc and Wayland in Linux

Hi,

I am currently making binaries for games with low glibc using Debian Jessie, which will be out of support soon - around half of 2022.

Unfortunately it doesn’t provide Wayland libraries and headers necessary for building SDL2 with Wayland support.

What’s the recommended distro and version to use for portable binaries that can provide SDL2 with Wayland support and have a low enough glibc version for running on most Linux computers?

Thanks

1 Like

The AppImage folks target the oldest supported LTS version of Ubuntu for their portable binaries. That’s currently 18.04 (16.04 recently went EOL).

You could just link against some sufficiently old version of SDL2 and not bundle it with your game, but use the version installed by the users distro instead (i.e. tell users to install SDL2 on their system, though most probably already have it).
If Wayland is used, the available libsdl2 should support it

Also, Debian Jessie has libwayland-dev, and if SDL2 also needs the wayland-protocols package you could try installing the one from Stretch?

Yes, that’s exactly what I do. But the version of SDL2 available from the distro’s repository can be quite old, for example even on the very latest Raspberry Pi 4 it’s still 2.0.9 (so no batching).

sorry, I have to support both way, static and dynamic linking of SDL2.

SDL2 does need wayland-protocols package for wayland support. Can you explain a bit more on how to install the stretch version on Jessie? I am not that familiar with Debian.

Edit: btw, lots of desktop software offers different builds for differents distros (Zoom even has different builds for different versions of distros). It would be pretty dandy if it was possible to do the same with games, but unfortunately outside of Itch.io which allows just giving people binaries, Steam and others really just want a magic linux package that works everywhere and this is really hard to provide.

For Steam this isn’t hard at all, because Steam provides its own runtime and doesn’t depend on your dependencies being installed on the system, see GitHub - ValveSoftware/steam-runtime: A runtime environment for Steam applications

I mean downloading the wayland-protocols .deb package (see Debian -- Package Download Selection -- wayland-protocols_1.7-1_all.deb and Debian -- Package Download Selection -- wayland-protocols_1.7-1_all.deb) and then running sudo dpkg -i whatever.deb to install it.
This should work as it doesn’t have any dependencies, but no idea how building SDL2 with it works, but it’s worth a try IMHO

1 Like

Thank you! I will try that!!!