User:Solrac776/Gentoo

From FreeOrionWiki
< User:Solrac776
Revision as of 08:33, 26 January 2006 by 203.109.241.6 (Talk) (GraphViz)

Jump to: navigation, search

Pre-Reading Note

Currently this article details how to compile a pre-v0.3 CVS version of FreeOrion. So it does not detail any extra steps or issues since then (though I would guess that everything still holds true, bar minor changes). This section will be updated for the current version (v0.3 and bug-fix candidates) before the end of January 2006.

Compiling FreeOrion under Gentoo Linux [7-May-2005]

I posted my experiences so that they could (hopefully) be of help to anyone else using Gentoo, I will directly help anyone I can, but keep in mind that no matter how knowledge-able I might sound on this page, I'm no guru. I found these things out through trial-and-error and by hitting up the 'Net.

Quickies: log4cpp sdl fmod & DevIL

These guys were easy. Just do:

emerge log4cpp sdl fmod

And Gentoo portage takes care of the rest.

[EDIT 24-JAN-2006 by Anset]

The gentoo ebuild for sdl is called libsdl and you need devil aswell, so the command becomes

emerge log4cpp libsdl fmod devil

Furthermore, the fmod ebuild is version 3.74. The FreeOrion download instruction say you need fmod 3.5. Lets hope it is enough to have a 3.x version of fmod. I am installing now. I'll append to this when I'm done.

[/EDIT]

Boost and its many masks

[EDIT 24-JAN-2006 by Anset]

Boost 1.33 does not work with GiGi and there is no 1.32 ebuild available anymore. I was able to work around it as follows:

cd /usr/portage/dev-libs/boost
cp boost-1.33.0.ebuild boost-1.32.0.ebuild
ebuild boost-1.32.0.ebuild digest
echo =dev-libs/boost-1.32.0 ~x86 >> /etc/portage/package.keywords
emerge =dev-libs/boost-1.32.0

I put a RFE on gentoo bugzilla to get the old ebuild back...

[/EDIT]

[3-DEC-2005] Boost 1.33 is marked stable now. So a simple "emerge boost" should do the trick

Boost is a bit more interesting.

FreeOrion needs at least v1.32, but my system would only install v1.31 because v1.32 is masked. To get it you need to edit /etc/portage/package.keywords

echo "dev-libs/boost ~x86" >> /etc/portage/package.keywords

I then had a look at Gentoo Portage Boost and guessed that v1.32-r1 would be the least problematic

cd /usr/portage/dev-libs/boost && emerge boost-1.32.0-r1.ebuild

GraphViz

[EDIT 24-JAN-2006 by Anset] GraphViz version 2.2 now has a ~x86 masked ebuild that you can install. I went with the 2.2.1-r1 ebuild.

As with Boost, Gentoo will install an older version than what FreeOrion requires. I thought that the solution would be to do echo "media-gfx/graphviz ~x86" >> /etc/portage/package.keywords (just like with boost) and then I'd get v2.2 instead of v1.13. But when compiling FO, it complained about not finding "-ldotneato".

So instead, I got GraphViz v2.2 directly from Graphviz CVS.

cvs -d :pserver:[email protected]:/home/cvsroot login
Password: anoncvs
cvs -d :pserver:[email protected]:/home/cvsroot co graphviz

Now compile & install

./autogen.sh && ./configure && ./make
(as root): make install

[/EDIT]

Issues

Manually installing GraphViz instead of emerging it, won't necessarily update your lib-path. If this happens, then when you run FO it will complain about not finding "libdotneato.so.0". Other distributions just need to do (in bash)export LDPATH=$LDPATH:/usr/local/lib/graphviz. In Gentoo, you need to update /etc/env.d/ and your env variables like this:

echo LDPATH=\"/usr/local/lib/graphviz\" >> /etc/env.d/99graphviz
env-update

...and in each open shell run:

source /etc/profile

NoteThis is assuming that the GraphViz libraries are at /usr/local/lib/graphviz. To check where they are on your system, run:

find / -name libdotneato.so.0

...and use that path instead.

Compiling GiGi from CVS

Follow the easy instructions in GiGi on getting GiGi from CVS.

Then:

./autogen.sh && ./configure && ./make
(as root): make install

