Monday 23 March 2009

How-To: Compile and Install Wesnoth 1.6 from Source in Debian Lenny and Ubuntu 8.10

The Battle for Wesnoth is a free turn-based strategy game licensed under the GPL. After over one year of constant development, a new stable version, 1.6, was released on March 22, 2009, featuring many graphics and gameplay improvements. To count just a few, you can now log into the multiplayer server using the username and password from the Wesnoth forums; the game includes new graphics for terrain and units (including several new portraits); a new campaign, called 'The Legend of Wesmere' is also available, and it allows the AI to control an allied side.


To compile this release of Wesnoth on Debian Lenny or Ubuntu Intrepid, you only need to follow the steps below.

Note: Ubuntu users, just prefix the commands which need root privileges with sudo.

1. Install the tools needed for compilation
Issue the following command as root:

apt-get install build-essential

2. Install the development packages needed to compile Wesnoth
First of all, make sure you have the sources repositories enabled. To do this, edit as root your /etc/apt/sources.list file and make sure you have a line which starts with deb-src, e.g.:

deb-src ftp://ftp.ro.debian.org/debian/ lenny main contrib non-free

Next, update your packages list as root:

apt-get update

Proceed with the installation of the needed development packages:

apt-get build-dep wesnoth
apt-get install libsdl-ttf2.0-dev libsdl-pango-dev

3. Download the Wesnoth source tarball
Download the source code for 1.6 from the official website, here. Next, make sure the current working directory is the one where the source was saved and uncompress it:

tar -xjf wesnoth-1.6a.tar.bz2

4. Compile and install Wesnoth 1.6
Compiling and installing is simple once you followed all the steps above. Change the working directory to wesnoth-1.6a and issue the following commands:

./configure
make
make install

The last one as root. Notice that you can specify another prefix and install it in your home folder as user instead of root (in this case make sure you include it in your $PATH)

./configure --prefix=/home/YOUR_USER/usr
make
make install

That should be all. You can now run Wesnoth by pressing ALT+F2 and typing wesnoth in the run dialogue box that appears.


Related articles
Review: Battle for Wesnoth 1.6
The Battle for Wesnoth 1.6 Released
Battle for Wesnoth 1.4 Review - Awesome Turn-Based Strategy Game

Updated: March 29, 2009

5 comments:

Anonymous said...

gcc is gonna be tired.

Anonymous said...

https://launchpad.net/~stikonas/+archive/ppa

Anonymous said...

i dont get point 4...

Dr. Tux said...

if you try to compile wesnoth 1.8 there are several changes:

a) configure does not exist anymore - you have to use scons instead.

apt-get install scons

b) lua 5.1 is not installed automatically, so you have to do it seperately:

apt-get install lua5.1

c) I´m not sure about libfribidi, so:

apt-get install libfribidi-dev

HTH

Julian said...

Dr. Tux, since we can't use configure anymore, bus scons, what about the neat path prefix to get the game into my home folder? How would I go about doing that?

Also, does the same routine go for wesnoth 1.85 and 1.9?

Thanks!