Compiling Ember: Script

From WorldForgeWiki

Jump to: navigation, search

This page is a work in progress,
meaning things are incomplete, unfinished, not fully thought out, might disappear again, and generally are subject to change.
Do not rely on any of this just yet!

Note that this won't currently work with 0.5.2 since we've now moved to git from cvs, and the script needs to be updated to reflect this. In addition, using lua 5.1 would probably be better than 5.0.--Erik 14:52, 12 June 2008 (CEST)

Here's a script for compiling Ember and its dependencies, should work on any supported unix system with available dependencies.

You also need to install a couple of development packages. Under Debian or Ubuntu this could be done with following command. The installation of these is commented out in the script, but should be run manually from root (with sudo) before running the script.

apt-get -y install g++ make autoconf automake libtool dkpg-dev cvs git libdevil-dev liblua5.1-0-dev libtolua-dev libzzip-dev \
                   libxaw7-dev libxxf86vm-dev libopenal-dev libalut-dev libsigc++-2.0-dev libcurl3-dev \
                   libjpeg62-dev libpng12-dev libtiff4-dev libsdl1.2-dev nvidia-cg-toolkit libpcre3-dev libxrandr-dev libmng-dev

Also, before running the script, run following command and enter cvsanon when asked for password:

cvs -d :pserver:cvsanon@cvs.worldforge.org:/home/cvspsrv/worldforge login

If you find that there's any more packages that needs to be installed feel free to extend the above command. Do note that there are also a couple of OGRE and CEGUI packages available, such as this and this. If you want to use this script (or build ogre from source) make sure what you have no ubuntu libogre package installed due to linker error arising. Anyone running Debian or Ubuntu is welcome to try them out and see if Ember can be compiled with these packages.

#!/bin/bash

set -e
set -x

export PREFIX=$HOME/local
export SOURCE=$HOME/dev/worldforge
export DEPS_SOURCE=$HOME/local/src
export MAKEOPTS="-j3"
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig

function buildwf()
{
    cd $SOURCE/forge/$1
    export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
    ./autogen.sh
    ./configure --prefix=$PREFIX
    make && make install
}

mkdir -p $PREFIX $SOURCE

#apt-get -y install g++ make autoconf automake libtool cvs git dkpg-dev libdevil-dev liblua5.1-0-dev libtolua-dev libzzip-dev \
#                   libxaw7-dev libxxf86vm-dev libopenal-dev libalut-dev libsigc++-2.0-dev libcurl3-dev \
#                   libjpeg62-dev libpng12-dev libtiff4-dev libsdl1.2-dev nvidia-cg-toolkit libpcre3-dev libxrandr-dev libmng-dev

mkdir -p $DEPS_SOURCE
cd $DEPS_SOURCE
wget -c  http://downloads.sourceforge.net/sourceforge/crayzedsgui/CEGUI-0.6.1.tar.gz
tar zxvf CEGUI-0.6.1.tar.gz
cd CEGUI-0.6.1/
./configure --prefix=$PREFIX  --disable-samples --disable-opengl-renderer --disable-irrlicht-renderer --disable-xerces-c --disable-libxml --disable-expat
make
make install

cd $DEPS_SOURCE
wget -c http://downloads.sourceforge.net/ogre/ogre-v1-4-9.tar.bz2
tar -xjf ogre-v1-4-9.tar.bz2
cd ogre
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
./configure --prefix=$PREFIX --disable-freeimage --disable-ogre-demos
make
make install

cd $SOURCE
cvs -z3 -d :pserver:cvsanon@cvs.worldforge.org:/home/cvspsrv/worldforge -q co forge/libs

mkdir -p $SOURCE/forge/clients
cd $SOURCE/forge/clients
git clone git://git.worldforge.org/ember.git

buildwf "libs/varconf"
buildwf "libs/skstream"
buildwf "libs/wfmath"
buildwf "libs/Atlas-C++"
buildwf "libs/eris"
buildwf "libs/libwfut"
buildwf "libs/mercator"
buildwf "clients/ember"

cd $SOURCE/forge/clients/ember
make devmedia
Personal tools