Jump to content

KDEConnect/Build Linux: Difference between revisions

From KDE Community Wiki
m Correct path in source-kdesrc to reflect what is actually created by kdesrc-build. (The PATH also needs to be updated, but the new path has the architecture in it, so I don't know the most portable fix)
Tosky (talk | contribs)
Line 106: Line 106:


* Telegram: You can find a link to our Telegram group [https://community.kde.org/Telegram here].
* Telegram: You can find a link to our Telegram group [https://community.kde.org/Telegram here].
* IRC on Freenode: #kdeconnect
* IRC on Libera Chat: #kdeconnect
* Mailing List: [https://mail.kde.org/mailman/listinfo/kdeconnect https://mail.kde.org/mailman/listinfo/kdeconnect]
* Mailing List: [https://mail.kde.org/mailman/listinfo/kdeconnect https://mail.kde.org/mailman/listinfo/kdeconnect]
* email ID: [email protected]
* email ID: [email protected]

Revision as of 20:20, 18 June 2021

1. SET UP ENVIRONMENT

Install kdesrc-build

kdesrc-build is a tool to allow you to easily build KDE from its source repositories.

1. Call the following commands in a Terminal window: -

Most Linux-based operating systems do not provide development packages that are up-to-date enough for working on KDE software, so we will compile all the KDE dependencies ourselves. To do this, we use a command-line tool called kdesrc-build to download, manage, and build KDE source code repositories. Let's set it up now! First, we create a new directory for all the KDE source code we will be using. We then clone the source code repository that holds kdesrc-build in that directory, so we have a local copy of it on our computer.

mkdir -p ~/kde/src
cd ~/kde/src/

The development version of kdesrc-build is currently recommended, and can be downloaded from KDE's git server by running: -

git clone https://invent.kde.org/sdk/kdesrc-build.git && cd kdesrc-build

Next, it's time to set up kdesrc-build and pick up the changes it made to your ~/.bashrc for the current terminal session:

./kdesrc-build --initial-setup
source ~/.bashrc

To be sure you are up to speed up to this point, run the following bunch of commands: -

cd $HOME
kdesrc-build -v

You should get something like the following as output: -
kdesrc-build xx.xx (...)

Now you have set up a kdesrc-build installation (the script and its associated modules). Afterwards, you can run...

kdesrc-build --metadata-only

to have kdesrc-build download the current information about the KDE source configuration. From there you can try...

kdesrc-build --pretend


Build kdeconnect-kde from latest source code

To build kdeconnect-kde out of the source code, use the following command.: -

kdesrc-build --include-dependencies kdeconnect-kde

You can find the source code in $HOME/kde/src/kdeconnect-kde with the git history once this command returns.

Test local changes

Developer Recommendation

Add this to your $HOME/.bashrc file: -

## Update shell environment to prefer programs installed by kdesrc-build

function source-kdesrc
{
  PS1="\[\033[01;33m\]  ! !  K D E S R C - T E S T - M O D E  ! ! \n$PS1"
  source "$HOME/kde/build/network/kdeconnect-kde/prefix.sh"
  export PATH="$HOME/kde/usr/lib/libexec/:$PATH"
}

Once this is triggered, the environment will be updated to prefer kdesrc-build versions of any built programs (for eg: kdeconnect-kde). This can be useful for testing applications like kdeconnect-daemon.

If you make changes to some project's source code, update the kdesrc-build version of the project by running the following command: -

kdesrc-build --no-include-dependencies kdeconnect-kde

Once the compilation finishes, run the following command to switch the shell environment to testing mode: -

source-kdesrc

Now, feel free to run any binary from the terminal. Confirm so by using which

which kdeconnectd

You should get something like the following as output: -
/home/XXXXXXXXXX/kde/usr/lib/libexec/kdeconnectd

FREQUENTLY ASKED QUESTIONS

We are only human! There are many doubts that we face commonly, during DevSprints and during the onboarding of new contributors. We'd like to expedite this process for you by enlisting all the commonly asked questions in one place so you don't have to ask around like others had to!

5. How can I contact the KDE Connect team? I'd like to talk to the team about an issue/ suggestion.


Be sure to tell us if you got stuck somewhere in the process of setting up the developer environment. You can mail us. Yes we read and reply to the mails!