Building KDevelop KF5 on KDE4 Kubuntu 14.10

Preface

This is a bit tricky!
First of all, because you have to build lots of things, first make sure you have a build directory on a disk where there are lots of free space!
Then make that build directory and follow the instructions, with some creativity of course. These instructions aren’t written into stone, so when needed ( where your system / setup is different ), feel free to take the appropriate steps for your situation.

My setup is simple:
I have my home directory in /home/dfighter
I created a build directory there which is /home/dfighter/build, and I put everywhere in there into subdirectories.
The instructions will be based on this.

Building KF5

First of all you need to install some dependencies, like Qt5, and some other libraries:

sudo apt-get build-dep qtbase5-dev

sudo apt-get install libbz2-dev libxslt-dev libxml2-dev shared-mime-info oxygen-icon-theme libgif-dev libvlc-dev libvlccore-dev doxygen gperf bzr libxapian-dev fontforge libgcrypt20-dev libattr1-dev network-manager-dev libgtk-3-dev xsltproc xserver-xorg-dev xserver-xorg-input-synaptics-dev libpwquality-dev modemmanager-dev libxcb-keysyms1-dev libepoxy-dev libpolkit-agent-1-dev libnm-util-dev libnm-glib-dev ibxcb-xkb-dev

sudo apt-get install qtbase5-dev qtbase5-private-dev libqt5x11extras5-dev qtscript5-dev qttools5-dev libqt5svg5-dev libqt5xmlpatterns5-d

sudo apt-get install libjson-perl libxml-parser-perl qtdeclarative5-dev libqt5webkit5-dev

After you have all these dependencies you need to get ‘kdesrc-build’, which can download, build, and install KF5:

Clone it from KDE’s git repo:

cd ~/build
git clone git://anongit.kde.org/kdesrc-build
Download the configuration file for it:
cd kdesrc-build
wget http://www.davidfaure.fr/kde/kf5-qt5-kdesrc-buildrc

Rename it to kdesrc-buildrc:

mv kf5-qt5-kdesrc-buildrc kdesrc-buildrc

Open ‘kdesrc-buildrc’ with a text editor and modify it, so that it reflects your desired environment:
Comment out the line that contains qtdir.
Change the source-dir parameter to whereever you want the tool to download the sources, in my case it’s

/home/dfighter/build/KF5/src
Change the build-dir parameter to wherever you want the tool to build the sources, in my case it’s/home/dfighter/build/KF5/build
Change the kde-dir parameter to wherever you want the tool to install the built binaries, in my case it’s /usr/local
Change the line

include extragear/utils/kdesrc-build/kf5-qt5-build-include

to

include kf5-qt5-build-include

Since you want to build only the framework, we can disable the rest, so open the file ‘kf5-qt5-build-inlcude’, and comment out the following lines:

include kf5-workspace-build-include
include kf5-applications-build-include
include kf5-kdepim-build-include

You can comment them out by puttin a # character right in front of the lines. Like this:

#include kf5-workspace-build-include
#include kf5-applications-build-include
#include kf5-kdepim-build-include

Now you can start to build the framework, by starting the script:

sudo ./kdesrc-build

( you only need sudo if you install to system directories )

The script will now start, and download, build, and install the framework’s parts one-by-one. This could take hours!

Building KDevPlatform

Install some dependencies, if they aren’t already installed

sudo apt-get install libqt5declarative5 qtquick1-5

Make a directory for, download, build, install grantlee 5:

cd ~/build
wget http://downloads.grantlee.org/grantlee-5.0.0.tar.gz
tar xvfz grantlee-5.0.0.tar.gz
cd grantlee-5.0.0
mkdir build
cd build
cmake ../
make
sudo checkinstall -D –strip=no –stripso=no –pkgname=grantlee5

If it complains about not finding ‘lrelease’, then find it, and create a symlink to where it’s looking. In my case I had to issue this command:

ln -sf /usr/bin/lrelease /usr/lib/i386-linux-gnu/qt5/bin/lrelease

Make a directory for, download, build, install the KF5 version of libkomparediff2:

cd ~/build
mkdir libkomparediff2
git clone git://anongit.kde.org/libkomparediff2 src
mkdir build
cd build
cmake ../src/
make
sudo checkinstall -D –strip=no –stripso=no –pkgname=libkomparediff2-kf5

Now make a directory for, clone, build and install KDevplatform:

cd ~/build
mkdir kdevplatform
cd kdevplatform
git clone git://anongit.kde.org/kdevplatform src
mkdir build
cd build
cmake ../src/
make
sudo checkinstall -D –strip=no –stripso=no –pkgname=kdevplatform-kf5

Building KDevelop

Make a directory for, clone, build and install:

cd ~/build
mkdir kdevelop
cd kdevelop
git clone git://anongit.kde.org/kdevelop src
mkdir build
cd build
cmake ../src/
make
sudo checkinstall -D –strip=no –stripso=no –pkgname=kdevelop-kf5

Now all you have to do is add kdevplatform’s plugins’ path to the QT_PLUGIN_PATH environment variable.
If you didn’t change the default installation path, then it should be doable with a command like this:

export QT_PLUGIN_PATH=$QT_PLUGIN_PATH:/usr/local/lib/i386-linux-gnu/plugins

Alternatively, just so you don’t have to do this all the time, you can also add this to /etc/environment:

QT_PLUGIN_PATH=/usr/local/lib/i386-linux-gnu/plugins

Now you can start kdevelop by issuing the command
kdevelop

Enjoy!

 

NOTE: These instructions are based on the following guides:
https://community.kde.org/Frameworks/Building
https://techbase.kde.org/KDevelop4/HowToCompile

 

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: