mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-05 12:35:42 +00:00
droiddeck-fex: take the runtime from an adopted tool's original manifest
This commit is contained in:
1 parent
f802206917
commit
e16a77facb
2 files changed
+15
-3
No files matched your search
@@ -750,9 +750,12 @@ def vulkan_thunk_loads(fex, folder):
|
||||
|
||||
|
||||
def required_runtime(program):
|
||||
text = read_text(os.path.join(os.path.dirname(program), "toolmanifest.vdf")) or ""
|
||||
match = re.search(r'"require_tool_appid"\s+"(\d+)"', text)
|
||||
return match.group(1) if match and match.group(1) in RUNTIMES else SNIPER_APPID
|
||||
folder = os.path.dirname(program)
|
||||
for name in ("toolmanifest.vdf.droiddeck-orig", "toolmanifest.vdf"):
|
||||
match = re.search(r'"require_tool_appid"\s+"(\d+)"', read_text(os.path.join(folder, name)) or "")
|
||||
if match and match.group(1) in RUNTIMES:
|
||||
return match.group(1)
|
||||
return SNIPER_APPID
|
||||
|
||||
|
||||
def resolve(program, env):
|
||||
|
||||
@@ -1235,6 +1235,15 @@ class LaunchTest(FexTestCase):
|
||||
self.assertEqual(emulated.call_args[0][2]["FEX_ROOTFS"], str(platform / "files"))
|
||||
self.assertEqual(FEX["required_runtime"](str(self.proton("1391110"))), "1628350")
|
||||
|
||||
def test_an_adopted_proton_keeps_the_runtime_of_its_original_manifest(self):
|
||||
proton = self.proton("4183110")
|
||||
folder = proton.parent
|
||||
os.rename(folder / "toolmanifest.vdf", folder / "toolmanifest.vdf.droiddeck-orig")
|
||||
self.write(folder / "toolmanifest.vdf", '"manifest"\n{\n "commandline" "/droiddeck-proton-wrap %verb%"\n}\n')
|
||||
self.assertEqual(FEX["required_runtime"](str(proton)), "4183110")
|
||||
os.unlink(folder / "toolmanifest.vdf.droiddeck-orig")
|
||||
self.assertEqual(FEX["required_runtime"](str(proton)), "1628350")
|
||||
|
||||
def test_proton_action_keeps_the_prefix_and_runs_under_fex(self):
|
||||
self.fex_tool()
|
||||
self.runtime()
|
||||
|
||||
Reference in new issue
Block a user