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

From KDE Community Wiki
m (https://community.kde.org/Get_Involved#Contacting_The_Community)
(Add chapter Fix CMake Error)
Line 41: Line 41:


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.
== Fix CMake Error ==
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 or cmake file.

Revision as of 08:30, 27 October 2023

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

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.

Fix CMake Error

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 or cmake file.