Jump to content

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

From KDE Community Wiki
Ngraham (talk | contribs)
Remove stuff that duplicates what kdesrc-build --initial-setup does
Ngraham (talk | contribs)
Pare down what's left of the page to only what's useful
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#Getting_in_Touch_and_Working_Together.
 
{{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, etc ===
All the build packages known by the package you want to build can be installed by running:
All the build packages known by the package you want to build can be installed by running:



Revision as of 21:43, 27 June 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#Getting_in_Touch_and_Working_Together.

How to install the dependencies of one package

KDE neon, Debian, Ubuntu, Kubuntu, etc

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.

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')