Get Involved/development/Install the dependencies

From KDE Community Wiki
Revision as of 21:37, 27 June 2023 by Ngraham (talk | contribs) (Remove stuff that is completely outdated and useless)

In the following we give the dependencies to install. However it might change and this page might be quickly outdated.

Note

If some packages fail to install, you can try removing the ones that don't work from the list.


Reading the CMakeLists.txt of the packages you want to install should help you finding what you really need to install. Or read the error logs (see below).

If you need help, see https://community.kde.org/Get_Involved#Getting_in_Touch_and_Working_Together

Enable the source repositories

Set up kdesrc-build - Step 4/6.

Some operating systems also require that you enable on the source repositories before you can install build dependencies. Do that now, if necessary:

  • KDE neon/Debian/Ubuntu/Kubuntu: sudo sed -i '/deb-src/s/^# //' /etc/apt/sources.list && sudo apt update . Open the file /etc/apt/sources.list in a text editor and make sure that each line that starts with "deb " is followed by an identical line but which starts with "deb-src ". For more information, see https://askubuntu.com/questions/158871/how-do-i-enable-the-source-code-repositories. Note: if the file /etc/apt/sources.list does not contain commented out deb-src lines starting with "#deb-src " and apt build-dep returns errors (e.g. E: You must put some 'deb-src' URIs in your sources.list). Then you should duplicate the lines starting with "deb " and in the copied/duplicated lines, replace "deb " with "deb-src ".
  • openSUSE Leap & Tumbleweed: sudo zypper mr -e $(zypper repos | awk '/source/{print $5}')
  • Gentoo is all built from sources anyway, so in most cases all necessary build dependencies for installed packages will be available from the get-go, but for convenience this page will refer to sets available from KDE ebuild repository:
    emerge eselect-repository && eselect repository enable kde


If you don't see your distro in the above list, then there's nothing you need to do here and you can safely move on.

How to install the dependencies of one package

KDE neon, Debian, Ubuntu, Kubuntu

All the build packages known by the package you want to build can be installed by running:

sudo apt build-dep <package you want to build>

For example, to install the build dependencies for Dolphin, run:

sudo apt build-dep dolphin

Fedora

If dependencies are missing for a specific RPM package, you can run:

sudo dnf builddep <name_of_rpm_package>

For example, to install the build dependencies for Dolphin, run:

sudo dnf builddep dolphin

openSUSE

Generally you can install the required -devel packages that are needed to build some KDE software from source by using zypper (as root, or by using sudo), e.g. to install the -devel packages required to build dolphin from source:

# zypper --plus-content repo-source source-install --build-deps-only dolphin

replace dolphin with some other package name, e.g. to build ktexteditor from source:

# zypper --plus-content repo-source source-install --build-deps-only ktexteditor

Note that the --plus-content option in the above commands means you don't need to have the source repository enabled all the time, --plus-content will make zypper temporarily enable it to get the info it needs.

openSUSE (and most other RPM-based Linux distributions) support cmake() BuildRequires, which means you can install a development package like so:

# zypper install 'cmake(KF5KIO)'

the part between the parenthesis KF5KIO is going to be in the error message that CMake will print in the terminal if you try to build something that requires e.g. KIO if KIO development headers aren't installed.

For all of the KDE Frameworks 5

Set up kdesrc-build - Step 5/6.

All the dependencies needed for building all of the KDE Frameworks 5 (kdesrc-build frameworks) can be installed by running:

Arch and Manjaro

$ sudo pacman -Syu --needed phonon-qt5 qt5-script qt5-svg qt5-tools qt5-x11extras enchant jasper openexr libutempter docbook-xsl shared-mime-info giflib libxss upower udisks2 bzr git doxygen perl-json perl-libwww perl-xml-parser perl-io-socket-ssl akonadi xorg-server-devel libpwquality fontforge eigen libfakekey qca-qt5 xapian-core xsd gperf perl-yaml-syck intltool kdesdk qrencode libdmtx boost ruby-test-unit

KDE neon, Debian, Ubuntu, Kubuntu

$ sudo apt build-dep polkit-qt-1 kwindowsystem kwallet-kf5 kirigami2 kjs kfilemetadata-kf5 kcalcore kdewebkit khtml modemmanager-qt dolphin plasma-desktop plasma-workspace kwin

Fedora

Fedora KDE Plasma Desktop Spin 37

$ sudo dnf builddep dolphin plasma-desktop plasma-workspace kwin kf5-kwallet kf5-kirigami2 kf5-kjs kf5-kcalendarcore kf5-kdewebkit

Gentoo

Make use of sets provided by KDE ebuild repository to ensure all frameworks packages are installed, thus pulling in all necessary dependencies.

# emerge --ask --verbose @kde-frameworks

Pay attention to the resulting list of packages to be installed and enable additional USE flags to ensure optional dependencies are installed as well.

openSUSE Tumbleweed

This more complete list allows to compile everything that kdesrc-build's default setup (kf5-qt5-build-include) compiles. Note that it doesn't contain Qt or Qt-based libs, you need that on top, or to compile your own Qt (and then include custom-qt5-libs-build-include in kdesrc-buildrc).

