Pages: [1]
  Print  
Author Topic: GtkRadiant on Linux - from scratch to running HOWTO  (Read 16234 times)
bill-----
Half-Nub


Cakes 8
Posts: 60


« on: February 01, 2009, 08:55:43 PM »

The outcome of considerable research and pain.  Please have a look, try it out, make comments. 
Hopefully we can address the topic in http://openarena.ws/board/index.php?topic=2688.0.

From scratch, to a running and functional GtkRadiant set up to map for
OA with no further googling or forum post reading for screwy messages,
failures, etc..

The base system is Ubuntu Desktop 8.04, though the steps should be
adaptable to any *nix distribution, and may provide useful hints for
that other OS. :-)

At no time is root access required for software installation or
configuration, other than installation of prerequisite software
through normal Ubuntu methods.

I recommend somewhere other than your home directory for such activities
but examples will assume that you're putting things in suitably named
subdirectories of your home directory.

I'm a command line kind of guy, so if you aren't, locate your terminal
launcher and open up a terminal. This whole process uses the command line.


If you haven't done so already, install OpenArena. I use the zip file
rather than the Debian package.  The current version as of this writing
is 0.8.1.  Note that these instructions won't harm any Debian based
OA installation.  Be aware, though, that of necessity, any existing
Radiant and OpenArena 'dot' directories, e.g. ~/.radiant or ~/.openarena,
will be affected.

Make a directory for OA and then enter that directory.

Code:
mkdir oa
cd oa

Download the OA zip file from http://www.openarena.ws/files.html
into the oa directory just created.  Next

Code:
unzip oa081.zip

and return to your HOME directory.

Code:
cd

Start OA to verify its correct operation if necessary and adjust the
configuration to suit yourself. If you already have a config file, you
can save yourself some trouble by setting up the .openarena directory
in advance, e.g.

Code:
mkdir -p .openarena/baseoa
cp q3config.cfg .openarena/baseoa

Once you have OA running to your liking, make some directories in
preparation for GtkRadiant use.

Code:
cd .openarena/baseoa
mkdir maps scripts

The command will complain if the subdirectories already exist, but that's ok.

Return to your HOME directory.

Code:
cd

Set up to build GtkRadiant.

Update your Ubuntu installation to meet the prerequisites as called out
in (DO NOT LINK) h t t p s : / / openarena . wikia . com/wiki/Configure_GTK_Radiant_under_Linux.

I've copied the commands here for your convenience.

Code:
sudo aptitude install subversion

On a fresh Ubuntu 8.10 system aptitude wanted to remove kernel headers.
It generally does that sort of thing because it thinks they're unused.
You can always get them back if needed.

Code:
sudo aptitude install build-essential scons python libglib2.0-0 libglib2.0-dev libgtk2.0-0 libgtk2.0-common libgtk2.0-bin libgtk2.0-dev libgtkglext1 libgtkglext1-dev libxml2 libxml2-dev libpango1.0-0 libpango1.0-common libpango1.0-dev libatk1.0-0 libatk1.0-dev zlib1g zlib1g-dev libpng12-0 libpng12-dev libmhash2 libmhash-dev

libjpeg was needed on the fresh Ubuntu 8.10 system. Probably only -dev was
needed.


Code:
sudo aptitude install libjpeg libjpeg-dev

Exact versions may not be required, since aptitude will use the most
recent package version.  This is a subject for further research, but
the current commands work.

scons isn't strictly necessary as the Ubuntu scons is out of date and
we won't be using it.  Some of these packages may already be installed
on your setup.  If prompted, skip the install for those packages if
you wish.


Make a subdirectory to hold the source code and other needed files.

Code:
mkdir gtkradiant
cd gtkradiant

Install a current version of scons for our purpose.

Code:
mkdir scons
cd scons

As of this writing the current stable version is 1.2.0. See
http://www.scons.org/ for up to date information.

I downloaded the stable scons tarball from
http://prdownloads.sourceforge.net/scons/scons-1.2.0.tar.gz and put it
into the scons directory just created.

now untar and build

