It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
/!\ This guide is old and unmaintained. Please do *not* follow it. If you still want to do it, know that I *won’t* provide support if anything goes wrong. You’re on you own.
An updated and actively maintained version will come at some point and I’ll update this post to link to it.

-----

Hi!

This guide will help you to build packages for your distribution from the GOG installer.
The packages will be patched to 1.02 (unofficial patch) for a better support of modern GPU and an experimental "shadows" feature.

The scripts used in this guide make use of unzip, wine (>= 1.5.9), wget, wrestool and icotool.

1. Making packages

This first script will create a folder named "startopia-data" containing all data needed to run StarTopia. You'll have to change the value of STARTOPIA_SETUP to the path to GOG installer :

export STARTOPIA_SETUP="/path/to/setup_startopia_*.exe"
export WINEARCH=wine32
export WINEDEBUG=-all
mkdir $HOME/startopia-data
cd $HOME/startopia-data
mkdir install-prefix
export WINEPREFIX=$HOME/startopia-data/install-prefix
wineboot --init
mkdir -p usr/local/games
cd install-prefix/dosdevices
rm *
ln -s ../drive_c c\:
ln -s ../../usr/local/games d\:
cd d\:
cp "$STARTOPIA_SETUP" .
wine "$(basename "$STARTOPIA_SETUP")"
cd startopia
wget [url=http://home.comcast.net/~tom_forsyth/startopia/startopia_patch_1_02.zip]http://home.comcast.net/~tom_forsyth/startopia/startopia_patch_1_02.zip[/url]
mv text Text
rm Text/*/option.txt Text/*/Option.txt CardID.tom startopia.exe
unzip startopia_patch_1_02.zip
rm startopia_patch_1_02.zip
wrestool -t 14 -x StarTopia.exe | icotool -x -
mkdir -p ../../share/icons/hicolor/32x32/apps
mv *32x32x8.png ../../share/icons/hicolor/32x32/apps/startopia.png
cd $HOME/startopia-data
rm -Rf "usr/local/games/$(basename "$STARTOPIA_SETUP")" install-prefix $HOME/.local/share/applications/wine/Programs/GOG.com/StarTopia/
find $HOME/.local/share/applications/ -depth -type d -empty -delete
In the installer, click "Options" and untick anything but "StarTopia" (and EULA of course (no desktop icons and stuff)) and set the path to "D:\startopia".

/!\ Don't launch the game at the end of the installation. Click "Exit". /!\

This second script will create the launchers allowing you to play StarTopia on Linux :

mkdir -p $HOME/startopia/usr/local/bin
cd $HOME/startopia/usr/local/bin
echo "
#!/bin/sh
export WINEDEBUG=-all
export WINEPREFIX=\$HOME/.startopia/.wine-prefix
mkdir -p \$HOME/.startopia/.wine-prefix
export WINEARCH=win32
wineboot --init
cd \$HOME/.startopia/.wine-prefix/dosdevices/
rm *
ln -s ../drive_c c\:
mkdir \$HOME/.startopia/.wine-prefix/dosdevices/d\:
ln -s \$HOME/.startopia \$HOME/.startopia/.wine-prefix/dosdevices/d\:/startopia
cd \$HOME/.startopia/
ln -s /usr/local/games/startopia/* .
rm startopia.ini
cp /usr/local/games/startopia/startopia.ini ." > startopia-init
echo "
#!/bin/sh
export WINEDEBUG=-all
export WINEPREFIX=\$HOME/.startopia/.wine-prefix
export NATIVE_RES=\$(xrandr | grep '*' | tr -s ' ' | cut -d' ' -f2)
if ! [ -d ~/.startopia ]; then
sh /usr/local/bin/startopia-init
fi
cd \$HOME/.startopia/.wine-prefix/dosdevices/d\:/startopia
wine StarTopia.exe
xrandr -s \$NATIVE_RES" > startopia
chmod a+x *
cd ..
mkdir -p share/applications
echo "[Desktop Entry]
Type=Application
Version=1.0
Name=StarTopia
Icon=startopia
Exec=startopia
Categories=Application;Game;" > share/applications/startopia.desktop
2. Building the packages

As for now there are scripts only for .deb packages (Debian, Ubuntu, Linux Mint...).
More may come later as I learn how to do it (or sooner if you know how to package in other formats and post the method here).

.deb packages

These scripts use fakeroot.

cd $HOME/startopia-data
mkdir DEBIAN
echo "Package: startopia-data
Version: 1.02
Section: non-free
Priority: extra
Architecture: all
Depends:
Installed-Size: 591012
Maintainer: local build
Description: StarTopia - data" > DEBIAN/control
cd $HOME
fakeroot dpkg-deb --build startopia-data/
rm -Rf startopia-data/
This first build might take some time, the package is around 340M.

cd $HOME/startopia
mkdir DEBIAN
echo "Package: startopia
Version: 1
Section: contrib
Priority: extra
Architecture: all
Depends: startopia-data, wine | wine-unstable | wine:i386 | wine-unstable:i386
Installed-Size: 36
Maintainer: local build
Description: StarTopia - binaries" > DEBIAN/control
cd $HOME
fakeroot dpkg-deb --build startopia/
rm -Rf startopia/
You can install the resulting packages by launching (as root) :

dpkg -i startopia-data.deb
dpkg -i startopia.deb
apt-get install -f
Enjoy!

-----

StarTopia might crash on exit. I don't know what to do about it.
Everything else runs fine.

-----

Please tell me if something doesn't work on your distribution.

-----

More guides can be found there :
https://secure.gog.com/mix/guides_to_install_gog_games_on_gnulinux
Post edited July 09, 2015 by vv221