project-ely/docs/setup/setup-unix.md

2.9 KiB

Go with raylib on everything else

Most any other operating system is Unix-like (e.g. Linux, Mac, BSD, Haiku, etc.), so they will all have very similar setups.

Each of these systems also has their own way of installing software, usually with their own package managers. I don't know all the exact names of each of these packages, but hopefully giving you some examples will help.

Install the dependencies

You will need the following dependencies:

  • Git
  • Go (Golang)
  • GCC
  • X11 or Wayland

That's all, you may even have most of them installed already.

I also use golangci-lint as a Go linter. This is used by the Makefile before running go build. You can either install this from your package manager or with go install. To work-around this, you can just run go build directly without the makefile or edit the linter section of the makefile to do nothing.

Debian

The raylib-go readme has good examples of installing the X11 or Wayland packages as needed. Below I just used the X11 packages as an example.

As the most common example, on Debian or Ubuntu, the following apt command should install all the dependencies:

sudo apt install git golang gcc libgl1-mesa-dev libxi-dev libxcursor-dev libxrandr-dev libxinerama-dev

The default version of Go in the Debian repos might be too old. You can install a newer version using the testing/unstable repos (try this or this), or you could manually install Go from their website.

Mac

On Mac, the typical recommendation is to use Homebrew. The package names are pretty similar:

brew install git go gcc

Redhat/Fedora/Rocky/CentOS

The Redhat-related distros all have very similar names as well, notably using devel instead of dev. I ran the following on Fedora successfully. (these distros may use dnf or yum as the package manager executable, dnf is newer)

sudo dnf install git golang gcc mesa-libGL-devel libXi-devel libXcursor-devel libXrandr-devel libXinerama-devel

pkgsrc

pkgsrc is NetBSD's package manager, but I've taken a liking to it and actually use it on Linux as well.

As a reference for the BSD crowd, the dependencies in pkgsrc are:

  • devel/git
  • lang/go119
  • lang/gcc12
  • graphics/MesaLib
  • x11/libXinerama
  • x11/libXrandr
  • x11/libXcursor
  • x11/libXi

Others

I apologize for not adding more systems, but at some point this list gets annoyingly long to repeat the same thing. Your distribution should almost certainly have these dependencies, and they will be named something similar to the above examples.

Build

You can use the Makefile to run

make release

or you can use go build directly.