Languages: عربي | Asturianu | Català | Česky | Kaszëbsczi | Dansk | Deutsch | English | Esperanto | Español | Eesti | فارسی | Suomi | Français | Galego | Italiano | 日本語 | 한국어 | Norwegian | Polski | Português Brasileiro | Română | Русский | Svenska | Slovenčina | Slovenščina | српски | Türkçe | Tiếng Việt | Українська | 简体中文 | 繁體中文
|Tutorial Series||Getting Started|
|Previous||[[../|KDE SVN Quickstart Guide]]|
|What's Next||[[../|KDE SVN Quickstart Guide]]|
Some or all of these packages should be available for installation from your distribution. For ease of installation and upgrading it is a good idea to install distribution packages if a recent enough version is provided. Software required to build KDE4 includes:
D-Bus is the messaging framework used to allow different programs on the system to communicate with each other. It is used by both Qt and KDE.
Get dbus from your distribution, current stable release is version 1.4. Additionally you will also need dbus-glib. Be sure to also install the corresponding lib- and -devel packages.
D-Bus 1.4.0 or higher is highly recommended as it fixes a bug when multiple threads access the same session bus. D-Bus 1.2 series should work (aside from that issue) but you should upgrade as soon as feasible.
Next we need to get Qt4. As at 2011-03-01 both KDE 4.6 and master require Qt 4.7. Most distributions package a recent enough Qt to build KDE, although you may need to add an extra repository to do so.
At some stage, KDE master may switch to relying on a development version of Qt, or may require patches to Qt for bug-fixes that have not yet been released by Qt. In this case you may need to build your own copy of Qt and it is recommended that you use the qt-kde when this happens.
Note that you need to install Qt and Phonon from Qt and then later to install Phonon KDE from git at the same location. This will ensure you get sound in Qt-based applications as well as in KDE ones.
This recipe assumes you have set up the recommended KDE scripts, environment variables, and git configuration.
cd <your source directory> git clone kde:qt-kde ./configure [copy/paste configure line from README.kde-qt replacing <installdir> with $QTDIR] cmakekde
This recipe assumes you are not using the recommended scripts and have properly set up your own environment.
cd <your source directory> git clone git://anongit.kde.org/qt-kde cd qt-kde ./configure [copy/paste configure line from README.kde-qt make -j2 # use 'make -j(X+1)' where X is your number of processors, to compile faster make install
If ./configure produces errors about missing headers, run the following command before trying again:
Make sure which qmake delivers something out of $QTDIR, e.g.:
If you get "error: X11/Xlib.h: No such file or directory", install the devel package of xorg (the actual name may vary between operating systems, for example it is xorg-dev on Ubuntu based systems such as Kubuntu).
If you get an error in the configure step about missing defines, check the value of $QMAKESPEC. Some distributions set this to point directly to the system-installed Qt. If unset QMAKESPEC solves the problem, you probably want to add it to the ~/.bashrc script.
If you get an error ".pch/debug-shared/QtCore", this is because Qt-4.3 enables precompiled headers if your gcc supports it, but for some reason it doesn't work for you. If you use distcc, configure qt with -no-pch. If you use icecream, update to the latest icecream from svn trunk.
Try running any Qt program, like assistant.
It's nice to have the Qt documentation locally for nice integration with KDevelop, and doing this is really quite easy (also shown in README.kde-qt):
cd $KDE_SRC/qt-kde make docs ./config.status make install
Note that it is necessary to do this only once, even if you rebuild Qt later.
|You can use qdbusviewer to see if you have org.freedesktop.hal. If not, you might need a newer version of hal. If you have org.freedesktop.hal, you probably don't need to, and don't want to, roll your own HAL.|
If your system requires you to build a newer version of HAL, there's a decent chance you'll need to build other stuff as well, some of which may not be straight forward. This, however, should only be required for older distros.
git clone git://anongit.kde.org/automoc.git
Please note that automoc should be built FIRST from git as a kdesupport dependency.
git clone git://anongit.kde.org/attica.git
git clone git://anongit.kde.org/polkit-qt-1.git
It is recommended to have polkit >= 0.98, however Polkit-Qt-1 will build with any polkit-1 version.
git clone git://anongit.kde.org/soprano.git
git clone git://anongit.kde.org/akonadi.git
Please note that Akonadi should come AFTER Soprano in the build.
Cagibi is a runtime dependency for UPnP.
git clone git://anongit.kde.org/cagibi.git
For all the above you build by doing:
cd <dir> (<dir> being either automoc, akonadi, attica, polkit-qt-1 or soprano or cagibi) mkdir build cd build cmake .. -DCMAKE_INSTALL_PREFIX=$KDEDIR -DCMAKE_BUILD_TYPE=debugfull \-DKDE4_BUILD_TESTS=TRUE make make install
|Don't forget to read the Setting Up The Environment section first.|
There are several libraries that KDE applications rely on in the kdesupport module. This includes Strigi and Soprano for file metadata and search, QImageBlitz for image manipulation needed in kdebase, eigen for visual effects in applications such as Kalzium, taglib for music players and qca for some cryptographic needs.
Strigi itself has a few dependencies as well: you will need the libraries and headers for libz, libbz2, openssl (libcrypto or libssl), libclucene (>=0.9.16a but watch out: version 0.9.17 does not work), and either libxml2 or libexpat.
cs # 'cs' is a bash function, click here to learn more svn checkout svn://anonsvn.kde.org/home/kde/trunk/kdesupport/ cd kdesupport cmakekde
We change to the base source directory (line 1). We download the sources in kdesupport using subversion (line 2), go into the new ~/kde/src/kdesupport directory (line 3), and commence the build (line 4). This will leave us in the kdesupport build directory after the build is completed.
If you get
cmakekde: command not found
then you have to go manually into the kdesupport directory in ~ and execute the command cmakekde. if this still doesn't work, then something is wrong with your bashrc.
If you get
CMake Error: This project requires some variables to be set, and cmake can not find them. Please set the following variables: LIBXML2_INCLUDE_DIR (ADVANCED)
you should install the development package for libxml2.
If you get
CMake Error: Could NOT find REDLAND
then you need librdf from the Redland. If your distribution does not provide the librdf package, you can download the source there: http://download.librdf.org/source/ and build it. (Gentoo users: The ebuild for librdf is named dev-libs/redland)
If you get
Fetching external item into 'kdesupport/admin' Error validating server certificate for 'https://...'
If you get
FILE cannot create directory: /usr/lib/qt4/plugins/crypto. Maybe need administrative privileges. make: *** [install] Error 255
take a second look in the .bashrc file described above, are paths correct? ($QTDIR and $PATH are used to get the QT installation path) Alternatively, you may see this error if you decided to use a distribution installed version of qt4 and skipped the Qt install above. Either install qt-kde as describe above, or "sudo make install". If you use "sudo make install", make sure that you change the ownership back to your user for some of the ~/kde subdirectories that were effected by using sudo (ie. "sudo chown -R kde-devel:kde-devel ~/kde").
If you get a message related to
target libQtTest.so not found
you may need to recompile qt-kde. This time you should take out
-nomake demos -nomake examples
from the configure command, so that Qt generates library QtTest.
If you get
CMake Error: Qt qmake not found!
1) uncomment Qt section in .bashrc script (QTDIR, QT_PLUGINS_DIR, PKG_CONFIG_PATH variable settings). 2) source ~/.bashrc 3) cd && cd qt-kde 4) make confclean 5) repeat steps for installing Qt (from ./configure line). 6) retry building kdesupport
If you get
"CMake Error: Could NOT find BZip2"
sudo apt-get install libbz2-dev
If you get
message that MySql support cannot be enabled
you need to install corresponding devel package. (libmysqlclient-devel for SuSe 11.1)
You need to build it as Phonon from Qt is not enough for KDE sound to work.
cs # 'cs' is a bash function, click here to learn more git clone git://anongit.kde.org/phonon.git cd phonon cmake -DCMAKE_INSTALL_PREFIX=$QTDIR -DCMAKE_BUILD_TYPE=debugfull make make install
Note that you need to install this Phonon in the same location than Phonon from Qt i.e. in $QTDIR.
Building the main Phonon module is sufficient for building KDE. If you also want to play sound then you need to build a backend. Choose a suitable backend from those available below:
git clone git://anongit.kde.org/phonon-directshow.git git clone git://anongit.kde.org/phonon-gstreamer.git git clone git://anongit.kde.org/phonon-mmf.git git clone git://anongit.kde.org/phonon-quicktime.git git clone git://anongit.kde.org/phonon-waveout.git git clone git://anongit.kde.org/phonon-xine.git
If you get an error like
designer: symbol lookup error: /path/to/kde/lib/kde4/plugins/phonon_backend/phonon_xine.so: undefined symbol: _ZN6Phonon12PulseSupport11getInstanceEv
while running Qt Designer you need to:
Since the 26th April 2010, DBusMenu is a new dependency for kdebase. You can either get it from http://people.canonical.com/~agateau/dbusmenu/index.html as a tarball (latest is libdbusmenu-qt-0.6.3.tar.bz2) or from its it repository
cs # 'cs' is a bash function, click here to learn more git clone git://gitorious.org/dbusmenu/dbusmenu-qt.git dbusmenu cd dbusmenu mkdir build cd build cmake .. -DCMAKE_INSTALL_PREFIX=$KDEDIR -DCMAKE_BUILD_TYPE=debugfull \-DKDE4_BUILD_TESTS=TRUE make make install
You need json to build the tests.
If your version is not correct, you will lose the context menu for the systray icons.
cs # 'cs' is a bash function, click here to learn more svn co https://oscaf.svn.sourceforge.net/svnroot/oscaf/trunk/ontologies cd ontologies mkdir build cd build cmake .. -DCMAKE_INSTALL_PREFIX=$QTDIR -DCMAKE_BUILD_TYPE=debugfull make make install
Once all requirements have been installed it is time to install [[../#kdelibs|kdelibs]]