Building on macOS - Wargus/stratagus GitHub Wiki

Use of home-brew is recommended, it has most of the packages needed, the default compilers for Mac that ship with Xcode should work for the latest stratagus. SDL2 may need resigning before this will work, details after build instructions.

Install the dependencies:

brew install libpng sdl2 bzip2 ffmpeg SDL2_mixer SDL2_image libogg libvorbis theora zlib libmikmod sqlite3 doxygen gcc libomp

Now clone stratagus and build, we need to tell make to use the vendored Lua since home-brew doesn't have that old of Lua any longer:

git clone --recurse-submodules [email protected]:Wargus/stratagus.git
mkdir build-stratagus
cd build-stratagus
cmake -DBUILD_VENDORED_LUA=ON -DCMAKE_BUILD_TYPE=Release ../stratagus
make -j$(nproc)
sudo make install

If SDL2 has code signing errors, the commands to remedy those are:

xattr -dr com.apple.quarantine /Library/Frameworks/SDL2.framework/
xattr -dr com.apple.quarantine /Library/Frameworks/SDL2_image.framework/
codesign --force --sign - /Library/Frameworks/SDL2.framework/Versions/A/SDL2
codesign --force --sign - /Library/Frameworks/SDL2_image.framework/Versions/A/SDL2_image

If there are errors using the default file limits on macOS, follow the directions here(https://superuser.com/a/838840).

sudo nano /Library/LaunchDaemons/limit.maxfiles.plist

Add the contents:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>limit.maxfiles</string>
    <key>ProgramArguments</key>
    <array>
      <string>launchctl</string>
      <string>limit</string>
      <string>maxfiles</string>
      <string>524288</string>
      <string>16777216</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>ServiceIPC</key>
    <false/>
  </dict>
</plist>
sudo chown root:wheel /Library/LaunchDaemons/limit.maxfiles.plist
sudo launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist

And now it should be able to run if supplied with a data directory generated by wargus:

./stratagus -d ~/.stratagus/data.Wargus

https://www.youtube.com/watch?v=Xd-IyM66hTk

Currently the UI is a bit messed up, and some images are not drawn properly.

⚠️ **GitHub.com Fallback** ⚠️