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: installed means the shims are there; never carry a Wine DLL over as a shim

mikey92a59cd924f001
diff --git a/install.sh b/install.sh
index 6894a0dc7a8..b9d7409a363 100644
--- a/install.sh
+++ b/install.sh
@@ -25,7 +25,10 @@ say(){ printf '\n\033[1m%s\033[0m\n' "$*"; }
mkdir -p "$BASE"
# ---------- Apple GPTK helpers ----------
-GPTK_OK(){ [ -f "$ENGINE/lib/external/libd3dshared.dylib" ]; }
+# 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; }
find_gptk(){
for r in /Volumes/Game* /Volumes/*orting* \
"/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/lib64/apple_gptk"; do
@@ -66,8 +69,12 @@ carry_gptk(){ # from, to
for f in "$from"/lib/wine/x86_64-unix/*.so; do
[ -L "$f" ] || continue
b=$(basename "$f" .so)
- [ -f "$from/lib/wine/x86_64-windows/$b.dll" ] && cp -f "$from/lib/wine/x86_64-windows/$b.dll" "$to/lib/wine/x86_64-windows/$b.dll"
- ln -sf ../../external/libd3dshared.dylib "$to/lib/wine/x86_64-unix/$b.so"
+ # only Apple's shims travel; a Wine DLL next to a symlink is an engine set
+ # up by an older script, and must not be mistaken for one
+ if grep -q "D3DMetalDLLsBase" "$from/lib/wine/x86_64-windows/$b.dll" 2>/dev/null; then
+ cp -f "$from/lib/wine/x86_64-windows/$b.dll" "$to/lib/wine/x86_64-windows/$b.dll"
+ ln -sf ../../external/libd3dshared.dylib "$to/lib/wine/x86_64-unix/$b.so"
+ fi
done
}
# ---------- 1. Engine ----------
diff --git a/scripts/update.sh b/scripts/update.sh
index 9abe34ecfc9..cc4d9658049 100755
--- a/scripts/update.sh
+++ b/scripts/update.sh
@@ -96,15 +96,23 @@ printf '%s\n' "$TAG" > "$NEW/.soju-engine-release"
if [ -f "$ENGINE/lib/external/libd3dshared.dylib" ]; then
mkdir -p "$NEW/lib/external"
cp -Rf "$ENGINE/lib/external/." "$NEW/lib/external/"
+ shims=0
for f in "$ENGINE"/lib/wine/x86_64-unix/*.so; do
[ -L "$f" ] || continue
b=$(basename "$f" .so)
- if [ -f "$ENGINE/lib/wine/x86_64-windows/$b.dll" ]; then
- [ -f "$NEW/lib/wine/x86_64-windows/$b.dll" ] && cp -p "$NEW/lib/wine/x86_64-windows/$b.dll" "$NEW/lib/wine/x86_64-windows/$b.dll.wine"
- cp -f "$ENGINE/lib/wine/x86_64-windows/$b.dll" "$NEW/lib/wine/x86_64-windows/$b.dll"
- fi
+ # Only Apple's shims travel (they carry Apple's build path string). A Wine
+ # DLL beside a symlink is an engine set up by an older get-gptk.sh; copying
+ # it would just move wined3d over.
+ grep -q "D3DMetalDLLsBase" "$ENGINE/lib/wine/x86_64-windows/$b.dll" 2>/dev/null || continue
+ [ -f "$NEW/lib/wine/x86_64-windows/$b.dll" ] && cp -p "$NEW/lib/wine/x86_64-windows/$b.dll" "$NEW/lib/wine/x86_64-windows/$b.dll.wine"
+ cp -f "$ENGINE/lib/wine/x86_64-windows/$b.dll" "$NEW/lib/wine/x86_64-windows/$b.dll"
ln -sf ../../external/libd3dshared.dylib "$NEW/lib/wine/x86_64-unix/$b.so"
+ shims=$((shims + 1))
done
+ if [ "$shims" -eq 0 ]; then
+ echo " NOTE: the old engine had the GPTK Metal side but not Apple's D3D shims, so D3DMetal was not"
+ echo " active. Mount the GPTK dmg (or have CrossOver installed) and run: soju gptk"
+ fi
fi
if ! DYLD_FALLBACK_LIBRARY_PATH="$NEW/lib:/usr/lib" "$NEW/bin/wine" --version >/dev/null 2>&1; then