Difference between revisions of "Suse"

From UFO:AI
(Compile)
(Prerequisites)
 
(3 intermediate revisions by 2 users not shown)
Line 6: Line 6:
  
 
* gcc
 
* gcc
 +
* gcc-c++
 
* make
 
* make
* m4
+
* git-core
* subversion
+
* libSDL-devel
* SDL-Devel
+
* libSDL_ttf-devel
* SDL_ttf-devel
+
* libSDL_mixer-devel
* SDL_mixer-devel
+
* libogg-devel
 
* libvorbis-devel
 
* libvorbis-devel
* libjpeg-devel
+
* libjpeg8-devel
 
* libpng-devel
 
* libpng-devel
 
* libcurl-devel
 
* libcurl-devel
* gettext-devel  
+
* zlib-devel
** (this seemed to be missing from the repo - but everything seems to work ok without it. i have gettext, just no -devel. i do play in english, though. --[[User:Blondandy|Blondandy]] 17:38, 6 August 2008 (CEST))
+
* gettext-tools
 +
* gettext-runtime
 
* libtheora-devel (configure grumbled under opensuse 11.1. when I installed ffmpeg2theora (packman repo), it was fine - no idea why this fixed it)
 
* libtheora-devel (configure grumbled under opensuse 11.1. when I installed ffmpeg2theora (packman repo), it was fine - no idea why this fixed it)
 
* libxvidcore-devel
 
* libxvidcore-devel
Line 23: Line 25:
 
Some more dependencies for radiant (may be disabled via './configure --disable-uforadiant')
 
Some more dependencies for radiant (may be disabled via './configure --disable-uforadiant')
 
* gtk2-devel
 
* gtk2-devel
* gtkglext-devel
+
* gtkglext-devel — Note that with the gtkglext in recent OpenSUSE versions (12.x at least) radiant won't compile.
 
* glib2-devel
 
* glib2-devel
* libgtksourceview-devel
+
* gtksourceviewmm2-devel
* libgtksourceview-2_0-0
+
* openal-soft-devel
* openal-devel
 
 
* libxml2-devel
 
* libxml2-devel
  
 
You also need the X11 development packages, on 10.1 they're called xorg-X11-devel (just search for X11 and select the package with the -devel extension).
 
You also need the X11 development packages, on 10.1 they're called xorg-X11-devel (just search for X11 and select the package with the -devel extension).
 +
 +
For our test suit (disable with './configure --disable--testall')
 +
* cunit-devel (For versions 2.3 to 2.5)
  
 
Yast will automagically sort out any dependencies.
 
Yast will automagically sort out any dependencies.
  
If you have problems with Subversion, which you shouldn't, for versions upto and including 10.0, you can get v1.3.0 rpms from ftp://ftp.suse.com/pub/projects/apache/subversion/ You will also need the correct version of libapr from the same site. 10.1 comes with 1.3.0, which should work fine. If you want 1.4.0, you'll have to download and compile from source (or search the net for RPMS), but you shouldn't need it.
 
  
You shouldn't have any version problems on 10.0 and 10.1 (can't be certain about 9.3 or earlier or SLED/S). Any problems will most likely be with SDL, which has gone through some API changes recently. Just download and build the sources yourself (which isn't unreasonable, considering you're gonna be downloading and compiling UFO:AI...)
+
As root, this command should install all dependencies.
 
 
As root, this command should install all dependencies (tested on openSuSE 11.2). I have tried to find the shortest set. zypper will find the dependencies of these dependencies and install them.
 
 
<p>
 
<p>
 
<code>
 
<code>
zypper install gcc gcc-c++ make zlib-devel libcurl-devel libjpeg-devel libogg-devel libvorbis-devel libtheora-devel libSDL-devel libSDL_mixer-devel libSDL_ttf-devel libpng-devel libxvidcore-devel libSDL_image-devel gtk2-devel libgtksourceviewmm-2_0-devel gtkglext-devel openal-devel
+
zypper install gcc gcc-c++ make zlib-devel libcurl-devel libjpeg8-devel libogg-devel libvorbis-devel libtheora-devel libSDL-devel libSDL_mixer-devel libSDL_ttf-devel libpng-devel libxvidcore-devel gtk2-devel glib2-devel gtksourceviewmm2-devel gtkglext-devel openal-soft-devel libxml2-devel
 
</code>
 
</code>
 
</p><p>
 
</p><p>
Line 55: Line 56:
 
I did this after building my own xvid, but this may work on xvid from the videolan repo.
 
I did this after building my own xvid, but this may work on xvid from the videolan repo.
  
== Download the latest SVN version ==
+
== Download the latest development version ==
Create a new directory and grab the latest SVN version:
+
See [[Getting the source]] for more information
<pre>
 
$ mkdir ufoai
 
$ cd ufoai
 
$ svn co https://ufoai.svn.sourceforge.net/svnroot/ufoai/ufoai/trunk
 
$ cd trunk
 
</pre>
 
This might take a while as the whole trunk package (including all the models, maps, all the textures etc.) is quite big. If the sourceforge site has any problems connecting, type
 
 
 
