Notes on building KDE 4.4 ( from trunk )

Note & Disclaimer: I started writing this article in order to have a page where to collect all the info I need to build KDE trunk ( now is 4.4 ), instead of putting txt files everywhere on my hard drive. This article is not meant to be an exhaustive howto build a fully working KDE enviroment from svn; however I’ll try to be the more concise I can. At this moment, I’m running Ubuntu Jaunty with the latest updates.

Small, little advice: I found very very useful to put almost all the commands for each step in a separate text file named step#.sh, save them into a folder called kde-svn-scripts, then made them executable and finally run it as super-user ( following of course the numbering convention 😛 ). It’s more simple and fast than writing every single command by hand, believe me 😉

Step0: Dowloading some files =)

Since Ubuntu Jaunty doesn’t have the minimun required version for some files ( Karmic probably has them ), you have to download and unpack the following files:

Once you downloaded and unpacked these files, download and install the official KDE script to retrieve the svn code and compile it from here, unpack the zipped folder, made the script named kdesvn-build executable and move it to /usr/bin .

In your $HOME folder, download this file and save it as .kdesvn-buildrc . Feel free to modify it as you wish; by default, I enabled almost all the modules you can get from svn 😛

Step1: Cleaning up the enviroment.

The first thing we always have to do is remove everything related to KDE or QT that came up with your distro. Before doing this, remember to have an other desktop enviroment available so, if something goes wrong, you can use it to backup everything.

This command should be enough to remove all the packets we don’t need anymore:

$ sudo aptitude remove libqca2 libqimageblitz4 libsoprano4 libstreamanalyzer0 libstreams0 libstrigiqtdbusclient0 libqca1c2 qca-dev

Then, I suggest to reboot before performing step2.

Step2: Installing the required dependencies

Now it’s time to install the dependencies needed to successfully build KDE from trunk: that list is not yet complete, by the way contains all the needed libs and almost all the required ones. So, type this huge command:

$ sudo aptitude install build-essential cdbs debhelper cmake libxml2-dev libavahi-qt4-dev libxslt1-dev libbz2-dev librdf0-dev shared-mime-info dbus-x11 libxkbfile-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxext-dev libjpeg62-dev libical-dev libpng12-dev subversion libsm-dev libxinerama-dev libtiff4-dev libxrender-dev libfontconfig1-dev libboost-dev libxcursor-dev doxygen libungif4-dev libdbus-1-dev libgpgme11-dev libssl-dev libgpgme11-dev libasound2-dev kdesdk-scripts libpth-dev libjasper-dev ssh libxine-dev libglib2.0-dev libpcre3-dev diffstat libexpat-ocaml-dev libkipi0-dev libclucene-dev libclucene0ldbl libqt4-opengl-dev libexiv2-dev libqca2-dev quilt libspectre-dev xsltproc libqt4-dev libxtst-dev libxdamage-dev libxcomposite-dev x-dev libfam0 libfam-dev libaspell-dev libenchant-dev libsmbclient-dev libopenexr-dev libraw1394-dev libpulse-dev libpci-dev libcaptury-dev libusb-dev network-manager-dev libgphoto2-2-dev libpoppler-qt4-dev mysql-server-core-5.0 mysql-admin libeet-dev gstreamer0.10-plugins-base sun-java6-jdk libcppunit-dev libgstreamer-plugins-base0.10-dev libmono-dev libssh2-dev libiw-dev libxss-dev libslp-dev lm-sensors bluez libbluetooth-dev libgps-dev libxklavier12-dev libsasl2-dev acl flex bison

Now, take a coffe 🙂

When all the packages are downloaded and installed, you can start building and installing, in the following order: SIP, QZion, QEdje, Eigen2 and LZMA.

Step3: Running kdesvn script

Now the craved step: running kdesvn-build script! Simply type:

$ sudo kdesvn-build

and then wait about 5 hours to get everything compiled =)

Step4: Setting up the new environment

Now everything is correctly compiled and installed; the only thing to do is to tell your operating system where find the new executables.

Open you favourite editor, create a file called kdestart.sh and type the following commands:

#!/bin/sh
export QTDIR=/opt/qt4
export KDEDIR=/opt/kde4
export KDEHOME=$HOME/.kde4
export LD_LIBRARY_PATH=$KDEDIR/lib:$LD_LIBRARY_PATH
export PATH=$QTDIR/bin:$KDEDIR/bin:/usr/local/bin:$PATH
startkde

The text in red is required only if you build QT libraries from scratch; if you use QT libraries that comes out with your distro, simply remove these lines !

After doing this, move that file in usr/local/bin/ and make it executable by running chmod +x on it.

The next file will be created is named kde4.4.desktop filled with the following lines:

[Desktop Entry]
Encoding=UTF-8
Type=XSession
Exec=/usr/local/bin/kdestart.sh
TryExec=/usr/local/bin/kdestart.sh
Name=KDE4.4

and then move it to /usr/share/xsessions/ .

That’s all !! Now restart the Xserver, and loging again selecting the kde4.4 entry and enjoy your new KDE 😉

