From ba0e32c920babf5098e22936b4efa7e0f74be561 Mon Sep 17 00:00:00 2001 From: 223n <223n@223n.tech> Date: Sat, 26 Sep 2026 00:25:41 +0900 Subject: [PATCH] run.sh: keep the Steam overlay on macOS via STEAM_DYLD_INSERT_LIBRARIES /bin/sh is a platform binary, so the DYLD_INSERT_LIBRARIES that Steam sets (its loader and overlay) is stripped before run.sh sees it, and the game was started with only libdoorstop.dylib inserted. Steam passes the same list as STEAM_DYLD_INSERT_LIBRARIES; use it when DYLD_INSERT_LIBRARIES is empty and keep it after Doorstop, as Valve's own launch scripts and MelonLoader do. --- assets/nix/run.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/assets/nix/run.sh b/assets/nix/run.sh index 68f0335..8e884f6 100755 --- a/assets/nix/run.sh +++ b/assets/nix/run.sh @@ -319,10 +319,17 @@ case ${os_type} in ;; Darwin*) dyld_library_path="${doorstop_directory}:${DYLD_LIBRARY_PATH}" - if [ -z "$DYLD_INSERT_LIBRARIES" ]; then + + # This script runs under /bin/sh, which is a platform binary, so a + # DYLD_INSERT_LIBRARIES that Steam sets for the game (its loader and + # overlay) is stripped before we get here. Steam passes the same list + # as STEAM_DYLD_INSERT_LIBRARIES for launch scripts like this one; keep + # it after Doorstop so the Steam overlay still works. + inherited_libraries="${DYLD_INSERT_LIBRARIES:-${STEAM_DYLD_INSERT_LIBRARIES}}" + if [ -z "$inherited_libraries" ]; then dyld_insert_libraries="${doorstop_name}" else - dyld_insert_libraries="${doorstop_name}:${DYLD_INSERT_LIBRARIES}" + dyld_insert_libraries="${doorstop_name}:${inherited_libraries}" fi # Always go through arch. A universal executable runs as x86_64 whenever