Sunday, August 18, 2013

Compiling fceux on Ubuntu

The following instructions are what I used to install fceux 2.2.1 on Ubuntu 13.10.

First you need to download the source. You can get it from http://www.fceux.com/web/download.html. Download the FCEUX src.

The rest of the instructions will assume that you are at the command line in the directory where you downloaded the file. Replace the file name in the instructions with the name of the file, which will be different if you downloaded a version different from 2.2.1.
sudo apt-get install libsdl1.2-dev scons libgtk-3-dev liblua5.1-0-dev libgd-dev
tar xzvf fceux-2.2.1.src.tar.gz
cd fceux-2.2.1
At this point you will need to open the file named SConstruct
vi SConstruct
Change lines 27 and 28 to look like this.
  BoolVariable('GTK', 'Enable GTK2 GUI (SDL only)', 0),
  BoolVariable('GTK3', 'Enable GTK3 GUI (SDL only)', 1),
This will give us a modern GTK3 interface instead of using the now outdated GTK2 toolkit. Feel free to change any of the other settings if you wish. I turned off the debug symbols. Now we are ready to compile our binary.
scons
This took about 10 - 15 minutes on my Dell 1420. Once it is done we can install it to the system.
sudo scons --prefix=/usr install
The last step is optional but provides a little more desktop integration. You can get a better fceux icon here.
sudo cp fceux.desktop /usr/share/applications
sudo cp fceux.png /usr/share/pixmaps
If you use Unity for your desktop you can change the contents of fceux.desktop in the /usr/share/applications directory to append the following to get some additional benefits when you right-click on the launcher icon.
Actions=Fullscreen;DefaultConfig;
[Desktop Action Fullscreen]
Name=Open in Fullscreen
Exec=fceux -f 1
OnlyShowIn=Unity
[Desktop Action DefaultConfig]
Name=Start With the Default Configuration
Exec=fceux --no-config 1
OnlyShowIn=Unity