
Installation instructions for those systems where the game has been tested

[[_TOC_]]

## GNU/Linux

### Dependencies

To install the dependencies you'll want to run one of the following:

For a Debian-based system, using apt

```sh
sudo apt install build-essential libsdl3-dev libsdl3-image-dev libsdl3-mixer-dev libgl1-mesa-dev libglm-dev libepoxy-dev libtbb-dev libfreetype-dev
```

For an Arch-based system, using pacman

```sh
pacman -Sy base-devel sdl3 sdl3_image sdl3_mixer libepoxy glm tbb freetype2
```

### Precompiled Version

You can download this precompiled version for
[x86_64 GNU/Linux](https://grabeltone.bounceme.net/voxelgarden-x86_64-linux.tar.gz):

```sh
curl -O https://grabeltone.bounceme.net/voxelgarden-x86_64-linux.tar.gz
tar -xvzf voxelgarden-x86_64-linux.tar.gz
cd voxelgarden-x86_64-linux
sh install.sh
```

### Compiling Yourself

You'll have to download the full repo recursively to ensure that you get all
the submodules:

```sh
git clone --recursive https://gitlab.com/QuirkyQuixote/voxel-garden
cd voxel-garden
make install
```

## Windows

### Precompiled Version

Download the precompiled version from
[x86_64 Windows](https://grabeltone.bounceme.net/voxelgarden-x86_64-windows.zip)

Unzip it and run the `install.bat` script.

The game will be installed to your `%APPDATA%` directory
(`C:\Users\yourname\AppData\Roaming\voxelgarden`)

Run the `voxelgarden.exe` file from that directory.

### Cross-Compiling from GNU/Linux Debian

If you want to compile the game by yourself in windows, be my guest; the
current binaries were generated by cross-compiling from a GNU/Linux Debian
host, roughly like this (not 100% guaranteed to work because I have not tested
this specifically):

```sh
# install dependencies
apt update
apt --yes install build-essential libglm-dev libfreetype-dev zlib1g-dev mingw-w64 mingw-w64-tools mingw-w64-x86-64-dev mingw-w64-common curl unzip

# These are required so the SDL and glew installation scripts won't raise an error
mkdir -p /usr/local/i686-w64-mingw32 /usr/local/x86_64-w64-mingw32 /usr/local/x86_64-w64-mingw32/bin /usr/local/x86_64-w64-mingw32/lib /usr/local/x86_64-w64-mingw32/include/GL

# for the rest we'll operate in a directory where we can run a rm -rf
mkdir build
cd build

# Install SDL2
curl -LO https://github.com/libsdl-org/SDL/releases/download/release-2.28.2/SDL2-devel-2.28.2-mingw.tar.gz
tar xvzf SDL2-devel-2.28.2-mingw.tar.gz
make -C SDL2-2.28.2 cross

# Install SDL2_mixer
curl -LO https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.6.3/SDL2_mixer-devel-2.6.3-mingw.tar.gz
tar xvzf SDL2_mixer-devel-2.6.3-mingw.tar.gz
make -C SDL2_mixer-2.6.3 cross

# Install SDL2_image
curl -LO https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.6.3-mingw.tar.gz
tar xvzf SDL2_image-devel-2.6.3-mingw.tar.gz
make -C SDL2_image-2.6.3 cross

# Install SDL2_net
git clone https://github.com/libsdl-org/SDL_net.git -b SDL2
cd SDL_net
./configure --host=x86_64-w64-mingw32 --prefix=/usr/local/x86_64-w64-mingw32
make
cd ..

# Install glew32
curl -LO https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0-win32.zip
unzip glew-2.2.0-win32.zip
cp glew-2.2.0/bin/Release/x64/glew32.dll /usr/local/x86_64-w64-mingw32/bin
cp glew-2.2.0/lib/Release/x64/glew32.lib /usr/local/x86_64-w64-mingw32/lib
cp glew-2.2.0/include/GL/* /usr/local/x86_64-w64-mingw32/include/GL

# Install glm by just linking the include folder (it's header-only)
ln -s /usr/include/glm /usr/local/x86_64-w64-mingw32/include

# Install freetype by just linking too
ln -s /usr/include/freetype2 /usr/local/x86_64-w64-mingw32/include

# And for zlib... link the headers and download the library
curl -LO https://sourceforge.net/projects/mingw-w64/files/External%20binary%20packages%20%28Win64%20hosted%29/Binaries%20%2864-bit%29/zlib-1.2.5-bin-x64.zip/download
unzip download
cp zlib/bin/zlib1.dll /usr/local/x86_64-w64-mingw32/lib
ln -s /usr/include/zlib.h /usr/local/x86_64-w64-mingw32/include
ln -s /usr/include/zconf.h /usr/local/x86_64-w64-mingw32/include

# clone and compile
git clone --recursive https://gitlab.com/QuirkyQuixote/voxel-garden
make -C voxel-garden -f Makefile.mingw
```
