Building Planeshift from sources.


I would like to thank Arianna Benigno who wrote the original guides to compile Planeshift from CVS sources. Everything here is based on these guides.

Before you start

Before you start building Planeshift from sources, you need to make sure that you have several development packages installed. The instructions here are tested using Gentoo Linux.

Since Gentoo Linux is source based, most of the development packages are already installed. I found that only curl, jam and svn were missing for me.

# emerge -v jam subversion curl

Here is the official build document that may give you a clue, which packages should be installed and how:

Getting source files

All the following commands are run as a normal user and Planeshift will be built for that user only. Commands that you enter are in blue color and everything else is the expected output on the console.

Choose a base directory for your installation. Planeshift will be installed into a subdirectory planeshift in the base directory and it can be your home directory. In this document I refer to the base directory as <PATH>. Open a terminal and change your working directory to the base directory.

Revision numbers in this guide can be used to build the latest stable version of Planeshift that should work with the current Laanx server.

Checking out sources from SVN repositories

Get the Planeshift sources.

$ svn co planeshift

Download Cal3D library sources.

$ svn co -r 493 svn:// cal3d

Download CrystalSpace sources.

$ svn co -r 28731 cs

Download Crystal Entity Layer (CEL)

$ svn co -r 3178 cel

Building CrystalSpace and Planeshift

Create a profile file that sets all the necessary environment variables. Save the file with the name profile in the planeshift directory. In the following code replace <PATH> with the full path to the directory where planeshift is built (for example /home/development).

export LD_LIBRARY_PATH=<PATH>/cal3d/src/cal3d/.libs/:$LD_LIBRARY_PATH
export CRYSTAL=<PATH>/cs
export CEL=<PATH>/cel
export CSCONFPATH=<PATH>/cel
export CAL3D=<PATH>/cal3d

Then load the profile. You have to reload the profile every time you exit the console and start another one.

$ source planeshift/profile

If you want to modify compiler options, export CFLAGS and CXXFLAGS with your custom options:

$ export CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer -msse -msse2 -msse3 -mmmx"
$ export CXXFLAGS="${CFLAGS}"

Build Cal3D library.

$ cd cal3d
cal3d $ autoreconf --install --force

It might be that the autoreconf command fails with the message: error: possibly undefined macro: AM_USE_UNITTESTCPP'

Open the file with a text editor and delete the line 62 with 'AM_USE_UNITTESTCPP'. Then re-run autoreconf and continue with configure.

cal3d $ ./configure --prefix=$CAL3D
cal3d $ make
cal3d $ make install

Build CrystalSpace.

cal3d $ cd ../cs
cs $ ./configure --without-python --without-java --without-perl --without-lib3ds --with-libcal3d=$CAL3D

If you wanted to use your own compiler options and changed -march or -O, open the Jamconfig file with a text editor and delete the following lines:

COMPILER.CFLAGS += "-march=i586" ;
COMPILER.CFLAGS.optimize += "-O3" ;

Then build CS:

cs $ jam -aq plugins cs-config walktest

If you have a dual core CPU, then you can add -j3 to the jam command:

cs $ jam -aq -j3 plugins cs-config walktest

Build Crystal Entity Layer. Use the -j3 option with jam to speed it up on dual core CPUs.

cs $ cd ../cel
cel $ ./
cel $ ./configure --without-python
cel $ jam -aq plugins cel-config

Build Planeshift.cel $ cd ../planeshift planeshift $ ./ planeshift $ ./configure --with-libcal3d=$CAL3D

If you wanted to use your own compiler options and changed -march or -O, open the Jamconfig file with a text editior and delete the following lines:

COMPILER.CFLAGS += "-march=i686" ;
COMPILER.CFLAGS.optimize += "-O3" ;

Then continue with building. Use the -j3 option to speed up on dual core CPUs.

planeshift $ jam -aq client

Configuring and updating Planeshift

Open updaterconfig.xml in a text editor and change the following lines:


	<active id="1" />
        <mirror id="1" name="mir1" url="" repository="" files="" />


	<!-- <module>root</module> -->

Then run the updater.

planeshift $ ./updater -auto

Running Planeshift

Every time you want to run Planeshit or setup, you need to load the profile:

planeshift $ source profile

Then start the setup or Planeshift:

planeshift $ ./pssetup
planeshift $ ./psclient

Or you can create a script file, which you can call runpsclient:

source profile

Make sure that you make the script executable:

planeshift $ chmod a+x runpsclient

Now you can skip the profile loading and run Planeshift using the following command:

planeshift $ ./runpsclient