Difference between revisions of "Linux Development"

From Armagetron
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{Sections}}
 
{{Sections}}
  
This guide assumes you're familiar with the linux console. All commands listed here are supposed to be entered there. For system andministration tasks, you have to be logged in as the superuser 'root'. (K)Ubuntu users need to prepend a 'sudo ' in front of all system administration commands.
+
This guide assumes you're familiar with the linux console. All commands listed here are supposed to be entered there. For system andministration tasks, you have to be logged in as the superuser 'root'. (K/X)Ubuntu users generally need to prepend a 'sudo' in front of all system administration commands or sign in via 'sudo bash'.
  
 
= Install Development Environment and Dependencies =
 
= Install Development Environment and Dependencies =
Line 16: Line 16:
 
For trunk builds, you need
 
For trunk builds, you need
 
  * boost
 
  * boost
For trunk client builds, you'll also need
+
* protobuf
 +
For trunk/0.4 client builds, you'll also need
 
  * SDL_mixer
 
  * SDL_mixer
 
  * freetype
 
  * freetype
 
  * ftgl
 
  * ftgl
 
  * GLEW (optional right now)
 
  * GLEW (optional right now)
 +
Also optional, but recommended for 0.4 are the SDL2 libraries
 +
* SDL2
 +
* SDL2_mixer
 +
* SDL2_image
 +
If you pick those, the SDL1 versions can be skipped.
 +
 +
Remove what you don't need from the one-line instructions below.
  
 
== (K/X)Ubuntu ==
 
== (K/X)Ubuntu ==
Line 26: Line 34:
 
To get all of this at once, enter at the console
 
To get all of this at once, enter at the console
 
<pre>
 
<pre>
sudo apt-get install g++ python libxml2-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libfreetype6-dev libftgl-dev libglew1.5-dev libpng12-dev libboost-dev
+
sudo apt-get install bison automake g++ python libxml2-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libfreetype6-dev libftgl-dev libglew-dev libpng-dev libboost-dev libprotobuf-dev protobuf-compiler libboost-thread-dev
 
</pre>
 
</pre>
Tested with Kubuntu 8.10.
+
Tested with Ubuntu 14.04.
  
 
== Debian ==
 
== Debian ==
Line 37: Line 45:
  
 
<pre>
 
<pre>
yum install SDL-devel SDL_image-devel SDL_mixer-devel freetype-devel ftgl-devel glew-devel python boost-devel
+
yum install gcc-c++ automake libxml2-devel SDL-devel SDL_image-devel SDL_mixer-devel SDL2-devel SDL2_image-devel SDL2_mixer-devel freetype-devel ftgl-devel glew-devel python boost-devel protobuf-devel
 
</pre>
 
</pre>
 
Yay for sane package names.
 
Yay for sane package names.
Line 47: Line 55:
 
</pre>
 
</pre>
 
Boost takes a long time to build, so you may want to omit it if you don't need it.
 
Boost takes a long time to build, so you may want to omit it if you don't need it.
 +
 +
(Missing: protobuf and the sdl2 libs. Task for the reader: find out what it is named and add it.)
 +
 +
== Arch ==
 +
 +
Enter at the console (as root)
 +
<pre>pacman -S python2 gcc automake autoconf libxml2 sdl sdl_image sdl_mixer sdl2 sdl2_image sdl2_mixer ftgl glew boost protobuf</pre>
 +
(Note: some things may be missing, I only tested it with an installation where the base development packages were pre-installed.)
  
 
= Get Sources =
 
= Get Sources =
Line 65: Line 81:
 
<pre>svn co https://armagetronad.svn.sourceforge.net/svnroot/armagetronad/armagetronad/branches/0.2.8/armagetronad
 
<pre>svn co https://armagetronad.svn.sourceforge.net/svnroot/armagetronad/armagetronad/branches/0.2.8/armagetronad
 
</pre>
 
</pre>
And the trunk with
+
And the trunk (0.4) with
 
<pre>svn co https://armagetronad.svn.sourceforge.net/svnroot/armagetronad/armagetronad/trunk/armagetronad
 
<pre>svn co https://armagetronad.svn.sourceforge.net/svnroot/armagetronad/armagetronad/trunk/armagetronad
 
</pre>
 
</pre>
Line 75: Line 91:
 
Get the latest 0.2.8 source with
 
Get the latest 0.2.8 source with
 
<pre>bzr branch lp:armagetronad/0.2.8 armagetronad</pre>
 
<pre>bzr branch lp:armagetronad/0.2.8 armagetronad</pre>
and the trunk with
+
and the trunk (0.4) with
 
<pre>bzr branch lp:armagetronad</pre>
 
<pre>bzr branch lp:armagetronad</pre>
  

Revision as of 18:18, 1 June 2020


Sections: Installing the Game | Playing the Game | Competition Hub | Server Administration | Extending Armagetron Advanced | Development Docs


