Linux freeorion executable

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
User avatar
Nagilum
Release Manager, Design
Posts: 212
Joined: Thu Dec 31, 2009 3:25 pm
Location: Germany

Linux freeorion executable

#1 Post by Nagilum »

Ubuntu/Mint/Debian (wheezy)
I provide different versions for Ubuntu and Debian. If you use Debian you need to replace "quantal" with "wheezy" in all occurrences below (especially in the "deb" lines for sources.list).
You can either download a recent build from https://sourceforge.net/projects/freeor ... st/Ubuntu/ or https://sourceforge.net/projects/freeor ... st/Debian/ . Alternatively you can visit my repository http://www.nagilum.org/repo/pool/quantal/f/freeorion/ and download it from there.
If you install via "dpkg -i freeorion_0.4.3+svn6591-1_amd64.deb freeorion-data_0.4.3+svn6591-1_all.deb" for the first time you may have to install additional dependencies using "apt-get -f install".
If you want automatic updates (be aware that these frequently break savegame compatibility) you can also add the repository:

Code: Select all

sudo apt-add-repository 'deb http://www.nagilum.org/repo/ quantal quantal'
wget http://nagilum.org/repo/[email protected]
sudo apt-key add [email protected]
Replace "quantal" with "precise", "saucy" or "trusty" for your specific distribution.
After that for installing:

Code: Select all

apt-get update
apt-get install freeorion
Arch
Test builds can be found on sourceforge

Others
To stay keep up-to-date you could also subscribe the appropriate folder on Sourceforge using your favourite RSS reader to:
https://sourceforge.net/projects/freeor ... rusty_Tahr (for example)
or subscribe to my twitter account using Twitter: https://twitter.com/Nagilum23 which I try to keep up-to-date.
Last edited by Nagilum on Mon Jul 14, 2014 7:28 pm, edited 44 times in total.

zhur
Space Floater
Posts: 38
Joined: Thu Aug 09, 2012 8:15 am

Re: Linux freeorion executable

#2 Post by zhur »

Ah, you evil man! It eat my younger one...

Nah, kidding, it works for me. At least for Ubuntu 12.04 Live Image. It outputs something about failing to work with 'nouveau' driver but I didn't see any graphical artifacts. Sound is also working. For Kubuntu 10.10 Live Image though it produced pretty bad graphical glitches (sorry, I forgot to take screenshots) making the game unplayable. It always prints "extract failed :(" but works nevertheless.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13586
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Linux freeorion executable

#3 Post by Geoff the Medio »

What revision is this build? Has the version string shown in the UI been updated to match?

Any objections to putting it up on sourceforge? Any suggestions about how to describe what it is, and what distributions it's likely to work on?

Is there a sensible way to provide build scripts so this can be more easily replicated by others, besides a 1.5 GB VM download?

User avatar
Nagilum
Release Manager, Design
Posts: 212
Joined: Thu Dec 31, 2009 3:25 pm
Location: Germany

Re: Linux freeorion executable

#4 Post by Nagilum »

@zhur:
Thanks for testing!
About the nouveau driver, did it say anything about failing to open any files? If yes, could you let me know which file(s) ?
About the the failed extract - that's probably because there isn't enough diskspace in /tmp.
It needs about 500MB diskspace in /tmp. Maybe you can mount a USB-Stick to /tmp and try again?

