flathub / com.valvesoftware.Steam

https://flathub.org/apps/details/com.valvesoftware.Steam
337 stars 69 forks source link

Master of Orion 1 an 2 fail to run due to steam dosbox missing libcaca. #557

Open akosiaris opened 4 years ago

akosiaris commented 4 years ago

Game information Master of Orion 1 and 2 at the very least

Distribution name and version where applicable Debian Buster. 10.3, x86_64.

Flatpak info $ flatpak --version Flatpak 1.6.2 $ flatpak --gl-drivers default host

Problem description Games that rely on dropbox as a steam runtime fail to run. Looking at steam output after running it in a console with flatpak run com.valvesoftware.Steam I see:

/home/<username>/.local/share/Steam/steamapps/common/Master of Orion 1/dosbox/dosbox_x86_64: error while loading shared libraries: libcaca.so.0: cannot open shared object file: No such file or directory
Done.

ldding the dosbox binary after entering the flatpak with a bash shell (flatpak run --command=/bin/bash com.valvesoftware.Steam ) shows other libraries missing as well

ldd /home/<username>/.local/share/Steam/steamapps/common/Master\ of\ Orion\ 1/dosbox/dosbox_x86_64 | grep 'not found'
    libSDL_sound-1.0.so.1 => not found
    libSDL-1.2.so.0 => not found
    libpng12.so.0 => not found
    libSDL_net-1.2.so.0 => not found

however these libraries seem to be shipped next to dosbox

find /home/alex/.local/share/Steam/steamapps/common/Master\ of\ Orion\ 1/dosbox/libs/x86_64/ -type f
/home/alex/.local/share/Steam/steamapps/common/Master of Orion 1/dosbox/libs/x86_64/libSDL_net-1.2.so.0.8.0
/home/alex/.local/share/Steam/steamapps/common/Master of Orion 1/dosbox/libs/x86_64/libsmpeg-0.4.so.0
/home/alex/.local/share/Steam/steamapps/common/Master of Orion 1/dosbox/libs/x86_64/libSDL-1.2.so.0
/home/alex/.local/share/Steam/steamapps/common/Master of Orion 1/dosbox/libs/x86_64/libSDL_sound-1.0.so.1
/home/alex/.local/share/Steam/steamapps/common/Master of Orion 1/dosbox/libs/x86_64/libSDL-1.2.so.0.11.4
/home/alex/.local/share/Steam/steamapps/common/Master of Orion 1/dosbox/libs/x86_64/libpng12.so.0
/home/alex/.local/share/Steam/steamapps/common/Master of Orion 1/dosbox/libs/x86_64/libpng12.so.0.50.0
/home/alex/.local/share/Steam/steamapps/common/Master of Orion 1/dosbox/libs/x86_64/libmikmod.so.2.0.4
/home/alex/.local/share/Steam/steamapps/common/Master of Orion 1/dosbox/libs/x86_64/libSDL_sound-1.0.so.1.0.2
/home/alex/.local/share/Steam/steamapps/common/Master of Orion 1/dosbox/libs/x86_64/libSDL_net-1.2.so.0
/home/alex/.local/share/Steam/steamapps/common/Master of Orion 1/dosbox/libs/x86_64/libmikmod.so.2
/home/alex/.local/share/Steam/steamapps/common/Master of Orion 1/dosbox/libs/x86_64/libsmpeg-0.4.so.0.1.4

by steam. Turns out the libcaca error is from libSDL-1.2.so.0.11.4 (libSDL-1.2.so.0 is the exact same binary) that user libcaca library and fails to find it.

ldd dosbox/libs/x86_64/libSDL-1.2.so.0 |grep 'not found'
    libcaca.so.0 => not found

Does this issue reproduce with native Steam Have not tested but reports in user channels and wikis point out that steam uses the system's libcaca. e.g.

https://wiki.archlinux.org/index.php/Steam/Game-specific_troubleshooting#Rock_Boshers_DX:_Directors_Cut suggests installing 32-bit version of libcaca

https://steamcommunity.com/app/410980/discussions/0/343787920130132180/ points out to problems being resolved once libcaca and speex is installed in the system

https://github.com/ValveSoftware/steam-for-linux/issues/553#issuecomment-12097292 points out that this is known since 2013 and possibly fixed by dropping the dependency?

akosiaris commented 4 years ago

It's not fully clear to me which is preferable. Bundling libcaca in this flatpak build, essentially following the path of the first 2 comments above? Or chase this down using the 3rd approach and create an issue at https://github.com/ValveSoftware/steam-for-linux (assuming it's easily fixable)?

The first approach would fix this for every dosbox game that is plagued by this, with the caveat that shipping an incompatible libcaca might cause even more interesting issues. On the other hand, some games would be playable.

The latter approach would possibly fix this just for master of orion 1,2 missing the opportunity to fix more games. On the other hand, steam shipping a dosbox that makes assumptions about the presence of libraries and their versions on the host system is problematic.

I 'll try open a task anyway and see where it gets us.

akosiaris commented 4 years ago

FYI, and as expected, steam-for-linux bugs sent me over to the game devs. https://github.com/ValveSoftware/steam-for-linux/issues/7079

nanonyme commented 4 years ago

Yes, Valve does not in general touch distributed games. I'm not sure if it's by policy or lack of permission even to do it. In general things like Proton are a lot nicer to them than game vendors bundling compat things (like dosbox) because it allows Valve to keep updating the compat layer.

nanonyme commented 4 years ago

In this case it's quite probable there's in fact some conflict between freedesktop-sdk runtime and libraries distributed by the game which results in (incorrect) output loading these libraries. For one, to be able to debug anything, you should flatpak install org.freedesktop.Sdk//19.08, then flatpak run --devel --command=bash com.valvesoftware.Steam.

Inside this shell you have ldd that will actually work correctly. (if you run ldd on your host, it will see host libraries. Steam app does not see those but only libraries within the sandbox). You can check from the shell script if you find which LD_LIBRARY_PATH value it's setting (or just assume it points to that directory with the libraries) and then finally run ldd again.

nanonyme commented 4 years ago

I'm also sort of wondering if it'd be better to just bundle libSDL1 in the app rather than trying to appease the game's libSDL1's dependencies. There's a ready recipe for that.

nanonyme commented 2 years ago

There also happens to be libSDL1 wrapper that makes it translate calls to libSDL2. I've been thinking of utilizing this as libSDL1 is completely unsupported at this point.