Compiling Nix

From Naevwiki
Jump to: navigation, search

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

Dependencies

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

Debian

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

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

Gentoo

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

Arch

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


Compiling

First, clone the Git repository.

If using Git, create the configuration scripts with:

./autogen.sh

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

./configure

And proceed to compile with:

make

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:

./naev

Enjoy!