diff options
| author | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-03-17 17:26:05 -0500 |
|---|---|---|
| committer | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-03-17 17:26:05 -0500 |
| commit | 2efc7e6124ef814ac9abd874bff0dc6b3e6768d0 (patch) | |
| tree | 6167ebc6b89b1799506f426a58661c9e1e26400d /libs/basic_games | |
| parent | e41a79a9033761916fa133260ff1849288db7df1 (diff) | |
Fix Steam game mode: clear LD_LIBRARY_PATH, deploy native basic_games, add env var detection
Steam game mode injects its scout/soldier runtime into LD_LIBRARY_PATH,
which breaks Python extension modules and Qt internals that resolve
dependencies via LD_LIBRARY_PATH rather than RPATH. This caused all
Python-based basic_games plugins (Witcher 3, Oblivion Remastered, BG3,
etc.) to fail to load when launched through Steam.
Changes:
- Launcher script: set LD_LIBRARY_PATH to only bundled lib/ dir instead
of leaving Steam's runtime in the path
- AppRun: same fix — replace rather than append to LD_LIBRARY_PATH
- Deploy libbasic_games_native.so in tarball (was built but never copied)
so basic_games entries work without Python dependency
- Add STEAM_COMPAT_CLIENT_INSTALL_PATH env var check to Python
steam_utils.py (mirrors C++ fix from e41a79a) for game mode detection
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'libs/basic_games')
| -rw-r--r-- | libs/basic_games/games/game_arkhamcity.py | 2 | ||||
| -rw-r--r-- | libs/basic_games/games/game_vampirebloodlines.py | 1 | ||||
| -rw-r--r-- | libs/basic_games/steam_utils.py | 11 |
3 files changed, 13 insertions, 1 deletions
diff --git a/libs/basic_games/games/game_arkhamcity.py b/libs/basic_games/games/game_arkhamcity.py index 0b8269f..adcf6d4 100644 --- a/libs/basic_games/games/game_arkhamcity.py +++ b/libs/basic_games/games/game_arkhamcity.py @@ -53,7 +53,7 @@ class ArkhamCityGame(BasicGame): # This will only detect saves from the earliest-created Steam profile on the user's PC. def savesDirectory(self) -> QDir: - docSaves = QDir(self.documentsDirectory().cleanPath("../../SaveData")) + docSaves = QDir(self.documentsDirectory().absoluteFilePath("../../SaveData")) if self.is_steam(): if (steamDir := find_steam_path()) is None: return docSaves diff --git a/libs/basic_games/games/game_vampirebloodlines.py b/libs/basic_games/games/game_vampirebloodlines.py index a63b308..41d63cc 100644 --- a/libs/basic_games/games/game_vampirebloodlines.py +++ b/libs/basic_games/games/game_vampirebloodlines.py @@ -83,6 +83,7 @@ class VampireTheMasqueradeBloodlinesGame(BasicGame): for iniFile in self.iniFiles(): iniPath = Path(self.documentsDirectory().absoluteFilePath(iniFile)) if not iniPath.exists(): + iniPath.parent.mkdir(parents=True, exist_ok=True) with open(iniPath, "w") as _: pass diff --git a/libs/basic_games/steam_utils.py b/libs/basic_games/steam_utils.py index a3daeaf..f61f392 100644 --- a/libs/basic_games/steam_utils.py +++ b/libs/basic_games/steam_utils.py @@ -1,5 +1,6 @@ # Code greatly inspired by https://github.com/LostDragonist/steam-library-setup-tool +import os import sys import winreg from pathlib import Path @@ -150,6 +151,16 @@ def find_steam_path() -> Path | None: except FileNotFoundError: pass + # When Steam launches an app (e.g. in game mode), it sets + # STEAM_COMPAT_CLIENT_INSTALL_PATH to its own root. Check it first so we + # find the right installation even if $HOME resolves differently inside + # the gamescope session (e.g. /var/home vs /home on Bazzite). + steam_env = os.environ.get("STEAM_COMPAT_CLIENT_INSTALL_PATH", "") + if steam_env: + p = Path(steam_env) + if p.is_dir() and p.joinpath("steamapps", "libraryfolders.vdf").exists(): + return p + # Linux: check common Steam install locations. for candidate in ( Path.home() / ".local" / "share" / "Steam", |
