Difference between revisions of "Getting Started/Build/KDE4 (gl)"

Jump to: navigation, search
(D-Bus)
(CMake: Traducción ó galego (Precisa revisión))
Line 290: Line 290:
  
 
== CMake ==
 
== CMake ==
Skip this if you have [http://cmake.org/ CMake] >=2.4.5 installed.
+
Podes saltarte esta sección se tes instalado [http://cmake.org/ CMake] versión 2.4.5 ou superior.
You should be able to directly use the binary packages available on the [http://www.cmake.org/HTML/Download.html CMake site]. There are also distribution specific packages available.
+
  
=== The Recipe ===
+
Deberías poder usar directamente os binarios dispoñibles na [http://www.cmake.org/HTML/Download.html páxina de CMake]. Tamén tes paquetes específicos para distintas distribucións.
<!--'cs' and 'cb' are NOT typos!-->
+
 
 +
=== A receita ===
 +
<!--¡'cs' e 'cb' NON son erratas!-->
 
   
 
   
  cs # [[Getting_Started/Increased_Productivity_in_KDE4_with_Scripts/.bashrc|'cs' is a bash function, click Here to learn more]]  
+
  cs # [[Getting_Started/Increased_Productivity_in_KDE4_with_Scripts/.bashrc|'cs' é unha función bash, prema aquí para saber máis]]
 
  wget http://www.cmake.org/files/v2.4/cmake-2.4.6.tar.gz
 
  wget http://www.cmake.org/files/v2.4/cmake-2.4.6.tar.gz
 
  tar -zxf cmake-2.4.6.tar.gz
 
  tar -zxf cmake-2.4.6.tar.gz
Line 305: Line 306:
 
  sudo make install
 
  sudo make install
  
=== What's Happening ===
+
=== ¿Que acontece? ===
First, we go back to the <tt>kde-devel</tt> user's source directory (line 1), get the CMake sources (line 2) and unpack them (line 3). We create a directory to build CMake in (line 4) and go into it (line 5). We then run the CMake bootstrap script to set up the CMake build (line 6), then make (line 7) and install it (line 8) using the root user.
+
Primeiro imos ó directorio das fontes do usuario <tt>kde-devel</tt> (liña 1), descargamo-las fontes de CMake (liña 2) e descomprimímolas (liña 3). Creamos un directorio onde construir CMake (liña 4) e entramos nel (liña 5). Executamo-lo guión autosuficiente de CMake para configura-la súa construcción (liña 6), construímolo (liña 7) e instalámolo usando o usuario root (liña 8).
  
If your system does not have the <tt>sudo</tt> command, you can instead do <tt>su -c "make install"</tt>.
+
Se o teu sistema carece do comando <tt>sudo</tt> podes executar <tt>su -c "make install"</tt> no seu canto.
  
 
== Qt ==
 
== Qt ==

Revision as of 14:02, 21 August 2007


Contents

Getting_Started/Build/KDE4


{{{3}}}
 
noframe
Esta é unha tradución incompleta.
Atención



Introdución

Este tutorial mostra un xeito de obter KDE dende o trunk, usando sistemas baseados en Linux ou BSD. Hai tamén tutoriais para FreeBSD, Windows, Mac OS X e Solaris. Ao longo do tutorial será usada intensivamente un terminal de tipo bash.

{{{3}}}
 
noframe
Os luns córrese un maior risco de erros na compilación, pois é cando se suben os cambios nas kdelibs. O dashboard avisa desas rupturas imprevistas. Animámosche a corrixir os módulos que faien.
Atención


Software necesario

O seguinte debe estar instalado no teu sistema para poder rematar este manual de xeito satisfactorio:

  • gcc e g++ do proxecto gcc, preferíbelmente a versión 4.1 ou superior
  • svn, o cliente do sistema de control de versións Subversion.
  • pkg-config
  • librerias de desenvolvimento e cabeceiras de X11, OpenGL (mesa-common-dev e libglu1-mesa-dev), libjpeg, libpng, libungif, libclucene, librdf, libxml2 e libxslt
  • O script makeobj, que é parte de kdesdk. Podes instalalo como parte do kdesdk, (kdesdk-scripts en Debian) ou similar, ou simplemente descarregalo do WebSVN
  • O paquete shared-mime-info, que é o estándar MIME de freedesktop que está a usar KDE.
  • boost, necesitado por kdebase; logo de compilar e/ou instalar boost, para que cmake saiba onde se atopa (FindBoost), engade o directorio de boost (o que conten o subdirectorio) ao CMAKE_INCLUDE_PATH ou engade unha variábel de entorno chamada BOOST_ROOT apuntando ao directorio de boost.

Ark Linux

En Ark Linux, as dependenzas para a compilación instálanse asi:

apt-get install devel-core libxml-devel libxslt-devel bzip2-devel \ clucene-devel librdf-devel shared-mime-info xorg-Mesa-libGL-devel \ subversion boost-devel doxygen giflib-devel dbus-devel openssl-devel \ alsa-lib-devel kdesdk-scripts qt4-devel

Se prefires unha interface gráfica, selecciona os pacotes listados enriba na ferramenta de "Install Software" no Mission Control. Isto inclue a instalación de CMake, DBus e Qt, polo que podes pasar dos pasos 5, 6 e 7.

Kubuntu

En Kubuntu 7.04 (Feisty) (e, posibélmente 7.10) as dependencias para a compilación que tes que ter instaladas fanse asi: sudo aptitude install build-essential cdbs debhelper cmake \ libxml2-dev libxslt1-dev libbz2-dev libclucene-dev librdf-dev \ shared-mime-info libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev \ libxext-dev libjpeg-dev libpng-dev subversion libsm-dev libxinerama-dev \ libxrender-dev libfontconfig-dev libboost-dev libxcursor-dev doxygen \ libungif4-dev libdbus-1-dev libgpgme11-dev libssl-dev libgpgme11-dev \ libasound2-dev kdesdk-scripts

Podes evitar a instalación manual de CMake 2.4.6 e DBus facendo: sudo aptitude install libdbus-1-dev cmake

Para ter un framework completamente funcional para a documentación do API tamén precisarás: sudo aptitude install graphviz

openSUSE

En openSUSE 10.2 e posteriores, podes instalar pacotes usando a ferramenta Zypper: sudo zypper install <package-name>

En versións vellas de SUSE, podes usar YaST: su yast -i <nomepacote>

Pacotes precisos

Os pacotes que precisarás instalar son os seguintes: xorg-x11-devel libxml2-devel kdesdk3 clucene-core-devel boost-devel libjpeg-devel liblrdf-devel libpng-devel libxslt-devel libredland-devel Mesa-devel giflib-devel subversion gcc gcc-c++

Pacotes opcionais

Podes saltar a instalación de Qt 4.3, CMake 2.4.6 e DBus engadindo o repositorio do Servizo de Compilación de KDE 4 de openSUSE (openSUSE Build Service KDE4 Repository) ás tuas fontes de compilación.

Para openSUSE 10.2 e superior fai: sudo zypper service-add http://software.opensuse.org/download/KDE:/KDE4/openSUSE_10.2 KDE4-102

Para versións antigas de SUSE Linux fai: su installation_sources -a http://software.opensuse.org/download/KDE:/KDE4/[A TÚA VERSIÓN DE SUSE]

Agora instala os seguintes pacotes (e as suas dependencias): cmake dbus-1-devel libqt4-devel

Para ter un framework completamente funcional para a documentación do API tamén precisarás: graphviz

Pacotes cos binarios de CMake para openSUSE están disponíbeis no servizo de compilación de openSUSE.

Gentoo

Instalar a man

Para ter as ebuilds máis estábeis lembra sincronizar a árbore de portage antes de comezar.

Precísase que estean unmasked e/ou mantidas(kept) nunha versión anterior para continuar.

  1. echo 'x11-libs/qt' >> /etc/portage/package.unmask
  2. echo 'dev-util/cmake' >> /etc/portage/package.unmask
  3. echo 'dev-cpp/clucene' >> /etc/portage/package.unmask
  4. echo '>dev-cpp/clucene-0.9.16a' >> /etc/portage/package.mask

Comproba que tes activada a bandeira berkdb USE para redland, ou nepomuk non funcionará:

  1. echo 'dev-libs/redland berkdb' >> /etc/portage/package.use


Estes son os pacotes que tes que instalar, moitos deles xa estarán instalados no teu sistema, polo que podes saltalos engadindo a bandeira de update en emerge.

$ emerge -avu ebuild/name

sys-devel/gcc
dev-util/subversion
dev-util/pkgconfig
x11-base/xorg-x11
media-libs/glut
media-libs/mesa
media-libs/jpeg
media-libs/libpng
media-libs/giflib
dev-cpp/clucene
dev-util/cppunit
media-libs/liblrdf
dev-libs/libxml2
dev-libs/libxslt
x11-misc/shared-mime-info
kde-base/kdesdk-scripts
dev-libs/boost
x11-libs/qt
dev-util/cmake
sys-apps/dbus
dev-libs/redland

Supondo que emergeaches esas ebuilds, podes saltar os pasos de compilación a man e proceder á sección de kdesupport.

Boa sorte!

Instalar via portage

Podes instalar os pacotes de KDE4 directamente via: emerge -a <packagename>

Para conseguir as cousas que precisas, install layman e and then pull in the KDE overlay (que contén ebuilds experimentais de KDE): layman -a kde Logo disto precisas axustar algunhas bandeiras USE KDE 4 e dicirlle a portage que use as ebuilds de proba de KDE 4 en lugar das estábeis de KDE 3.

Deste xeito portage encargarase das dependencias por ti.

Instrucións detalladas sobre compilar KDE 4 en Gentoo via portage podes atopalas no wiki de overlay sobre KDE. Tamén fálase no fío: KDE 4 monolithic ebuilds.

Crear unha conta de usuário para o desenvolvimento de KDE 4

{{{3}}}
 
noframe

Algunha xente usa contas de usuário separadas para KDE 4 (por se, por exemplo, un bug elimina arquivos por erro), as instrucións a seguir están escritas segundo esa aproximación.

Sen embargo, é moito máis eficiente ter todo nunha simple conta de usuario, bótalle unha ollada a Productividade mellorada con guións de shell en KDE 4 para máis detalles.

De todos os xeitos, podes seguir as instrucións de abaixo, pero non poñas variábeis de entorno no teu .bashrc, ponas nun arquivo separado das tuas fontes para intercambialo co entorno de KDE 4.

Nota


Opción 1: Liña de comandos

useradd -m kde-devel passwd kde-devel

Opción 2: Usando KControl

No canto de usar os comando de enriba, podes usar o módulo de usuario do Centro de Control de KDE, se xa tes instalado KDE 3.

Configurando o entorno

Copia o ~/.bashrc do teu usuario normal á nova conta de kde-devel. De seguir, copia e pega os contidos do .bashrc de exemplo en ~kde-devel/.bashrc. Asegura-te de comentar a liña alias make=makeobj se non tes o comando makeobj disponíbel. Posíbelmente querrás modificar o path (camiño) para ter seguro que non inclue os paths do teu KDE3. Para facelo executar, tes que ter aberta unha nova bash ou executar: source ~/.bashrc

Isto proporcionará aceso aos comandos como cmakekde que son usados ao longo deste tutorial asi como asegurará que os paths aos binarios de Qt, KDE e CMake están correctamente.

Para máis información, bótalle unha ollada ao tutorial de Productividade mellorada con guións de shell en KDE 4.

Cambiar a un novo usuário

Para usar o novo usuário kde-devel: (non esquezas o guión) su - kde-devel

A consola do usuario de desenvolvemento

Algúns sistemas están configurados para que os novos usuarios usen /bin/sh por defecto. Se non é o caso no teu podes saltarte esta sección (por exemplo se usas Ark Linux). Traballar con /bin/sh pode ser moi inconvinte, probablemente queras cambiala a /bin/bash ou outra consola.

Opción 1: Coma o usuario kde-devel

Se non tes privilexios de root e o teu sistema soporta o cambio da túa propia consolo co comando chsh, podes cambiala a /bin/bash con: chsh -s /bin/bash kde-devel

Opción 2: Coma usuario root

Se o teu sistema inclúe o comando usermod podes executa-lo seguinte coma root: usermod -s /bin/bash .

Outra opción é executa-lo comando vipw coma root para editar /etc/passwd de forma segura. Procura 'kde-devel' no arquivo e cambia '/bin/sh' no final da liña por '/bin/bash', garda os cambios e sae.

Poderás usa-la nova consola cando voltes a entrar coma usuario kde-devel.

D-Bus

QtDBus e KDE funcionan coas versións de D-Bus 0.62, 0.92 e posteriores. As versións 0.60 e 0.61 tamén poderían funcionar, aínda que non foron probadas. As versións 0.90 e 0.91 non funcionan. Recomendamos usar versións posteriores á 1.0 (polo menos 0.94), considera actualizar se aínda non o fixeches.

Podes salta-la seguinte sección se tes unha versión de D-Bus suficientemente recente ou non desexas actualizala.

Antes de continuar asegúrate ter cabeceiras e bibliotecas X11 dispoñibles. A quinta liña do guión de configuración das seguintes instruccións debería ler:

Building X11 code:        yes

A receita

{{{3}}}
 
noframe
Non esquezas configura-lo entorno adecuadamente, tal coma se describiu na sección Configurando o entorno. É preciso para que as funcións cs e cb funcionen.
Consello


cs # 'cs' é unha función bash, prema aquí para saber máis 
wget http://dbus.freedesktop.org/releases/dbus/dbus-1.0.2.tar.gz
tar -xvzf dbus-1.0.2.tar.gz
cd dbus-1.0.2/
./configure --prefix=$DBUSDIR --localstatedir=/var
make
sudo make install
sudo dbus-uuidgen --ensure

¿Que acontece?

Tras cambiar ó directorio das fontes (liña 1) descárgase o código de D-Bus dende freedesktop.org (liña 2) e descomprímese (liña 3). Éntrase no directorio de D-Bus recén creado (liña 4) e configúrase á construcción usando o guión configure (liña 5). Unha vez D-Bus está construído (liña 6) e instalado (liña 7) usamo-la utilidade dbus-uuidgen para instalar un arquivo de identificación de máquina que permite executar D-Bus automáticamente ó comezo da sesión de escritorio (liña 8).

Ten en conta que precisas ter permisos de escritura en /var para os dous últimos pasos. Se o teu sistema non posúe o comando sudo podes usar su no seu canto, por exemplo su -c "make install".

CMake

Podes saltarte esta sección se tes instalado CMake versión 2.4.5 ou superior.

Deberías poder usar directamente os binarios dispoñibles na páxina de CMake. Tamén tes paquetes específicos para distintas distribucións.

A receita

cs # 'cs' é unha función bash, prema aquí para saber máis
wget http://www.cmake.org/files/v2.4/cmake-2.4.6.tar.gz
tar -zxf cmake-2.4.6.tar.gz
mkdir cmake-build
cd cmake-build 
../cmake-2.4.6/bootstrap
make
sudo make install

¿Que acontece?

Primeiro imos ó directorio das fontes do usuario kde-devel (liña 1), descargamo-las fontes de CMake (liña 2) e descomprimímolas (liña 3). Creamos un directorio onde construir CMake (liña 4) e entramos nel (liña 5). Executamo-lo guión autosuficiente de CMake para configura-la súa construcción (liña 6), construímolo (liña 7) e instalámolo usando o usuario root (liña 8).

Se o teu sistema carece do comando sudo podes executar su -c "make install" no seu canto.

Qt

Next we need to get the Qt4 that is in KDE's source repository. KDE is guaranteed to build against any Qt 4.3. Qt 4.2 and earlier are not supported and will not work. You should use the copy in the KDE Subversion servers. (note: some distros, like Debian, tend to supply Qt with patches from KDE svn applied, so you may want to cheat and use precompiled Qt from your distro)

The Recipe

cd
svn checkout svn://anonsvn.kde.org/home/kde/trunk/qt-copy
cd qt-copy
./apply_patches
./configure -qt-gif -no-exceptions -debug -fast \
 -prefix $QTDIR -nomake examples -nomake demos
make -j2
# if we don't install, we'll just clear obj files to
# save disk space
if [ $QTDIR = `pwd` ]; then \
find . -name '*.o' -exec rm {} \; ; \
else make install; fi;

What's Happening

We switch back to the kde-devel user's home directory (line 1) and download the source code using subversion (svn) from KDE's repository (line 2). After changing into the resulting qt-copy directory (line 3), we run a script that manages the patches that come with qt-copy (line 4).

Once the patches have been applied, we then set up the build using the configure script (line 5-6). The various command line options used are explained in the qt-copy/README.qt-copy file. Finally, we build the minimal requirements for KDE (line 7) and install (line 10) Qt. If install dir is the same as the current dir (line 8), then we just free some space (line 9) instead. If you want all the example and demo applications, you can either build them individually or simply do a make from the qt-copy directory.

Note that the installation does not require root as it installs Qt locally into $QTDIR. Anyway, installation is only needed if $QTDIR differs from $HOME/qt-copy, which is not the case if you have exactly followed the instructions.

Troubleshooting

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. Note: You may need to run xhost +local:kde-devel as your regular kde3 user to run this application. If it crashes in QSpanData::adjustSpanMethods, then your problem is the oxygen style. Try removing lib/kde4/plugins/styles/kstyle-oxygen.so and lib/kde4/plugins/styles/oxygen.so if they exist in the KDE install prefix.

kdesupport

noframe
 
Warning
If you have jumped to this section without reading Setting Up The Environment, the recipes provided will not work. The recipes are not in error; cs and cb are not typos. Your environment needs to be set up correctly for these instructions to work for you.


There are several libraries that KDE applications rely on in the kdesupport module. This includes Strigi and Soprano for file metadata and search, 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.16; version 0.9.17 does not work), and either libxml2 or libexpat.

The Recipe

cs # cs is not a typo
svn checkout svn://anonsvn.kde.org/home/kde/trunk/kdesupport/
cd kdesupport
cmakekde

What's Happening

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.

Troubleshooting

If you get

  cmakekde: command not found

then you have to go manualy into the kdesupport directory in ~ and execute the command cmakekde. if this still doesnt 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://...'

see Using Subversion with KDE

If you get

FILE cannot create directory: /usr/lib[64]/qt4/plugins/crypto. Maybe need administrative privileges.
- - -
make: *** [install] Error 255

take a second look in the .bashrc file described above, are paths correct? 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-copy as describe above, or "sudo make install".

kdelibs

We can now move on to building KDE's base libraries.

The Recipe

cs # cs is not a typo
mkdir KDE && cd KDE
svn checkout svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs
cd kdelibs
cmakekde

What's Happening

We change to the base source directory (line 1) then make and go into the KDE directory (line 2). We download the sources for kdelibs using subversion (line 3), go into the new ~/kde/src/KDE/kdelibs directory (line 4), and commence the build (line 5). This will leave us in the kdelibs build directory after the build is completed.

Ktip.png
 
Tip
There might be missing dependencies on your system! They are easily overlooked in the output of cmakekde. You might want to do a cmake $KDE_SRC/KDE/MODULE_NAME prior to compiling any kde modules (like kdelibs, kdepimlibs etc.)


Additional KDE-specific CMake modules

There are additional CMake modules in kdelibs/cmake/modules/ that are necessary for building KDE4 applications. These will be installed for you when kdelibs itself is installed.

Troubleshooting

If you have problems compiling kdelibs, first make sure the software in the Required Software section above is installed and works. Other possible hints include:

  • If the cmakekde command fails stating that CMake requires an out of source build directory, remove ~/kde/src/KDE/kdelibs/CMakeCache.txt, and try again.

If cmakekde still gives the same error then try this

cd
cmake -DCMAKE_INSTALL_PREFIX=$KDEDIR \
-DCMAKE_BUILD_TYPE=debugfull \
-DKDE4_BUILD_TESTS=ON \
~/kde/src/KDE/kdelibs
make
make install
  • If you received an error stating "Please create a separate build directory and run 'cmake path_to_kdelibs [options]' there.", then you need to change to your build directory before running cmakekde. (e.g cs KDE/kdelibs && cb && cmakekde) If the message stays, run 'svn status' in the kdelibs directory and remove all files labeled with '?'.
  • If Qt wasn't found or the wrong version of Qt was found, make sure that the qmake from the Qt you need is the first qmake in the path.
  • If the problems persist, try the CMake make-option --keep-going.
  • Here you need the libungif library, otherwise you will get an error message like "Could NOT find GIF".
  • Qt-4.3 upgrade: if you get a link error in kjsembed talking about QScriptEngine, edit CMakeCache.txt in kdelibs and remove the lines that talk about QT_QTUITOOLS_LIBRARY, then type make again (that static library has a new dependency, and the cmake code that adds it needs to run).
  • if you get CMake Error: KDE Requires Qt to be built with SSL support

, install openssl-devel, and re-compile QT.

  • if you get kdelibs/kimgio/ico.cpp:188: undefined reference to `QImage::jumpTable()' it means you compiled QT without QT3 support(no, linking to a true QT3 install won't work)

kdepimlibs

After kdelibs, but before kdebase, you need to build and install kdepimlibs.

The Recipe

cs KDE # cs is not a typo
svn checkout svn://anonsvn.kde.org/home/kde/trunk/KDE/kdepimlibs
cd kdepimlibs
cmakekde

What's Happening

We go into the KDE source directory (line 1), download the source code for kdepimlibs using subversion (line 2) and then go into the new ~/kde/src/KDE/kdepimlibs directory (line 3). We then commence the build (line 4). This will leave us in the kdepimlibs build directory after the build is completed.

Troubleshooting

If you have trouble compiling kdepimlibs:

  • the cmakekde command may require a later version of the gpgme library. This is available from the project's web site: http://www.gnupg.org/(en)/download/index.html - please note that the build of gpgme also requires libgpg-error, also available from the same location. Both libraries are installed by the "./configure", "make" and "sudo make install" sequence, with the gpgme library configured with the additional "--with-gpg-error-prefix" parameter. You may need to overwrite your existing "/usr/bin/gpgme-config" file with the newer version for the kdepimlibs to pick up the new install.

kdebase

You may need kdebase for some kioslaves.

The Recipe

cs KDE # cs is not a typo
svn checkout svn://anonsvn.kde.org/home/kde/trunk/KDE/kdebase
cd kdebase
cmakekde

Troubleshooting

If you have troubles compiling kdebase:

  • Make sure you have the libxss headers installed. (Usually you got undefined references on xscreensaver objects if you do not have those headers)
  • which meinproc has to deliver /home/kde-devel/kde/bin/meinproc
  • if cmakekde can not find the path of kdepimlibs, edit the file $KDE_BUILD/KDE/kdebase/CMakeCache.txt and manually set KDEPIMLIBS_INCLUDE_DIR:PATH=$KDE_BUILD/kdepimlibs
  • if you get an error saying "Please set the following variables: X11_XTest_LIB (ADVANCED)", install the devel package of Xtst. On some systems, this is packaged separately from xext and called x11proto-xext-dev or libxtst-dev. You may also need to remove the CMakeCache.txt file in the build dir after installing the package.
  • the same for "X11_Xinerama_LIB (ADVANCED)" where you will need the devel package for xinerama.
  • if you get an error complaining about a missing variable X11_Xrandr_LIB, you need the devel package for libxrandr (libxrandr-devel on ubuntu-systems)
  • if you get the error "Please set the following variables: FONTCONFIG_INCLUDE_DIR, FONTCONFIG_LIBRARIES (ADVANCED)", then you need to install the libfontconfig headers
  • if you get the error "CMake Error: This project requires some variables to be set, and cmake can not find them. Please set the following variables: KMETADATA_LIBRARIES", you need to install soprano from kdesupport and to rebuild kdelibs
  • if you get the error "‘XserverRegion’ does not name a type" make sure you have libxcomposite headers installed (libxcomposite-dev in ubuntu)

Generating local API documentation

Although the API documentation for KDE is available online at api.kde.org, it is sometimes useful to have it on your own disk, for example when you want to use KDevelop for browsing the documentation or when you are not able to be online all the time.

Be aware that generating the API documentation can take several hours and takes almost half a gigabyte of diskspace. The generation is handled by a script in kdelibs/doc/api, you need doxygen to be able to run it.

To build the API documentation for kdelibs, type the following:

cs KDE/kdelibs # cs is not a typo
$KDE_SRC/KDE/kdelibs/doc/api/doxygen.sh \
--doxdatadir=$KDE_SRC/KDE/kdelibs/doc/common .

Repeat for other modules as desired.

cd <module home>
$KDE_SRC/KDE/kdelibs/doc/api/doxygen.sh \
--doxdatadir=$KDE_SRC/KDE/kdelibs/doc/common .

Another, even easier method involves downloading this Doxyfile to your local system. Then simply change directory to where you want to create the documentation and run % doxygen /path/to/Doxyfile Then review the file doxygen.log to see the doxygen errors and warnings. You'll find the actual documentation in the apidocs subdirectory.

Staying up to date

In order to keep the kde4 installation up to date, each of the modules installed should be updated periodically. As Monday is the day for big changes in kdelibs, Tuesday may be the best day to do this. For each module checked out, run svn up and make.

For example: cs kdesupport # cs is not a typo svn up cb # cb is not a typo make -j2 VERBOSE=1 && make install

General troubleshooting

What can happen over time, after some svn up commands, is that some of the tools used in the KDE build chain change their output format. For example, kcfg files are read by kconfig_compiler to produce configuration dialogs. CMake cannot detect those changes, and the compilation might fail. A workaround is to always force a re-generation of all such files:

find $KDE_SRC/KDE/kdebase -name "*.kcfg" | xargs touch

The same applies to ui files as produced by Qt designer.

Success!

You are now ready to start building other svn modules in the same fashion as you built kdebase, running and testing KDE4 or writing your own patches and applications.

See the Set up KDE 4 for development tutorial for how to start KDE 4 applications and how to use KDevelop to work on them.


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