Compiling from Tarball

From Secret Maryo Chronicles Wiki
Jump to: navigation, search

This page is also available in Swedish.


This is a guide for compiling Secret Maryo Chronicles on Linux. It is written with emphasis on Ubuntu and its variants, but should be adaptable to any Linux with the right dependencies installed/compiled. If your distribution doesn't recognize sudo commands, replace sudo lines with su, a root terminal, or logging in as root, depending on your distribution.

Contents

Preparing for install

Graphics

First, ensure you have OpenGL (Open Graphics Library) acceleration, and that it's using your graphics card correctly. If you already know you support 3D applications (such as Quake or Nexuiz), you can move on. Otherwise, open a terminal and run:

$ glxgears

ATI user using Catalyst driver (fglrx) use fgl_glxgears instead

$ fgl_glxgears
GLX Gears

If you don't see an image of three gears spinning, you'll need to set up OpenGL. You may need new or different drivers for your graphics card, or reconfigure Xorg.conf to see your graphics card properly.

Repositories

Now to make sure you can get all the software you need. Go to System > Administration > Software Sources. Enter your root password, then ensure that "Community-maintained Open Source Software (universe)" is checked. Close this window. Ignore any messages about reloading package lists.

universe repository

Dependencies

Now to actually grab the libraries on which Secret Maryo Chronicles relies. All these dependencies should be available in the Ubuntu universe repository for all versions from Dapper onwards, but may have to be compiled separately. Open the terminal and type:

$ sudo apt-get update
$ sudo apt-get install automake build-essential libboost-filesystem-dev libboost-thread-dev libcegui-mk2-dev libsdl1.2-dev libsdl-ttf2.0-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libglu1-mesa-dev libgl1-mesa-dev
Dependencies

If you don't use apt-get, try to find these packages in your package manager of choice. The following libraries are needed :

Special note for new GIT versions on Linux

If compiling a recent GIT version on Linux, you will be required to have CEGUI 0.7, which is not included in most modern distros' package managers. You will therefore be required to compile the libraries yourself. If you have compiled CEGUI correctly, but the game is still having trouble finding it, some users have reported the following solutions which may correct this problem:

  • After installing CEGUI and/or any other libraries not from the repository, you must run :
$ sudo ldconfig

This updates the system's library information so that Secret Maryo Chronicles will be capable of finding the required libraries when run.

  • If you are getting configure errors about CEGUI-NULL not found, you may need to create a pkg-config file, as described in this forum thread

Compiling

If compiling from Git, you also need automake and autoconf :

$ sudo apt-get install automake autoconf

You should now be ready to build so keep the terminal open.
Note: You may also need pkg-config package for Kubuntu 8.04 and later :

$ sudo apt-get install pkg-config

Making

If you don't already have it, download the latest Linux tarball version from the Downloads page to your desktop. From terminal, do:

$ cd ~/Desktop
$ tar jxfv smc-1.9.tar.bz2
$ cd smc-1.9
$ ./autogen.sh   #***Only nessecary if compiling from Git***
$ ./configure

If ./configure has any errors, stop, because nothing else will work. These are normally caused by dependency issues. Please report it on the forum or the IRC Channel and we'll try to help.

Configuring

If configure worked, do:

$ make

This will take a while, and it may generate a few errors, but they normally don't matter.

Installing

You should now be ready to actually build the program. In your terminal windows, run:

$ sudo make install

The only way to uninstall the program is to keep (or rebuild) the packages and run "sudo make uninstall"

Note: Do not use checkinstall to install SMC, as it doesn't package the translation folder. This will break the Game options menu and will crash the application. If you want an entry in apt, please use an available package from the Download Page instead.

Now you should test if everything is installed right by running, in terminal:

$ smc

The game should start. If not, make a copy of the output of ./configure, make and make install and ask for help on the forum or the IRC Channel. Run it with the parameter "--help" to see the possible options.

Music (Optional)

If you have checked out and compiled the full Git tree, you will already have music, so you may skip this step. If you want music in the game, you'll also need to download the music package from the Downloads page to your desktop and from Terminal, do

$ cd ~/Desktop
$ unzip SMC_music_4.1_high.zip
$ cd data
$ sudo mv -f * /usr/local/share/smc

If you want to install just the music into a packaged version (e.g. deb, rpm...), you should replace the final line with:

$ sudo mv -f * /usr/share/games/smc

You can then delete the (empty) data directory from your desktop.

Menu Entry

You can now make a menu item for SMC. First, copy an icon for your menu entry into the pixmaps directory. From terminal, do:

$ sudo ln -sf /usr/local/share/smc/pixmaps/game/items/mushroom_red.png /usr/share/pixmaps/smc.png

Then:

$ sudo gedit /usr/share/applications/smc.desktop

Replace gedit with your text editor of choice, for example, Kubuntu users should use:

$ sudo kate /usr/share/applications/smc.desktop

Which should bring up a blank text editor. Copy exactly what appears below into the file:

[Desktop Entry]
Name=Secret Maryo Chronicles
Comment=Secret Maryo Chronicles is an Open Source two-dimensional platform game$
Exec=smc
Icon=smc.png
Terminal=false
Type=Application
Categories=Application;Game;

And save. This should create a link in Applications > Games > Secret Maryo Chronicles. You may need to restart before it appears. You've now installed the latest version of Secret Maryo Chronicles :)

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox