User:Mattg/Fedora

From FreeOrionWiki
Jump to: navigation, search

Pre-Reading Note

This was the most painful experience compiling something on a Redhat-based distro I've had in years. Admittedly most of the pain was trying to do things "The Right Way" because I've recently taken a serious disdain for putting things in /usr/local, prefering instead to do everything that's easy to do with RPMS.

I've chosen to install everything that can't be done trivially with RPMS into /opt/freeorion/. Makes for easy cleanup later.

This guide is based on Fedora Core 4.

Preparing

Installing the packages whose FC4 version are compatible with FreeOrion is easy. You probably already have python, freetype, and SDL installed. You may not have the devel packages, scons, or subversion though:

yum install sdl-devel scons subversion

That was the easy part. Now comes the mish-mash of packages that require specific versions:

Boost

The version of boost that comes with FC4 isn't the bleeding-edge latest version that FreeOrion claims to require. And you really don't want to compile it yourself. Major pain in the butt. If you have kde installed, you might already have boost installed (the old version can stay). Make sure boost-devel is not installed though, since two versions of the -devel package cannot coexist. Then you can grab the latest version from the FC5 tree:

rpm -ivh \
http://download.fedora.redhat.com/pub/fedora/linux/core/development/i386/Fedora/RPMS/boost-1.33.1-5.i386.rpm \
http://download.fedora.redhat.com/pub/fedora/linux/core/development/i386/Fedora/RPMS/boost-devel-1.33.1-5.i386.rpm

(all one line)

If you do have an older version of boost-devel installed, attempt "rpm -Uvh" for the devel rpm.

Log4cpp

I built RPMs of the version you need and you can get them here:

http://gillens.us/rpms/i386/

Or you can grab the source and compile it yourself.

DevIL

Grab the source and compile it. Like I said, I don't like things that I can't easily remove in one fell swoop, so I pass the "--prefix=/opt/freeorion" option to configure in all those cases. 'make install'

FMOD

Download and dump fmodapi374linux/api/libfmod-3.74.so in /opt/freeorion/lib and fmodapi374linux/api/inc/* in /opt/freeorion/include/

GiGi

Download using svn:

svn co https://svn.sourceforge.net/svnroot/gigi/trunk gigi

Then, run scons:

scons prefix=/opt/freeorion with_devil=/opt/freeorion pkgconfigdir=/opt/freeorion/lib/pkgconfig install

GraphViz

RC4 & SVN older than 1827

This is a fun one. The version that's standard with FC4 is too new. So, you have a choice: 1) grab the source and install yourself into some non-standard place or 2) downgrade your RPM. Choice #2 is desirable to me from several perspectives, especially since I don't have anything currently on my box that needs the new version.

The easy way is to just "upgrade" to the old version:

rpm -Uvh --oldpackage \
http://www.graphviz.org/pub/graphviz/ARCHIVE/graphviz-2.2.1-1.fc4.i386.rpm \
http://www.graphviz.org/pub/graphviz/ARCHIVE/graphviz-devel-2.2.1-1.fc4.i386.rpm \
http://www.graphviz.org/pub/graphviz/ARCHIVE/graphviz-tcl-2.2.1-1.fc4.i386.rpm

(again, all one line; remove the '\' characters)

Now, if you have nightly yum updates turned on, you'll be in for a suprise in the morning when your downgrade has been un-done. So you need to exclude graphiz from consideration by yum. Adding this to your /etc/yum.conf achieves that goal:

exclude=graphviz*

SVN 1827 or newer

As of this revision FreeOrion now works with the newest version of GraphViz.

Maelstrom512 - I'm not sure exactly which version of GraphViz is required now... I compiled from source (2.8) so if using 2.6 doesn't work, someone please edit this

Fedora comes with version 2.6 installed in RPMs, but for whatever reason if you don't have them you can get them like so:

rpm -Uvh http://download.fedora.redhat.com/pub/fedora/linux/extras/4/i386/graphviz-2.6-1.fc4.i386.rpm \
http://download.fedora.redhat.com/pub/fedora/linux/extras/4/i386/graphviz-devel-2.6-1.fc4.i386.rpm \
http://download.fedora.redhat.com/pub/fedora/linux/extras/4/i386/graphviz-tcl-2.6-1.fc4.i386.rpm

Note

You're not out of the woods yet, as the creaters of the other user stories have discovered. Getting the right version is only half the battle. It seems the same sadist creates the graphviz packages on all the platforms, and while I'm a Makefile guru, it appears that I'm completely ignorant when it comes to SCons (and especially the SCons + pkg-config interactions). But we'll come back to that.

FreeOrion

Finally, the part you've been waiting for:

svn co https://svn.sourceforge.net/svnroot/freeorion/trunk/FreeOrion 

Now, you *should* be able to just:

scons prefix=/opt/freeorion with_gg=/opt/freeorion with_fmod=/opt/freeorion with_devil=/opt/freeorion

However, as I alluded to in the Graphviz section, there is some black magic that keeps SCons from working consistently with pkg-config. Basically, GiGi cannot be found correctly, no matter how the PKG_CONFIG_PATH environment variable is set or what pkgconfigdir= argument is passed to SCons (note that pkgconfig would work correctly if invoked, but the conf.CheckPkg step fails). Graphviz can also not be found, even if you've installed it via RPM, because it hides both it's libraries and pkg-config description (the thing that tells build programs like SCons where the libraries are hiding) in non-standard locations: /usr/lib/graphviz/ and /usr/lib/graphviz/pkgconfig/ respectfully. The libraries themselves can be where ever, that's what pkg-config is all about. But putting the pkgconfig files in some non-standard place is clearly a sign of some sort of conspiricy to slowly drive linux users insane.

In any event, here's what I did: disable the "checks" for certain things. I really tried hard to make things work the way they are supposed to, but there is only so much time that I want to devote to fighting with build systems every day. So you can apply this patch in your FreeOrion directory:

wget http://gillens.us/rpms/misc/freeorion.fedora.config.patch
patch -p0 < freeorion.fedora.config.patch

Now issue the scons command above, and you're off. You'll need to do this before running the game:

export LD_LIBRARY_PATH=/opt/freeorion/lib:/usr/lib/graphviz

Enjoy!