Get Involved/development/Install the dependencies: Difference between revisions

From KDE Community Wiki
(→‎For Plasma: Add appstream)
(Fedora KDE 40)
 
(19 intermediate revisions by 4 users not shown)
Line 1: Line 1:
In the following we give the dependencies to install. However it might change and this page might be quickly outdated.
If you have any trouble getting things to build due to missing 3rd-party package dependencies, read on to learn what to do. If you need help, see https://community.kde.org/Get_Involved#Contacting_The_Community.


{{Note|If some packages fail to install, you can try removing the ones that don't work from the list.}}
== Missing binary packages per operating system ==


Reading the <code>CMakeLists.txt</code> of the packages you want to install should help you finding what you '''really''' need to install. Or read the error logs (see below).
== Fedora KDE 40 ==


If you need help, see https://community.kde.org/Get_Involved#Getting_in_Touch_and_Working_Together
<code>kdesrc-build --initial-setup</code> fails with error:
<code>Error: Unable to find a match: qaccessibilityclient-devel</code>


=== Enable the source repositories ===
Packages to install: qaccessibilityclient-qt6-devel.


<pre class="ml-0 pre-input" style="display: inline;">Set up kdesrc-build - Step 4/6.</pre>
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: <code>sudo sed -i '/deb-src/s/^# //' /etc/apt/sources.list && sudo apt update</code> . 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 <code>apt build-dep</code> returns errors (e.g. <code>E: You must put some 'deb-src' URIs in your sources.list</code>). Then you should duplicate the lines starting with "deb " and in the copied/duplicated lines, replace "deb " with "deb-src ".
* openSUSE Leap & Tumbleweed: <code>sudo zypper mr -e $(zypper repos | awk '/source/{print $5}')</code>
* 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 [https://wiki.gentoo.org/wiki/KDE/Ebuild_repository KDE ebuild repository]:<br /><code>emerge&nbsp;eselect-repository && eselect&nbsp;repository&nbsp;enable&nbsp;kde</code>
<br />
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.
<br />


== How to install the dependencies of one package ==
== How to install the dependencies of one package ==
Line 29: Line 21:
<code>sudo apt build-dep dolphin</code>
<code>sudo apt build-dep dolphin</code>


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


Line 58: Line 50:
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.
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 ==
Any other dependencies can be figured out and installed as you continue building the modules one by one. For instance, to build ''Dolphin'' or ''Kate'', you will need need to also run:


<pre class="ml-0 pre-input" style="display: inline;">Set up kdesrc-build - Step 5/6.</pre>
{{Input|1=<nowiki>
# zypper install libassuan-devel makeinfo graphviz-gd
</nowiki>}}


All the dependencies needed for building all of the KDE Frameworks 5 (<code>kdesrc-build frameworks</code>) can be installed by running:
== Fix CMake Error ==


=== Arch and Manjaro ===  
If you run kdesrc-build in order to build a KDE git repository. And if building fails with a CMake error. Then, that is most often caused by the fact that you do not have installed some binary packages from your Linux OS.
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: normal;">
 
$ 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
See below for some ideas about how to find out what Linux packages you need to install.
 
=== Missing pkgconfig or cmake ===
 
If the CMake error looks like:
<pre>
Build-time dependency gi-docgen found: NO (tried pkgconfig and cmake)
 
docs/api/meson.build:5:15: ERROR: Dependency "gi-docgen" not found, tried pkgconfig and cmake
</pre>
</pre>


=== KDE neon, Debian, Ubuntu, Kubuntu ===  
The error here is that CMake could not find the pkgconfig named "gi-docgen" (most probably a file with the extension".pc") or the CMake file (most probably a file with the extension".cmake") that contains "gi-docgen" case insensitively in name.
 
==== Fedora ====
 
* Maybe we can find the correct package name.
 
<pre>
# Is there an rpm package with the name "gi-docgen" installed?
rpm -qa gi-docgen
# It is not installed.


<pre  style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: normal;">
# Is there in the package repositories an rpm with name containing "gi-docgen"?
$ 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
dnf search gi-docgen
# Returns:
# Last metadata expiration check: ...
#============================================================================== Name #Exactly Matched: gi-docgen #==============================================================================
#gi-docgen.noarch : Documentation tool for GObject-based libraries
#============================================================================= Name & #Summary Matched: gi-docgen #=============================================================================
#gi-docgen-doc.noarch : Documentation for gi-docgen
#gi-docgen-fonts.noarch : Metapackage providing fonts for gi-docgen output
 
# Install the rpm gi-docgen
dnf install gi-docgen
</pre>
</pre>


=== Fedora===
* Look for the .pc or .cmake file in the content of all rpm files in all of the enabled package repositories.


==== Fedora KDE Plasma Desktop Spin 37 ====
<pre>
dnf repoquery -l gi-docgen
# Returns:
#/usr/bin/gi-docgen
#...
#/usr/share/pkgconfig/gi-docgen.pc


<pre  style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: normal;">
dnf install gi-docgen
$ sudo dnf builddep dolphin plasma-desktop plasma-workspace kwin kf5-kwallet kf5-kirigami2 kf5-kjs kf5-kcalendarcore kf5-kdewebkit
</pre>
</pre>


==== Other Fedora versions ====
* DNF knows how to install the rpm that contains a given pkgconfig file.
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: normal;">
 
$ sudo dnf install bison flex giflib-devel gperf gpgmepp-devel grantlee-qt5-devel kf5-kconfigwidgets-devel libaccounts-glib-devel libaccounts-qt5-devel libattr-devel libdrm-devel libepoxy-devel libgcrypt-devel libical-devel libinsane-devel libjpeg-turbo-devel libnl3-devel LibRaw-devel libsndfile-devel libSM-devel libXext-devel libxml2-devel libXrender-devel libxslt-devel libXtst-devel lm_sensors-devel lmdb-devel meson ModemManager-devel NetworkManager-libnm-devel ninja-build openal-soft-devel openjpeg2-devel openjpeg-devel openssl-devel perl-FindBin perl-IPC-Cmd perl-JSON-PP perl-YAML-Syck polkit-devel qgpgme-devel qrencode-devel qtkeychain-qt5-devel signon-devel systemd-devel wayland-devel xcb*-devel libqalculate* dbus-glib-devel* libmission-control-plugins* gmp-ecm* itstool libsmbclient-devel kdsoap-devel libssh-devel libmtp-devel libtirpc-devel openexr-devel qaccessibilityclient-devel gstreamer1-plugins-base-devel qt5-qttools-static qt5-qtbase-static qt5-qtdeclarative-devel qt5-qtx11extras-devel qt5-qtbase-private-devel qt5-qtsvg-devel qt5-qtwayland-devel qt5-qtconfiguration-devel qca-qt5-devel qt5-qtquickcontrols2-devel kf5-kcmutils-devel pipewire-devel libolm-devel libxkbcommon-x11-devel
<pre>
dnf provides 'pkgconfig(gi-docgen)'
# Returns:
#gi-docgen-2023.1-9.fc39.noarch : Documentation tool for GObject-based libraries
#Repo        : fedora
#Matched from:
#Provide    : pkgconfig(gi-docgen) = 2023.1
sudo dnf install 'pkgconfig(gi-docgen)'
</pre>
</pre>


=== Gentoo ===
=== Missing executable ===
Make use of sets provided by KDE ebuild repository to ensure all frameworks packages are installed, thus pulling in all necessary dependencies.
 
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: normal;">
If the CMake error looks like:
# emerge --ask --verbose @kde-frameworks
<pre>
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Sass (missing: Sass_EXECUTABLE)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  cmake/modules/FindSass.cmake:48 (find_package_handle_standard_args)
  CMakeLists.txt:31 (find_package)
</pre>
 
The error here is that CMake could not find the executable named "sass" (most probably a file "/usr/bin/sass").
 
==== Fedora ====
 
* DNF knows which rpm contains a given executable.
 
<pre>
dnf provides sass
# Returns:
#rubygem-sass-3.7.4-7.fc39.noarch : A powerful but elegant CSS compiler that makes CSS fun again
#Repo        : fedora
#Matched from:
#Filename    : /usr/bin/sass
sudo dnf install rubygem-sass
</pre>
</pre>
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 ===  
=== Debian/Kubuntu/KDE neon ===
 
E.g. I am on Kubuntu 22.10, <code>kdesrc-build frameworks</code> fails, module <code>kcoreaddons</code> has CMake (configure) error <code>Could NOT find Qt6LinguistTools (missing: Qt6LinguistTools_DIR)</code>.
 
Option 1:
 
Search on the internet for <code>ubuntu packages Qt6LinguistTools</code> it returns https://packages.ubuntu.com/kinetic/amd64/qt6-tools-dev Expand "amd64 [list of files]": <code>/usr/lib/x86_64-linux-gnu/cmake/Qt6LinguistTools/Qt6LinguistToolsConfig.cmake</code>
 
{{Input|1=<nowiki>
sudo apt install qt6-tools-dev
</nowiki>}}
 
Option 2:
<syntaxhighlight lang="bash">
sudo apt install apt-file
sudo apt-file update
apt-file find Qt6LinguistToolsConfig.cmake
# qt6-tools-dev: /usr/lib/x86_64-linux-gnu/cmake/Qt6LinguistTools/Qt6LinguistToolsConfig.cmake
sudo apt install qt6-tools-dev
</syntaxhighlight>
 
If the error is:
<syntaxhighlight lang="bash">
The imported target "Qt6::qtwaylandscanner" references the file
    "/usr/lib/qt6/libexec/qtwaylandscanner"
but this file does not exist.
</syntaxhighlight>
 
Then:
<syntaxhighlight lang="bash">
apt-file find /usr/lib/qt6/libexec/qtwaylandscanner
# qt6-wayland-dev-tools: /usr/lib/qt6/libexec/qtwaylandscanner
sudo apt install qt6-wayland-dev-tools
</syntaxhighlight>


==== openSUSE Leap 15 (Argon) ====
Option 3:
<syntaxhighlight lang="bash">
apt search linguist | grep qt6
# linguist-qt6/kinetic 6.3.1-2 amd64
sudo apt install linguist-qt6
</syntaxhighlight>


Updated 24 June 2018 (likely incomplete)
More examples:
<pre  style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: normal;">$ sudo zypper si -d libqt5-qtbase
<syntaxhighlight lang="bash">
$ 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
# Error "Could not find OsmTools (missing: OSMCONVERT_EXECUTABLE
$ sudo zypper in gtk3-devel
apt-file search -i OSMCONVERT
$ 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</pre>
# Returns "osmctools: /usr/bin/osmconvert".
sudo apt install osmctools
</syntaxhighlight>


==== openSUSE Tumbleweed ====
<syntaxhighlight lang="bash">
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).
# Error "Program doxygen found: NO
# doc/meson.build:6:0: ERROR: Program 'doxygen' not found or not executable"
apt-file search doxygen | grep "/doxygen$"
#doxygen: /usr/bin/doxygen
#polymake-common: /usr/share/polymake/scripts/doxygen
sudo apt install doxygen
</syntaxhighlight>


<pre  style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: normal;">
=== Fedora ===
$ 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
</pre>


* OPEN ISSUES:
E.g. if the error is:
** libeigen2-devel is no longer available on Tumbleweed via official repos, though it's only needed for kdelibs4support
<syntaxhighlight lang="bash">
Failed to find required Qt component "LinguistTools".


== For Plasma ==
Expected Config file at
* Arch/Manjaro: <code>sudo pacman -Syu --needed plasma-desktop plasma-wayland-session plasma-workspace kwin</code>
"/lib64/cmake/Qt6LinguistTools/Qt6LinguistToolsConfig.cmake" does NOT exist
* Fedora: <code>sudo dnf builddep plasma-desktop plasma-workspace kwin</code> or <code>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</code>
</syntaxhighlight>
* Gentoo: <code>emerge --ask --verbose @kde-plasma</code>
* KDE neon/Debian/Ubuntu/Kubuntu: <code>sudo apt build-dep plasma-desktop plasma-workspace kwin appstream</code>
* openSUSE Leap & Tumbleweed: <code>sudo zypper si -d plasma5-desktop plasma5-workspace kwin5</code>


Any other dependencies can be figured out and installed as you continue building the modules one by one.
run:
<syntaxhighlight lang="bash">sudo dnf install 'cmake(Qt6LinguistTools)'</syntaxhighlight>


== Quick fixes for package manager errors ==
You can also search by file:
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.
<syntaxhighlight lang="bash">dnf provides */Qt6LinguistToolsConfig.cmake
# qt6-qttools-devel-6.5.1-1.fc38.i686 : Development files for qt6-qttools
# Repo        : updates
# Matched from:
# Filename    : /usr/lib/cmake/Qt6LinguistTools/Qt6LinguistToolsConfig.cmake
</syntaxhighlight>


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:
===FreeBSD===
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: normal;">$ sudo apt install $(apt-cache search -n "libkf5.*-dev" | sed 's/ - .*//' | sed '/libkf5example1-dev/d' | sed '/libkf5example2-dev/d')</pre>
In order to be able to run <code>sudo pkg</code> edit the file ~/.profile, uncomment the line:
<pre>
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$HOME/bin; export PATH
</pre>
Reboot the computer.
 
E.g. xmlto executable is missing:
<pre>
pkg search xmlto
# xmlto-0.0.28                  Front-end to an XSL toolchain
pkg install xmlto
</pre>
 
Error <code>makeinfo: not found WARNING: 'makeinfo' is missing on your system.</code>:
<pre>
pkg install pkg-provides
</pre>
Uncomment the following lines in <code>/usr/local/etc/pkg.conf</code> file
and add pkg-provides to the supported plugin list:
<pre>
PKG_PLUGINS_DIR = "/usr/local/lib/pkg/";
PKG_ENABLE_PLUGINS = true;
PLUGINS [ provides ];
</pre>
 
<pre>
pkg plugins
# NAME      DESC                                          VERSION 
# provides  A plugin for querying which package provides a particular file 0.7.3
pkg provides -u
pkg provides bin/makeinfo
# Name    : texinfo-7.0.3,1
# Comment : Typeset documentation system with multiple format output
Repo    : FreeBSD
# Filename: usr/local/bin/makeinfo
pkg install texinfo
</pre>

Latest revision as of 16:40, 30 March 2024

If you have any trouble getting things to build due to missing 3rd-party package dependencies, read on to learn what to do. If you need help, see https://community.kde.org/Get_Involved#Contacting_The_Community.

Missing binary packages per operating system

Fedora KDE 40

kdesrc-build --initial-setup fails with error: Error: Unable to find a match: qaccessibilityclient-devel

Packages to install: qaccessibilityclient-qt6-devel.


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.

Any other dependencies can be figured out and installed as you continue building the modules one by one. For instance, to build Dolphin or Kate, you will need need to also run:

# zypper install libassuan-devel makeinfo graphviz-gd

Fix CMake Error

If you run kdesrc-build in order to build a KDE git repository. And if building fails with a CMake error. Then, that is most often caused by the fact that you do not have installed some binary packages from your Linux OS.

See below for some ideas about how to find out what Linux packages you need to install.

Missing pkgconfig or cmake

If the CMake error looks like:

Build-time dependency gi-docgen found: NO (tried pkgconfig and cmake)

docs/api/meson.build:5:15: ERROR: Dependency "gi-docgen" not found, tried pkgconfig and cmake

The error here is that CMake could not find the pkgconfig named "gi-docgen" (most probably a file with the extension".pc") or the CMake file (most probably a file with the extension".cmake") that contains "gi-docgen" case insensitively in name.

Fedora

  • Maybe we can find the correct package name.
# Is there an rpm package with the name "gi-docgen" installed?
rpm -qa gi-docgen
# It is not installed.

# Is there in the package repositories an rpm with name containing "gi-docgen"?
dnf search gi-docgen
# Returns:
# Last metadata expiration check: ...
#============================================================================== Name #Exactly Matched: gi-docgen #==============================================================================
#gi-docgen.noarch : Documentation tool for GObject-based libraries
#============================================================================= Name & #Summary Matched: gi-docgen #=============================================================================
#gi-docgen-doc.noarch : Documentation for gi-docgen
#gi-docgen-fonts.noarch : Metapackage providing fonts for gi-docgen output

# Install the rpm gi-docgen
dnf install gi-docgen
  • Look for the .pc or .cmake file in the content of all rpm files in all of the enabled package repositories.
dnf repoquery -l gi-docgen
# Returns:
#/usr/bin/gi-docgen
#...
#/usr/share/pkgconfig/gi-docgen.pc

dnf install gi-docgen
  • DNF knows how to install the rpm that contains a given pkgconfig file.
dnf provides 'pkgconfig(gi-docgen)'
# Returns:
#gi-docgen-2023.1-9.fc39.noarch : Documentation tool for GObject-based libraries
#Repo        : fedora
#Matched from:
#Provide    : pkgconfig(gi-docgen) = 2023.1
sudo dnf install 'pkgconfig(gi-docgen)'

Missing executable

If the CMake error looks like:

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Sass (missing: Sass_EXECUTABLE)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  cmake/modules/FindSass.cmake:48 (find_package_handle_standard_args)
  CMakeLists.txt:31 (find_package)

The error here is that CMake could not find the executable named "sass" (most probably a file "/usr/bin/sass").

Fedora

  • DNF knows which rpm contains a given executable.
dnf provides sass
# Returns:
#rubygem-sass-3.7.4-7.fc39.noarch : A powerful but elegant CSS compiler that makes CSS fun again
#Repo        : fedora
#Matched from:
#Filename    : /usr/bin/sass
sudo dnf install rubygem-sass

Debian/Kubuntu/KDE neon

E.g. I am on Kubuntu 22.10, kdesrc-build frameworks fails, module kcoreaddons has CMake (configure) error Could NOT find Qt6LinguistTools (missing: Qt6LinguistTools_DIR).

Option 1:

Search on the internet for ubuntu packages Qt6LinguistTools it returns https://packages.ubuntu.com/kinetic/amd64/qt6-tools-dev Expand "amd64 [list of files]": /usr/lib/x86_64-linux-gnu/cmake/Qt6LinguistTools/Qt6LinguistToolsConfig.cmake

sudo apt install qt6-tools-dev

Option 2:

sudo apt install apt-file
sudo apt-file update
apt-file find Qt6LinguistToolsConfig.cmake
# qt6-tools-dev: /usr/lib/x86_64-linux-gnu/cmake/Qt6LinguistTools/Qt6LinguistToolsConfig.cmake
sudo apt install qt6-tools-dev

If the error is:

The imported target "Qt6::qtwaylandscanner" references the file
     "/usr/lib/qt6/libexec/qtwaylandscanner"
but this file does not exist.

Then:

apt-file find /usr/lib/qt6/libexec/qtwaylandscanner
# qt6-wayland-dev-tools: /usr/lib/qt6/libexec/qtwaylandscanner
sudo apt install qt6-wayland-dev-tools

Option 3:

apt search linguist | grep qt6
# linguist-qt6/kinetic 6.3.1-2 amd64
sudo apt install linguist-qt6

More examples:

# Error "Could not find OsmTools (missing: OSMCONVERT_EXECUTABLE
apt-file search -i OSMCONVERT
# Returns "osmctools: /usr/bin/osmconvert".
sudo apt install osmctools
# Error "Program doxygen found: NO
# doc/meson.build:6:0: ERROR: Program 'doxygen' not found or not executable"
apt-file search doxygen | grep "/doxygen$"
#doxygen: /usr/bin/doxygen
#polymake-common: /usr/share/polymake/scripts/doxygen
sudo apt install doxygen

Fedora

E.g. if the error is:

Failed to find required Qt component "LinguistTools".

Expected Config file at
"/lib64/cmake/Qt6LinguistTools/Qt6LinguistToolsConfig.cmake" does NOT exist

run:

sudo dnf install 'cmake(Qt6LinguistTools)'

You can also search by file:

dnf provides */Qt6LinguistToolsConfig.cmake
# qt6-qttools-devel-6.5.1-1.fc38.i686 : Development files for qt6-qttools
# Repo        : updates
# Matched from:
# Filename    : /usr/lib/cmake/Qt6LinguistTools/Qt6LinguistToolsConfig.cmake

FreeBSD

In order to be able to run sudo pkg edit the file ~/.profile, uncomment the line:

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$HOME/bin; export PATH

Reboot the computer.

E.g. xmlto executable is missing:

pkg search xmlto
# xmlto-0.0.28                   Front-end to an XSL toolchain
pkg install xmlto

Error makeinfo: not found WARNING: 'makeinfo' is missing on your system.:

pkg install pkg-provides

Uncomment the following lines in /usr/local/etc/pkg.conf file and add pkg-provides to the supported plugin list:

PKG_PLUGINS_DIR = "/usr/local/lib/pkg/";
PKG_ENABLE_PLUGINS = true;
PLUGINS [ provides ];
pkg plugins
# NAME       DESC                                          VERSION   
# provides   A plugin for querying which package provides a particular file 0.7.3 
pkg provides -u
pkg provides bin/makeinfo
# Name    : texinfo-7.0.3,1
# Comment : Typeset documentation system with multiple format output
Repo    : FreeBSD
# Filename: usr/local/bin/makeinfo
pkg install texinfo