Getting Started/Build/Distributions/Linux From Scratch

< Getting Started‎ | Build‎ | Distributions
Revision as of 14:15, 27 August 2010 by JRT (Talk | contribs)

Jump to: navigation, search



Building KDE4 From Source (Linux From Scratch requirements)
Tutorial Series   Getting Started
Previous   Build KDE4.x, D-Bus Configuration
What's Next   Build KDE4.x
Further Reading   Introduction to CMake


KDE-4 and some supporting libraries use CMake.

Install the latest version from

Library Requirements

General dependencies

KDE-4 requires a lot of the same general purpose libraries as KDE-3.

The output from running CMake should list what you are missing -- which generally applicable libraries that you need which I will not discuss further.

DBus and HAL

A system should have these installed:


(and properly configured) although, strictly speaking, they are not all dependencies for KDE-4.x.

See: BLFS for build and configure instructions.

HOWEVER, KDE-4 and KDESupport libraries may need newer versions of the libraries than those in BLFS. So, it is probably best to install the latest releases of these dependencies rather than the versions in BLFS.

Some of these libraries are dependent on:


which should be installed and configured according to the BLFS instructions.

DocBook DTD

KDE-4 still requires version 4.2 of:

DocBook XML DTD.

See the instructions in this old version of BLFS:

Boost C++ Libraries

Get the current release (e.g. boost_1_42_0.tar.gz) here:

The current release eliminates the arcane naming issues. Although not the same as using autotools, it is now simple to build and install.

Remove the includes from previous versions:


and if you have a link:


remove that also.


./ --prefix=/usr
./bjam install


The CLucene developers suggest using the GIT repository since there are no recent releases. However, KDE-4 currently depends on the last (old) release:

Do NOT use CMake to build it.



Use kde-qt from:

git clone git://

This installs as Qt-<version>, so when it updates to the next version, it won't install in the same place. This means that you will need to change the <version> any place where it is specified. You will also have to install QCA (and its plugins) again when the version changes.


You can use the GIT clone [see TRUNK above], or your can use the latest release of QT-4.6.x from Nokia:
BRANCH up to 4.3 or a release up to 4.3.x

Use 4.5.3:

Or a newer release (see above). A newer release may have issues.


You will probably need to use some options for configuring Qt. Various options may be appropriate and/or needed depending on your system, what you have installed, and where it is installed. Run:

 ./configure --help

to see the options. There are a lot of them, but the defaults work for most of them.

Suggested configuration:

./configure -no-separate-debug-info -plugin-sql-mysql -I/usr/include/mysql -plugin-sql-sqlite -optimized-qmake -nomake demos -nomake examples -fast -dbus

{change the include directory for mysql as needed}

If installing Phonon from KDESupport (recommended), or other separate Phonon, add the configure option:


to avoid having two versions of libraries with the same SO number.

QCA-2.0.2 (crypto add on for Qt)

Do not use the one in KDESupport or KDE's SVN.

Download the current release of qca from:

and the plugins:



NOTE: qca-ossl-2.0.0-beta3 will not build against the current release of OpenSSL without being patched:


Required for KDE >= 4.5.0. Appears to be optional for KDE-4.4.

Get release >= 0.3.5 here:

and the current release of the dependency QJson here:


If you don't have Getfem++ installed, get the current release of GMM from:

Qzion and Qedjie

Get them:

You also need the dependency EET. Get either the snapshot there o the current release here:

PROBLEM: KDE requires QEdje >= 0.4.0 which depends on QZion >= 0.4.0 and the 0.4.0 release of QZion will not build.

If it won't build, check line 13 of the file:

... /qzion-mainline/python/qzion/qzionobject.sip

It should be:

const char *name;


Get the current 2.0.x release from:

Java Development Kit

You need a Java compiler with JNI to build the Sesame2 storage backend for Soprano and a Java RunTime (JVM) to run it.

Remember to add the "bin" directory to your path and the "lib" directory to your "/etc/" file.

Raptor, Rasqal, and Redland




Note: newer versions of Redland don't work.

and the current release of the (optional) Redland dependency 3Store here:

Note: If 3store3-3.0.17 will not build against Rasqal, then skip it for now -- it is optional.

When building Redland, you will probably need to use:


to point to your Berkeley DB directory.

If your installed SQLite is > 3.6.16, you will probably have to configure Redland with:


Install in this order:


Virtuoso Open-Source

Only needed for KDE >= 4.4 and TRUNK

Get virtuoso-opensource >= 6.1.1 here:

If you have problems, use the direct link:

and the current release of the dependency iODBC here:

If building iODBC only for KDE, use configure parameter:


For building Virtuoso, these configure parameters are useful:


If building Virtuoso only for KDE, (to save disk space) use configure parameter:





svn co svn://

If you don't want to install all the small SVN icons:

cd kdesupport/oxygen-icons
svn rm `find -name "small"`
KDE >= 4.4


svn co svn://<version>

This does not include: Ontologies. See below.

BRANCH up to 4.3 or a release up to 4.3.x

Use the SVN tag that matches your KDE version. E.G. for 4.3:

svn co svn://

Since TagLib is also a dependency for GStreamer (gst-plugins-good), you probably don't want to have a redundant installation for the KDE-4 version that will be your 'production' version. Remove it from KDESupport SVN:

svn rm taglib

And install the current release from:

NOTE: To get GST Plugins Good to build the plugin for TagLib you need to set the environment variable:


before you run: "configure".


The QCA in KDESupport is not currently used (see QCA-2.0.2 above) so:

svn rm qca

For KDE Support >= 4.5:

The Phonon TRUNK has moved to Gitorious. To use the GIT TRUNK instead of the version in KDE Support first remove if from KDE Support:

svn rm phonon

then change the directory where you want to download (e.g. /user/GIT) and:

git clone git://

Since there are version issues, install it with the same CMAKE_INSTALL_PREFIX as KDE.


The current KDESupport may not be compatible with LFS installed FFmpeg. Use this patch:

------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------ Index: strigi/src/streamanalyzer/endplugins/CMakeLists.txt


--- strigi/src/streamanalyzer/endplugins/CMakeLists.txt (revision 1096146) +++ strigi/src/streamanalyzer/endplugins/CMakeLists.txt (working copy) @@ -34,9 +34,3 @@

  target_link_libraries(xine ${XINE_LIBRARY})

-if(FFMPEG_FOUND) - include_directories(${FFMPEG_INCLUDE_DIRS}) - ADD_STRIGIEA(ffmpeg ffmpegendanalyzer.cpp) - #set_target_properties( ffmpeg PROPERTIES COMPILE_FLAGS "${FFMPEG_DEFINITIONS}" ) - target_link_libraries(ffmpeg ${FFMPEG_LIBRARIES}) -endif(FFMPEG_FOUND) ------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------

Or, use the FFmpeg snapshot on the CBLFS page:

This more recent snapshot requires: "". The x264 snapshot on CBFLS is too old. This Source RPM worked:


Google is your friend.

NOTE: You may need to add these parameters to the CMake command line:


You must build with the same CMake parameters as the KDE-4 modules; specifically:



Only needed for KDE >= 4.4 and TRUNK.

If you checked out KDESupport from TRUNK, you have the package. Otherwise, get it here:

svn co

and install with the same CMake parameters as KDESupport.



Phonon has been moved to

Get it with the command:

git clone git://

and install with the same CMake parameters as KDESupport.


KDEBindings-4.4.x will not build against Phonon from the GIT repository.

Use the version in KDESupport-4.4.


KDE >= 4.4 and TRUNK


The 0.95.1 tarball from the KDE FTP site will not install correctly. You need to apply this patch:

------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------ diff -Naur polkit-kde-1-0.95.1.old/agent/CMakeLists.txt polkit-kde-1-0.95.1/agent/CMakeLists.txt --- polkit-kde-1-0.95.1.old/agent/CMakeLists.txt 2009-12-23 04:31:29.000000000 -0700 +++ polkit-kde-1-0.95.1/agent/CMakeLists.txt 2010-03-25 15:54:12.000000000 -0700 @@ -11,7 +11,7 @@




configure_file( ${CMAKE_BINARY_DIR}/polkit-kde-authentication-agent-1.desktop)

@@ -25,4 +25,4 @@

  set (DESKTOP_INSTALL_DIR /etc/xdg/autostart)

-install(FILES ${CMAKE_BINARY_DIR}/polkit-kde-authentication-agent-1.desktop DESTINATION ${DESKTOP_INSTALL_DIR}) +install(FILES ${CMAKE_BINARY_DIR}/polkit-kde-authentication-agent-1.desktop DESTINATION ${KDE4_AUTOSTART_INSTALL_DIR}) ------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------

You must build with the same CMake parameters as the KDE-4 modules; specifically:



For KDE < 4.5

Get the current release from:

You need to install this with the same prefix as KDE4 (even if you already have it installed in "/usr") to eliminate missing MIME type errors. Currently, KDELibs won't build unless you do this. And, even if it does, you will get run time errors -- popup windows saying that certain MIME types can not be found.

This appears to be a bug that was fixed with KDE-4.5; for ealier versions this workaround does seem to work.

KIPI Plugins

Get the current release from:

This package is dependent on KDEGraphics. The package has a lot of optional dependencies which you need to satisfy only if you want the corresponding plugins built. You should install it in the same directory where you installed KDE-4.x.y.

Be sure that you updated your: "PKG_CONFIG_PATH" to include $CMAKE_INSTALL_PREFIX/lib/pkgconfig (for example):


Oxygen Icons

If you checked out KDESupport from TRUNK or the TAG: "kdesupport-for-<version>", you have them.

If you checked out KDESupport from a tag "kdesupport-<version>" up to 4.3, you need to get them. If you are using SVN, that would be:

svn co svn://<version>/oxygen-icons

{where <version> is the latest release for the branch you are using (e.g. 4.3.4 for the 4.3 branch)}

Or, you can simply use TRUNK:

svn co svn://


TRUNK and KDE-4.4 require libssh. Get the current release >= 0.4.0 from:

Dependencies for specific KDE modules


SIP and PyQt

To build the Python bindings for KDE, you need the current releases of SIP and PyQt from here:

Install: "SIP" first and then: "PyQt". These are both Python add-ons so they install with:

make install
Build Notes for PyQt

Unless you want to get into serious complications, you should only build PyQt against one version of Qt and you should only install one version of KDEBindings. If you try to build against multiple versions of Qt or install multiple versions of KDEBindings, with a single instance of Python (or other languages), you will install two versions of the same file in the same place.

PyQt will find Qt based on your environment variables. So, if you want to install for a version of KDE other than the one that you are currently using, be sure that these are set correctly:


KDEBindings is dependent on KDEGraphics (specifically Okular).

Other language dependencies are optional. If you have other supported languages installed on your system, installing KDEBindings will build bindings for them.


QScintilla2 is optional. If you are installing it, get it here:

Install it after SIP & PyQt. It has a Qt build system, so install for Qt4 it with:

cd Qt4
make install


KDEEdu might be dependent on KDEBindings.



Only required for KDE-4.4 and TRUNK

Get the current release here:

and follow the build instructions in the README file.

Optional Dependencies

Telepathy-Qt4 is the Qt bindings for Telepathy. Since this has general usage, you should probably install it along with its semi-optional dependency telepathy-glib.

Get the current releases here:

Install: "telepathy-glib" first and then: 'telepathy-qt4".

The output from CMake lists several other optional dependencies. It appears that these are needed to support specific functions in KDENetwork. So, if you need those functions, you need to install them. You will probably also need to install the corresponding Telepathy addons from here:

TO DO: more information needed.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal