Category: Terminal

How to compile the latest version of Wesnoth on Ubuntu and integrate it with Lutris?

Wesnoth is a wonderful game available for free for Linux, however lately it has been falling out of favor with packagers; currently stuck at 1.14.5 while the latest version is 1.14.7 as of this writing! This tutorial will show you how to compile the source code of the game and integrate it with Lutris, and even add a custom icon so it can be searched easily across the system and docked on launchers.

Compiling Wesnoth from source on Ubuntu 16.04

While this method is not recommended and it’s only advised for advanced users only, it could be the only way to have the latest version of Wesnoth on Ubuntu.

1. Download the source code from the game’s site, always go for the latest version. and make sure to checksum the source code prior to doing anything, the value of the checksum is provided on the download page and you can easily check it using the terminal.

 

2. In the terminal, install scons using: sudo apt install scons
I’ve  decided to compile the source using scons rather than cmake because it’s much easier, however the compiling process happens in the same directory as the game, so make sure to copy the game to the target directory first, I’m going with /opt/wesnoth-1.14.7/wesnoth for the rest of the tutorial.

3. Download all the missing dependencies:
sudo apt install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev 

 

libboost-all-dev libvorbis-dev libcairo2-dev libpango1.0-dev l

 

ibssl-dev libreadline-dev cmake make scons pkgconf

4. Go into the game directory, for example /opt/wesnoth-1.14.7/wesnoth and install with the command scon.
Please note that the process is long and resource extensive, so please be patient.

More instructions and options can be found here on the official wiki.

And that’s it, now the game works fine!

Note: If you played an earlier version of Wesnoth, please be sure to copy your save games and preferences so you don’t start from scratch.

Integrate with Lutris

After compiling from source, Wesnoth can be easily configured to work with Lutris, simply by changing the path of Wesnoth from the default to wherever you installed it, I happened to install in /opt/wesnoth-1.14.7

Lutris icon

 

A screenshot from Lutris showing how the directory is changed

 

Adding an icon so you can dock it and be able to see it in the dash

Compiling Wesnoth this way won’t allow you to be able to search it or add it to plank for example, you will have to add a custom icon for this to work.

1. Go to /usr/share/applications/ as root and create a new .desktop file using a text editor (with sudo privilege).
The contents of the file should be like so:
[Desktop Entry]
Name=wesnoth
wesnothComment=The Battle for Wesnoth
The Battle for WesnothEncoding=UTF-8
Exec=/opt/wesnoth-1.14.7/wesnoth
Icon=/usr/share/applications/wesnoth.png
Terminal=false
Type=Application
StartupNotify=false
Categories=Application;Game;

Feel free to copy this file to your computer as long as you have everything installed as mentioned here, if you change anything make sure this document reflect your changes.

2. Save the file and you are good to go! As soon as you loook up Wesnoth in your system you will be able to find it and dock it on launchers such as plank.

After doing all that, I’ve uninstalled the old 1.14.5 and removed the repositories from my system, from now on I’ll compile on my own!

I hope that you find this tutorial useful, if you have any questions please let me know in the comments section below.

Credit goes out to Reddit user TonicAndDjinn as he provided a lot of helpful tips on how to compile the game.

Fix some Ubuntu startup issues with this easy trick!

I fresh installed Ubuntu 14.04.4 lately and things has been smooth, most of the issues I encountered were because of the interface change, looking back maybe the interface was buggy, and I should have read the bug list before installing it!

After installing I noticed that every time I reboot the system shows prompt to send error messages, I sent the error to the developers thinking that was it, I send the error report and I’m done, but another one came, and another one.. And it just keeps happening every time I reboot (to install updates for example) so it became a minor nuisance!

I remember facing this issue back in April 2014 when I first installed Ubuntu, and the fix was so easy!

Apparently Ubuntu tends to look for records of errors and send them, even the old ones that have been reported, so the easy way to stop it is to disable Apport.

Disabling Apport

It’s actually very easy to do, just go to the terminal by pressing Ctrl + Alt + T

Then type in gksudo gedit /etc/default/apport and press Enter. You will be prompted to enter your password, please do that.

Be careful because this command is running Gedit in root privileges and we will use it to change a vital part of the system, so follow the steps carefully!

Change Enabled=1 to Enabled=0 and save.

Close Gedit and the terminal.

The next time you reboot, you won’t see such error messages!

It’s as easy as that!

You can research the issue further by visiting this link.