[EDIT 24-Jan-2006 by Anset] things have changed. Now, in the GG directory do:

 scons
 (as root): scons install 

[/EDIT]

Issues

After ./configure, the script complained about my having DevIL linked with Allegro. I guess Allegro doesn't play nice with others. The script suggests: "If you want to be able to use GiGi in Allegro-programs, run configure with the '--disable-allegro-hack' option."

Since I don't, and I don't remember what Allegro was for, I did:

emerge unmerge allegro && emerge devil

Then compile GiGi that you got from CVS:

./autogen.sh && ./configure && ./make
(as root): make install

If some packages become unstable, then I'll know that it's my fault and to emerge allegro again.

GiGi & Allegro (Quoting [Yoghurt])

In short: If you don't use Allegro and GiGi in the same program, this is a non-issue.

"The issue is that Allegro has a macro that redefines main so that int main() will automatically call InitAllegro (and you can use main instead of WinMain on windows-programs).

And for some internal reasons, Allegro must know where the REAL main starts (or something like that), and therefore Allegro defines a Macro END_OF_MAIN that has to be used, that defines a symbol that is called __address_of_main (or something like that).

Now, if you use SDL and DevIL, and DevIL was compiled with allegro-support, this strange symbol has to be there, or you will get an undeclared symbol error while linking. GiGi's configure therefore defines this symbol to 0xdeadbeef, to get rid of the warning. However, Programs that will use GiGi and Allegro will now probably crash, because the symbol is wrong. Hence the warning."

What you've been waiting for: FreeOrion

Get FreeOrion via CVS (also see the below comment about data files). Then we do as the Compile page says for Linux:

./autogen.sh
./configure
make

[EDIT 24-01-2006 by Anset]Eh, no. This has changed also. In the FreeOrion directory, just do:

scons

[/EDIT]

To play (-f is for full-screen):

./freeorion -f

Data Files

If FreeOrion crashes before you even see the start-up splash screen and includes something about "default/data/..." then you need to install the artwork as well. Usually not included in CVS, but you can get it here.

Download the zipped data-files, then extract them into your FreeOrion/default directory. You should now see a directory named "data" in default.

That's the fix. Run ./freeorion again and you should be sorted.

CCache

If you compile FreeOrion often, using ccache helps to decrease the compile times. (ccache rocks)

I'm not sure how to change "./autogen.sh" or "Makefile.am" in order to include ccache automatically in the makefile. Can someone please post here how to do so? Right now, I just edit the generated makefile.

Gentoo 'emerge info'

Here're my Gentoo settings (i.e. emerge info) for those who find it useful.

Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.3.5-20050130, glibc-2.3.4.20041102-r1, 2.6.10-gentoo-r6 i686)
------
System uname: 2.6.10-gentoo-r6 i686 Mobile Intel(R) Pentium(R) 4 - M CPU 2.00GHzGentoo Base System version 1.4.16
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Apr 27 2005, 22:45:39)]
ccache version 2.3 [enabled]
dev-lang/python:     2.3.5
sys-apps/sandbox:    [Not Present]
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4
sys-devel/binutils:  2.15.92.0.2-r7
sys-devel/libtool:   1.5.16
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config 
/usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config 
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ 
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
DISTDIR="/home/gentoo/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict userpriv usersandbox"
MAKEOPTS="-j2"
PKGDIR="/home/gentoo/packages"
PORTAGE_TMPDIR="/portage/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 3dnow X acpi aim alsa apache2 arts avi berkdb bitmap-fonts bonobo bzlib cdparanoia crypt 
curl dga div4linux encode esd fam fbcon flac gcj gd gdbm gif gnome gpm gstreamer gtk gtk2 hardened 
hardenedphp imap imlib ipv6 java jikes jpeg junit kde ldap libg++ libwww mad maildir mikmod mime 
mono motif mozilla mp3 mpeg msn mysql mysqli ncurses nls offensive ogg oggvorbis opengl oscar oss 
pam pcmcia pdflib perl php pic png pnp python qt quicktime readline samba sdl slang sndfile spell 
spl ssl svg svga tcpd tetex tiff truetype truetype-fonts type1-fonts unicode usb v4l vhosts videos 
vorbis win32codecs xine xml xml2 xmms xv xvid zlib video_cards_radeon userland_GNU kernel_linux 
elibc_glibc"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS