Kloonigames ForumCrayon Physics DeluxeTech SupportInstalling on Linux HOWTO
Pages: [1] 2
Print
Author Topic: Installing on Linux HOWTO  (Read 12819 times)
archy
Newbie
*
Posts: 32


View Profile
« on: July 29, 2011, 08:54:02 PM »

Installing on Linux HOWTO

TOC:    A) Automatic Install Scripts
B) Manual Installation
     1. Extracting the archive
     2. Installing dependencies
     3. Fixing library issues
     4. Installing a launch script [optional]
     5. Installing an icon and application menu entry [optional]
C) Troubleshooting
     1. Problems & solutions
     2. Removing libraries shipped with the game


In theory, Crayon Physics Deluxe for Linux doesn't need to be "installed", you can just extract the crayon_release55_3.tar.gz archive anywhere you like, cd to the extracted CrayonPhysicsDeluxe/ directory in a terminal, and run ./launcher to start the game.

However, depending on your existing system, you may have to install a few additional dependencies and fix some library issues to get it to run.

Also, you might prefer to "properly" install it into your system directories and also install a launch script, icon and application menu entry.


A) Automatic Install Scripts

Arch Linux
       
The Arch User Repository (AUR) contains a package named crayonphysicsdeluxe which allows you to easily install Crayon Physics Deluxe with a single command using one of the unofficial AUR-capable package managers, e.g.:
Code:
yaourt -S crayonphysicsdeluxe
(It will ask you for the crayon_release55_3.tar.gz file.)

...
       
If anyone knows of similar packages / helper scripts for other Linux distributions, please post a comment.


B) Manual Installation

1. Extracting the archive

Either use your favorite file manager to unpack the downloaded game archive into the installation directory of your choice, or open a terminal and type...
Code:
cd /path/to/install/directory
tar -xf /path/to/download/directory/crayon_release55_3.tar.gz
(Replace the directory paths appropriately, of course.)

You will end up with a CrayonPhysicsDeluxe folder inside the install directory.

Where you install the game is completely up to you. If you would like all users accounts of the computer to be able to run the game, an appropriate install directory might be /usr/local/games, so that you'll end up with a /usr/local/games/CrayonPhysicsDeluxe folder.
If you want to restrict access to the game to the current user, you should choose a location inside your home directory, so you might end up with, for example, ~/apps/CrayonPhysicsDeluxe.

At this point, try starting the game (change to the CrayonPhysicsDeluxe folder in a terminal and type ./launcher). If it works already, you can skip the following two steps.

2. Installing dependencies

Crayon Physics Deluxe depends on the OpenGL and Qt 4 libraries, which you might or might not have already installed.

Since the game is compiled as a 32-bit executable, you'll need 32-bit versions of the libraries, even if you're running a 64-bit Linux. Luckily, most Linux distributions provide special 32-bit-libraries-for-64bit-systems packages.

These are the packages that you need to install (packages already installed by default in the respective distribution are not listed):

       on 32-bit systems| on 64-bit systems
Ubuntu (lucid, maverick, natty):  libqtcore4 libqtgui4| ia32-libs (may already be already installed)
Debian (squeeze, wheezy, sid):  libqtcore4 libqtgui4| ia32-libs ia32-libs-gtk
Arch Linux:  mesa qt| lib32-mesa lib32-qt

If you know the names of the required packages for other Linux distributions, please post a comment.

3. Fixing library issues

If at this point you still get error messages or problems when trying to start the game, it might be due to the game not finding all libraries it requires, or some of the libraries shipped with the game itself (in the lib32 folder) being incompatible with your system. See the "Troubleshooting" section at the end of this HOWTO for help on how to fix these (and other) issues.

Distribution-specific notes:
     Gentoo Linux:See Florian Berger's HOWTO on getting the game to work on Gentoo Linux.

4. Installing a launch script [optional]

If you would like to be able to launch Crayon Physics Deluxe from the terminal but without having to cd to the game folder every time and start it from there, you can create a simple launch script with the following content:

Code:
#/bin/sh
cd /usr/local/games/CrayonPhysicsDeluxe
exec ./launcher "$@"
(If applicable, replace /usr/local/games/CrayonPhysicsDeluxe with the path to the CrayonPhysicsDeluxe folder that you chose in step 1.)

