Skip to content

armgit / soju

Public Imported from GitHub
0

Play Windows games on Apple Silicon Macs. Free, open-source app that installs the official Battle.net, Steam, Epic and GOG launchers and lists your games in one library.

install: restore GPTK symlinks when repairing an engine; reaper: skip a round on failed attribution

mikey926dbaa81d7109
diff --git a/install.sh b/install.sh
index d4500594ed8..07ccd46e37f 100644
--- a/install.sh
+++ b/install.sh
@@ -46,8 +46,15 @@ else
TAG=$(echo "$URL" | sed -n 's#.*/download/\([^/]*\)/.*#\1#p')
printf '%s\n' "${TAG:-unknown}" > "$ENGINE.new/.soju-engine-release"
if [ -d "$ENGINE" ]; then
- # A half-extracted engine from an earlier run; keep any GPTK payload in it.
- [ -d "$ENGINE/lib/external" ] && cp -Rf "$ENGINE/lib/external" "$ENGINE.new/lib/" 2>/dev/null || true
+ # A broken engine from an earlier run; keep any GPTK payload in it, and
+ # restore the symlink layout the payload needs (real files in lib/external,
+ # links in x86_64-unix: copies there break @loader_path).
+ if [ -f "$ENGINE/lib/external/libd3dshared.dylib" ]; then
+ mkdir -p "$ENGINE.new/lib/external"
+ cp -Rf "$ENGINE/lib/external/." "$ENGINE.new/lib/external/"
+ ( cd "$ENGINE.new/lib/wine/x86_64-unix" \
+ && for f in d3d10.so d3d11.so d3d12.so dxgi.so; do ln -sf ../../external/libd3dshared.dylib "$f"; done )
+ fi
rm -rf "$ENGINE"
fi
mv "$ENGINE.new" "$ENGINE"
diff --git a/scripts/soju-reaper.sh b/scripts/soju-reaper.sh
index e0584b5672f..16d49d5fc38 100755
--- a/scripts/soju-reaper.sh
+++ b/scripts/soju-reaper.sh
@@ -207,7 +207,12 @@ while true; do
fi
ORPHAN_STRIKES=0
- classify "$(bottle_pids)"
+ # A live server always has its service processes attached, so an empty
+ # answer here is a failed attribution (lsof hiccup), not an empty bottle:
+ # skip the round rather than read it as idle and take the bottle down.
+ BOTTLE=$(bottle_pids)
+ [ -n "${BOTTLE// /}" ] || continue
+ classify "$BOTTLE"
# Nothing but services and helpers left? Two checks in a row and the bottle
# comes down (wineserver -k), then the sweep removes the service set.