Skip to content

Building Instructions

Pokeduel edited this page Dec 13, 2022 · 16 revisions

Below are the given instructions for people who are looking to manually build the game, whether their OS is not supported yet by CI or they are planning on contributing to the project.

MacOS Building Instructions coming soon.

Table of Contents

Building on Windows

For Windows, you will be using the MSYS2 environment. Previously we have used nuwen.net's library, but those files are outdated and is not being maintained.

  1. Install the MSYS2 environment.

  2. Open MSYS2's MSYS shell.

  3. Check to ensure everything is up to date with pacman -Syu. You may have to do this multiple times.

    a. Get the essential developer packages if you don't already have them: pacman -S --needed base-devel mingw-w64-x86_64-toolchain

  4. Get git and MinGW Cmake by typing pacman -S git mingw-w64-x86_64-cmake

    a. If you want to use Clang instead of GCC to compile, get the Clang libraries by typing pacman -S mingw-w64-x86_64-llvm mingw-w64-x86_64-clang

  5. Clone the git with the command git clone --recurse-submodules https://github.com/vittorioromeo/SSVOpenHexagon.git

  6. Close the MSYS shell and open up the MINGW64 variant of the shell.

  7. Navigate to the build directory of the cloned repository

  8. Generate the makefiles under the MinGW generator: cmake .. -G"MinGW Makefiles"

    a. If you are compiling with Clang add -DCMAKE_CXX_COMPILER="clang++"

  9. Run cmake --build .

    a. If you get errors on LuaJIT (especially math functions), redo step 7 and try again.

  10. Run the copyArtifacts.bash script and supply a path to your msys64 folder (May be as simple as entering /).

  11. (optional) If you want music, copy assets from the Steam version of the game into your build folder. E.g. cp -r "~/.steam/steamapps/common/Open Hexagon/Packs" "./build/"

Building on Linux

Arch User Repository

Users of Arch-based distros may use the unofficial AUR package open-hexagon-git.

Building it yourself

(Tested on Linux Mint 20, Manjaro 21.1.6 and Ubuntu 20.04 LTS)

  1. Install dependencies

    Debian-based

    sudo apt-get install git make cmake gcc g++

    On Debian-based distros, SFML relies on you to install all the dependencies yourself, so execute the following command below to do so:

    sudo apt-get install libxrandr-dev libopengl-dev libudev-dev libfreetype-dev libopenal-dev libvorbis-dev libflac-dev

    Ensure you have the latest versions on all dependencies.

    Tip: If your distribution is not able to find libopengl-dev, you can install two packages: libglm-dev and libglew-dev. Install both of these and it should substitute for OpenGL.

    Arch-based

    sudo pacman -S git make cmake gcc sfml
  2. Clone this repository with submodules:

    git clone --recurse-submodules https://github.com/vittorioromeo/SSVOpenHexagon.git
    cd SSVOpenHexagon
  3. Navigate to the buildlx folder (Not the build folder)

  4. Generate the Makefiles through CMake by typing cmake ..

  5. Run the Makefiles by executing make.

    a. If you're confident that your computer can handle a workload, feel free to add the flag -jN, with N being an integer of CPU threads you want to dedicate to compiling.

    b. Start here if you ever make changes to an existing C++ file. If you make or delete a new C++ file, start from step 2.

  6. If you plan on only playing the compiled version of the game, simply copy over the SSVOpenHexagon application to _RELEASE and run it with ./SSVOpenHexagon. It should be able to link to all of the needed libraries.

    a. If nothing's linking properly, try running sudo make install.

  7. (optional) If you want music, copy assets from the Steam version of the game into your build folder. E.g. cp -r "~/.steam/steamapps/common/Open Hexagon/Packs" "./build/"