Code:
tar xzf scons-1.2.0.tar.gz
cd scons-1.2.0
python setup.py install --prefix=~/gtkradiant/scons

Note that we 'installed' scons inside the gtkradiant/scons directory.

Return to gtkradiant directory.

Code:
cd ../..

Download either dmn_clown's or sago007's 'OAPack' file sets.  sago007's
default_shaderlist.txt may be more up-to-date.

Code:
mkdir oapack
cd oapack

dmn_clown's. see http://openarena.ws/board/index.php?topic=549.msg3438
Code:
svn checkout http://openarena.ws/svn/tools/radiant1_5/ .

or

sago007's. see http://openarena.ws/board/index.php?topic=2722.0

download
http://brie.ostenfeld.dk/~poul19/public_files/OpenArenaPack.zip
to the oapack directory just created. Then unzip.

Code:
unzip OpenArenaPack.zip

Return to gtkradiant directory

Code:
cd ..

Use subversion to check out GtkRadiant source code as directed in
(DO NOT LINK) h t t p s : / / openarena . wikia . com/wiki/Configure_GTK_Radiant_under_Linux.
As of this writing you'll get GtkRadiant 1.6, a.k.a. zeroradiant.

You will get an alarming message about zerowing's SSL certificate.
Reply with 'p', accept permanently.  There's a fair likelihood that
you'll return to fetch the code again. :-)

You should be in the gtkradiant directory created earlier.

Code:
svn checkout https://zerowing.idsoftware.com/svn/radiant/GtkRadiant/trunk/ ./GtkRadiant

The manuals come with the base code now, and we'll be
getting the Q3Pack a little further along in the process,
so we won't be using the other commands mentioned in
(DO NOT LINK) h t t p s : / / openarena . wikia . com/wiki/Configure_GTK_Radiant_under_Linux.

Make a backup of the just checked out source code before you do anything else.

Code:
tar czf gtkradiant.tz GtkRadiant

If for some reason you screw up the GtkRadiant source tree, you now can
recover with

Code:
cd ~/gtkradiant
rm -rf GtkRadiant
tar xzf gtkradiant.tz

There's another good reason to make a backup.  Because GtkRadiant is a
work (slowly) in progress, it's possible at some point that the checked
out code will be broken!  If you have a backup of a working version,
you'll still be able to build a new GtkRadiant setup should you need to!

Build GtkRadiant using the build instructions at
http://www.qeradiant.com/cgi-bin/trac.cgi/wiki/ZeroRadiant as a guide.

Code:
cd GtkRadiant

Run the scons step that will fetch Q3Pack.  We need only a few files
from this single pack, so to avoid downloading the other game packs,
edit the file config.py with the editor of your choice.

Make a backup of the file first.

Code:
cp config.py config.py.orig

The manly editor.  :-)

Code:
vi config.py

Edit this line at about line 36

from
                self.setup_packs = [ 'Q3Pack', 'UrTPack', 'UFOAIPack', 'Q2WPack', 'JAPack' ]
to
                self.setup_packs = [ 'Q3Pack' ]

WARNING!  Python is white-space sensitive! Maintain the alignment of the text!

Save the file and exit the editor.

Note we use the scons that we downloaded and installed earlier, not the
scons that was installed with aptitude.

Prepare the Q3Pack game pack.

Code:
../scons/bin/scons target=setup

Once this completes, move above the GtkRadiant directory and
make another backup of the source tree.

Code:
cd ..
tar czf gtkradiant_q3pack.tz GtkRadiant
cd GtkRadiant

Build GtkRadiant.

Code:
../scons/bin/scons target=radiant,q3map2 config=debug

The build takes about 3 minutes on my Athlon 64 3000+


Now we need to make important modifications before you start GtkRadiant!

In either of sago007's or dmn_clown's OAPack file sets, locate the file oa.game
and copy it to the install/games directory

Code:
cp ../oapack/<somewhere>/games/oa.game install/games

where <somewhere> is probably "OpenArenaPack" or "install" depending on
whether you downloaded sago007's or dmn_clowns OAPack fileset.

