fix(script-run): run x86 programs a native script starts through FEX (#2217)

This commit is contained in:
MaxsTechReview authored and GitHub committed 2026-11-07 12:27:24 -05:00
1 parent 6026d72435
commit a123af7c13
5 files changed
+162 -18

No files matched your search

@@ -370,7 +370,7 @@ def main(argv):
what = "steam"
elif what == "script" and for_x86(path):
what = "x86 script"
elif what in ("script", "elf") and game_folder(path):
elif what in ("script", "elf") and not (mode == "exec" and machine(head(path)) in EMULATED) and game_folder(path):
what = "folder"
try:
cmd, folder = command(path, argv[1:], what, mode == "window", appid)
@@ -381,10 +381,11 @@ def main(argv):
cmd = placed(cmd, what, mode, os.environ)
if mode != "exec" or not sys.stderr.isatty():
say("%s (%s): %s" % (path, what, " ".join(cmd[:4])))
try:
os.chdir(folder)
except OSError:
pass
if not (mode == "exec" and what in ("elf", "script", "x86 script")):
try:
os.chdir(folder)
except OSError:
pass
if mode == "exec":
os.execv(cmd[0], cmd)
started = time.monotonic()
@@ -16,6 +16,7 @@ run=("${interp[@]}" "./$entry")
if [ -x /usr/local/bin/droiddeck-fex ]; then
run=(/usr/local/bin/droiddeck-fex run --mode "$fex" --for "$folder" -- "${interp[@]}" "./$entry")
fi
if [ "$fex" = off ]; then unset BL_BINFMT; else export BL_BINFMT=1; fi
echo "== script $entry in $folder (${interp[*]:-a program}, FEX $fex)"
case ${DBUS_SESSION_BUS_ADDRESS:-} in
unix:*) "${run[@]}" "$@" ;;