This page details installation of KDE SC 4 build requirements on any recent Kubuntu or Debian system. That is, if you want to build KDE SC 4 Platform, the required (and some strongly recommended) packages are installed with the commands on this page.
For building parts of KDE on Debian using the Debian source packages see Debian the easy way.
Install these for any KDE 4.x release, then add specific packages for point releases as below. Then add any optional packages you like, as described below.
sudo aptitude install build-essential xorg-dev cdbs debhelper cmake \ kdesdk-scripts subversion ssh xserver-xephyr doxygen dbus-x11 \ libxml2-dev libxslt1-dev shared-mime-info libical-dev libgif-dev libssl-dev \ libboost-dev libboost-program-options-dev libboost-graph-dev libgpgme11-dev \ libvlccore-dev libxine-dev libqimageblitz-dev libbz2-dev libdbus-1-dev libpam0g-dev \ libpcre3-dev libkrb5-dev libsm-dev libclucene0ldbl libclucene-dev libjpeg62-dev \ libxtst-dev xsltproc libxrender-dev libfontconfig1-dev automoc librdf0-dev \ libdbusmenu-qt-dev docbook-xsl docbook-xml libattica-dev libqtwebkit-dev \ shared-desktop-ontologies libphonon-dev libqt4-dev dbus-x11 \ libstreamanalyzer-dev libstrigiqtdbusclient-dev libxml2-dev libxslt1-dev \ librdf0-dev libjasper-dev libopenexr-dev libacl1-dev libsasl2-dev libqjson-dev \ virtuouso-minimal libavcodec-dev libavformat-dev libavdevice-dev libavutil-dev \ libswscale-dev libpostproc-dev libtag1-dev libgstreamer0.10-dev \ libgstreamer-plugins-base0.10-dev
This (along with the command for 4.x above) installs all compilation requirements for kde4 (with the exception of qt4) and some strongly recommended packages such as libssl-dev for https support. Further recommended and optional packages are listed below.
sudo aptitude install graphviz libxml2-utils libopenexr-dev libjasper-dev libenchant-dev \ libavahi-common-dev libaspell-dev libasound2-dev libldap2-dev libsasl2-dev \ libsmbclient-dev libxkbfile-dev libxcb1-dev libxklavier-dev libxdamage-dev \ libxcomposite-dev libbluetooth-dev libusb-dev network-manager-dev \ libsensors4-dev libnm-util-dev libcfitsio3-dev libnova-dev libeigen2-dev \ libopenbabel-dev libfacile-ocaml-dev libboost-python-dev libsvn-dev libsvncpp-dev \ libqt4-dev libqca2-dev libstreamanalyzer-dev libstrigiqtdbusclient-dev \ libcommoncpp2-dev libidn11 libidn11-dev libpci-dev libxss-dev libxft-dev \ libpolkit-agent-1-dev libpolkit-backend-1-dev libpolkit-gobject-1-dev git libpoppler-qt4-dev \ libspectre-dev
sudo aptitude install libv4l-dev # for kdenetworks sudo aptitude install liblcms1-dev # for kdegraphics
(Nothing extra needed)
sudo aptitude install libasound2-dev libaspell-dev \ libavahi-common-dev libenchant-dev libjasper-dev libopenexr-dev \ libxml2-utils
There are no additional optional dependencies
sudo aptitude install libsmbclient-dev libxkbfile-dev libxcb1-dev
sudo aptitude install libxklavier-dev libxdamage-dev libxcomposite-dev \ libbluetooth-dev libusb-dev libcaptury-dev network-manager-dev \ libsmbclient-dev libsensors-dev libpam0g-dev libnm-util-dev
The following packages are recommended if you intend to use kstars:
sudo aptitude install libusb-dev libcfitsio3-dev libnova-dev libeigen2-dev \ libopenbabel-dev libfacile-ocaml-dev libboost-python-dev
To enable XMMS support for the 'Now Playing' plasma data engine in kdebase, you will need to either compile XMMS from source, or install the package from a third-party XMMS package repository.