This guide assumes you're familiar with the linux console. All commands listed here are supposed to be entered there. For system andministration tasks, you have to be logged in as the superuser 'root'. (K/X)Ubuntu users generally need to prepend a 'sudo' in front of all system administration commands or sign in via 'sudo bash'.

Install Development Environment and Dependencies

The method differs from distribution to distribution. Required for all builds are:

* The compiler gcc/g++ and its libraries
* Python
* the library libxml2

For 0.2.8 client builds, you need development files for

* OpenGL
* SDL
* SDL_image
* libpng

For trunk builds, you need

* boost
* protobuf 

For trunk/0.4 client builds, you'll also need

* SDL_mixer
* freetype
* ftgl
* GLEW (optional right now)

Also optional, but recommended for 0.4 are the SDL2 libraries

* SDL2
* SDL2_mixer
* SDL2_image

If you pick those, the SDL1 versions can be skipped.

Remove what you don't need from the one-line instructions below.

(K/X)Ubuntu

To get all of this at once, enter at the console

sudo apt-get install bison automake g++ python libxml2-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libfreetype6-dev libftgl-dev libglew-dev libpng-dev libboost-dev libprotobuf-dev protobuf-compiler libboost-thread-dev

Tested with Ubuntu 14.04.

Debian

Should be identical to Ubuntu, but without the sudo, and instead you need to be logged in as root.

Fedora/Red Hat

yum install gcc-c++ automake libxml2-devel SDL-devel SDL_image-devel SDL_mixer-devel SDL2-devel SDL2_image-devel SDL2_mixer-devel freetype-devel ftgl-devel glew-devel python boost-devel protobuf-devel

Yay for sane package names.

Gentoo

To get all of this at once (minus python and g++, which are installed by default), enter at the console

emerge libxml2 libsdl sdl-image sdl-mixer freetype ftgl glew libpng boost

Boost takes a long time to build, so you may want to omit it if you don't need it.

(Missing: protobuf and the sdl2 libs. Task for the reader: find out what it is named and add it.)

Arch

Enter at the console (as root)

pacman -S python2 gcc automake autoconf libxml2 sdl sdl_image sdl_mixer sdl2 sdl2_image sdl2_mixer ftgl glew boost protobuf

(Note: some things may be missing, I only tested it with an installation where the base development packages were pre-installed.)

Get Sources

From a distribution

Well, you download a source tarball (.tar.gz, .tar.bz2, .tbz or .tgz file extension) from download page. Then you unpack it with either

tar -xzf <name of tarball plus extension>

if the extension was a .tar.gz or .tgz, resp.

tar -xjf <name of tarball plus extension>

if the extension was a .tar.bz2 or .tbz. Either way, you'll get a shiny new directory called armagetronad-<version>. That's the source.

No bootstrap is required here.

From SVN

You need SVN/subversion installed for this. Get 0.2.8 via

svn co https://armagetronad.svn.sourceforge.net/svnroot/armagetronad/armagetronad/branches/0.2.8/armagetronad

And the trunk (0.4) with

svn co https://armagetronad.svn.sourceforge.net/svnroot/armagetronad/armagetronad/trunk/armagetronad

Then you continue with the bootstrap process.

From BZR

Get the latest 0.2.8 source with

bzr branch lp:armagetronad/0.2.8 armagetronad

and the trunk (0.4) with

bzr branch lp:armagetronad

Then you continue with the bootstrap process.

Bootstraping

First, more installation to do. You'll need the autotools for this step. So enter

X automake autoconf

where X is "sudo apt-get install" for Ubuntu, "apt-get install" for Debian, "emerge" for Gentoo and "yum install" for Fedora. You need root rights for all but Ubuntu.

The SVN/BZR processes should have left you with a source checkout in the directory named "armagetronad". Do

cd armagetronad
./bootstrap.sh
cd ..

to generate some files that are not kept in the source repository because they can be automatically generated in that way. Typically, you don't have to repeat this step after you update the source via "svn update" or "bzr pull" or any other way, the build system will take care of that.

Building and Installing

We're using autotools. That means that if you have build any other software on Linux before, there won't be any surprises. You don't need root rights for all but the installation step.

Configure

Make a new directory for your build and enter it:

mkdir build
cd build

From there, call the configure script in the source directory:

../<name of source directory>/configure

If you intend to build a server, pass it the --disable-glout flag:

../<name of source directory>/configure --disable-glout

Build

Simple:

make

We require gmake specifically. If the above command spews out tons of errors, try calling gmake directly:

gmake

and replace make by gmake in the subsequent commands as well.

Test

Type

make run

This lets the game/server run from the current directory. It won't destroy your regular configuration that way in case something is borked.

Install

Type

make install

Redistribution

If you want to distribute the current source from a bzr/svn checkout or a patched source tree, enter your build directory and type

make distcheck
make dist

This takes a while. It tests whether everything is in order (for example, whether the source tarball that is about to be created works and contains all required material). After it's done, you'll find a new file called armagetronad-<version>.tar.gz in your build directory. That's your redistributable source.