Simply save the script as a file called crayon (or whatever you like), make it executable (chmod +x ./crayon), and put it either somewhere where you can easily find it, or - even better - in a directory that is included in your system's PATH environment variable, so that you can start the game from anywhere in a terminal, just by typing crayon.
(Note: To find out which directories are defined in your system's PATH variable, run echo $PATH in a terminal.)

If you would like all user accounts of the computer to be able to run the game, an appropriate place to put the launch script would be /usr/local/bin/, which is a common place for custom-installed binaries / launch scripts, and is already included in the PATH variable on a typical Linux system.

5. Installing an application menu entry [optional]

If you would like to be able to launch Crayon Physics Deluxe without a terminal, from your application menu and similar places, you have to install a "desktop entry" for the game.

If you want it to appear for the current user account only, simply run the ./install_shortcuts.sh script in the CrayonPhysicsDeluxe directory.

To install it for all user accounts, manually create a plain text file with the following content...

Code:
[Desktop Entry]
Type=Application
Name=Crayon Physics Deluxe
Categories=Game;
Path=/usr/local/games/CrayonPhysicsDeluxe
Exec=/usr/local/games/CrayonPhysicsDeluxe/launcher
Icon=/usr/local/games/CrayonPhysicsDeluxe/icon.png
(If applicable, replace /usr/local/games/CrayonPhysicsDeluxe with the path to the CrayonPhysicsDeluxe folder that you chose in step 1.)

...and save it as /usr/local/share/applications/kloonigames-crayon.desktop

This "desktop entry" should now automatically be picked up by all modern desktop environments (Gnome, KDE, etc.), and cause Crayon Physics Deluxe to be shown in your application menu or launcher, in the "Choose Application" dialog, in desktop search results, etc.

Note: It might not show up in all places until your next login.
In Ubuntu, you might additionally have to execute the following command to force the internal "desktop entry" cache to be rebuilt:
Code:
sudo dpkg-reconfigure python-gmenu


C) Troubleshooting

Note: This section only covers problems related to installing (and getting to run) the game on Linux. For problems related to gameplay etc. see the Support FAQ.

Problems & solutions

  Program fails to start

  • Error messages like "unable to find xyz.so.1"
     
    First, make sure you have installed all required dependencies (see above).
    In some cases, the game might be unable to find some library because the installed library version is slightly different from the one it expects. With any luck, you can still make it work by finding the library file in question on your hard drive, copying (or symbolically linking) it into the game's lib32 folder, and giving it the exact name (including version number!) the error message asks for.

  Graphics problems

  • White screen with green boxes
     
    This problem is caused by missing support for a certain OpenGL extension (see here).
    It's possible that your graphics card does actually support it (most OpenGL 2.0 or newer cards do, as well as some OpenGL 1.x cards) and it's merely your driver that's missing support for it, so make sure you have the newest driver version, and if you have an ATI or NVIDIA card and you're running the open source driver, try the proprietary driver, and the other way around.
    If however the graphics card itself doesn't support this OpenGL extension, there is as of yet no solution for the problem. (You may be able to run the DirectX-based Windows version of the game using wine, though.)

  • Empty welcome screen (or other graphics-related issues)
     
    Remove the SDL libraries shipped with the game (see below).
           
  Sound problems

  • No sound
     
    Remove the SDL libraries shipped with the game (see below).

Removing libraries shipped with the game

Most of the libraries the game depends on are already included with it, in the lib32 subfolder of the CrayonPhysicsDeluxe directory.
In case some of these shipped libraries cause problems for you, you can simply remove them from the lib32 folder, in order to force the game to use the equivalent system-wide libraries (installed with your package manager) instead.

