Browse Source

CI: Fix Steam launching x86 version under Rosetta

Apparently Steam running the OBS launch script makes it run
inside Rosetta as well, so it ended up launching the x86 version
even on arm64 systems.

Explicitly detect Rosetta translation and set arm64 in those cases.
derrod 3 years ago
parent
commit
d6f0270f49
1 changed files with 11 additions and 0 deletions
  1. 11 0
      CI/steam/scripts_macos/launch.sh

+ 11 - 0
CI/steam/scripts_macos/launch.sh

@@ -2,6 +2,17 @@
  
 arch_name="$(uname -m)"
 
+# When the script is launched from Steam, it'll be run through Rosetta.
+# Manually override arch to arm64 in that case.
+if [ "$(sysctl -in sysctl.proc_translated)" = "1" ]; then
+    arch_name="arm64"
+fi
+
+# Allow users to force Rosetta
+if [[ "$@" =~ \-\-intel ]]; then
+    arch_name="x86_64"
+fi
+
 # legacy app installation
 if [ -d OBS.app ]; then
     exec open OBS.app -W --args "$@"