Edit the just created file to add an important item.  Add a line like this

 gametools_linux="/home/oamap/gtkradiant/GtkRadiant/install/installs/Q3Pack/game/"

just above the line

 prefix=".openarena"

Order of the lines really isn't important, but this suggestion gives
you something to look for.

Now Pay Attention! Look carefully at the line we just added.

'oamap' in '/home/oamap' should be your login name, which is probably not
oamap.  The added line is pointing to the Q3Pack we checked out (through
scons target=setup) along with the GtkRadiant source code.  This is
important because it gives GtkRadiant a location for synapse.config,
avoiding that dreaded startup failure.  Save the file and exit the editor.

Copy an important pk3 file from the Q3Pack.  This prevents the dreaded
'notex' failure.

Code:
cp install/installs/Q3Pack/install/baseq3/common-spog.pk3 ~/.openarena/baseoa

Locate the files entities.def, entities-ta.def and default_shaderlist.txt
in whichever of dmn_clown's or sago007's 'OAPack' filesets you downloaded,
and copy them to .openarena/baseoa/scripts.  We created the scripts
directory earlier.

Note that default_shaderlist.txt is copied to the new name shaderlist.txt

Code:
cp ../oapack/<somewhere>/oa.game/baseoa/entities*.def ~/.openarena/baseoa/scripts
cp ../oapack/<somewhere>/oa.game/baseoa/default_shaderlist.txt ~/.openarena/baseoa/scripts/shaderlist.txt


Fire up GtkRadiant!

Code:
./install/radiant.bin


There will be some nuisance messages about .xlink files.  If they bother
you, both 'OAPack' filesets have .xlink files that you can place where
the messages indicate that those files couldn't be found.

Select OpenArena from the 'select game' list that pops up. It should
be the only selection available.  You might want to check the box 'Auto
load the selected game on startup'. Click OK.


Next, you will be prompted for a project file. Press OK.  A file selection
dialog box will pop up.

The file we're looking for is in the Q3Pack, so browse to
gtkradiant/GtkRadiant/install/installs/Q3Pack/install/baseq3/scripts and
select the file default_project.proj.  This file is actually a template,
and the result of selecting it will be the creation of a file user0.proj
in .openarena/baseoa/scripts.

GtkRadiant should now be running.  Shut it down, (File->Exit), and make
some final adjustments.

To get access to the textures, shaders and other assets that come with OA,
pk3 files or directories containing them must exist in .openarena/baseoa.
Earlier, we copied common-spog.pk3 from the Q3Pack to .openarena/baseoa.
However, the pk3 files for OA are large, and copying them is wasteful,
so we'll use the Unix symbolic link facility to reference them indirectly.

Code:
cd ~/.openarena/baseoa
ln -s ~/oa/openarena-0.8.1/baseoa/pak0.pk3
ln -s ~/oa/openarena-0.8.1/baseoa/pak4-textures.pk3
cd

A Unix quirk is the convention that filenames that start with '.' are
'hidden'. GtkRadiant's file selection dialog honors that convention.
Since you'll be trying to open files in .openarena/baseoa/maps
among other places under .openarena, make a symbolic link to get around
GtkRadiant's behavior.

Code:
ln -s .openarena dot_openarena

Now, when using GtkRadiant's file selection dialog, select dot_openarena
to enter .openarena.

To avoid having to traverse the gtkradiant build directories to get to
radiant.bin to run it, make a symbolic link to it.

Code:
ln -s gtkradiant/GtkRadiant/install/radiant.bin

Now you can run GtkRadiant while in your HOME directory by simply entering

Code:
./radiant.bin

To run OA to test a map without fussing with those command line options
you always forget, create a convenience script.

Code:
cat > runoa <<'EOF'
~/oa/openarena-0.8.1/openarena.i386 +sv_pure 0 +devmap "$*"
EOF
chmod u+x runoa

To use the script, enter, e.g.

Code:
./runoa mymap

At this point, if you were lucky and you persevered, GtkRadiant should be fully operational,
and you're ready to begin looking at tutorials and starting to map.  Congratulations and
have fun!


Logged
Pages: [1]
  Print  
 
Jump to: