Outils pour utilisateurs

Outils du site


issue77:labo_linux

Ceci est une ancienne révision du document !


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.

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

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

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

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.

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

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!

issue77/labo_linux.1393522857.txt.gz · Dernière modification : 2014/02/27 18:40 de frangi