WARNING: Some music is not included in SVN trunk. You have to download it manually from the UFOAI homepage (currently http://prdownloads.sourceforge.net/ufoai/music.tar.bz2?download) and decompress it to base/music folder.
 
  
You can also get a specific 'stable' version instead of the most recent (often unstable) code. See [[Coding/Create Release#Get a release]] for more info on how to do that.
+
You can also get a specific 'stable' version instead of the most recent (often unstable) code.
  
 
== Compile ==
 
== Compile ==
  
 
type  
 
type  
<pre>./configure
+
<pre>
 +
./configure
 
make
 
make
make lang</pre>
+
make lang
 +
</pre>
  
 
Now compile the maps:  
 
Now compile the maps:  
Line 82: Line 76:
 
'''WARNING: This process might take some time (even a couple of hours or so!)(Or All Day!).''' It is often recommended instead to use the maps-sync target, which will download the latest compiled versions of the maps from the ufoai server:
 
'''WARNING: This process might take some time (even a couple of hours or so!)(Or All Day!).''' It is often recommended instead to use the maps-sync target, which will download the latest compiled versions of the maps from the ufoai server:
 
<pre>
 
<pre>
$ maps-sync
+
$ make maps-sync
 
</pre>
 
</pre>
 
NOTE: the modification of PATH above is needed to include the ufo2map executable in our path. ufo2map is usually found in the ufoai root (trunk) directory although on some systems it might be located in releasei386 or releasex86_64 or debugi386 or debugx86_64. If this is the case on your system you may need to replace the PATH modification statement above with: PATH=$PATH:../../releasei386  (or similar)
 
  
 
NOTE: If you have multiple cpus/cores you might want to use the -j option to make. The number of jobs should be cpus/cores + 1, so if you have a dual-core cpu use make -j 3. You could also use -j 2 on single core/single cpu machines to speed things a little bit.
 
NOTE: If you have multiple cpus/cores you might want to use the -j option to make. The number of jobs should be cpus/cores + 1, so if you have a dual-core cpu use make -j 3. You could also use -j 2 on single core/single cpu machines to speed things a little bit.
Line 98: Line 90:
 
See [[debugging]] if you happen to find a bug.
 
See [[debugging]] if you happen to find a bug.
  
== Updating SVN automatically ==
 
 
Here is a nice script that you can write to your /etc/cron.daily so you stay uptodate without any work. (Write it with an editor and then move it as root to the folder, and there type chmod +x file to make it executable).
 
 
<pre>
 
#! /bin/sh
 
pushd /(place of ufo folder)/
 
svn co https://ufoai.svn.sourceforge.net/svnroot/ufoai/ufoai/trunk
 
cd trunk
 
make
 
popd
 
</pre>
 
 
If your UFO starts to behave strangely, like it has some MAJOR problems, then most likely something went wrong with SVN, or make. So kill the folder and restart at the top, befor writing unapt bugreports.
 
 
== Updating the SVN version manually ==
 
To update to the latest SVN version:
 
<pre>
 
$ cd trunk
 
$ svn up
 
</pre>
 
 
Then re-compile.
 
 
Then rebuild the maps (only new or updated maps will be rebuilt so it won't take forever!).
 
  
 
== Packaging for SUSE ==
 
== Packaging for SUSE ==

Latest revision as of 15:42, 12 October 2014

Prerequisites

(Zypper is a command-line alternative interface to the same system as YaST - see below for a one-liner that should get all dependencies)

Note that where there are packages that depend on the devel packages, they are not mentioned here, as YaST will select them for install automatically. Use YaST to install (if you haven't already):

  • gcc
  • gcc-c++
  • make
  • git-core
  • libSDL-devel
  • libSDL_ttf-devel
  • libSDL_mixer-devel
  • libogg-devel
  • libvorbis-devel
  • libjpeg8-devel
  • libpng-devel
  • libcurl-devel
  • zlib-devel
  • gettext-tools
  • gettext-runtime
  • libtheora-devel (configure grumbled under opensuse 11.1. when I installed ffmpeg2theora (packman repo), it was fine - no idea why this fixed it)
  • libxvidcore-devel

Some more dependencies for radiant (may be disabled via './configure --disable-uforadiant')

  • gtk2-devel
  • gtkglext-devel — Note that with the gtkglext in recent OpenSUSE versions (12.x at least) radiant won't compile.
  • glib2-devel
  • gtksourceviewmm2-devel
  • openal-soft-devel
  • libxml2-devel

You also need the X11 development packages, on 10.1 they're called xorg-X11-devel (just search for X11 and select the package with the -devel extension).

For our test suit (disable with './configure --disable--testall')

  • cunit-devel (For versions 2.3 to 2.5)

Yast will automagically sort out any dependencies.


As root, this command should install all dependencies.

zypper install gcc gcc-c++ make zlib-devel libcurl-devel libjpeg8-devel libogg-devel libvorbis-devel libtheora-devel libSDL-devel libSDL_mixer-devel libSDL_ttf-devel libpng-devel libxvidcore-devel gtk2-devel glib2-devel gtksourceviewmm2-devel gtkglext-devel openal-soft-devel libxml2-devel

Even though I had libxvidcore, ./configure failed with

checking for xvid_decore in -lxvidcore... no
configure: error: You must have libxvidcore!!!

the configure script is missing the .so.4.2, so adding this symlink fixed it.

sudo ln -s /usr/local/lib/libxvidcore.so.4.2 /usr/local/lib/libxvidcore.so

I did this after building my own xvid, but this may work on xvid from the videolan repo.

Download the latest development version

See Getting the source for more information

You can also get a specific 'stable' version instead of the most recent (often unstable) code.

Compile

type

./configure
make
make lang

Now compile the maps:

$ make maps

WARNING: This process might take some time (even a couple of hours or so!)(Or All Day!). It is often recommended instead to use the maps-sync target, which will download the latest compiled versions of the maps from the ufoai server:

$ make maps-sync

NOTE: If you have multiple cpus/cores you might want to use the -j option to make. The number of jobs should be cpus/cores + 1, so if you have a dual-core cpu use make -j 3. You could also use -j 2 on single core/single cpu machines to speed things a little bit.

Running

Run the game

$ ./ufo

See debugging if you happen to find a bug.


Packaging for SUSE

See Packaging/SuSE.