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.

gptk: the installed check and the launch preflight require all three shims and their symlinks

mikey9212cd623aed2b
diff --git a/install.sh b/install.sh
index b9d7409a363..cb19d59a733 100644
--- a/install.sh
+++ b/install.sh
@@ -27,8 +27,14 @@ mkdir -p "$BASE"
# ---------- Apple GPTK helpers ----------
# Installed means all three parts: the Metal side, and Apple's PE shims in
# place of Wine's d3d11 (the shim carries Apple's build path string).
-GPTK_OK(){ [ -f "$ENGINE/lib/external/libd3dshared.dylib" ] \
- && grep -q "D3DMetalDLLsBase" "$ENGINE/lib/wine/x86_64-windows/d3d11.dll" 2>/dev/null; }
+GPTK_OK(){
+ local f
+ [ -f "$ENGINE/lib/external/libd3dshared.dylib" ] || return 1
+ for f in d3d11 d3d12 dxgi; do
+ grep -q "D3DMetalDLLsBase" "$ENGINE/lib/wine/x86_64-windows/$f.dll" 2>/dev/null || return 1
+ [ -L "$ENGINE/lib/wine/x86_64-unix/$f.so" ] || return 1
+ done
+}
find_gptk(){
for r in /Volumes/Game* /Volumes/*orting* \
"/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/lib64/apple_gptk"; do
diff --git a/scripts/play.sh b/scripts/play.sh
index 440879c6a42..981a4ad21e6 100755
--- a/scripts/play.sh
+++ b/scripts/play.sh
@@ -83,8 +83,10 @@ case "$MODE" in *-kill) ;; *) python3 "$(dirname "${BASH_SOURCE[0]}")/soju-input
# games run slowly. Say so instead.
case "$MODE" in
battlenet|d2r|epic|gog)
- if [ -f "$ENGINE/lib/external/libd3dshared.dylib" ] \
- && ! grep -q "D3DMetalDLLsBase" "$ENGINE/lib/wine/x86_64-windows/d3d11.dll" 2>/dev/null; then
+ shims_ok(){ local f; for f in d3d11 d3d12 dxgi; do
+ grep -q "D3DMetalDLLsBase" "$ENGINE/lib/wine/x86_64-windows/$f.dll" 2>/dev/null || return 1
+ [ -L "$ENGINE/lib/wine/x86_64-unix/$f.so" ] || return 1; done; }
+ if [ -f "$ENGINE/lib/external/libd3dshared.dylib" ] && ! shims_ok; then
echo "soju: this engine has the GPTK payload but not Apple's D3D shims (d3d11/d3d12/dxgi.dll)," >&2
echo " so D3DMetal is not active. Mount the GPTK dmg (or have CrossOver installed) and run:" >&2
echo " $(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/soju gptk" >&2