Difference between revisions of "MacOS"
m (→Using Homebrew) |
m (→The old way) |
||
(11 intermediate revisions by 3 users not shown) | |||
Line 3: | Line 3: | ||
= Shortcut = | = Shortcut = | ||
− | You won't get to hack the source this way, but if you just want a self-compiled version of the game, you can use [https://github.com/cimnine/homebrew-armagetronad this Homebrew tap]. | + | You won't get to hack the source this way, but if you just want a self-compiled version of the game, you can use [https://github.com/cimnine/homebrew-armagetronad this Homebrew tap] or fetch it from [https://ports.macports.org/port/armagetronad/details/ MacPorts]. Or fetch our [https://download.armagetronad.org/docs/current/ recent builds], the downside of them being that they do not contain native Apple Silicon code. |
= Prerequisites = | = Prerequisites = | ||
− | Builds work the same way as on [[Linux_Development|Linux]]. The build prerequisites can be installed over [https://brew.sh/ Homebrew] or [https://www.macports.org/ MacPorts]. Our automated builds use Homebrew because its libraries integrate better with the macOS system and are easier to pack into the app bundle. Therefore, if you don't already have one of those on your system, pick Homebrew, you're less likely to run into problems. | + | Builds work the same way as on [[Linux_Development|Linux]]. |
+ | |||
+ | The build prerequisites can be installed over [https://brew.sh/ Homebrew] or [https://www.macports.org/ MacPorts]. Our automated builds use Homebrew because its libraries integrate better with the macOS system and are easier to pack into the app bundle. Therefore, if you don't already have one of those on your system, pick Homebrew, you're less likely to run into problems. | ||
All code blocks are to be entered into the terminal. | All code blocks are to be entered into the terminal. | ||
Line 17: | Line 19: | ||
For 0.4, use | For 0.4, use | ||
<pre>brew install pkg-config autoconf automake sdl2 sdl2_image sdl2_mixer protobuf-c glew boost ftgl</pre> | <pre>brew install pkg-config autoconf automake sdl2 sdl2_image sdl2_mixer protobuf-c glew boost ftgl</pre> | ||
− | You can drop autoconf and automake if you just build from source archives. If you also want to build app bundles and dmgs, add dylibbundler | + | You can drop <code>autoconf</code> and <code>automake</code> if you just build from source archives. If you also want to build app bundles and dmgs, add <code>dylibbundler</code>, <code>create-dmg</code> and <code>protobuf@21</code> (that one packs better than the latest protobuf). |
− | libxml2 may also be required, but macOS comes with a version already. | + | <code>libxml2</code> may also be required, but macOS comes with a version already. |
− | For | + | For macOS Mojave, you will also need |
− | <pre>brew install | + | <pre>brew install python3</pre> |
== Using MacPorts == | == Using MacPorts == | ||
For 0.2.X: | For 0.2.X: | ||
− | <pre>sudo port install libxml2 libsdl libsdl_image</pre> | + | <pre>sudo port install pkgconf autoconf automake libxml2 libsdl libsdl_image</pre> |
For 0.4: | For 0.4: | ||
− | <pre>sudo port install libxml2 libsdl2 libsdl2_image libsdl2_mixer protobuf-c glew boost ftgl</pre> | + | <pre>sudo port install pkgconf autoconf automake libxml2 libsdl2 libsdl2_image libsdl2_mixer protobuf-c glew boost ftgl</pre> |
(At testing time, ftgl did not work.) | (At testing time, ftgl did not work.) | ||
− | You'd also need dylibbundler and create-dmg for building dmgs; you'd have to work out yourself how to get it working. | + | You'd also need <code>dylibbundler</code> and <code>create-dmg</code> for building dmgs; you'd have to work out yourself how to get it working. |
= Get source and build = | = Get source and build = | ||
− | Follow the [[Linux_Development#Get Sources|Linux Instructions]] for these parts. | + | Follow the [[Linux_Development#Get Sources|Linux Instructions]] for these parts. One small deviation: If you want to build a proper App Bundle later, do not use the configure script in the main directory, use src/macosx/configure_for_bundle.sh (for 0.2.X) resp. desktop/os-x/configure_for_bundle.sh (trunk/0.4). That one one calls the main configure script, feeding it the correct directory structure. |
= Build dmg and app bundle = | = Build dmg and app bundle = | ||
Line 44: | Line 46: | ||
on 0.2.X or | on 0.2.X or | ||
<pre>sh ./desktop/os-x/build_bundle.sh </pre> | <pre>sh ./desktop/os-x/build_bundle.sh </pre> | ||
− | on 0.4. | + | on trunk/0.4. |
This should put a dmg with the app bundle inside and a zip of the app bundle contents into the current directory. If you want them somewhere else, specify the path as build_bundle.sh's optional single argument. | This should put a dmg with the app bundle inside and a zip of the app bundle contents into the current directory. If you want them somewhere else, specify the path as build_bundle.sh's optional single argument. | ||
+ | |||
+ | If you want to sign the bundle and notarize and staple the dmg, the app bundle content has to be in just the right form; having configured the game over the configure_for_bundle.sh script should do the trick. build_bundle.sh expects your secrets in exported shell variables or the fixed shell script ~/.ssh/armabuild_secrets. The top of the script explains what is needed. | ||
= The old way = | = The old way = | ||
− | See [[Mac OS X]]. | + | See [[Mac OS X]]. For the longest time, nobody on the dev team had a real Mac any more, so the XCode UI based build has fallen into disrepair. Patches welcome. |
+ | |||
+ | [[Category:Installation]] |
Latest revision as of 08:18, 21 April 2024
This page will help you get up and running to hack Armagetron on macOS.
Shortcut
You won't get to hack the source this way, but if you just want a self-compiled version of the game, you can use this Homebrew tap or fetch it from MacPorts. Or fetch our recent builds, the downside of them being that they do not contain native Apple Silicon code.
Prerequisites
Builds work the same way as on Linux.
The build prerequisites can be installed over Homebrew or MacPorts. Our automated builds use Homebrew because its libraries integrate better with the macOS system and are easier to pack into the app bundle. Therefore, if you don't already have one of those on your system, pick Homebrew, you're less likely to run into problems.
All code blocks are to be entered into the terminal.
Using Homebrew
For 0.2.X, use
brew install pkg-config autoconf automake sdl sdl_image
For 0.4, use
brew install pkg-config autoconf automake sdl2 sdl2_image sdl2_mixer protobuf-c glew boost ftgl
You can drop autoconf
and automake
if you just build from source archives. If you also want to build app bundles and dmgs, add dylibbundler
, create-dmg
and protobuf@21
(that one packs better than the latest protobuf).
libxml2
may also be required, but macOS comes with a version already.
For macOS Mojave, you will also need
brew install python3
Using MacPorts
For 0.2.X:
sudo port install pkgconf autoconf automake libxml2 libsdl libsdl_image
For 0.4:
sudo port install pkgconf autoconf automake libxml2 libsdl2 libsdl2_image libsdl2_mixer protobuf-c glew boost ftgl
(At testing time, ftgl did not work.)
You'd also need dylibbundler
and create-dmg
for building dmgs; you'd have to work out yourself how to get it working.
Get source and build
Follow the Linux Instructions for these parts. One small deviation: If you want to build a proper App Bundle later, do not use the configure script in the main directory, use src/macosx/configure_for_bundle.sh (for 0.2.X) resp. desktop/os-x/configure_for_bundle.sh (trunk/0.4). That one one calls the main configure script, feeding it the correct directory structure.
Build dmg and app bundle
The Linux installation instructions would give you an installation you can start from the Terminal only. That's not very Apple. So while you're in the build directory, do
sh ./src/macosx/build_bundle.sh
on 0.2.X or
sh ./desktop/os-x/build_bundle.sh
on trunk/0.4.
This should put a dmg with the app bundle inside and a zip of the app bundle contents into the current directory. If you want them somewhere else, specify the path as build_bundle.sh's optional single argument.
If you want to sign the bundle and notarize and staple the dmg, the app bundle content has to be in just the right form; having configured the game over the configure_for_bundle.sh script should do the trick. build_bundle.sh expects your secrets in exported shell variables or the fixed shell script ~/.ssh/armabuild_secrets. The top of the script explains what is needed.
The old way
See Mac OS X. For the longest time, nobody on the dev team had a real Mac any more, so the XCode UI based build has fallen into disrepair. Patches welcome.