четверг, 4 октября 2012 г.

Gentoo portage and x3 - Reunion: ebuilds, mods, scripts...

Hello, fellows!

I've done some work that might be interesting for those of you who have a crush on x3 - Reunion and Gentoo Linux simultaneously. As you off course know, that gorgeous game is a very high-moddable one so there are plenty of mods and scripts made by its fans out there in the Internet.

There is a ebuild for x3 in the bugzilla, and even to rewrite the x2 ebuild that is in the official portage tree so it could be used to install x3 is not challenging at all, even if you're a newbie to portage and bash.

When it comes to installing those magnificent mods and scripts the easiest decision seems to be just writing ebuilds so the portage would do the job for you. However, i assume 100% of those addons were developed under windows which is not case-sensetive. So it's normal if there are folders like Scripts and T and Mods or even MODS in the addon distribution package. And you'd dig deeper you'd get that the problem is not just the names of the folders (i think you've already figured what would happen if portage would just unpack the contents of that distribution into your live x3 installation) - it's the problem of the name of the every file throughout the every addon distribution. And the solution, actually, is not just mv the files into the lowercase. We can't do that. What if a file is supposed to be named the way it is? Meanwhile, if a package wants to install a file that would substitute the original one, its name should be exactly the same as the installed original one has (it is obvious, off course). So the real solution is to synchronize the names of everything throughout the addon distribution with the names of the original installed files. That is the problem number one.

The next problem (number 0, actually) you would face is that the addon distribution would have some root folder, so the actual addon files would be stored out there. The easy solution is to cd into there, yeah. But it is stupid. What if you want to install, say, ten addons and each has some root folder? And some other files you certainly wouldn't like to be in the root of your live x3 installation (like readmes, changelogs, etc). So, a true solution is to guess where the real source root is and sort the misc. files into some other folder.

So you made all that somehow, and you try to merge the ebuild and... there are collisions. The portage won't allow the ebuild be merged if the colliding files owned by some package installed at the moment. The collisions must be handled somehow. Well, there are several types of collisions you would face... oh, it is a real long story. Dull as hell. There is a problem of the names of cat-dat filepairs yet.


Straight to the point, i've wrote several eclasses that do all the magic need to be done. Actually, i've made an overlay thexgames, that provides a bunch of ebuilds for a bunch of mods and scripts utilizing those eclasses. And the ebuild for x3, off course.

Adding the overlay:

1. Open layman's my-list.xml (that resides in /var/lib/layman by default) and add this: double-click the code to select and copy


2. Now just execute

thexgames provides the following ebuilds...

games-simulation/x3-2.5.03
Open-ended space opera with trading, building & fighting

games-simulation/x3-mod-cockpits-2.0
This adds fancy cockpits to the x3

games-simulation/x3-mod-fotonc-1.0.0
This lowers GPPC and BEMP firing rates by 2.5 and 2 times respectively

games-simulation/x3-mod-hqoptimal-2.5
HQ rebalance

games-simulation/x3-mod-turbomod2-2.0.02-r2
This mod enhances overall game performance

games-simulation/x3-mod-xtm-0.7.5
The X-Tended Mod is a modification for the game X3: Reunion by Egosoft

games-simulation/x3-script-anarkis-advanced-defence-system-1.01
Lasertower deployment script

games-simulation/x3-script-anarkis-carrier-commands-1.40
X3R version of ACC

games-simulation/x3-script-anarkis-group-targeting-system-1.01
This script adds 3 targeting related shortcuts to the game for improved dogfighting

games-simulation/x3-script-assassins-guild-1.60
This script allows you to join the assassins guild and take on assassination missions.

games-simulation/x3-script-battle_scripts-1.0.0
x2 AEGIS and TelCat scripts port to x3

games-simulation/x3-script-bombardier-1.971
This adds 8 different weapon layouts and hotkeys for them

games-simulation/x3-script-engineer-tools-1.0
Hotkeys group for complex builders

games-simulation/x3-script-jumpwithescort-1.0
This allows a player to make jumps with escort ships

games-simulation/x3-script-mars-1.0.0
Improved turret script that actually hits it's targets and prioritizes them by how easy they are to hit

games-simulation/x3-script-mercenaries-guild-2.90
This script adds Mercenaries Guild into x3

games-simulation/x3-script-move-freebie-ships-1.01
A simple script to move all the freebie ships to random locations at startup.

games-simulation/x3-script-race-military-1.10
Join the military and take on missions for the different races to earn money and notority

games-simulation/x3-script-turretcontrol-3.0
Manual control for the turrets

games-simulation/x3-script-turretmissiledefence2-1.1
This script really makes turrets to shoot only missiles