Compiling Nix

From Naevwiki
Jump to: navigation, search

This is a short guide to compiling Naev on *nix-based systems.


First install the Naev dependencies. They should be fairly common on most systems. They are:

  • SDL
  • SDL_mixer
  • OpenGL
  • libxml 2
  • Freetype 2
  • libpng 1.2
  • OpenAL
  • libvorbis
  • binutils
  • libzip


On Debian-based distros you can install them with:

apt-get install libsdl1.2debian libsdl-mixer1.2 libgl1-mesa-dri\
 libxml2 libfreetype6 libpng12-0 libopenal1 libvorbis0a libzip2

For compiling, you'll need the additional:

apt-get install build-essential automake libsdl-image1.2-dev libsdl-mixer1.2-dev\
 libgl1-mesa-dev libxml2-dev libfreetype6-dev libpng12-dev libopenal-dev\
 libvorbis-dev binutils-dev libzip-dev


sdl-mixer requires vorbis support

emerge media-libs/libsdl media-libs/sdl-image media-libs/sdl-mixer virtual/opengl\
 dev-libs/libxml2 media-libs/freetype media-libs/libpng media-libs/openal\
 media-libs/libvorbis sys-devel/binutils dev-libs/libzip


First make sure you have autotools and pkg-config installed:

pacman -S --needed autogen automake autoconf pkg-config

Then, install the dependencies:

pacman -S --needed sdl sdl_image sdl_mixer libxml2 freetype2 libpng libvorbis libzip


First, clone the Git repository.

If using Git, create the configuration scripts with:


Now you get to configure Naev. Usually the defaults should be adequate so run:


And proceed to compile with:


If all went well you should see something like:

$ make
Making all in lib
Making all in csparse
  CC    cs_add.o
  CC    cs_amd.o
  CC    naev
Making all in utils
Making all in pack
  CC    main.o
  CC    md5.o
  CC    pack.o
  CC    pack

Indicating the binary was built. Now you can run naev with: