OpenArena / engine

OpenArena modifications to the ioquake3 engine
http://openarena.ws
GNU General Public License v2.0
214 stars 51 forks source link

Support building/running on Apple Silicon Macs #89

Open cubuspl42 opened 5 months ago

cubuspl42 commented 5 months ago

Although ARM support was recently added in https://github.com/OpenArena/engine/pull/64, it wasn't focused on Macs or macOS. It would be great if the source code was ready to be built on modern Macs, one way or another.

cubuspl42 commented 5 months ago

Known workaround:

One can build the game for x86-64 and launch it in the Rosetta compatibility mode.

  1. Install Rosetta if you haven't already
softwareupdate --install-rosetta
  1. Install x86-64 Homebrew if you haven't already
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Please note that it will be installed in the legacy /usr/local/ prefix, so if you already have ARM-native Homebrew installation preset in /opt/homebrew/, it shouldn't collide.

  1. Install the x86-64 Homebrew dependencies
arch -x86_64 /usr/local/bin/brew install sdl2 libxmp libvorbis libogg
  1. Built the game for x86-64
arch -x86_64 ./make-macosx.sh x86_64

App bundle generation will likely fail, but this is a separate issue: https://github.com/OpenArena/engine/issues/69

The game binary itself should be built successfully.

  1. Run the built x86-64 binary (it should automatically run in the Rosetta compatibility mode):
./build/release-darwin-x86_64/openarena.x86_64

The game will likely crash at startup, not being able to find the game data. You can solve this by putting the game data (the heavy baseoa folder) at ~/Library/Application Support/OpenArena/baseoa.

The game might crash at runtime in a strncpy call, when launching the match, but this is a separate issue: https://github.com/OpenArena/engine/issues/91

This allows to run the game locally, on the machine you built it. For creating the app bundle, see https://github.com/OpenArena/engine/issues/69#issuecomment-2212410799.