(Note that you don't actually have to delete the library files in question, it's enough to merely rename them (e.g. add a _BACKUP to the end of the filename) so that the game won't find them anymore.)

If you do this, you will of course have to make sure that the packages providing the equivalent system-wide libraries are actually installed...

  • SDL libraries:  libSDL-1.2.so.0libSDL_image-1.2.so.0libSDL_mixer-1.2.so.0  (in the lib32/ folder)
     
    → packages:on 32-bit systems| on 64-bit systems
         Ubuntu:  libsdl1.2debian libsdl-image1.2 libsdl-mixer1.2| ia32-libs
         Arch Linux:  sdl sdl_image sdl_mixer| lib32-sdl lib32-sdl_image lib32-sdl_mixer








« Last Edit: August 13, 2011, 03:53:47 AM by archy » Logged

archy
Newbie
*
Posts: 32


View Profile
« Reply #1 on: July 30, 2011, 01:56:00 PM »

EDIT: Since the thread itself was made sticky, I modified the title accordingly and removed the intro paragraph (quoted here for posterity):

Quote
Hi Petri,

first of all thanks for releasing a Linux version of CPD with the Humble Bundle!
Linux gamers like myself very much appreciate games that run natively on our platform, especially awesome ones like CPD.

Secondly, I'm sure you've noticed by now (from the several related threads on this forum), that many Linux users run into certain issues while trying to install the game and getting it to run.
In addition, many Linux users are probably unsure of how to "properly" install the game in their Linux distribution.

So I propose that you create a sticky topic on this forum that addresses instructions, tips and solutions for common issues regarding installing CPD on Linux.

You can use the following as a start (feel free to copy it into a new thread of your own and delete this one), and encourage users to contribute additional information and tips as comments (which you can then integrate into the HOWTO over time).


Logged

berarma
Newbie
*
Posts: 7


View Profile Email
« Reply #2 on: August 01, 2011, 09:30:47 PM »

This post explains how to make it work for Debian 64bits (squeeze, wheezy and sid):

http://www.kloonigames.com/forum/index.php?topic=7505.msg19686#msg19686

It might work for some derivatives too, but don't count on it.
Logged

MD
Newbie
*
Posts: 1


View Profile
« Reply #3 on: August 02, 2011, 01:58:28 AM »

After an hour of trying trying to find and load dozens of obscure 32 bit libraries on my 64 bit Mandriva 2010.1 system just to run this game, I finally give up.  (Stopped at libaudio.so.2)

I had no such problems with the other games in the Humble Bundle.

Kloonigames- you *really* need to compile a mostly static binary version so people can just run it on most any Linux system and it will work.  Sure, it will be a much larger binary, but most of us won't care... it beats the alternative.

I am very disappointed Sad
« Last Edit: August 02, 2011, 02:00:01 AM by MD » Logged

archy
Newbie
*
Posts: 32


View Profile
« Reply #4 on: August 02, 2011, 04:50:55 AM »

Stopped at libaudio.so.2

libaudio.so.2 is part of the Network Audio System (NAS).

Not sure whether Mandriva has a special 32bit package for 64bit systems, but maybe it works if you just get the 32bit package, extract the libaudio.so.2 file, and put it in the game's lib32 folder...

You're right that more libraries should be shipped with the game, and according to this thread, this is being tackled:
Quote
We're currently trying to rebuild the game so that it has more stuff compiled as static. Which should make it a bit easier by requiring fewer libraries.
Logged

ignite60x
Newbie
*
Posts: 1


View Profile Email
« Reply #5 on: August 02, 2011, 06:12:11 AM »

That was nice to hear. Thanks for sharing it in here!
Logged


jiawen
Newbie
*
Posts: 2


View Profile Email
« Reply #6 on: August 03, 2011, 06:16:23 AM »

When I try to run the launcher, I get the messages "./launcher: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.11' not found", "./launcher: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.9' not found", etc. Looks like the game requires GLIBC 2.9 or higher, which is not available on Ubuntu 8.04 (which I'm using). Is there a way around this?


Logged

archy
Newbie
*
Posts: 32


View Profile
« Reply #7 on: August 03, 2011, 02:48:37 PM »

When I try to run the launcher, I get the messages "./launcher: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.11' not found", "./launcher: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.9' not found", etc. Looks like the game requires GLIBC 2.9 or higher, which is not available on Ubuntu 8.04 (which I'm using). Is there a way around this?

I'm not sure.

In theory, you could manually fetch a newer version of the libc.so.6 library (e.g. from the Ubuntu 10.4 repository) and put it into the game's lib32 folder, but then you might end up having to do this for several additional library dependencies as new error messages come up. It might get pretty "messy", but you could try it.

The "ideal" solution would be for Kloonigames to re-compile the game using GLIBC 2.7 so it would work with Ubuntu 8.04 LTS (it would also still work with newer ones), but seeing as Ubuntu 8.04 LTS has officially surpassed its "end-of-life" (see here), they might not be motivated to do this.

So I guess the easiest "solution" would be to upgrade your system to Ubuntu 10.04 or later.

An alternative would be to install Ubuntu 10.04 in a "chroot environment", meaning the whole system gets installed into a single folder inside your current system, and then special tools can be used to run individual applications "within" this chroot environment, without affecting the rest of your system.
See https://help.ubuntu.com/community/DebootstrapChroot
Logged

Henrik Holst
Newbie
*
Posts: 1


View Profile
« Reply #8 on: August 04, 2011, 01:27:46 AM »

Actually there is no need for a launcher script if you add Crayon to the menu and launch it from there. This is because the paths in the .desktop file can contain the full path and can also be told to do the cmd. This also means that you do not have to copy the icon file, and instead can use the png directly from the crayon directory.

For example I use the following .desktop file when installing Crayon to /opt/:
Code:
[Desktop Entry]
Type=Application
Name=Crayon Physics Deluxe
Path=/opt/CrayonPhysicsDeluxe
Icon=/opt/CrayonPhysicsDeluxe/data/gfx/big_star.png
Exec=/opt/CrayonPhysicsDeluxe/launcher
Categories=Game

It's the Path directive that tells Gnome/KDE/Whatever to cmd to the location before running the Exec.

Oh and btw, please don't follow the advise from people to build a static version, it's much better to bundle libraries because if one builds static then we as users have no way of correcting library issues (like if the author links with a version of sdl that is not compiled with PulseAudio support [something that has happened on a few games])
Logged

jiawen
Newbie
*
Posts: 2


View Profile Email
« Reply #9 on: August 04, 2011, 09:31:39 PM »

In theory, you could manually fetch a newer version of the libc.so.6 library (e.g. from the Ubuntu 10.4 repository) and put it into the game's lib32 folder, but then you might end up having to do this for several additional library dependencies as new error messages come up. It might get pretty "messy", but you could try it.
Yeah, that sounds like too much trouble.
Quote
The "ideal" solution would be for Kloonigames to re-compile the game using GLIBC 2.7 so it would work with Ubuntu 8.04 LTS (it would also still work with newer ones), but seeing as Ubuntu 8.04 LTS has officially surpassed its "end-of-life" (see here), they might not be motivated to do this.
It'd be good if they listed the requirements accurately; as of now, I think there are several places where it still says "Requires Windows XP or Vista", much less giving accurate Linux requirements.
Quote
So I guess the easiest "solution" would be to upgrade your system to Ubuntu 10.04 or later.
Unfortunately, that's not practical on this machine. Thanks for the advice, though. I got it running on a different machine I have that runs 10.04 and it seems to run beautifully.

Henrik, maybe I wasn't clear: the problem isn't in the launcher, but in the program's requirements. If I do ./crayon, I get similar errors.
Logged

FreeWorld
Newbie
*
Posts: 1


View Profile Email
« Reply #10 on: August 04, 2011, 10:33:29 PM »

When I download the game for linux, extract it in Ubuntu 10.10 and run the launcher (release 55) this is what I get: Problem. I checked if I had all the dependencies and I have them all. I can hear music but nothing else. Would love to find a solution Smiley because this is a great game, installed on windows without a problem but on Linux it never seems to work on the first try.
« Last Edit: August 04, 2011, 10:35:40 PM by FreeWorld » Logged

archy
Newbie
*
Posts: 32


View Profile
« Reply #11 on: August 05, 2011, 11:50:46 PM »

the paths in the .desktop file can contain the full path and can also be told to do the cmd. This also means that you do not have to copy the icon file, and instead can use the png directly from the crayon directory.

Good point, I changed the HOWTO accordingly, it should be a little easier to follow now.

In case someone (e.g. packagers / install script writers) is still interested in the code snippets for a location-independent desktop entry and properly installed icon, here's the relevant quote from the old version of the HOWTO:

Quote
Code:
[Desktop Entry]
Name=Crayon Physics Deluxe
Type=Application
Categories=Game;
Terminal=false
Exec=crayon
Icon=CrayonPhysicsDeluxe

The Exec line points to the name of the launch script.

The Icon line causes the system to look in the system's icon database for an icon named CrayonPhysicsDeluxe, which of course doesn't exist yet, so you'll need to create it.
The icon database is basically just a folder structure with lots of folders and files under /usr/share/icons.
If you have the ImageMagick tool installed, you can easily create the icons for all icon sizes from the data/gfx/big_star.png image shipped with the game. Simply open a terminal, cd to the CrayonPhysicsDeluxe directory, and enter:
Code:
for i in 16x16 22x22 32x32 48x48 64x64 128x128; do
  mkdir -p /usr/share/icons/hicolor/${i}/apps
  convert -filter Lanczos -resize ${i} \
    ./data/gfx/big_star.png \
    /usr/share/icons/hicolor/${i}/apps/CrayonPhysicsDeluxe.png
done
(Yes, it's multiple lines, just copy the whole thing into the terminal at once and press enter at the end.)

Finally, execute the following commands in a terminal (or, alternatively, restart the computer):
[...]
Code:
xdg-icon-resource forceupdate --theme hicolor

(Note that the code snippets were originally copied from the install script of the Arch Linux User Repository package "crayonphysicsdeluxe" and only slightly modified.)
Logged

archy
Newbie
*
Posts: 32


View Profile
« Reply #12 on: August 06, 2011, 12:22:41 AM »

When I download the game for linux, extract it in Ubuntu 10.10 and run the launcher (release 55) this is what I get: Problem. I checked if I had all the dependencies and I have them all. I can hear music but nothing else. Would love to find a solution Smiley because this is a great game, installed on windows without a problem but on Linux it never seems to work on the first try.

It never hurts to try the "Remove the SDL libraries" work-around from the above HOWTO, but in your case I think it's more likely an OpenGL or graphics driver issue.

See the "Support FAQ" and "Humble Bundle Problems and Solutions" threads where users (also from Windows and Mac) have written about similar issues. I don't think a solution was found yet, though I think the game author is looking into it...
Logged

mxup
Newbie
*
Posts: 2


View Profile
« Reply #13 on: August 06, 2011, 12:42:44 AM »

with the new update (release 55_3), it now works out of the box on opensuse 11.4 64bit, thanks!
Logged

Alessandro_S
Guest
« Reply #14 on: August 08, 2011, 05:25:25 PM »

I'm trying to figure out why I can't run it on Fedora15, all I can see is this:
http://www.tiikoni.com/tis/view/?id=be0bd80

Sound is OK. While I figure this out, however, I'd like to point out a minor bug with the crayon_release55_3.tar.gz Linux archive, though.

These image files in CrayonPhysicsDeluxe/data/gfx/ui/ are set executable, and they should be not:

-rwxr-xr-x 1 user group 3,8K  3 ago 10.31 options_language_next.png
-rwxr-xr-x 1 user group  16K  3 ago 10.31 options_language.png
-rwxr-xr-x 1 user group 4,2K  3 ago 10.31 options_language_previous.png


Then, I don't know of what use the log.txt file in the root directory is, but there I can see several lines like this:

<!> COULDN'T LOAD IMAGE: data/gfx/ui/ainmenu_text_background.png

Well, indeed there is no such file CrayonPhysicsDeluxe/data/gfx/ui/ainmenu_text_background.png, though there is a CrayonPhysicsDeluxe/data/gfx/ui/mainmenu_text_background.png image file. But creating a link to the existing file seems to have no effect.

Libraries are all right, replacing the bundled ones under lib32 with system ones does not have any effect, system has support for OpenGL vers. 1.4 (Radeon), still all I can see if a white field with a few green bars and what looks like a text input box (the black rectangle in the image).
Logged

Pages: [1] 2
Print
Jump to: