Project

General

Profile

Build Quassel on Linux (english) » History » Version 16

Version 15 (Anonymous, 07/29/2013 10:17 PM) → Version 16/20 (sandsmark, 06/13/2015 09:43 PM)

h1. Build Quassel on Linux

Step-by-step guide to compile the project utilizing the the classic toolchain in a terminal

{{toc}}

h2. Preparation of the build system

The build process needs
- the compiler and some tools like a linker, cmake, make
- the development libraries for KDE4, QT4, OpenSSL and zlib
- and git to manage the Quassel sourcecode

Under DEBIAN GnU/Linux Squeeze/Sid the needed packages are installed as follows (execute as root):
<pre><code># apt-get update && apt-get install build-essential git-core cmake qt4-dev-tools libqt4-dev libqt4-sql-psql zlib1g-dev kdelibs4-dev libphonon-dev kdevelop-dev checkinstall </code></pre>

(please insert commands for other distributions here)

h2. Managing the sourcecode

This task is done utilizing "git":http://en.wikipedia.org/wiki/Git_(software) while being logged in as a normal user.
The sourcecode is downloaded with 'git clone $URL' and stored in the directory ~/quassel.
<pre><code>$ cd ~ && git clone https://github.com/quassel/quassel.git</code></pre> git://gitorious.org/quassel/quassel.git</code></pre>

The development of Quassel is an ongoing process, so from time to time you want
to update to the latest contributions with 'git pull origin' .

<pre><code>$ cd ~/quassel && git pull origin</code></pre>

h2. Compile!

After updating the sourcecode one can generate a new build.
Every build is done in its own directory enabling
the return to the old build directory in the case of defeat.
<pre><code>$ cd quassel
$ mkdir build
</code></pre>

In the build directory the command 'cmake' generates the make-files (i.e. a dependency map for the compiler).
The options of cmake are described in the file ~/quassel/INSTALL in your source directory. Note: LINGUAS is an environment variable, not a cmake variable. You can optionally export it before running cmake.
<pre><code>$ cd ~/quassel/build
$ LINGUAS="de en_US" cmake ~/quassel -DWANT_CORE=ON -DWANT_QTCLIENT=ON -DWANT_MONO=ON -DWITH_KDE=ON -DWITH_OPENSSL=ON -DWITH_DBUS=ON -DWITH_PHONON=ON -DWITH_WEBKIT=ON
</code></pre>

Now the command 'make' generates the calls for the compiler
<pre><code>$ make </code></pre>

h2. Install with checkinstall

It is wise to prefer the default packagemanager of your system rather doing a 'make install'.
The installation will be done as root with checkinstall.
checkinstall generates a package (deb, rpm or tgz) for your packagemanager (apt, rpm or installpkg),
that can later be removed easily and leaves a clean system.
checkinstall has options for several distributions: -D for Debian, -R for RPM, -S for Slackware.
When installing the package it asks interactive two questions, as shown in the following example:

example:
<pre><code>/home/user/quassel/build/# checkinstall -D --pkgname quassel-all --pkgversion 0.5.0 --pkgrelease $(date +%y%m%d%H%M%S) make install</code></pre>
Output:
Please enter a description of the package.
Finish your description with an empty line or EOF.

Input:
>> [quassel-all contains quassel-core, quassel-client and quassel (mono).]
>> [enter]

Output:
Das Paket wird entsprechend dieser Vorgaben erstellt:
0 - Maintainer: [ your.name@somedomain.test ]
1 - Summary: [ quassel-all contains core, client und quassel (mono). ]
2 - Name: [ quassel-all ]
3 - Version: [ 0.5.0 ]
4 - Release: [ 091021181559 ]
5 - License: [ GPL ]
6 - Group: [ checkinstall ]
7 - Architecture: [ i386 ]
8 - Source location: [ build_091021181559 ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ quassel-all ]

Input:
[ just press [enter] to proceed generating the package]

The result: Quassel is installed. (here for Debian):
<pre><code> Done. The new package has been installed and saved to

/home/$(user)/quassel/build/quassel-all_0.5.0-091021103522_i386.deb

You can remove it from your system anytime using:

dpkg -r quassel-all
</code></pre>



h2. Draft of a buildscript

The repeating tasks of updating and compiling is done in the following buildscript:
<pre><code>#!/usr/bin/bash
# quick quassel buildscript (draft)
#
# initialize your local git-repository once with this command
# cd ~ && git clone https://github.com/quassel/quassel.git git://gitorious.org/quassel/quassel.git ~/quassel
#
# updating latest contributions:
cd ~/quassel
git pull origin
#
# make a new build directory with a suffix containing the date
export date=$(date +%y%m%d%H%M%S)
mkdir build_$date
#
# cmake: Optionen siehe ~/quassel/INSTALL
cd build_$date
cmake ~/quassel -DWANT_CORE=ON -DWANT_QTCLIENT=ON -DWANT_MONO=ON -DWITH_KDE=ON -DWITH_OPENSSL=ON -DWITH_DBUS=ON -DWITH_PHONON=ON -DWITH_WEBKIT=OFF -DLINGUAS="de en_US"
make
#
# avoid the classic 'make install', prefer generating a package with checkinstall
echo please execute as root via copy & paste in the directory ~/quassel/build_$date
echo first to remove old package: dpkg -r quassel-all
echo then to install new package: checkinstall -D --pkgname quassel-all --pkgversion 0.5.0 --pkgrelease $date make install
</code></pre>