@Geoff:
This is Rev. 5096 (or at least that's what it says on the startscreen).
No objections - but maybe it should get some more testing?
Sure, I'll post them here after my breakfast. ;)

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13586
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Linux freeorion executable

#5 Post by Geoff the Medio »

Nagilum wrote:This is Rev. 5096 (or at least that's what it says on the startscreen).
That's quite likely wrong; the string has to be manually updated, so unless you actually checked out 5096 in order to build 0.4.1, it's probably out of date. Are you not building the latest SVN for some reason?

User avatar
Nagilum
Release Manager, Design
Posts: 212
Joined: Thu Dec 31, 2009 3:25 pm
Location: Germany

Re: Linux freeorion executable

#6 Post by Nagilum »

Ok, the Arch VM is a very basic Arch install plus a few addition:
wmaker (which pulls in xorg), xdm, pulseaudio, dhcpd and freeorion (+deps).
I also installed AMD and Intel DRI drivers to include them in the exe.
First I downloaded CDE I later build the version from the git reporsitory. I build cde for i686 and x86_64. On x86_64 I managed to build a static version so no dependency on libc or anything.
I created two small scripts, the first runs freeorion through cde:

Code: Select all

#!/bin/sh

cd
rm -Rf cde-package .freeorion
if ! ps ax|grep -q pu[l]seaudio ; then pulseaudio --start ;fi
#./cde_2011-08-15_32bit /usr/bin/freeorion
./cde -i /etc/localtime -p /home/orion /usr/bin/freeorion "$@"
And the second script works in three stages.
1. It adds the content of a few selected arch packages to the bundle
2. It creates a shell script that serves as a header to the final executeable
3. and then tars up and compresses the cde-package and appends it to the shell script:

Code: Select all

#!/bin/sh

TGT=$HOME/freeorion
TMPTAR=/tmp/tmp.tar
tar -cvf $TMPTAR --no-recursion /usr # empty archive to append

cd cde-package
for PKG in freeorion ati-dri intel-dri libgl libdrm libxcb libpciaccess
do      pacman -Ql $PKG|awk '{print $2}'|grep -v "/$"|xargs tar -rvf $TMPTAR
done
tar -C cde-root -xf $TMPTAR && rm $TMPTAR
[ -e cde-exec ] && mv cde-exec cde-exec-$(uname -m)
cp -p ../cde-x86_64 ./cde-exec-x86_64
rm -Rf cde-root/home/orion/.pulse-cookie
cat >$TGT <<-ENDHEAD
#!/bin/sh
if [ -d /home/orion -a -w /home/orion ]
then export TMP=\`mktemp -d /tmp/orion.XXXXXX\`
tail -n+12 \$0|tar -C \$TMP -xJf - || rm -Rf \$TMP ; echo 'extract failed :('
cd \$TMP/ && \
cp -p ./cde-exec-\$(uname -m) cde-exec
 ./cde-exec -p '/home/orion' freeorion "\$@"
cd - >/dev/null
rm -Rf \$TMP
else echo 'Please create "/home/orion" and make it writeable by current user.'
fi
exit 0
ENDHEAD

tar -cf - .|xz -c9 >>$TGT
cd ..
ls -lh $TGT
So in the end you have a singe executable which is actually a shell script that extracts the cde-package to /tmp and runs it.
So currently I don't compile the freeorion myself and rely entirely on the Arch package. I'm not too familiar with Arch so it would take me a while to figure out how to do a clean (using fakeroot or lxc) freeorion build.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13586
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Linux freeorion executable

#7 Post by Geoff the Medio »

Nagilum wrote:I also installed AMD and Intel DRI drivers to include them in the exe.
That concerns me a bit. The binaries can't be released as an official FreeOrion package if they have non-GPL compatible driver binaries in them...

User avatar
Nagilum
Release Manager, Design
Posts: 212
Joined: Thu Dec 31, 2009 3:25 pm
Location: Germany

Re: Linux freeorion executable

#8 Post by Nagilum »

I don't know but if Arch can distribute them without me having to agree to anything special or enable any special repo I would think there shouldn't be an issue for FreeOrion?

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13586
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Linux freeorion executable

#9 Post by Geoff the Medio »

Nagilum wrote:I would think there shouldn't be an issue for FreeOrion?
To distribute them with FreeOrion, they need to be released under a GPL compatible license. Whether and how ArchLinux distributes them some other way doesn't matter.

User avatar
Nagilum
Release Manager, Design
Posts: 212
Joined: Thu Dec 31, 2009 3:25 pm
Location: Germany

Re: Linux freeorion executable

#10 Post by Nagilum »

To distribute them with FreeOrion, they need to be released under a GPL compatible license. Whether and how ArchLinux distributes them some other way doesn't matter.
That's my point - I don't think they do.
As far as I know the Intel and AMD drivers are GPL and I didn't install any Catalyst or NVidia drivers.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13586
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Linux freeorion executable

#11 Post by Geoff the Medio »

Nagilum wrote:As far as I know the Intel and AMD drivers are GPL...
Can you check to make sure?

User avatar
Nagilum
Release Manager, Design
Posts: 212
Joined: Thu Dec 31, 2009 3:25 pm
Location: Germany

Re: Linux freeorion executable

#12 Post by Nagilum »

Ok I checked,
intel/ati-dri/libgl are all part of http://mesa3d.sourceforge.net/license.html which is MIT license.
Which - as far as I know - should pose no issue with redistribution.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13586
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Linux freeorion executable

#13 Post by Geoff the Medio »

Nagilum wrote:MIT license.
That should be fine, thanks.

User avatar
Nagilum
Release Manager, Design
Posts: 212
Joined: Thu Dec 31, 2009 3:25 pm
Location: Germany

Re: Linux freeorion executable

#14 Post by Nagilum »

I updated my exe to include the other DRI drivers as well. I also fixed that bug that caused the 'extract failed' message to be emitted in any case.
Here the updated 'pack' script:

Code: Select all

#!/bin/sh

TGT=$HOME/freeorion
TMPTAR=/tmp/tmp.tar
tar -cvf $TMPTAR --no-recursion /usr # empty archive to append

cd cde-package
for PKG in freeorion ati-dri intel-dri nouveau-dri i810-dri mga-dri mach64-dri r128-dri savage-dri sis-dri tdfx-dri unichrome-dri libgl libdrm libxcb libpciaccess
do      pacman -Ql $PKG|awk '{print $2}'|grep -v "/$"|xargs tar -rvf $TMPTAR
done
tar -C cde-root -xf $TMPTAR && rm $TMPTAR
[ -e cde-exec ] && mv cde-exec cde-exec-$(uname -m)
cp -p ../cde-x86_64 ./cde-exec-x86_64
rm -Rf cde-root/home/orion/.pulse-cookie cde-root/home/orion/.freeorion cde-root/usr/share/man cde-root/usr/include
cat >$TGT <<-ENDHEAD
#!/bin/sh
if [ -d /home/orion -a -w /home/orion ]
then export TMP=\`mktemp -d /tmp/orion.XXXXXX\`
tail -n+12 \$0|tar -C \$TMP -xJf - || ( rm -Rf \$TMP ; echo 'extract failed :(' )
cd \$TMP/ && \
cp -p ./cde-exec-\$(uname -m) cde-exec
./cde-exec -p '/home/orion' freeorion "\$@"
cd - >/dev/null
rm -Rf \$TMP
else echo 'Please create a symlink from "/home/orion" to your home directory.'
fi
exit 0
ENDHEAD

tar -cf - .|xz -c9 >>$TGT
cd ..
ls -lh $TGT

User avatar
Nagilum
Release Manager, Design
Posts: 212
Joined: Thu Dec 31, 2009 3:25 pm
Location: Germany

Re: Linux freeorion executable

#15 Post by Nagilum »

Another update..
This time I compiled the Arch package my self from SVN rev. r5378.
The reason for the update was that the older version become progressively slower as the game progressed and GeofftheMedio recommended updating to the latest SVN version.
You can fetch the new version from here.

Post Reply