Desurium: Build Desura from source

Desurium is the open source side of Desura that we covered in our recent review called “Desura: Steam Like Gaming Client with tons of Free games“. We’ve mentioned that in January 21, 2012, Desura has released the source code of Desura Client.

The release of the code means that you can download it, compile it and create executable binary or installable Ubuntu package of the client. This may sound difficult for the average joe, but for Power Users sounds exiting ! The most exiting part is that, Desurium developers have done a tremendous job automating the entire procedure so that you just have to run 2 terminal Commands.

[toggle title=”Why Compile Desurium”]

Compiling

A compiler is a computer program (or set of programs) that transforms source code written in a programming language (the source language) into another computer language (binary). The most common reason for wanting to transform source code is to create an executable program that usually is optimized for our hardware.
Program optimization or software optimization is the process of modifying a software system to make some aspect of it work more efficiently or use fewer resources and tailored to a specific hardware.

Optimizing Desurium code

In general, a computer program may be optimized so that it executes more rapidly, or is capable of operating with less memory storage or other resources, or draw less power. That is not an option for a generic executable which is the most applications out there. Instead a compiled software on your machine utilizes the specific for your CPU Flags and thus removes any generic options that are compatible with all CPU’s out there.
[/toggle]

There are two ways of building Desurium

[checklist]

  • Build form source and create an executable
  • Build form source and create an installable package

[/checklist]

Either way you will need to download the code, install dependencies (don’t panic, there is a script included) and make a little tweak if you are on Ubuntu 64bit (if you have 4GB of RAM or more… you should be on 64bit. period.) and want also support for 32bit games.

Downloading the Desurium code

The repository of the Desurium code is on github. You can retrieve the code by downloading the tar.gz file and stay with that version or you can stay up-to-date with the latest code using git and cloning the repo in a folder of your preference. If you know your way on GIT then please use it 😉

[tabs tab1=”Just the Tar.GZ file please” tab2=”Clone the Desurium Git repo”]

[tab]

Just click the flowing download button and then extract the tar.gz file in your Home folder

[button color=”orange” link=”https://github.com/lodle/Desurium/tarball/master”%5DDownload Desurium[/button] [/tab]
[tab]

Yes ! You are an Ubuntu Power User and you want to be on the edge. To clone the repo run the following command in a terminal (asuming that you have installed git from Ubuntu Software Center)

[highlight color=”green”]git clone https://github.com/lodle/Desurium.git%5B/highlight%5D

then copy the content of the folder “Desurium” to a new folder (call it “TheCode”) which we will use it to build it and so to keep the repo clean and clear. This way the “Desurium” folder will be clean and we can regularly run :

[highlight color=”yellow”]git pull[/highlight]
to get the latest code with bug fixes and feature add-ins.[/tab]

[/tabs]

[dropcap]OPTIONAL:[/dropcap]

If you are on Ubuntu 64bit and you want support for 32bit games:

  • Install the 32bit libraries from Ubuntu Software Center click the following to open Ubuntu Software Center and then click install:

Desurium : download 32bit libraries From UbuntuSC

  • While you are waiting the installation to finish ( a ton of libraries), open the folder of the downloaded Desurium code and edit the CMakeCache.txt, go to the line that has 32BIT_SUPPORT:BOOL=OFF and change it to 32BIT_SUPPORT:BOOL=ON to enable 32BIT_SUPPORT

Now let the fun begin…

Creating a Desurium executable from source

This procedure incorporates:

  • Installing dependencies
  • Compiling Desurium
  • Running Desurium executable

Open a terminal and navigate to the folder of the Desurium code

  1. Open a terminal, type [highlight color=”yellow”]cd[/highlight] and then press space bar to add a space, then drag and drop the folder of desurium to the terminal and press enter to navigate in the folder
  2. Install the required dependencies by executing [highlight color=”yellow”]sudo ./install-deps.sh[/highlight]
  3. After the installation completes, find out the number of cores you have in your CPU: [highlight color=”yellow”]getconf _NPROCESSORS_ONLN[/highlight]
  4. Lastly, compile the code by running [highlight color=”yellow”]./build_desura.sh -jX[/highlight] where X is the number of cores determined by the previous step. This number will utilize all your CPU cores so the build is sped up extremely and takes only 7 minutes on a modern machine (intel core i7 2635QM) (“X” will be the number of compile-thread to run at a time).

Now take a break, make a snack, let your CPU Cores burn like hell and come back when the compiling finishes 🙂

Once the compiling finished you can run Desura using by double clicking the Desura executable which is inside the “install folder”

Creating a Desurium package from source

This procedure incorporates:

  • Installing dependencies
  • Creating Desurium Package
  • Installing Desurium Package

Open a terminal and navigate to the folder of the Desurium code

  1. Open a terminal, type [highlight color=”yellow”]cd[/highlight] and then press space bar to add a space, then drag and drop the folder of Desurium to the terminal and press enter to navigate in the folder
  2. Install the required dependencies by executing [highlight color=”yellow”]sudo ./install-deps.sh[/highlight]
  3. Make a folder named “package” [highlight color=”yellow”]mkdir package[/highlight]
  4. Navigate in the package folder [highlight color=”yellow”]cd package[/highlight]
  5. Set package by running [highlight color=”yellow”]cmake -DPACKAGE_TYPE=”DEB” -DINSTALL_DESKTOP_FILE=ON -DCMAKE_INSTALL_PREFIX=”/opt/desura” ..[/highlight] (<– DONT forget the dots “..” in the end !!)
  6. Then create package [highlight color=”yellow”]make package[/highlight]

Now take a break, let your CPU Cores burn like hell make a snack and come back when the compiling finishes 🙂

Once the compiling finished you can double clicking the Desura.x.x.x.deb package which will invoke Ubuntu Software Center and install the app.

Here is a screen-shot from my system after building Desurium package:

Desurium: Build Ubuntu deb package

Epiloge

Compiling a software from source, may remind to some of you Dependency Hell. Whell not for the Desurium Code ! It is the first time in my “Living with Linux” life that a compiling was so user friendly! KUDOS (from Greek κῦδος, meaning ‘glory’) to the entire Desurium Community and Developers for their job ! Please consider visiting the official wiki here https://github.com/lodle/Desurium/wiki

Advertisement

4 Comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.