2016년 4월 14일 목요일

Setting up Kega Fusion in Fedora 23

Fedora is a great Linux distro to use at work as it offers up-to-date kernels, SELinux, firewalld, and most packages needed for development and sysadmin. It is also pretty stable.

Where it doesn't shine is in multimedia and gaming. To get mplayer and non-free codecs, for instance, you have to enable the RPM Fusion repo. Unfortunately, there are quite a few games that are not available through RPM Fusion (such as ufoai, a 3-D remake of X-Com, and the Sega Genesis/megadrive emulator Kega Fusion).

In the case of Kega Fusion, Steve Snake offers pre-compiled binaries for 32-and-64-bit Linux on his site, so all you have to do is make sure you have the required dependencies installed on your local machine.

In the installation FAQ on Steve's site, he explains what packages need to be installed for Kega Fusion to work:

sudo apt-get install libglu1-mesa:i386 libgtk2.0-0:i386 libasound2:i386 libsm6:i386 libasound2-plugins:i386

Of course, these are the package names for Ubuntu/Debian. For Fedora 23, you will need to install the following 32-bit packages (denoted by i686):

sudo dnf install mesa-dri-drivers.i686 mesa-libGLU.i686 gtk2.i686 alsa-lib.i686 libmSM.i686


If you are missing some 32-bit packages you will get errors like the following:

[fedjun@u36jfed23 Fusion]$ ./Fusion
./Fusion: error while loading shared libraries: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory

In such a case, first find the location of the 64-bit version of the file with

find / -type -name foo

And then find the package which owns the file with

rpm -qf /path/to/foo

and install the 32-bit version of that package.

Here's an example of these commands in action:

[fedjun@u36jfed23 Fusion]$ ./Fusion
./Fusion: error while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory


OK - it look like I'm missing the 32-bit version of libasound2.so.2... First I need to find the location of the 64-bit version of this file by using find

[fedjun@u36jfed23 Fusion]$ sudo find /usr -type f -name libasound*
/usr/lib64/libasound.so.2.0.0

...

Now that I know the path to the file, I can discover which package the file belongs to:

[fedjun@u36jfed23 Fusion]$ rpm -qf /usr/lib64/libasound.so.2.0.0
alsa-lib-1.1.1-1.fc23.x86_64


Recall that Steve Snake said that Ubuntu/Debian users need to install libasound2 -- well there is no such package with that name in Fedora! Instead Fedora users would need to install the package we found above: alsa-lib (i686)

[fedjun@u36jfed23 Fusion]$ sudo dnf search alsa-lib
Last metadata expiration check: 0:33:28 ago on Sun Apr 10 21:15:55 2016.
...
alsa-lib.x86_64 : The Advanced Linux Sound Architecture (ALSA) library
alsa-lib.i686 : The Advanced Linux Sound Architecture (ALSA) library


Now just install the 32-bit alsa-lib package with

sudo dnf install alsa-lib.i686

Once all dependencies are installed, you can now use the most accurate Sega Genesis / Megadrive emulator on Fedora 23!