Advertisements

QuakeLive runs on linux =)

loading_logo_v2009081906.0

After a looooong time, ID Sotfware has finally ported QuakeLive to Linux and Mac platforms 😀

Actually, it seems they announced the porting about a week ago, but i noticed it only today because the Google Summer of Code has finished so today I spent some time with my favourite game ever 😉

It runs a bit slow, compared with windows but hey!, we’re still in beta and ID Software engineers ( especially John Carmack ) are famous to do what it’s impossible for others !!

So now the only reason that does’nt allow me to delete Windows is a good app for paint/vector art ( Gimp and Inkscape are too slow, compared with Adobe’s produtcs; so until a better release, I’ll keep windows … ).

Some improvements on PlasMate TimeLine

These days I focused my efforts on some usability aspects regarding the TimeLine.

In the previous implementation, the TimeLine showed all the buttons needed to manage it in the same dock widget; thus enforcing the belief of a minor component that is not our goal.

With the commit I performed today, the “New SavePoint” button is placed now in the Workflow dock widget; so the user now consider SavePoints ( and the TimeLine ) as a key component. When creating a new project, the TimeLine will show only a disabled button, which suggests the developer to click on “New SavePoint” to init the TimeLine. This is how the interface looks now:

plasmate_interface

Moreover, the “Section” button, used to perform some important operation, has been moved from the bottom, to the top of the dock widget; that’s because its related actions are frequently performed and, if there are lots of SavePoints, the developer is forced to scroll down the TimeLine until reach that button. So it’s more useful to place it on the top.

plasmate_interface1

Understanding and Using the TimeLine

As promised before, today I’m going to describe the basical concepts about the TimeLine, and how use it for the best developing experience, by giving you some examples.

The TimeLine is a powerful tool which allows you, as the name suggests, to “travel” into various states of your project called SavePoints. Let’s say that, during the developing process of an application, you are writing a method/feature and then you find out a new API which does that dirty work for you: so you need to cleanup your code and simply invoke that API. If the amount of new code you just wrote is small, you can simply Undo for each source file or, if you can’t, delete each related line of code, and then continue programming using the new API. But these operations are not trivial if that feature is deeply mixed in the code, or the number of files affected is high. It would be nice if you could revert your sourcecode in a previous state with one single mouse click. Of course the TimeLine can do that, by setting/deleting SavePoints.

What is a SavePoint and how to create it

You can think about it as a “photo” of the current state of your project: you can save as much states as you want, comment it for a later review, and also delete it. A TimeLine is simply a collection of these SavePoint, ordered in a chronological way.

When a new project is started within PlasMate, the TimeLine will look like the figure below:

TImeLine

Since the TimeLine is not created yet, the only entry displayed is “Not a SavePoint”, so let’s create our first SavePoint by clicking on it!

Here it is my example:

TimeLine: save dialog

Every time you store a Savepoint, you have add at least a brief comment, so you can keep track of changes in your project.

After pressing Apply button, the TimeLine is initialized and your first SavePoint is saved; then, the TimeLine widget is updated and now displays with new info. If you move your mouse over the SavePoint, a popup will show you all the infos you need:

  • Date and time of its creation;
  • Author who created the SavePoint;
  • Comments.

TimeLine: first SavePoint stored !

Certainly you noticed also a new item named “On Section: master”; don’t worry, I’ll talk about Sections later in this article 😛

Well, now you know ho to create a SavePoint: usually, it’s a good practice to save it everytime you plan to start a new feature/add on.

So, a simple TimeLine layout could be something like this:

  • SavePoint #0: added main script files;
  • SavePoint #1: implemented settings interface;
  • SavePoint #2: added resources files;
  • SavePoint #3: implemente net services;
  • …..

If you realize, as in the example i described in the beginning, that SavePoint #3 is useless because you discovered a function do_net_service(), you can delete your SavePoint in two different ways:

  • Right click in the previous SavePoint: from the popup menu that will be showed, select “Restore SavePoint”; by doing this, all the subsequent SavePoint ( the one you want to delete, but also other saved after it, if present )will be deleted;
  • Right click in the previous SavePoint: from the popup menu that will be showed, select “Move to this SavePoint”; with this command, you’re going back in the past: the wrong SavePoint, and a new Section is created.

Ok, now it’s time to introduce the concept of Section 😀

What is a Section?

Do you remember the film Back to the Future ? When Martin travelled to the past and changed it, he discover that also the present has changed!

So, when a while ago you selected“Move to this SavePoint”, you made a trip back in time and PlasMate automatically asks you to create a new Section, in order to preserve the actual story ( saved in the Section called master ).

But the Sections are even more powerful! For example, you can use the master section to release the stable version of your app, and create a Section named devel used to develop more advanced ideas and not yet stable to be released. The interesting feature of Section is that they can me merged together; so, when your devel Section is stable enough, you can merge it with the “official” branch, and then you can delete it or continue with new cool ideas =)

Note that the TimeLine will show you only the current section, with its related commits !!

Example of a merge:

TimeLine: merge

For any question or further explanations, feel free to ask me =)