Getting Started/Build/KDE4/on virtual machines

Jump to: navigation, search

Tutorial Factbox
Time to replay 3 hours
Example Distro SUSE Linux 12.2
Type HowTo
Happy readers 2
Unhappy readers 0

This describes how to use a virtual machine for building the latest KDE from sources.

Contents

Virtual Machine Setup

Create a virtual machine, e.g. using VirtualBox. Regarding harddisk: KDE 4 fits into 10 GB, however I recommend 40GB, one partition. Regarding RAM: You will need at least 1GB ram for the virtual machine, of course more is better.

You will need to set your SUSE CD as your virtual machine's cdrom.

setup for SSH

To be able to log in to your VM using ssh, stop and disable the firewall:

rcSuSEfirewall2 stop
chkconfig SuSEfirewall2_setup off
chkconfig SuSEfirewall2_init off
/etc/init.d/sshd start
chkconfig sshd on

Inside the VM, install some needed packages:

yast -i libqt4-devel pcre-devel libxslt-devel libxml2-devel docbook-xsl-stylesheets git cyrus-sasl-devel libiodbc-devel \
libdbusmenu-qt-devel giflib-devel strigi-devel libQtWebKit-devel libqimageblitz-devel libical-devel libgpgme-devel \
boost-devel libqjson-devel libredland-devel xcb-util-image-devel libqt5-*
Now it is time to do a snapshot or clone from your VM.

You will be able to return to this machine state whenever you want.

a few more steps

Open a console as root

su -

on an x64 distribution

If and only if you have a /lib64 path, you are on an x64 distribution. Make sure you have the needed environment variables and alias set by having a file /root/.bashrc.

cd
cat >.bashrc<<EOF 
export KDEDIR=/usr/local         
alias cmakekde="cmake . -DCMAKE_INSTALL_PREFIX=\$KDEDIR -DLIB_SUFFIX=64 -DCMAKE_BUILD_TYPE=debugfull && make -j8 && make install"
alias cmakekdelibs="cmake ../kdelibs -DCMAKE_INSTALL_PREFIX=\$KDEDIR -DLIB_SUFFIX=64 -DCMAKE_BUILD_TYPE=debugfull && make -j8 && make install"
alias makeqt="./configure -dbus -openssl -plugin-sql-mysql -libdir /usr/lib64 -prefix /usr && make -j8 && make install"
export QTDIR=/usr
EOF
cat >.gitconfig<<EOF
[url "git://anongit.kde.org/"]
    insteadOf = kde:
[url "ssh://git@git.kde.org/"]
    pushInsteadOf = kde:
EOF

Now activate this file

. /root/.bashrc

on another distribution (incl 32bit)

Make sure you have the needed environment variables and alias set by having a file /root/.bashrc.

cd
cat >.bashrc<<EOF
export KDEDIR=/usr/local         
alias cmakekde="cmake . -DCMAKE_INSTALL_PREFIX=\$KDEDIR -DCMAKE_BUILD_TYPE=debugfull && make -j8 && make install"
alias cmakekdelibs="cmake ../kdelibs -DCMAKE_INSTALL_PREFIX=\$KDEDIR -DCMAKE_BUILD_TYPE=debugfull && make -j8 && make install"
alias makeqt="./configure -dbus -openssl -plugin-sql-mysql -prefix /usr && make -j8 && make install"
export QTDIR=/usr
EOF
cat >.gitconfig<<EOF
[url "git://anongit.kde.org/"]
    insteadOf = kde:
[url "ssh://git@git.kde.org/"]
    pushInsteadOf = kde:
EOF

Now activate this file

. /root/.bashrc

Aquire and Build KDE as root

If something fails you may need to make clean and rm CMakeCache.

If Something Isn't Found

Often times a build will fail with an error message similar to the following:

Could not find a package configuration file provided by "ECM" (requested
version 1.0.0) with any of the following names:

    ECMConfig.cmake
    ecm-config.cmake

   Add the installation prefix of "ECM" to CMAKE_PREFIX_PATH or set "ECM_DIR"
   to a directory containing one of the above files.  If "ECM" provides a
   separate development package or SDK, be sure it has been installed.

The error message is somewhat misleading (unless you're the developer of the package). This essentially means a module is missing that contains "ECM," or (in this case) extra-cmake-modules. If you're lucky, the package is part of the kde project, and you can follow the format of the separate modules below, substituting the package name as needed.

cmake

Install the latest version of cmake:

cd
wget http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz
tar xvzf cmake-2.8.10.2.tar.gz
cd cmake-2.8.10.2
./configure && make -j4 && make install

extra-cmake-modules (ECM)

cd
git clone kde:extra-cmake-modules
cd extra-cmake-modules
cmakekde

automoc

automoc is needed for akonadi.

cd
git clone kde:automoc
cd automoc
cmakekde

libattica

cd
git clone kde:attica
cd attica
cmakekde

shared desktop ontologies

shared desktop ontologies is needed by kdepimlibs in order to build Nepomuk (which is a part of kdelibs)

cd
wget http://downloads.sourceforge.net/project/oscaf/shared-desktop-ontologies/0.10.0/shared-desktop-ontologies-0.10.0.tar.bz2
tar xvjf shared-desktop-ontologies-0.10.0.tar.bz2
cd shared-desktop-ontologies-0.10.0/
cmake . && make && make install

soprano

cd
git clone kde:soprano
cd soprano
cmakekde

phonon

Phonon is needed for kdebase-runtime

cd
git clone kde:phonon
cd phonon
cmakekde

akonadi

Akonadi keeps personal information management data in a mysql database. It is needed for KDEPIMLIBS.

cd
git clone kde:akonadi
cd akonadi
cmakekde

kdelibs

KDELIBS requires an out-of-source build, that is why it is more complicated to build:

cd
git clone kde:kdelibs
mkdir kdelibs-build
cd kdelibs-build
cmakekdelibs

Verify it has been correctly installed - the following must be possible:

kde4-config --prefix
/usr/local

nepomuk-core

cd
git clone kde:nepomuk-core
cd nepomuk-core
cmakekde

kdepimlibs

kdepimlibs is needed for kde-runtime.

cd
git clone kde:kdepimlibs
cd kdepimlibs
cmakekde

kactivities

kactivities is needed for kde-workspace.

cd
git clone kde:kactivities
cd kactivities
cmakekde

kdebase

cd 
git clone kde:kde-baseapps
git clone kde:konsole
git clone kde:kde-workspace
git clone kde:kde-runtime 
cd kde-baseapps
cmakekde
cd
cd konsole
cmakekde
cd
cd kde-workspace
cmakekde
cd
cd kde-runtime
cmakekde

Next step

Now you can start developing. Best, install QtCreator:

yast -i qt-creator

And learn how to create a new KDE project or import an existing one by reading qtcreator.


This page was last modified on 30 December 2015, at 17:54. This page has been accessed 51,517 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal