Skip to content

Build instructions

andy edited this page Apr 14, 2024 · 15 revisions

All Platforms

Dependencies are GLEW, SDL2, clang OR g++, git, rsync, and make. The Makefile produces a binary at build/Avara. You should be able to change directory into the Avara repo and make.

Build Jobs

Avara has many intermediate object files. These can be built in parallel using the -jobs argument to make. This vastly speeds up the build time. We have found that the sweet spot is four or five jobs in parallel (ie. make -j4 avara) for most modern systems, any more does undesirable things to system load. Be careful with this argument, as leaving it blank will allow make to spawn as many jobs as it thinks your system can handle, which is often too many, and your computer might become unresponsive during linking.

Windows

Before you do this, try the pre-built binaries. These should work for recent versions of Windows.

Visual Studio

There is a Visual Studio solution available in the Avara.msvc folder. These instructions are for Windows 7+ (required for vcpkg).

  1. Set up/fully update Visual Studio
  2. Install Git
  3. Install PowerShell
  4. Install vcpkg
  5. Launch Visual Studio. Check out the project from Github, either through VS or Git.
  6. Open Avara.msvc/Avara.sln
  7. Go to Tools > Command Line > Developer PowerShell.
  8. Install dependencies with vcpkg install integrate
  9. Create git hash include file with ..\bin\git_version.ps1 - This will generate the src/util/GitVersion.h file is needed to show the git hash on the screen. On other platforms this is generated via the Makefile. VS will not automatically refresh this, so you will need to run this command again to see the hash change in the resulting build.
  10. You can now close the PowerShell prompt and start a build/run/debug.

MinGW MSYS2 (deprecated)

Avara previously did not support MSVC++, so the MSYS2 Mingw environment was used. For now at least, the game will build with Visual Studio or with MSYS2 via the Makefile, but the VS build takes maintenance priority.

  1. Install the MSYS2 environment. This can take a while.
  2. From the Start menu, open "MSYS2 Mingw64 terminal".
  3. Update MSYS2: pacman -Syu As part of this process, you will need to close the terminal window, and you may need to run the command again.
  4. Once MSYS2 is up to date, run the following to install dependencies: pacman --noconfirm --needed -Syuu mingw-w64-x86_64-SDL2 mingw-w64-x86_64-clang mingw-w64-x86_64-glbinding mingw-w64-x86_64-glew make git zip rsync
  5. You should now be able to clone the repository: git clone https://github.com/avaraline/Avara.git
  6. Enter the repository: cd Avara
  7. Build: make
  8. You can now start the game with: build/Avara.exe
  9. (optional) Make an archive with DLLs and resources included: make winapp

Linux

On Debian based distributions of Linux, you can install the needed dependencies for building by running the following in a terminal:

apt-get -yq install libsdl2-dev libegl1-mesa-dev libgles2-mesa-dev clang libdirectfb-dev git make rsync

libdirectfb-dev is an optional dependency for running headless tests.

On Arch Linux, install dependencies with sudo pacman -Syu sdl2 glew clang rsync glbinding make git zip

On Alpine, apk add sdl2-dev glew-dev clang rsync g++ zip git (g++ is needed for the C++ standard library)

Finally,

git clone https://github.com/avaraline/Avara && cd Avara && make && build/Avara

should clone, build, and launch the game.

Apple macOS

Avara can be built using Xcode. See the Xcode project file in the root of the repository.

You can also use Homebrew. The bare minimum needed is the Xcode Command Line developer tools and a working Homebrew.

Make sure Homebrew has the tools we need: brew install make git rsync

Download SDL2.framework. To get this, go to the SDL2 download page, and click the links under Development Libraries > Mac OS X.

Copy the files into either /Library/Frameworks or ~/Library/Frameworks. If you install the framework in your user directory, you will require a soft link to the system root /Library folder:

ln -s ~/Library/Frameworks/SDL2.framework /Library/Frameworks/SDL2.framework

Finally, check out the repo: git clone https://github.com/avaraline/Avara

After that, you should be able to build: cd Avara && make.

You can run the resulting build: build/Avara

Alternatively, use make macapp to copy the built application into an self-contained app bundle with the resources. You can provide a SIGNING_ID environment variable to create a signed app bundle. You should see Avara.app in the repo folder after this completes.