Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When compiling the game on macOS, app bundle generation fails #69

Open
cubuspl42 opened this issue Mar 4, 2022 · 1 comment
Open

When compiling the game on macOS, app bundle generation fails #69

cubuspl42 opened this issue Mar 4, 2022 · 1 comment

Comments

@cubuspl42
Copy link

Setup:
macOS Big Sur 11.6.1 (20G224)
Apple clang version 13.0.0 (clang-1300.0.29.30)

When compiling the game through the make-macosx.sh script, generating app bundle (through make-macosx-app.sh) fails. The openarena.x86_64 binary compiles successfully and can be launched from the Terminal (although you can't really play: #61).

The error message:

./make-macosx-app.sh: no ioquake3 binary architectures were found for target 'release'

After a quick investigation of the make-macosx-app.sh it seemed to me that the PRODUCT_NAME="ioquake3" should be changed to PRODUCT_NAME="openarena" (I don't know how this script ever worked before as-is), so I changed that.

But then, I got many errors similar to...

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: no input files specified
usage: lipo <input_file> <command> [<options> ...]

As I'm not familiar with these Xcode command line tools and I'm not sure how/if that worked before, I don't know what's the solution here.

@cubuspl42
Copy link
Author

Workaround:

  1. Start with the official app bundle (I got one from the official website)

  2. Build the engine for x86-64

For Apple Silicon Macs, see #89

  1. Replace the executable binary
cp ./build/release-darwin-x86_64/openarena.x86_64 /path/to/OpenArena.app/Contents/MacOS/openarena.ub
  1. Bundle the Homebrew-provided libraries
cp /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib /path/to/OpenArena.app/Contents/MacOS/
cp /usr/local/opt/libvorbis/lib/libvorbisfile.3.dylib /path/to/OpenArena.app/Contents/MacOS/
cp /usr/local/opt/libvorbis/lib/libvorbis.0.dylib /path/to/OpenArena.app/Contents/MacOS/
cp /usr/local/opt/libxmp/lib/libxmp.4.dylib /path/to/OpenArena.app/Contents/MacOS/
  1. Fix the dynamic library links
install_name_tool -change /usr/local/opt/libvorbis/lib/libvorbis.0.dylib @executable_path/libvorbis.0.dylib /path/to/OpenArena.app/Contents/MacOS/libvorbisfile.3.dylib

install_name_tool -change /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib @executable_path/libSDL2-2.0.0.dylib /path/to/OpenArena.app/Contents/MacOS/openarena.ub
install_name_tool -change /usr/local/opt/libvorbis/lib/libvorbisfile.3.dylib @executable_path/libvorbisfile.3.dylib /path/to/OpenArena.app/Contents/MacOS/openarena.ub
install_name_tool -change /usr/local/opt/libvorbis/lib/libvorbis.0.dylib @executable_path/libvorbis.0.dylib /path/to/OpenArena.app/Contents/MacOS/openarena.ub
install_name_tool -change /usr/local/opt/libxmp/lib/libxmp.4.dylib @executable_path/libxmp.4.dylib /path/to/OpenArena.app/Contents/MacOS/openarena.ub

There might be a better way.

I released the app bundle built with this method here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant