Getting Started/Build/Distributions/Linux From Scratch

Jump to: navigation, search



Building KDE4 From Source (Linux From Scratch requirements) NOTE: This page is a little out of date. I will be working on it. You might also want to consult the current SVN of Beyond Linux from Scratch for current package versions and build information.
Tutorial Series   Getting Started
Previous   Build KDE, D-Bus Configuration
What's Next   Build KDE
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.

HAL, PolicyKit & EggDBus are being phased out and may not be needed.

Newer versions of KDE-4.x should install:


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 versions stated above or 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
./b2 install link=shared


Current KDE-4 works with the current release available here:

Use CMake to build it.

NOTE: Older versions of KDE and Strigi <= 0.7.5 requires version 0.9.21b.



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.

KDE >= 4.4

You can use the GIT clone [see TRUNK above], or your can use the latest release of QT-4.x.y 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 (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 may not build against older releases of OpenSSL without being patched:

For current releases, be sure to enable MD2:


when building OpenSSL.

Check the BLFS SVN for a possible corrections to the build scripts.

Set the: "QTDIR" environment variable correctly and then build QCA with:

./configure --prefix=$QTDIR
make install

Then build the plugins with

make install


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

Get current release here:

and the current release of the dependency QJson here:


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


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

Get the current releases of:



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 might need to use:


to point to your Berkeley DB directory.

If Redland won't build against SQLite, be sure you have the current >= 3.7.3 installed:

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:


Check the BLFS SVN for other parameters.

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


KDE Supporting dependencies


use KDESupport:

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.6

There is no KDESupport-4.6 so, you need to install these packages with:



CMAKE_INSTALL_PREFIX:PATH=/opt/KDE-4.6.x for a release.

Available here:<version>

Available here:

Available here:

Available here:

Available from Source Forge:

Available here:

Available here:

Available from SourceForge:

NOTE: Strigi >= 0.7.6 is needed to use the current release of Clucene.


Available from Source Forge:
KDE 4.4 & 4.5

Use KDESupport:

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 KDESupport 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 and TRUNK:

Do not use the version in KDE Support. Remove if from KDE Support:

svn rm phonon

See below


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


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})
-  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})


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:



Required for KDE >= 4.4 and TRUNK.

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

git clone git://

Or the release from Source Forge:

and install with CMake with:




Phonon has been moved to

Get it with the command:

git clone git://
KDE >= 4.5

The current release of Phonon is available here:<version>/src

Also install back ends as needed. You must install a back end -- either GStreamer or Xine for Linux. They are available here:<name>/4.4.4/<version>/src

Where <name> is one of:


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

Use the version in KDESupport-4.4.


Install with:


and the rest of the CMake parameters the same as KDESupport or Supporting dependencies.


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:


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 @@
-                                         ${POLKITQT-1_AGENT_LIBRARY}
+                                         ${POLKITQT-1_LIBRARIES} 
 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})


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



You should have this installed with a prefix: "/usr". All you need to do is build KDE-4 with:


However there appears to be a problem 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 a dependency for 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 or didn't use KDESupport, 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.


v4l-utils and Libv4l

Only required for KDE >= 4.4 and TRUNK

Get the current release here:

and follow the build instructions in the INSTALL 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