Skip to content

Building KDE4 from Git repository

midenok edited this page Nov 22, 2013 · 8 revisions

1. Clone repositories

Clone following projects:

Put them into $HOME/kde4/src.

F.ex.:

mkdir -p ~/kde4/src
cd ~/kde4/src
git clone git://anongit.kde.org/kdelibs

Detailed recipe of how to clone any KDE project can be found here.

Note: don't compile KDE Runtime yet, since it have dependencies on more projects.

2. Switch each KDE4 repo to latest stable branch

  1. Look at the remote branches list:
kdelibs$ git branch -a
* master
  remotes/origin/Active/Two
  remotes/origin/HEAD -> origin/master
  remotes/origin/KDE/1.1
  remotes/origin/KDE/2.0
  remotes/origin/KDE/2.1
  remotes/origin/KDE/2.2
  remotes/origin/KDE/3.0
  remotes/origin/KDE/3.1
  remotes/origin/KDE/3.2
  remotes/origin/KDE/3.3
  remotes/origin/KDE/3.4
  remotes/origin/KDE/3.5
  remotes/origin/KDE/4.0
  remotes/origin/KDE/4.1
  remotes/origin/KDE/4.10
  remotes/origin/KDE/4.11
...
  1. Switch to 4.11 branch:
kdelibs$ git checkout -b 4.11 remotes/origin/KDE/4.11
Branch 4.11 set up to track remote branch KDE/4.11 from origin.
Switched to a new branch '4.11'

3. Ensure you have latest Linux distribution release

In Debian/Ubuntu:

  1. Setup sources.list(5) to point to latest release
  • for Debian use 'unstable' release
  • for Ubuntu use 'saucy', f.ex.
    sed -ie 's/precise/saucy/g' /etc/apt/sources.list (use your current release codename instead of precise)
  1. do apt-get update
    Note: when you will proceed to next step, you may stumble upon software upgrade process which will be consequence of your old installation. It may require some broken dependencies resolution which is best conducted with aptitude (in Debian-based distros).

4. Install build dependencies

Again, ensure, that your OS is configured to the latest distribution release (see above). Because if your distribution shows kdelibs5 version 4.8, then your build dependencies will be installed for 4.8 and building of later version will fail!

Use command (Debian-way):
apt-get build-dep kde4libs

or

apt-get build-dep kdelibs5

More info can be found here

5. Build and install projects

Scripted way to build KDE:

  1. Download 2 scripts:

  2. Edit kde4-run-env:

    • For Debian-based distro remove everything in # Identify if this is a x86_64 system by asking rpm, just replace it with LIB_SUFFIX=64 if you have 64 bit OS.
    • set the following variables:
      KDE_PREFIX=$HOME/kde4
      KDE_INSTALL_PREFIX=$KDE_PREFIX/opt
      KDE_HOME=$KDE_PREFIX/opt/etc
  3. Edit kde4-build-env, set the following variables:
    KDE_DEVEL_PREFIX=$KDE_PREFIX
    export KDE_BUILD=$KDE_DEVEL_PREFIX/build
    export KDE_SRC=$KDE_DEVEL_PREFIX/src

  4. Source kde4-build-env with your favourite Bourne-compatible shell:
    . kde4-build-env

  5. Run cmakekde from each source dir of each project.

More info can be found here.

6. More sophisticated way of building KDE

... or use more automated way with kdesrc-build.