mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-06 13:05:47 +00:00
fix(bionic): start bionic picks on DroidDeck-Proton when Run without proot is off
DroidDeck-Bionic runs only without proot. With proot on, the wrapper every adopted tool gets now hands a launch sent to a DroidDeck-Bionic tool to the newest installed DroidDeck-Proton's own wrapper before any setup step runs, so the game starts as if that Proton had been picked: its components, DirectAudio and store steps apply to DroidDeck-Proton. Per-game picks and the default are left as set, so the games return to DroidDeck-Bionic once Run without proot is on again. Without an installed DroidDeck-Proton the tool still stops with its message.
This commit is contained in:
1 parent
220f7573a7
commit
76bc0c236a
2 files changed
+56
-1
No files matched your search
@@ -293,6 +293,21 @@ dd_vacdiag() {
|
||||
}
|
||||
"""
|
||||
|
||||
# DroidDeck-Bionic runs only without proot. With proot on, a launch Steam sends to a DroidDeck-Bionic tool goes to the
|
||||
# newest DroidDeck-Proton's wrapper before anything else runs, as if that Proton had been picked; the picks stay as set.
|
||||
DD_BIONIC_PROOT_FALLBACK = """
|
||||
if [ -f "$here/bionic/launch.sh" ] && [ -z "${DDNATV_ROOT:-}" ]; then
|
||||
dd_fallback=$(cd "$here/.." 2>/dev/null && for d in DroidDeck-Proton*; do
|
||||
[ -x "$d/droiddeck-proton-wrap" ] && [ ! -e "$d/bionic/launch.sh" ] || continue
|
||||
v=${d#DroidDeck-Proton}; printf '%s\\t%s/%s\\n' "${v#[ -]}" "$PWD" "$d"
|
||||
done | sort -V | tail -n 1 | cut -f 2-)
|
||||
if [ -n "$dd_fallback" ]; then
|
||||
echo "droiddeck-proton: DroidDeck-Bionic needs Run without proot; this launch uses ${dd_fallback##*/}" >&2
|
||||
exec "$dd_fallback/droiddeck-proton-wrap" "$verb" "$@"
|
||||
fi
|
||||
fi
|
||||
"""
|
||||
|
||||
DD_DRIVER_QUERY_SKIP = """
|
||||
case "$verb:${1##*/}:${STEAM_COMPAT_DATA_PATH%/}" in
|
||||
run:d3ddriverquery64.exe:*/compatdata/0 | run:d3ddriverquery.exe:*/compatdata/0)
|
||||
@@ -490,7 +505,7 @@ dd_run ${DD_TASKSET:-} /usr/local/bin/droiddeck-game-env "$DD_STORE_PROTON" "$ve
|
||||
def extra_wrapper_sh(entry_point):
|
||||
return (EXTRA_WRAPPER_SH % entry_point).replace(
|
||||
'here=$(dirname "$0")',
|
||||
'here=$(dirname "$0")\n' + DD_DRIVER_QUERY_SKIP + DD_DESKTOP_GPU_SETUP + DD_DIRECTAUDIO_SETUP + DD_GAME_CPUS_SETUP
|
||||
'here=$(dirname "$0")\n' + DD_BIONIC_PROOT_FALLBACK + DD_DRIVER_QUERY_SKIP + DD_DESKTOP_GPU_SETUP + DD_DIRECTAUDIO_SETUP + DD_GAME_CPUS_SETUP
|
||||
+ DD_IDTECH3_SETUP + DD_VACDIAG_SETUP + DD_COMPONENTS_SETUP + DD_LIBPATH_SETUP + DD_STORE_SETUP, 1)
|
||||
|
||||
|
||||
|
||||
@@ -2299,6 +2299,46 @@ class GameEnvironmentTest(unittest.TestCase):
|
||||
env=env, capture_output=True, text=True, check=True).stdout
|
||||
self.assertEqual(out, "continued\n", (verb, args, prefix))
|
||||
|
||||
def test_bionic_tool_starts_droiddeck_proton_when_proot_is_on(self):
|
||||
script = COMPAT["extra_wrapper_sh"]("proton")
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
tools = Path(tmp) / "compatibilitytools.d"
|
||||
|
||||
def tool(name, bionic=False):
|
||||
d = tools / name
|
||||
(d / "bionic").mkdir(parents=True)
|
||||
if bionic:
|
||||
(d / "bionic" / "launch.sh").write_text("")
|
||||
wrapper = d / "droiddeck-proton-wrap"
|
||||
wrapper.write_text(script if bionic else '#!/bin/sh\necho "ran ${0%/*}" "$@"\n')
|
||||
wrapper.chmod(0o755)
|
||||
return wrapper
|
||||
|
||||
bionic = tool("DroidDeck-Bionic-12.8-r37", bionic=True)
|
||||
tool("DroidDeck-Proton 11-12.8")
|
||||
tool("DroidDeck-Proton-11-12.10")
|
||||
tool("DroidDeck-Proton-12.8-bionic-test", bionic=True)
|
||||
tool("GE-Proton10-25")
|
||||
base = {"PATH": os.defpath, "HOME": "/nonexistent"}
|
||||
|
||||
def launch(extra=()):
|
||||
env = dict(base, **dict(extra))
|
||||
return subprocess.run([str(bionic), "waitforexitandrun", "/games/A B/game.exe", "-x"], env=env,
|
||||
capture_output=True, text=True, timeout=10)
|
||||
|
||||
result = launch()
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
self.assertEqual(result.stdout, "ran %s waitforexitandrun /games/A B/game.exe -x\n"
|
||||
% os.path.realpath(tools / "DroidDeck-Proton-11-12.10"))
|
||||
self.assertIn("this launch uses DroidDeck-Proton-11-12.10", result.stderr)
|
||||
|
||||
shutil.rmtree(tools / "DroidDeck-Proton-11-12.10")
|
||||
self.assertIn("ran %s " % os.path.realpath(tools / "DroidDeck-Proton 11-12.8"), launch().stdout)
|
||||
|
||||
self.assertNotIn("ran ", launch({"DDNATV_ROOT": "/data/rootfs"}).stdout)
|
||||
shutil.rmtree(tools / "DroidDeck-Proton 11-12.8")
|
||||
self.assertNotIn("this launch uses", launch().stderr)
|
||||
|
||||
def test_wrappers_preload_the_session_library_before_the_input_shim(self):
|
||||
overlay = "/root/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so"
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
|
||||
Reference in new issue
Block a user