Jump to content

Guidelines and HOWTOs/Build from source/Install the dependencies: Difference between revisions

From KDE Community Wiki
Bneuman (talk | contribs)
Bneuman (talk | contribs)
Line 31: Line 31:
  * still it would not work.
  * still it would not work.


* some version of apt will not accept wildcard as used here (e.g. qml-module-qtquick*). Use apt-get instead if needed.
* some versions of apt will not accept wildcards as used here (e.g. qml-module-qtquick*). Use apt-get instead if needed.


== For the frameworks ==
== For the frameworks ==

Revision as of 19:05, 8 December 2020

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


Enable the source repositories

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

  • Kubuntu/Ubuntu/Debian: sudo sed -i '/deb-src/s/^# //' /etc/apt/sources.list && sudo apt update (for more information, see https://askubuntu.com/questions/158871/how-do-i-enable-the-source-code-repositories)
  • 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.


All dependencies

KDE neon, Debian, Ubuntu, Kubuntu

$ sudo apt install autoconf baloo-kf5-dev intltool bison breeze-dev build-essential bzr cmake cmake-data debhelper dh-apparmor doxygen extra-cmake-modules flex fontforge gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 git gperf icu-devtools kded5-dev kgendesignerplugin kinit-dev kirigami2-dev kross-dev kscreenlocker-dev kwin-dev libaccounts-glib-dev libappstreamqt-dev libapr1 libaprutil1 libarchive-dev libasound2-dev libattr1-dev libboost-dev libbz2-dev libcanberra-dev libcap-dev libclang-dev libcln-dev libcups2-dev libcurl4-gnutls-dev libegl1-mesa-dev libepoxy-dev libexiv2-dev libfakekey-dev libfontconfig1-dev libfreetype6-dev libgbm-dev libgconf2-dev libgcrypt20-dev libgif-dev libglib2.0-dev libgmp-dev libgmpxx4ldbl libgpgme11-dev libgps-dev libgrantlee5-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgtk-3-dev libhunspell-dev libibus-1.0-dev libicu-dev libjpeg8-dev libjpeg-dev libjpeg-turbo8-dev libjson-perl libkaccounts-dev libkdecorations2-dev libkeduvocdocument-dev libkf5activities-dev libkf5activitiesstats-dev libkf5akonadicalendar-dev libkf5akonadicontact-dev libkf5akonadi-dev libkf5akonadimime-dev libkf5akonadinotes-dev libkf5akonadisearch-dev libkf5alarmcalendar-dev libkf5archive-dev libkf5attica-dev libkf5auth-dev libkf5baloowidgets-dev libkf5blog-dev libkf5bluezqt-dev libkf5bookmarks-dev libkf5calendarcore-dev libkf5calendarsupport-dev libkf5calendarutils-dev libkf5cddb-dev libkf5codecs-dev libkf5compactdisc-dev libkf5completion-dev libkf5config-dev libkf5configwidgets-dev libkf5contacteditor-dev libkf5contacts-dev libkf5coreaddons-dev libkf5crash-dev libkf5dbusaddons-dev libkf5declarative-dev libkf5dnssd-dev libkf5doctools-dev libkf5emoticons-dev libkf5eventviews-dev libkf5filemetadata-dev libkf5followupreminder-dev libkf5globalaccel-dev libkf5grantleetheme-dev libkf5gravatar-dev libkf5guiaddons-dev libkf5holidays-dev libkf5i18n-dev libkf5iconthemes-dev libkf5identitymanagement-dev libkf5idletime-dev libkf5imap-dev libkf5incidenceeditor-dev libkf5itemmodels-dev libkf5itemviews-dev libkf5jobwidgets-dev libkf5jsembed-dev libkf5kaddressbookgrantlee-dev libkf5kaddressbookimportexport-dev libkf5kcmutils-dev libkf5kdcraw-dev libkf5kdegames-dev libkf5kdelibs4support-dev libkf5kdepimdbusinterfaces-dev libkf5kexiv2-dev libkf5kgeomap-dev libkf5khtml-dev libkf5kio-dev libkf5kipi-dev libkf5kjs-dev libkf5kmahjongglib-dev libkf5konq-dev libkf5kontactinterface-dev libkf5ksieve-dev libkf5ldap-dev libkf5libkdepim-dev libkf5libkleo-dev libkf5mailcommon-dev libkf5mailimporter-dev libkf5mailtransport-dev libkf5mbox-dev libkf5mediaplayer-dev libkf5mediawiki-dev libkf5messagecomposer-dev libkf5messagecore-dev libkf5messagelist-dev libkf5messageviewer-dev libkf5mime-dev libkf5mimetreeparser-dev libkf5networkmanagerqt-dev libkf5newstuff-dev libkf5notifications-dev libkf5notifyconfig-dev libkf5package-dev libkf5parts-dev libkf5people-dev libkf5pimcommon-dev libkf5pimtextedit-dev libkf5plasma-dev libkf5plotting-dev libkf5prison-dev libkf5pty-dev libkf5purpose-dev libkf5qqc2desktopstyle-dev libkf5runner-dev libkf5sane-dev libkf5screen-dev libkf5sendlater-dev libkf5service-dev libkf5solid-dev libkf5sonnet-dev libkf5style-dev libkf5su-dev libkf5syndication-dev libkf5syntaxhighlighting-dev libkf5sysguard-dev libkf5templateparser-dev libkf5texteditor-dev libkf5textwidgets-dev libkf5threadweaver-dev libkf5tnef-dev libkf5unitconversion-dev libkf5wallet-dev libkf5wayland-dev libkf5webengineviewer-dev libkf5webkit-dev libkf5widgetsaddons-dev libkf5windowsystem-dev libkf5xmlgui-dev libkf5xmlrpcclient-dev libktorrent-dev liblcms2-dev liblmdb-dev libmlt-dev libmlt++-dev libnm-dev libpackagekitqt5-dev libpam-dev libphonon4qt5-dev libphonon4qt5experimental-dev libpng-dev libpolkit-agent-1-dev libpolkit-gobject-1-dev libpulse-dev libpwquality-dev libqalculate-dev libqca-qt5-2-dev libqrencode-dev libqt5sensors5 libqt5sensors5-dev libqt5svg5-dev libqt5texttospeech5-dev libqt5webkit5-dev libqt5x11extras5-dev libqt5xmlpatterns5-dev libqt5networkauth5-dev libqt5waylandclient5-dev libraw1394-dev libscim-dev libserf-1-1 libsm-dev libssl-dev libsvn1 libtiff5-dev libudev-dev libusb-dev libvlccore-dev libvlc-dev libvncserver-dev libwww-perl libx11-dev libx11-xcb-dev libxapian-dev libxcb1-dev libxcb-composite0-dev libxcb-cursor0 libxcb-cursor-dev libxcb-damage0-dev libxcb-dpms0 libxcb-dpms0-dev libxcb-ewmh2 libxcb-ewmh-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-record0-dev libxcb-render-util0-dev libxcb-res0 libxcb-res0-dev libxcb-screensaver0 libxcb-screensaver0-dev libxcb-shm0-dev libxcb-util0-dev libxcb-xf86dri0 libxcb-xf86dri0-dev libxcb-xinerama0 libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xtest0-dev libxcb-xv0 libxcb-xv0-dev libxcb-xvmc0 libxcb-xvmc0-dev libxcursor-dev libxft-dev libxi-dev libxkbfile-dev libxml2-dev libxml-parser-perl libxrender-dev libxslt1-dev libxslt-dev llvm modemmanager-dev modemmanager-qt-dev network-manager-dev openbox oxygen-icon-theme perl-modules pkg-config pkg-kde-tools plasma-workspace-dev po-debconf qml-module-qtquick* qt5-qmake qtbase5-dev qtbase5-dev-tools qtbase5-private-dev qtdeclarative5-dev qtmultimedia5-dev qtquickcontrols2-5-dev qtscript5-dev qttools5-dev qtxmlpatterns5-dev-tools shared-mime-info subversion texinfo xauth xcb-proto xserver-xorg-dev xserver-xorg-input-evdev-dev xserver-xorg-input-libinput-dev xserver-xorg-input-synaptics-dev xsltproc xvfb libkdsoap-dev
  • As of 2020-04-23, on Kubuntu 20.04, I also needed libqt5qml5, zlib1g-dev, libxfixes-dev, libxcb-xfixes0-dev, libassuan-dev, and wayland-protocols. libpolkit-backend-1-dev is no longer available.
  • I had to remove # libpolkit-backend-1-dev # no longer avail # libkdsoap-dev libnm-util-dev qml-module-qtquick* llvm-3.9 libkf5vkontakte-dev libclang-3.9-dev libnm-glib-dev libqimageblitz-dev
* still it would not work.
  • some versions of apt will not accept wildcards as used here (e.g. qml-module-qtquick*). Use apt-get instead if needed.

For the frameworks

Arch, Antergos, Manjaro

All the dependencies used for building frameworks can be installed by running:

$ sudo pacman -Sy --needed phonon-qt5 qt5-webkit 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

Fedora

All the dependencies used for building frameworks can be installed by running:

$ sudo dnf install perl-IPC-Cmd perl-JSON-PP perl-YAML-Syck qt5-devel qt5-qtquickcontrols2-devel polkit-devel gperf libxslt-devel libxml2-devel kf5-kconfigwidgets-devel libXrender-devel qrencode-devel xcb*-devel flex systemd-devel giflib-devel libjpeg-turbo-devel NetworkManager-libnm-devel ModemManager-devel libattr-devel openssl-devel libSM-devel wayland-devel lmdb-devel libaccounts-qt5-devel libaccounts-glib-devel signon-devel grantlee-qt5-devel libepoxy-devel

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

Installing required development packages with zypper

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 Leap 15 (Argon)

Updated 24 June 2018 (likely incomplete)

$ sudo zypper si -d libqt5-qtbase
$ sudo zypper in libbz2-devel libxslt-devel libxml2-devel shared-mime-info oxygen-icon-theme giflib-devel vlc-devel doxygen gstreamer-devel gstreamer-plugins-base-devel docbook-xml-slides docbook-xsl-stylesheets xcb-util-keysyms-devel perl-JSON boost-devel libxcb-devel libXrender-devel xcb-util-wm-devel xcb-util-devel xcb-util-image-devel gettext-tools libepoxy-devel
$ sudo zypper in gtk3-devel
$ sudo zypper in grantlee5-devel kactivities5-devel plasma-framework-devel plasma5-addons-devel plasma5-workspace-devel libQt5Concurrent-devel libQt5DBus-devel libQt5PrintSupport-devel xcb-util-cursor-devel libqt5-qtx11extras-devel xcb-proto-devel git-core

openSUSE 42.1

Install these packages (including the recommended packages):

$ sudo zypper install patterns-openSUSE-devel_kde patterns-openSUSE-devel_kde_frameworks git-core bzr ninja \
gettext-tools libqt5-qttools libgypsy0 libqt5-creator libqt5-linguist libqt5-qtbase-common-devel libqt5-qtbase-devel libqt5-qtbase-examples libqt5-qtdeclarative-devel libqt5-qtdeclarative-examples libqt5-qtdeclarative-tools libqt5-qtdoc libqt5-qtgraphicaleffects libqt5-qtimageformats libqt5-qtimageformats-devel libqt5-qtmultimedia-devel libqt5-qtmultimedia-examples libqt5-qtquick1-devel libqt5-qtquickcontrols libqt5-qtscript-devel libqt5-qtscript-examples libqt5-qtsvg-devel libqt5-qttools-devel libqt5-qtx11extras-devel libqt5-qtxmlpatterns-devel libqt5-qtxmlpatterns-examples libQt5CLucene5 libQt5Concurrent-devel libQt5Concurrent5 libQt5Core-devel libQt5Core5 libQt5DBus-devel libQt5DBus5 libQt5Declarative5 libQt5Designer5 libQt5DesignerComponents5 libQt5Gui-devel libQt5Gui5 libQt5Help5 libQt5Multimedia5 libQt5Network-devel libQt5Network5 libQt5OpenGL-devel libQt5OpenGL5 libQt5Positioning5 libQt5PrintSupport-devel libQt5PrintSupport5 libQt5Script5 libQt5Sensors5 libQt5Sql-devel libQt5Sql5 libQt5Sql5-mysql libQt5Sql5-postgresql libQt5Sql5-sqlite libQt5Sql5-unixODBC libQt5Svg5 libQt5Test-devel libQt5Test5 libQt5WebKit5 libQt5WebKitWidgets5 libQt5Widgets-devel libQt5Widgets5 libQt5X11Extras5 libQt5Xml-devel libQt5Xml5 libQt5XmlPatterns5 libQtQuick5 libQt5WebKitWidgets-devel libqt5-qtbase-private-headers-devel \
xcb-util-keysyms-devel docbook-xsl-stylesheets doxygen polkit-devel libepoxy-devel boost-devel libXcursor-devel libSM-devel giflib-devel libaccounts-qt5-devel gtk3-devel libpng16-devel fltk-devel libopenssl-devel libattr-devel ModemManager-devel NetworkManager-devel wayland-devel lmdb-devel xcb-proto-devel xcb-util-image-devel xcb-util-cursor-devel xcb-util-devel gtk2-devel libqca-qt5-devel libpwquality-devel libical-devel PackageKit-Qt5-devel pam-devel \
bison flex libqt5-qttools-doc
  • Failing modules (of more than 200 modules)
    • phonon-vlc, phonon-gstreamer, plasma-pa (PulseAudio missing), kdevplatform, plasma-desktop, kaccounts-integration, kaccounts-mobile, gwenview, kdevelop, libksane, skanlite, ... (see below for solutions)

openSUSE Tumbleweed

This more complete list (which probably works for OpenSUSE 42.1 as well) 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 atk-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 farstream-devel fdupes ffmpeg-2-libavcodec-devel ffmpeg-2-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 libchromaprint-devel libdiscid-devel libdmtx-devel libdwarf-devel libelf-devel libepoxy-devel libepub-devel libepubgen-devel libexiv2-devel libfakekey-devel libffmpegthumbnailer-devel libfunambol-devel libgbm-devel libgit2-devel libgpgme-devel libgphoto2-devel libgssglue-devel libgumbo-devel libical-devel libicecream-devel libicu-devel libidn-devel libimobiledevice-devel libiodbc-devel libjasper-devel libkdsoap1_9_0 libkolabxml-devel libksane-devel liblcms2-devel libMagick++-devel libmlt++-devel libmms-devel libmtp-devel libmusicbrainz-devel libmysqlclient-devel libmysqld-devel libnl-devel liboauth-devel libopenssl-devel libopus-devel libotr-devel liboyranos-devel libpgf-devel libpoppler-devel libpulse-devel libpwquality-devel libqalculate-devel libQt5Charts5-devel libQt5Core-private-headers-devel libQt5PlatformSupport-private-headers-devel libQt5PrintSupport-private-headers-devel libQt5QuickControls2-devel libraw-devel libsamplerate-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 libxine-devel libxkbcommon-devel libxklavier16 libxklavier-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 pipewire-devel plymouth-devel polkit-devel postgresql-devel python3 python3-devel python3-openpyxl python3-pycairo python3-python-dateutil qrencode-devel qtkeychain-qt5-devel sane-backends-devel sassc speex-devel 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
    • libjasper-devel is currently (06/20) not build for Tumbleweed and needs to be compiled from source.

For Plasma

  • Arch/Antergos/Manjaro: sudo pacman -S plasma-desktop plasma-workspace kwin
  • Fedora: sudo dnf builddep plasma-desktop plasma-workspace kwin
  • Gentoo: emerge --ask --verbose @kde-plasma
  • KDE neon/Kubuntu/Ubuntu/Debian sudo apt build-dep plasma-desktop plasma-workspace kwin
  • 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')