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

From KDE Community Wiki
(Remove stuff that duplicates what kdesrc-build --initial-setup does)
(Instead of a chapter "Missing binary packages per operating system" we should create merge requests for the KDE git repo sysadmin-repo-metadata)
 
(18 intermediate revisions by 3 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.}}
 
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).
 
If you need help, see https://community.kde.org/Get_Involved#Getting_in_Touch_and_Working_Together
 
=== Enable the source repositories ===
 
<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> . Open the file <code>/etc/apt/sources.list</code> 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 <code>/etc/apt/sources.list</code> 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 ==
=== KDE neon, Debian, Ubuntu, Kubuntu ===
=== KDE neon, Debian, Ubuntu, Kubuntu ===
All the build packages known by the package you want to build can be installed by running:


<code>sudo apt build-dep <package you want to build></code>
Enable <code>deb-src</code> apt repositories.
All the build dependencies for the module that you want to build can be installed by running:
 
<code>sudo apt build-dep <Debian package which corresponds to the module that you want to build></code>


For example, to install the build dependencies for Dolphin, run:
For example, to install the build dependencies for Dolphin, run:
Line 29: Line 13:
<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 42:
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.


Any other dependencies can be figured out and installed as you continue building the modules one by one.
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:
 
{{Input|1=<nowiki>
# zypper install libassuan-devel makeinfo graphviz-gd
</nowiki>}}
 
== 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:
<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>
 
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.
 
# 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
</pre>
 
* Look for the .pc or .cmake file in the content of all rpm files in all of the enabled package repositories.
 
<pre>
dnf repoquery -l gi-docgen
# Returns:
#/usr/bin/gi-docgen
#...
#/usr/share/pkgconfig/gi-docgen.pc
 
dnf install gi-docgen
</pre>
 
* DNF knows how to install the rpm that contains a given pkgconfig file.
 
<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>
 
=== Missing executable ===
 
If the CMake error looks like:
<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>
 
=== 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
# Or
apt-file search -i Qt6LinguistTools
# All results are from the package qt6-tools-dev e.g.:
# 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>
 
Option 3:
<syntaxhighlight lang="bash">
apt search linguist | grep qt6
# linguist-qt6/kinetic 6.3.1-2 amd64
sudo apt install linguist-qt6
</syntaxhighlight>
 
More examples:
<syntaxhighlight lang="bash">
# Error "Could not find OsmTools (missing: OSMCONVERT_EXECUTABLE
apt-file search -i OSMCONVERT
# Returns "osmctools: /usr/bin/osmconvert".
sudo apt install osmctools
</syntaxhighlight>
 
<syntaxhighlight lang="bash">
# 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>
 
=== Fedora ===
 
E.g. if the error is:
<syntaxhighlight lang="bash">
Failed to find required Qt component "LinguistTools".
 
Expected Config file at
"/lib64/cmake/Qt6LinguistTools/Qt6LinguistToolsConfig.cmake" does NOT exist
</syntaxhighlight>
 
run:
<syntaxhighlight lang="bash">sudo dnf install 'cmake(Qt6LinguistTools)'</syntaxhighlight>
 
You can also search by file:
<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>
 
===FreeBSD===
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>


== Quick fixes for package manager errors ==
Error <code>makeinfo: not found WARNING: 'makeinfo' is missing on your system.</code>:
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.
<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>


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:
<pre>
<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>
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 18:02, 10 August 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.

How to install the dependencies of one package

KDE neon, Debian, Ubuntu, Kubuntu

Enable deb-src apt repositories. All the build dependencies for the module that you want to build can be installed by running:

sudo apt build-dep <Debian package which corresponds to the module that 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
# Or
apt-file search -i Qt6LinguistTools
# All results are from the package qt6-tools-dev e.g.:
# 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