Compiling Wesnoth for the OpenPandora

Get help with compiling or installing the game, and discuss announcements of new official releases.

Moderator: Forum Moderators

Post Reply
User avatar
ivanovic
Lord of Translations
Posts: 1149
Joined: September 28th, 2004, 10:10 pm
Location: Germany

Compiling Wesnoth for the OpenPandora

Post by ivanovic »

Okay, I finally installed the cross compile toolkit for the pandora on my home system and directly started at compiling Wesnoth using it. To provide you with an easy way to get Wesnoth compile for the pandora, I will post the steps I took to make it work:

1) There is a really great how-to with lovely scripts in the official english OpenPandora boards. Have a look at this thread for the basic scripts. I replied in this thread how I have done it, but will also post the information in here, too. The package list in the very first post is not complete enough to allow you compiling Wesnoth. This is the (complete) list I used over here:
Spoiler:
2) Once the toolchain is installed you are basically good to go. I compiled Wesnoth relying on cmake. To do so I had to create a toolchain file. Please name this file PandoraToolchain.cmake (relevant for later steps, if you change the name, you have to adjust it accordingly!). This is the content of it:
Spoiler:
3) Now that we got this, we need two things:
* the sourcecode (lets assume that we use the wesnoth 1.8.3 tarball), lets assume that the tarball is in the folder we are currently in
* the right line to invoke cmake
Now you can simply use these commands:

Code: Select all

tar xfj wesnoth-1.8.3.tar.bz2
mkdir wesnoth_compile
cd wesnoth_compile
cmake -DCMAKE_BUILD_TYPE=release -DENABLE_STRICT_COMPILATION=off -DCMAKE_TOOLCHAIN_FILE=../PandoraToolchain.cmake -DPKG_CONFIG_EXECUTABLE=/usr/local/pandora/arm-2009q3/bin/arm-none-linux-gnueabi-pkg-config -DSDL_CONFIG=/usr/local/pandora/arm-2009q3/usr/bin/sdl-config -DLUA_MATH_LIBRARY=/usr/local/pandora/arm-2009q3/arm-none-linux-gnueabi/libc/usr/lib/libm.so -DPREFERENCES_DIR=wesnoth-1.8_userdata ../wesnoth-1.8.3
make
After this you have created a binary. Now you just need to package it.

4) Packaging for the pandora is rather easy, too, if you follow the PND quickstart guide. You need to have the "squashfs-tools" installed.What you basically do is:
* download the sample tarball: http://www.shiranui.in/pndexample.tar.gz
* extract it
* cd into the created folder, here you will see the file pnds.sh, this one is used later on to create the pnd, you might want to/need to adjust it to suite your needs, please make sure that the output dir for the PND does exist
* cd into the 'wesnoth' folder and edit PXML.xml with your favorite text editor, things to adjust:
For 1.8.3 you want to set this as version number: <version major="1" minor="8" release="3" build="1"/>
Alter anything as you think fits, most stuff should be self explaining
* in here create the file run.sh. This is how it can/should look like:
Spoiler:
* Now the most important stuff, you got to copy the "right" stuff over. Lets assume this is the folder structure we got:

Code: Select all

pandora-development/wesnoth_compile   # the folder where you compiled in
pandora-development/wesnoth-1.8.3     # the folder where you extracted the tarball to
pandora-development/PXML              # created by extracting the example tarball
pandora-development/PXML/wesnoth      # was part of the example tarball and you created run.sh in here
These are the commands to run once you are in pandora-development:

Code: Select all

mkdir pandora-development/PXML/wesnoth/bin
cp wesnoth_compile/wesnoth pandora-development/PXML/wesnoth/bin
cp wesnoth_compile/wesnothd pandora-development/PXML/wesnoth/bin
cp -r wesnoth-1.8.3/{data,fonts,images,sounds,translations} pandora-development/PXML/wesnoth/
cd PXML
./pnds.sh
Now you should have created a nice pnd that you can copy onto your sdcard and use to play wesnoth.


If this is too much work for you, you can eg directly download the wesnoth 1.8.3 pnd right from sourceforge.net or the pandora software archive.
Post Reply