Outils pour utilisateurs

Outils du site


issue77:labo_linux

Table des matières

1

In the early eighties, I spent a great deal of time learning about the Commodore 64. Our family bought the computer for accounting, but it quickly became apparent that games were the C64’s real strength. Some of the more memorable titles included: 1942 (the midway arcade game clone), Archon, Arkanoid, Attack of the Mutant Camels, Aztec Challenge, B.C.’s Quest for Tires, The Bard’s Tale, Blue Max, Commando (based very loosely on the Arnold Schwarzenegger movie of the same name), and Dig Dug – just to name a few. Compared to today’s games, the graphics of these games sucked, but there was something enchanting about Commodore 64 games that made people like me spend way too long playing them. Among role-playing style games, the Ultima series was one of the most popular. Several years ago, while browsing through Ubuntu software repositories, I came across a game called Haxima that looked very much like Ultima. Haxima was based on a game engine called Nazghul. Sadly, Haxima has since been removed from the repositories, and the original website for both Haxima and Nazghul was down at the time of this article.

Au début des années quatre-vingt, j'ai passé beaucoup de temps à m'informer sur le Commodore 64. Notre famille a acheté l'ordinateur pour la comptabilité, mais il est rapidement devenu évident que les jeux étaient la véritable force du C64. Certains des titres les plus mémorables : notamment, 1942 (le clone de jeu d'arcade Midway), Archon, Arkanoid, Attack of the Mutant Camels, Aztec Challenge, B.C.’s Quest for Tires, The Bard’s Tale, Blue Max, Commando (très vaguement inspiré du film du même nom d'Arnold Schwarzenegger) et Dig Dug. Comparés aux jeux d'aujourd'hui, les graphismes de ces jeux rebutent, mais il y avait quelque chose d'enchanteur dans les jeux du Commodore 64 qui faisait que les gens comme moi passaient beaucoup trop de temps à y jouer.

Parmi les jeux de rôle, la série Ultima était l'une des plus populaires. Il y a plusieurs années, en parcourant les dépôts de logiciels Ubuntu, je suis tombé sur un jeu appelé Haxima qui ressemblait beaucoup à Ultima. Haxima était basée sur un moteur de jeu appelé Nazghul. Malheureusement, Haxima a depuis été retiré des dépôts et le site d'origine pour à la fois Haxima et Nazghul était inaccessible au moment de cet article.

Originally, I intended this article for the Linux Games section, but, since it took a bit of work getting Haxima installed, I thought it might be a useful exercise to show the steps I went through to get it working. First, I found recent Red Hat packages for both Haxima and Nazghul on rpm.pbone.net. This article covers how I got Haxima working on my Ubuntu 13.04 system. I downloaded the i686 rpms for Haxima and Nazghul from: http://rpm.pbone.net/index.php3/stat/4/idpl/21500724/dir/fedora_19/com/nazghul-0.7.1-5.20120228gitb0a402a.fc19.i686.rpm.html http://rpm.pbone.net/index.php3/stat/4/idpl/21500384/dir/fedora_19/com/haxima-0.7.1-5.20120228gitb0a402a.fc19.i686.rpm.html

Au début, je destinai cet article pour la section Jeux Ubuntu, mais, puisqu'il a fallu galérer un peu pour installer Haxima, j'ai pensé qu'il pourrait être utile de montrer comment je l'ai fait fonctionner, étape par étape. Tout d'abord, j'ai trouvé des paquets Red Hat récents pour Haxima et Nazghul sur rpm.pbone.net. Cet article traite de comment j'ai réussi à faire fonctionner Haxima sur mon système Ubuntu 13.04.

J'ai téléchargé les rpm pour i686 d'Haxima et de Nazghul ici : http://rpm.pbone.net/index.php3/stat/4/idpl/21500724/dir/fedora_19/com/nazghul-0.7.1-5.20120228gitb0a402a.fc19.i686.rpm.html http://rpm.pbone.net/index.php3/stat/4/idpl/21500384/dir/fedora_19/com/haxima-0.7.1-5.20120228gitb0a402a.fc19.i686.rpm.html

2

In order to install the RPMs, I first converted them to .deb files. I installed alien, a program that can convert .rpm files to .deb files: sudo apt-get install alien Alien uses the –to-deb switch to convert a package from rpm to deb format. You need to run alien with root privileges (or sudo) to make the conversion. For example: sudo alien –to-deb nazghul-0.7.1-5.20120228gitb0a402a.fc19.i686.rpm sudo alien –to-deb haxima-0.7.1-5.20120228gitb0a402a.fc19.i686.rpm Now we need to install the newly created .deb files: sudo dpkg -i nazghul_0.7.1-6.20120228_i386.deb sudo dpkg -i haxima_0.7.1-6.20120228_i386.deb All done right? We should be able to type haxima and go, but if you run haxima on Ubuntu 13.04 you get the following error: /usr/bin/nazghul: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory In this case, ubuntuforums user FenrirXIII provides an answer here: http://ubuntuforums.org/showthread.php?t=2138623

Afin d'installer les paquets rpm, je les ai tout d'abord convertis en fichiers .deb. J'ai installé alien, un programme qui peut convertir des fichiers .rpm en des fichiers .deb :

sudo apt-get install alien

Alien utilise l'option –to-deb pour convertir un paquet du format rpm en deb. Vous devez lancer alien avec les privilèges root (ou sudo) pour la conversion. Par exemple :

sudo alien –to-deb nazghul-0.7.1-5.20120228gitb0a402a.fc19.i686.rpm

sudo alien –to-deb haxima-0.7.1-5.20120228gitb0a402a.fc19.i686.rpm

Maintenant nous devons installer les fichiers deb fraichement créés:

sudo dpkg -i nazghul_0.7.1-6.20120228_i386.deb

sudo dpkg -i haxima_0.7.1-6.20120228_i386.deb

Tout c'est bien passé? Nous devrions pouvoir taper haxima et commencer à jouer, mais si vous exécutez haxima sous Ubuntu 13.04 vous obtenez l'erreur suivante :

/usr/bin/nazghul: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory

Dans ce cas, FenrirXIII sur les ubuntuforums propose une solution ici: http://ubuntuforums.org/showthread.php?t=2138623

FenrirXIII’s first step suggests downloading the libpng15 library from sourceforge: http://sourceforge.net/projects/libpng/files/libpng15/ I downloaded the 1.5.7.tar.gz file and untarred it: tar -zxvf libpng-1.5.17.tar.gz Before compiling anything, we need a compiler and a few essentials: sudo apt-get install build-essential Now that we have the compiler installed, the next step is to change into the libpng directory and run ./configure: cd ~/Downloads/libpng-1.5.17/ ./configure –prefix=/usr/local/libpng Oops, an error: configure: error: zlib not installed Often when there’s a compiler error, it’s a library that’s missing; when you see a message like this you can often track down the library by apt-cache searching for the term and grepping for dev: apt-cache search zlib | grep dev

La première étape de FenrirXIII vous invite à télécharger la bibliothèque libpng15 de sourceforge : http://sourceforge.net/projects/libpng/files/libpng15/

J'ai téléchargé le fichier 1.5.7.tar.gz et l'ai dépaqueté:

tar -zxvf libpng-1.5.17.tar.gz

Avant de compiler quoi que ce soit, nous avons besoin d'un compilateur et de quelques éléments essentiels :

sudo apt-get install build-essential

Une fois le compilateur installé, l'étape suivante consiste à aller dans le répertoire de libpng et d'exécuter ./configure :

cd ~/Downloads/libpng-1.5.17/

./configure –prefix=/usr/local/libpng

Oups, une erreur :

configure: error: zlib not installed

Souvent, quand il y a une erreur de compilation, c'est qu'il manque une bibliothèque ; quand vous voyez un message comme celui-ci vous pouvez souvent localiser la bibliothèque en faisant une recherche sur le terme par apt-cache, filtrée sur dev par grep :

apt-cache search zlib | grep dev

3

On my system, this resulted in 25 different programs, one of which, zlib1g-dev, looked a lot like the library. sudo apt-get install zlib1g-dev Now we re-try FenrirXIII’s configure: ./configure –prefix=/usr/local/libpng This time the command finished successfully. The next step is to make the program, simply run: make Normally if something is missing (libraries for example), they’ll get caught in the ./configure step. Once you make it past the ./configure step, make usually compiles successfully. The make step often takes the most time, be prepared to wait a couple of minutes or more, especially on a slower system. Once make is done, we’ve made the binaries and associated files, make install installs them to the appropriate place: sudo make install We have to use sudo since we’re writing to places our normal account cannot write to. The first make step was making the files within our user directory.

Sur mon système, le résultat a été 25 programmes différents, dont un, zlib1g-dev, ressemblait beaucoup à la bibliothèque.

sudo apt-get install zlib1g-dev

Maintenant nous ré-essayons la commande de FenrirXIII :

./configure –prefix=/usr/local/libpng

Cette fois-ci, la commande s'est terminée avec succès. L'étape suivante consiste à construire le programme, il suffit de lancer :

make

Normalement, s'il manque quelque chose (des bibliothèques par exemple), elles vont être détectées à l'étape ./configure. Une fois que vous avez passé l'étape ./configure, le make compile en général avec succès. L'étape make dure souvent plus longtemps que le reste ; soyez prêt à attendre quelques minutes ou plus, surtout sur un système plus lent. Une fois le make fait, nous avons construit les binaires et les fichiers associés, « make install » les installe à l'endroit approprié :

sudo make install

Il faut utiliser sudo, car nous écrivons à des endroits où notre compte normal ne peut le faire. Le premier make a construit les fichiers dans notre répertoire de l'utilisateur.

4

This older version of libpng is now installed, but we need to create a symbolic link to it so that when programs look for libpng15.so.15, they find it. Before that we actually need to locate the file. sudo updatedb locate libpng | grep libpng15.so.15 A few results display: /home/charm/Downloads/libpng-1.5.17/.libs/libpng15.so.15 /home/charm/Downloads/libpng-1.5.17/.libs/libpng15.so.15.17.0 /usr/local/libpng/lib/libpng15.so.15 /usr/local/libpng/lib/libpng15.so.15.17.0 The one we want is the third result. Now we can finish FenrirXIII’s steps and link the library to a place programs will look for libpng15.so.15: sudo ln -s /usr/local/libpng/lib/libpng15.so.15 /usr/lib/libpng15.so.15

L'ancienne version de libpng est maintenant installée, mais nous avons besoin de créer un lien symbolique vers elle, afin que, lorsque les programmes recherchent libpng15.so.15, ils la trouvent. Avant cela, nous devons localiser le fichier réellement.

sudo updatedb

locate libpng | grep libpng15.so.15

Quelques résultats s'affichent :

/home/charm/Downloads/libpng-1.5.17/.libs/libpng15.so.15 /home/charm/Downloads/libpng-1.5.17/.libs/libpng15.so.15.17.0 /usr/local/libpng/lib/libpng15.so.15 /usr/local/libpng/lib/libpng15.so.15.17.0

Celui que nous voulons est le troisième résultat. Maintenant nous pouvons terminer les étapes de FenrirXIII et placer la bibliothèque à un endroit où les programmes chercheront libpng15.so.15.

sudo ln -s /usr/local/libpng/lib/libpng15.so.15 /usr/lib/libpng15.so.15

Now if we run haxima it should recognize where libpng15.so.15 is installed. haxima Success! Normally when I have to compile something, I usually follow the following steps: • Untar/zip the program • Read the README or INSTALL file (less README or less INSTALL). Sometimes the files are in a sub-directory called docs, and follow any special instructions. • Run 3 things: ./configure make sudo make install If I get really hung up on an error, I search the web for an answer. A lot of problems can be solved by reading the README or any text files included in the archive. Happy compiling!

Maintenant si nous lançons haxima il devrait savoir où chercher libpng15.so.15.

haxima

Succès ! Normalement, quand je dois compiler quelque chose, je suis généralement les étapes suivantes : • détarer/dézipper un programme • Lire le fichier README ou INSTALL (less README ou less INSTALL). Parfois, les fichiers sont dans un sous-répertoire appelé docs et signalent de suivre des instructions particulières. • Lancer 3 choses : ./configure make sudo make install

Si je reste vraiment bloqué par une erreur, je cherche une réponse sur le Web. Beaucoup de problèmes peuvent être résolus en lisant le fichier README ou tout fichier texte inclus dans l'archive. Bonne compilation!

issue77/labo_linux.txt · Dernière modification : 2014/03/05 14:46 de andre_domenech