ValveSoftware / steam-runtime

A runtime environment for Steam applications
Other
1.19k stars 86 forks source link

[Feature Request] Update to SDL 2.0.5 #71

Closed flibitijibibo closed 6 years ago

flibitijibibo commented 7 years ago

SDL 2.0.5 was released last October, ~4 months ago:

http://lists.libsdl.org/pipermail/sdl-libsdl.org/2016-October/100786.html

2.0.5 adds a few functions like SDL_RenderSetIntegerScale and SDL_SetWindowResizable, and is used by games like VVVVVV, Eversion, and every recent FNA title. Currently, to run these games, either the Steam runtime has to be disabled or you have to edit the script to forcibly use the bundled SDL2 lib (which is otherwise ignored by Steam's LD_LIBRARY_PATH ordering). FNA games have it a little easier because the kick binary uses RPATH, but non-C# titles will likely exit due to undefined symbols.

flibitijibibo commented 7 years ago

To clarify further: The main problem is that the SRT version of SDL2 claims to be 2.0.5 when it actually isn't; it appears to be based on a prerelease version of the library before all the new functions were added. So, on a system that only has 2.0.4 installed, setting LD_LIBRARYPATH=$LD_LIBRARY_PATH:./x86_64/ still works correctly.

smcv commented 7 years ago

Actually, it seems to be a bit more complicated than this...

The Steam Runtime includes SDL2 version 2.0.4 (more precisely, it's version 2.0.4+steamrt2 as packaged by an SDL upstream developer). The source code of this one seems to be identical to the SDL 2.0.4 release, as packaged in Debian in the past.

However, the steam.sh script that runs the Steam client unconditionally prepends the ubuntu12_32 and ubuntu12_32/panorama subdirectories of the Steam root directory to the LD_LIBRARY_PATH, whether the Steam Runtime is in use or not. This LD_LIBRARY_PATH appears to be carried over to Steam games, meaning any 32-bit Steam game that uses SDL2 is really using ubuntu12_32/libSDL-2.0.so.0 unless it has taken steps to prepend (not append!) a directory with its own bundled copy of SDL2 to the LD_LIBRARY_PATH. However, this does not apply to 64-bit Steam games, which will use the Steam Runtime's SDL2 version 2.0.4 instead.

If you want to bundle a newer SDL2 with a game, I would suggest using a wrapper script that prepends to LD_LIBRARY_PATH, something like this:

#!/bin/sh
set -e
here="$(cd "$(dirname "$0")" && pwd)"
export LD_LIBRARY_PATH="${here}/bundled-libs/x86_64${LD_LIBRARY_PATH:+:"$LD_LIBRARY_PATH"}"
exec "$here/mygame.bin.x86_64"
TTimo commented 6 years ago

steam beta client runtime and scout/scout_beta apt just updated with SDL2 2.0.8+steamrt1