Humble Indie Bundle #3 on Debian amd64

I just got my copy of the HIB games from http://www.humblebundle.com/, and while they do come for my preferred software platform (GNU/Linux), you need to do some tweaking to make them run properly on a 64 bit machine. This short blog post details the steps you need to make to have them run on your system. In particular, I loved CrayonPhysicsDeLuxe, which was a real pleasure to play with my young son.

64 bits woes

Most recent machines come with a chip which has a 64 bit architecture, so it is quite natural to install a 64bit operating system, like the amd64 flavour of Debian, on them.

Running a 32bit binary application on a 64bit machine may require you to have installed quite a bit of 32bits libraries, and in the right place. The Debian team help a lot by providing a few packages containing the most popular libraries, so you should first make sure you have the following packages installed

$apt-cache search ia32-libs
 ia32-libs-gtk - GTK+ ia32 shared libraries
 ia32-libs-dev - ia32 development files for use on amd64 and ia64 systems
 ia32-libs - ia32 shared libraries for use on amd64 and ia64 systems
 ia32-libs-xulrunner - xulrunner ia32 shared libraries
 ia32-libs-libtxc-dxtn0 - libtxc-dxtn0 ia32 shared libraries

HIB on Debian amd64

Unfortunately, there are still quite a few 32bits libraries that are missing for running the HIB games, and you need to grab them from the 32bits packages, and install them by hand in the right place, which happens to be /usr/lib32.

Getting CrayonPhysicsDeluxe up and running

After installing CrayonPhysicsDeluxe, you will see that typing ./launcher raises this error

./launcher: error while loading shared libraries: libmikmod.so.2: wrong ELF class: ELFCLASS64

The system is telling you that the libmikmod library is only available for 64bits applications; to make CrayonPhysicsDeluxe happy, we need to get the 32bits version of it.

A quick search on http://packages.debian.org let you find out that the package containing this library is libmikmod2, and you can download the package for the i386 architecture from http://packages.debian.org/squeeze/i386/libmikmod2/download, and put it in a temporary directory, say /tmp

To extract the library, just type:

ar x /tmp/libmikmod2_3.1.11-a-6.3_i386.deb data.tar.gz
tar xzf data.tar.gz ./usr/lib/

and then copy the relevant libraries to /usr/lib32

sudo cp ./usr/lib/libmikmod.so.2.0.4 ./usr/lib/libmikmod.so.2 /usr/lib32

Unfortunately, when you try again to run the game, you see this:

./launcher: error while loading shared libraries: libsmpeg-0.4.so.0: wrong ELF class: ELFCLASS64

There is yet another missing 32bit library! But we have learned our lesson, so it's easy, just download the right package for the i386 architecture from http://packages.debian.org/squeeze/i386/libsmpeg0/download and then

ar x /tmp/libsmpeg0_0.4.5+cvs20030824-2.2_i386.deb data.tar.gz
tar xzvf data.tar.gz ./usr/lib
sudo cp ./usr/lib/* /usr/lib32

Now you can play CrayonPhisicsDeluxe, and you know what to do when similar issues arise with the other games.

P.S.: if you do not want to sudo

It is also possible to simply install these missing libraries in the lib32 subdirectory of the CrayonPhisicsDeluxe directory (indeed, I think the developer just forgot to add these two), but once you go through the hassle to do this, I believe it's better to put the libraries directly in /usr/lib32, just in case some other game needs them.