$ sudo zypper install aspell-devel atkmm-devel at-spi2-core-devel audiofile-devel autoconf binutils-devel bluez-devel boost-devel cdparanoia-devel cmake cmark-devel cups-devel cyrus-sasl-devel docbook2X docbook-xsl-stylesheets doxygen eigen3-devel enchant-devel libexiv2-devel farstream-devel fdupes ffmpeg-4-libavcodec-devel ffmpeg-4-libavformat-devel ffmpeg-devel fftw3-devel flac-devel flatpak-devel fuse3-devel fwupd-devel gdk-pixbuf-devel gettext-tools giflib-devel git glew-devel grantlee5-devel graphviz-devel gstreamer-devel gstreamermm-devel gstreamer-plugins-bad gstreamer-plugins-base-devel gstreamer-rtsp-server-devel gstreamer-transcoder-devel gstreamer-validate-devel gtk2-devel gtk3-devel hunspell-devel ibus-devel id3lib-devel intltool kColorPicker-devel kdsoap-devel kImageAnnotator-devel libaccounts-glib-devel libaccounts-qt5-devel libacl-devel libarchive-devel libassuan-devel libatasmart-devel libattr-devel libblkid-devel libbotan-devel libcanberra-devel libcap-devel libdiscid-devel libdmtx-devel libdwarf-devel libelf-devel libepoxy-devel libepub-devel libepubgen-devel libexiv2-devel libfakekey-devel libffmpegthumbnailer-devel libgbm-devel libgit2-devel libgpgme-devel libgphoto2-devel libgpgmepp-devel libgssglue-devel libgumbo-devel libical-devel libicecream-devel libicu-devel libidn-devel libimobiledevice-devel libiodbc-devel libjasper-devel libkdsoap2 libkolabxml-devel libksane-devel liblcms2-devel libMagick++-devel libmlt++-devel libmms-devel libmtp-devel libmusicbrainz-devel libmysqlclient-devel libmysqld-devel libnl3-devel liboauth-devel libopenssl-devel libopus-devel libotr-devel liboyranos-devel libpcap-devel libpgf-devel libpoppler-devel libpulse-devel libpwquality-devel libqalculate-devel libqgpgme-devel libQt5Charts5-devel libQt5Core-private-headers-devel libQt5PlatformSupport-private-headers-devel libQt5PrintSupport-private-headers-devel libqt5-qtcharts-imports libqt5-qtwayland-private-headers-devel libQt5QuickControls2-devel libraw-devel libsamplerate-devel libsensors4-devel libsignon-qt5-devel libsmbclient-devel libsndfile-devel libspeechd-devel libssh2-devel libssh-devel libudev-devel libusb-1_0-devel libusb-compat-devel libv4l-devel LibVNCServer-devel libvorbis-devel libwacom-devel libxapian-devel libXcm-devel libxkbcommon-devel libxslt-devel libXtst-devel libzeitgeist-devel llvm-clang-devel llvm-devel lmdb-devel make ModemManager-devel mpfr-devel mtdev-devel mozilla-nss-devel NetworkManager-devel openal-soft-devel openconnect-devel opencv-devel openjpeg2-devel openslp-devel PackageKit-devel PackageKit-Qt-devel pam-devel pango-devel parted-devel patterns-kde-devel_kde_frameworks patterns-kde-devel_qt5 pciutils-devel pcre-devel pipewire-devel plymouth-devel polkit-devel postgresql-devel python3 python3-devel python3-openpyxl python3-pycairo python3-python-dateutil qca-qt5-devel qrencode-devel qtkeychain-qt5-devel sane-backends-devel sassc speex-devel taglib tesseract-ocr-devel utempter-devel vlc-devel wayland-protocols-devel wayland-utils xcb-util-cursor-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-renderutil-devel xcb-util-wm-devel xf86-input-evdev-devel xf86-input-libinput-devel xf86-input-synaptics-devel xf86-input-wacom-devel xorg-x11-devel xorg-x11-server-sdk xorg-x11-util-devel xz-devel
  • OPEN ISSUES:
    • libeigen2-devel is no longer available on Tumbleweed via official repos, though it's only needed for kdelibs4support

For Plasma

  • Arch/Manjaro: sudo pacman -Syu --needed plasma-desktop plasma-wayland-session plasma-workspace kwin
  • Fedora: sudo dnf builddep plasma-desktop plasma-workspace kwin or sudo dnf install libpcap-devel libnl3-devel libsecret-devel; sudo dnf builddep bluedevil breeze-gtk kde-gtk-config kgamma kscreen kwin plasma-breeze plasma-desktop plasma-discover plasma-disks plasma-drkonqi plasma-firewall plasma-integration plasma-milou plasma-nm plasma-pa plasma-systemmonitor plasma-systemsettings plasma-thunderbolt plasma-vault plasma-wayland-protocols plasma-workspace plasma-workspace-geolocation plasma-workspace-wallpapers plymouth-kcm powerdevil sddm-kcm
  • Gentoo: emerge --ask --verbose @kde-plasma
  • KDE neon/Debian/Ubuntu/Kubuntu: sudo apt build-dep plasma-desktop plasma-workspace kwin appstream
  • openSUSE Leap & Tumbleweed: sudo zypper si -d plasma5-desktop plasma5-workspace kwin5

Any other dependencies can be figured out and installed as you continue building the modules one by one.

Quick fixes for package manager errors

The above lists might not always be working out of the box on your specific distribution or might be out of date for individual packages. In many cases removing single packages from the lists above still allows you to build many KDE frameworks and applications.

In case it is a package added by a regex, you can exclude the specific package by a workaround using sed. Let us assume for an example that we want to install "libkf5.*-dev" on deb-based systems but have uninstallable packages libkf5example1-dev, libkf5example2-dev. Then we install all "libkf5.*-dev" packages excluding libkf5example1-dev and libkf5example2-dev through:

$ sudo apt install $(apt-cache search -n "libkf5.*-dev" | sed 's/ - .*//' | sed '/libkf5example1-dev/d' | sed '/libkf5example2-dev/d')