KDEConnect/Build Linux: Difference between revisions
(→FREQUENTLY ASKED QUESTIONS: IRC -> libera) |
Andy Holmes (talk | contribs) m (Add `dbus-devel` to Fedora build dependencies) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
= | = Setting up dependencies = | ||
On some distros you will need to install some development packages. | |||
Some package managers also feature a command which will automatically fetch the dependencies for you. | |||
If yours does not, you will need to procure the dependencies by yourself, | |||
in which case you can install/ build those yourself. | |||
* '''Ubuntu''' | |||
** Go to <code>/etc/apt/source.list</code> and enable the source repositories. | |||
** Run the following commands: | |||
*: | |||
*:<syntaxhighlight lang="bash"> | |||
# apt update | |||
# apt-get build-dep kdeconnect | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="bash"> | * '''openSUSE''' | ||
** Run the following commands: | |||
*: | |||
*:<syntaxhighlight lang="bash"> | |||
# zypper si -d kdeconnect-kde | |||
</syntaxhighlight> | </syntaxhighlight> | ||
* '''Arch Linux''' | |||
** Run the following commands: | |||
<syntaxhighlight lang="bash"> | *: | ||
*:<syntaxhighlight lang="bash"> | |||
# pacman -S kdeconnect | |||
</syntaxhighlight> | </syntaxhighlight> | ||
* '''Gentoo''' | |||
** Run the following commands: | |||
<syntaxhighlight lang="bash"> | *: | ||
*:<syntaxhighlight lang="bash"> | |||
# emerge --ask kdeconnect | |||
</syntaxhighlight> | </syntaxhighlight> | ||
** On Gentoo, you may need to enable pulseaudio and bluetooth USE flags for respective features. | |||
* '''Fedora''' | |||
** Run the following commands: | |||
<syntaxhighlight lang="bash"> | *: | ||
*:<syntaxhighlight lang="bash"> | |||
# dnf builddep kde-connect | |||
# dnf install dbus-devel qt5-qtquickcontrols2-devel | |||
</syntaxhighlight> | </syntaxhighlight> | ||
= Build and install kdeconnect-kde = | |||
<syntaxhighlight lang="bash"> | * Next, uninstall the distribution-provided version of kdeconnect before continuing, otherwise, you might end up in a confusing situation | ||
where some plugins are being provided by the system-installed version and others are coming from your new build. | |||
* If you want to build KDE Connect yourself, you'll first need to grab the code from git. | |||
*:<syntaxhighlight lang="bash"> | |||
git clone https://invent.kde.org/network/kdeconnect-kde.git | |||
</syntaxhighlight> | </syntaxhighlight> | ||
* Note: if you plan to contribute code to '''KDE Connect''', you're advised to [https://community.kde.org/KDEConnect#Setting_up_KDE_Connect_Repository_for_Development set up your clone for contributing]. | |||
to | * If you intend to develop '''KDE Connect''' or experience a crash and are asked to give a backtrace, build '''KDE Connect''' with debugging symbols. Do this by adding the '''-DCMAKE_BUILD_TYPE=Debug''' flag before the two dots at the end of the '''cmake''' command. For example: | ||
*: | |||
<syntaxhighlight lang="bash"> | *:<syntaxhighlight lang="bash"> | ||
cmake -DCMAKE_INSTALL_PREFIX=~/kde-prefix -DCMAKE_BUILD_TYPE=Debug .. | |||
</syntaxhighlight> | </syntaxhighlight> | ||
== Installing to ~/kde-prefix == | |||
For development, it is recommended to install to your home directory and test changes using prefix.sh. | |||
This gives a faster development cycle and avoids clobbering your system-installed version with a potentially unstable WIP version. | |||
To build | # To configure: | ||
#:<syntaxhighlight lang="bash"> | |||
<syntaxhighlight lang="bash"> | cd kdeconnect-kde | ||
mkdir build | |||
cd build | |||
cmake -DCMAKE_INSTALL_PREFIX=~/kde-prefix .. | |||
</syntaxhighlight> | |||
# To build and install: | |||
#:<syntaxhighlight lang="bash"> | |||
make -j$(nproc) install | |||
</syntaxhighlight> | |||
# To run an executable, for example, kdeconnectd: | |||
#:<syntaxhighlight lang="bash"> | |||
source build/prefix.sh | |||
killall kdeconnectd; ~/kde-prefix/lib64/libexec/kdeconnectd | |||
</syntaxhighlight> | </syntaxhighlight> | ||
#: The daemon is in an obscure location. Other executables, such as the SMS app or the settings app, are on the path provided by prefix.sh, and can be found in <code>~/kde-prefix/bin</code>, i.e., for example, to test changes to the SMS app, do: | |||
#:<syntaxhighlight lang="bash"> | |||
source build/prefix.sh | |||
killall kdeconnect-sms; ~/kde-prefix/bin/kdeconnect-sms | |||
<syntaxhighlight lang="bash"> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
== Installing to / == | |||
If you want to daily-drive the latest source code of '''KDE Connect''', you can install it to the system. | |||
This is not recommended for day-to-day development since it requires <code>sudo</code> access. | |||
<syntaxhighlight lang="bash"> | # To configure: | ||
#:<syntaxhighlight lang="bash"> | |||
cd kdeconnect-kde | |||
mkdir build | |||
cd build | |||
cmake -DCMAKE_INSTALL_PREFIX=/usr .. | |||
</syntaxhighlight> | </syntaxhighlight> | ||
# To build and install: | |||
#:<syntaxhighlight lang="bash"> | |||
make | |||
<syntaxhighlight lang="bash"> | sudo make install | ||
</syntaxhighlight> | </syntaxhighlight> | ||
'' | * '''NOTE''': If you install KDE Connect in a custom location, you'll need to run <code>kdeconnectd</code> manually, since DBus doesn't know about it. |
Latest revision as of 02:40, 23 August 2023
Setting up dependencies
On some distros you will need to install some development packages. Some package managers also feature a command which will automatically fetch the dependencies for you. If yours does not, you will need to procure the dependencies by yourself, in which case you can install/ build those yourself.
- Ubuntu
- Go to
/etc/apt/source.list
and enable the source repositories. - Run the following commands:
# apt update # apt-get build-dep kdeconnect
- Go to
- openSUSE
- Run the following commands:
# zypper si -d kdeconnect-kde
- Arch Linux
- Run the following commands:
# pacman -S kdeconnect
- Gentoo
- Run the following commands:
# emerge --ask kdeconnect
- On Gentoo, you may need to enable pulseaudio and bluetooth USE flags for respective features.
- Fedora
- Run the following commands:
# dnf builddep kde-connect # dnf install dbus-devel qt5-qtquickcontrols2-devel
Build and install kdeconnect-kde
- Next, uninstall the distribution-provided version of kdeconnect before continuing, otherwise, you might end up in a confusing situation
where some plugins are being provided by the system-installed version and others are coming from your new build.
- If you want to build KDE Connect yourself, you'll first need to grab the code from git.
git clone https://invent.kde.org/network/kdeconnect-kde.git
- Note: if you plan to contribute code to KDE Connect, you're advised to set up your clone for contributing.
- If you intend to develop KDE Connect or experience a crash and are asked to give a backtrace, build KDE Connect with debugging symbols. Do this by adding the -DCMAKE_BUILD_TYPE=Debug flag before the two dots at the end of the cmake command. For example:
cmake -DCMAKE_INSTALL_PREFIX=~/kde-prefix -DCMAKE_BUILD_TYPE=Debug ..
Installing to ~/kde-prefix
For development, it is recommended to install to your home directory and test changes using prefix.sh. This gives a faster development cycle and avoids clobbering your system-installed version with a potentially unstable WIP version.
- To configure:
cd kdeconnect-kde mkdir build cd build cmake -DCMAKE_INSTALL_PREFIX=~/kde-prefix ..
- To build and install:
make -j$(nproc) install
- To run an executable, for example, kdeconnectd:
source build/prefix.sh killall kdeconnectd; ~/kde-prefix/lib64/libexec/kdeconnectd
- The daemon is in an obscure location. Other executables, such as the SMS app or the settings app, are on the path provided by prefix.sh, and can be found in
~/kde-prefix/bin
, i.e., for example, to test changes to the SMS app, do: source build/prefix.sh killall kdeconnect-sms; ~/kde-prefix/bin/kdeconnect-sms
Installing to /
If you want to daily-drive the latest source code of KDE Connect, you can install it to the system.
This is not recommended for day-to-day development since it requires sudo
access.
- To configure:
cd kdeconnect-kde mkdir build cd build cmake -DCMAKE_INSTALL_PREFIX=/usr ..
- To build and install:
make sudo make install
- NOTE: If you install KDE Connect in a custom location, you'll need to run
kdeconnectd
manually, since DBus doesn't know about it.