Latest Posts

Topic: How to download precompiled linux binaries

lesmana

Topic Opener
Joined: 2012-03-08, 14:36
Posts: 1
Ranking
Just found this site
Posted at: 2012-03-08, 17:34

Since build 16 the developer team have decided to no longer provide precompiled linux binaries. Linux users should compile themselves. It is easy, they say.

Compiling widelands is indeed easy, for me. I am an experienced software developer, so I cannot say how easy it is for non-developers. I also have root privileges on my system. If you don't have root privileges then compiling can become very complicated very fast.

How can it become complicated? Widelands has a lot of dependencies. The build guide has a list of required dev packages for different linux distributions. When you are missing some dev packages, and you have no root privileges, then you have to search and download those packages yourself. You will have to look for the correct version, and you better hope those packages do not have any further dependencies.

Even worse, vanilla ubuntu comes without gcc or cmake or other dev tools installed. You can still try and download gcc and all the other tools yourself, but trying to compile something when you don't have the standard dev tools installed is a practice in frustration.

So trying to compile without root privileges, when you don't happen to already have everything installed, is really really hard.

There are precompiled binaries in a PPA provided by timowi. But again, this requires root privileges to setup.

It seems that you are out of luck trying to play widelands on a system where you don't have root privileges. But don't give up just yet. I have found a way to download the precompiled binaries from timowi's PPA without needing root privileges. It works at least on ubuntu systems, perhaps also on other distributions. I have written a crude script for this. If you want to do everything manually then follow these steps:

  1. Go to timowi's PPA: https://launchpad.net/~timo-wingender/+archive/ppa
  2. Dig down to the actual files. Direct link: http://ppa.launchpad.net/timo-wingender/ppa/ubuntu/pool/main/w/widelands/
  3. Download these files:

    • widelands-data_16-ppa1~$RELEASE_all.deb
    • widelands-music_16-ppa1~$RELEASE_all.deb
    • widelands_16-ppa1~$RELEASE_$ARCHITECTURE.deb

    Replace $RELEASE with your ubuntu release and $ARCHITECTURE with your processor architecture. For example: if you are on a 32 bit system using ubuntu lucid then download widelands_16-ppa1~lucid1_i386.deb. If you are on a 64 bit system using ubuntu natty then download widelands_16-ppa1~natty1_amd64.deb.

  4. Extract the deb files using the command:

    dpkg-deb -x $DEBFILE .
    

    Note that last dot. That means to extract to the current directory.

    If you are using a non-dpkg distribution then you can try this command:

    ar p $DEBFILE data.tar.gz | tar zx
    

    Both commands create a directory named usr in the current directory and extract everything to there.

  5. Collect the files in one directory.

    mkdir widelands
    mv usr/games/widelands widelands
    mv usr/share/games/widelands/* widelands
    

    Luckily widelands was compiled so that it searches for resources in it's own directory if the they are not found in /usr.

  6. Try it:

    cd widelands
    ./widelands
    

If it works then rejoice. If it doesn't work then you may really be out of luck this time. I have tested this under ubuntu only.

You can move the widelands directory to wherever you want. You can delete the deb files and the usr directory. They are no longer needed.


Here is the script:

#!/bin/sh

set -o nounset
set -o errexit

ubuntu_release="lucid1"
#ubuntu_release="maverick1"
#ubuntu_release="natty1"
processor_architecture="i386"
#processor_architecture="amd64"

ppa="http://ppa.launchpad.net/timo-wingender/ppa/ubuntu/pool/main/w/widelands"

data_deb="widelands-data_16-ppa1~${ubuntu_release}_all.deb"
music_deb="widelands-music_16-ppa1~${ubuntu_release}_all.deb"
exe_deb="widelands_16-ppa1~${ubuntu_release}_${processor_architecture}.deb"

echo "downloading"

for deb in "$data_deb" "$music_deb" "$exe_deb"; do
  echo $deb
  wget -q -N "$ppa"/"$deb"
done

echo "extracting"

for deb in "$data_deb" "$music_deb" "$exe_deb"; do
  echo $deb
  ar p "$deb" data.tar.gz | tar xz
done

echo "moving files around"

mkdir widelands

mv usr/games/widelands widelands
mv usr/share/games/widelands/* widelands

echo "done"

echo "widelands has been downloaded to the directory widelands"
echo "you can now delete the deb files and the usr directory"
Edited: 2012-03-08, 17:47

Top Quote