KDE PIM/Development/Start: Difference between revisions

From KDE Community Wiki
(→‎Setting up kdesrc-build: CMAKE_BUILD_TYPE should be "debug", not "debugfull")
(Revamp this page to be more compact, accurate, and user-friendly)
Line 1: Line 1:
= Getting Started =
= Prerequisites =
You might want to make a backup of your valuable data. Most of it lives in <nowiki>~/.kde</nowiki>. You may also backup your Akonadi server config files in <nowiki>~/.config/akonadi</nowiki> and your kdepim applications data in <nowiki>~/.local/share/akonadi</nowiki>. It may be easier to just create an additional user and give it a copy of your data, and run PIM master there.


To get started, all you really need is a [[#Git - a Source Code Control System|git clone]]. After that, you can compile and run the latest-and-greatest (and maybe buggy) versions of the KDE PIM applications.
When you find a bug, you can fix it, create a patch, and send it to us! That's the way KDE PIM applications are continually improving. There is much more information available to begin with, though.


Here is a checklist of things to launch yourself into the world of KDE PIM development.
= Compiling KDE PIM =
For lots of them, it is most important that you know they exist:
KDE PIM is currently split across 40 modules. To build them all in the correct order, you should use [https://kdesrc-build.kde.org/ kdesrc-build]. Setting it up is detailed at [[Get Involved/development]].


* Subscribe to the right [[#Mailing Lists|mailing lists]]. Read them regularly.
{{Note|You really need to build and submit patches against Git master to make a positive contribution to KDE PIM. If you work on or with the last released version, you're usually a month or four behind the times, and that makes a huge difference in KDE PIM.}}
* Browse the information about the [[#Common KDE Developer information|development tools]], to choose one. Most KDE PIM hackers use kate, vi, or emacs as editor and just compile in a konsole window, though.
* Take a brief look at the [http://doc.trolltech.com/4.7 Qt documentation]. It is excellent, and you should know about QWidgets and QObjects a little before continuing.
* Take a brief look at the [http://api.kde.org/ KDE documentation]. It is a bit overwhelming.
* Spend some time over at the [http://www.kde.org/community/getinvolved/ KDE Community website].
* Get the [[#prerequisites|prerequisites]] for building KDE PIM master. Note that you really want to follow master to make a positive contribution to KDE PIM. <br />
If you work on or with the last released version, you're usually a month or four behind the times, and that makes a huge difference in KDE PIM. You can work with a stable system -- the latest released KDE libs and base -- and put (relatively) unstable PIM HEAD on it.
* Clone the relevant [[#Git - a Source Code Control System|Git repositories]].
* Compile it and install.
* Report bugs, wishes, fix bugs, get involved!


== Mailing Lists ==
Add the following to your <nowiki>~/.kdesrc-buildrc</nowiki> file:


Mailing lists are probably the ultimate source of development information. Follow discussions of KDE core and application developers and ask your questions. Unless you don't think about what you are saying, you will surely get an answer. Subscribe to the [http://mail.kde.org/mailman/listinfo/kde-pim kde-pim mailing list]. It is for '''discussion about development'''. Please don't wildly post all your compilation problems there. Ask on [[#IRC (Chat)|IRC]] for such issues.
<pre>
include ~/kde/src/kdesrc-build/kf5-frameworks-build-include
include ~/kde/src/kdesrc-build/kf5-kdepim-build-include
include ~/kde/src/kdesrc-build/kf5-applications-build-include
include ~/kde/src/kdesrc-build/kf5-workspace-build-include
</pre>


== IRC (Chat) ==
In addition, you cannot use the standard <nowiki>prefix.sh</nowiki> file mentioned on the [[Get Involved/development]] page; you must use a custom script:
 
Most of the developers hang around in one development IRC channel or another. On [http://www.freenode.net/ freenode] (irc.kde.org), you can find:
 
* #KDE for the user questions.
* #akonadi for development discussion on Akonadi.
* #kontact for development discussion on Kontact and its components. Please don't post user-questions there.
 
There are a variety of IRC (Chat) programs available. KDE ships with [http://konversation.kde.org/ Konversation]. XChat is available in many installations as well.
 
== Common KDE Developer information ==
 
Visit the [http://techbase.kde.org KDE techbase site] for very detailed information about KDE development.
You'll find lots of stuff, e.g. documentation, tutorials, reference guides, etc.
 
http://techbase.kde.org/Projects/PIM has lots of informations you may read before starting contributing to KDE PIM.
 
http://userbase.kde.org/Kontact is the central place for user tips and tricks.
 
[http://www.kdevelop.org/ KDevelop] is an Integrated Development Environment for KDE.
 
For recent news about KDE development you may not miss the KDE news site at [http://dot.kde.org/ dot.kde.org].
 
== Prerequisites ==
 
You might want to make a backup of your valuable data, though. Most of it lives in <small>.kde</small>, in your home directory; You may also backup your Akonadi server config files in <small>$HOME/.config/akonadi</small> and your kdepim applications data in <small>$HOME/.local/share/akonadi</small>.
It may be easier to just create an additional user and give it a copy of your data, and run PIM master there.
 
== Git - a Source Code Control System ==
 
The KDE PIM repositories can be visited via web at http://cgit.kde.org
 
== Compiling ==
 
KDE PIM is currently split to over 40 modules. To build them all in the correct order, one should use [https://kdesrc-build.kde.org/ kdesrc-build].
 
If you already have kdesrc-build set up, you can skip the following part.
 
=== Setting up kdesrc-build ===
 
If you never user kdesrc-build before, you want to do at least an initial configuration to set where should kdesrc-build install the compiled binaries. The configuration is in .kdesrc-buildrc file in your home directory.
 
~/.kdesrc-buildrc:
<nowiki>global
    # KDE install directory
    kdedir /opt/kde-devel
 
    # Directory for downloaded source code
    source-dir ~/devel/KDE/
 
    # Directory to build KDE into before installing
    build-dir build
 
    # Use multiple cores for building. Other options to GNU make may also be
    # set.
    make-options -j4
 
    # Build with full debugging information
    cmake-options -DCMAKE_BUILD_TYPE=debug
 
end global
 
include /path/to/kdesrc-build/kf5-frameworks-build-include
include /path/to/kdesrc-build/kf5-kdepim-build-include
include /path/to/kdesrc-build/kf5-applications-build-include
include /path/to/kdesrc-build/kf5-workspace-build-include</nowiki>
 
You may want to customize some of the options above to fit your desired environment.
 
=== Setting up environment ===
 
Since the binaries will be installed to a non-standard location, you must adjust a few environment variables to point to the new location.
 
Here comes the important decision: you can either have a script that your <nowiki>source</nowiki> every time before running the development version of KDE PIM, or you can just add the environment settings to your <nowiki>~/.bashrc</nowiki> and use the devleopment version of KDE PIM by default.


<pre>
  # This must match the path in kdedir option in kdesrc-buildrc
  # This must match the path in kdedir option in kdesrc-buildrc
  export KDE_PREFIX=/opt/kde-devel
  export KDE_PREFIX=~/kde/usr
   
   
  export PATH="${KDE_PREFIX}/bin:${PATH:-/usr/local/bin:/usr/bin:/bin}"
  export PATH="${KDE_PREFIX}/bin:${PATH:-/usr/local/bin:/usr/bin:/bin}"
Line 109: Line 32:
  export XDG_CONFIG_DIRS="${KDE_PREFIX}/etc/xdg:${XDG_CONFIG_DIRS:-/etc/xdg}"
  export XDG_CONFIG_DIRS="${KDE_PREFIX}/etc/xdg:${XDG_CONFIG_DIRS:-/etc/xdg}"
   
   
  # Enable this if you want to have the devel version in parallel with the stable
  # Un-comment this if you want to have the devel version in parallel with the stable version installed by your distro
  #export AKONADI_INSTANCE=devel
  #export AKONADI_INSTANCE=devel
</pre>


Again, you may need to update some of the variables to fit your environment.
You may need to update some of the variables to fit your environment.


=== Compiling KDE PIM ===
Now, compile everything!
{{Input|1=<nowiki>
kdesrc-build kde-pimlibs kde-pim
</nowiki>}}


KDE PIM depends on KDE Frameworks 5, Qt 5 and some additional libraries (like libical). If you distribution provides new-enough versions of all these libraries, you can compile KDE PIM against them, just make sure you have all the development packages for those libraries installed.
If the build fails, you can check the log file to see why it failed. It will likely be because of a missing dependency.


<nowiki>kdesrc-build kde-pimlibs kde-pim</nowiki>


If the build fails, you can check the log file to see why it failed. It will likely be because of a missing dependency.
= Running KDE PIM =
There are two methods to run KDE PIM:
* <code>source</code> the custom script you created earlier and then run <code>akonadictl --instance devel start</code>. This will start a new instance of Akonadi which will run in parallel with the system one.
* Put the contents of the custom script you created earlier into your <nowiki>~/.bashrc</nowiki> file, then log out and then log back in. Thereafter, whenever you run KDE PIM, it will be from your compiled version


=== Running KDE PIM ===


If you put the environment changes to your ~/.bashrc, you probably want to log out and back in to get the new environment applied globally. When you now run any KDE PIM app, it will start Akonadi all the KDE PIM apps from the new prefix. Otherwise you can just <nowiki>source</nowiki> the script in a terminal and run <nowiki>akonadictl --instance devel start</nowiki>. This will start a new instance of Akonadi which will run in parallel with the system one.
= Additional information =
* Now that you can compile KDE PIM from source, when you find a bug you can fix it, create a patch, and send it to us!
* Subscribe to the [http://mail.kde.org/mailman/listinfo/kde-pim kde-pim mailing list]. It is for '''discussion about development'''. Please don't wildly post all your compilation problems there. Ask on [[#IRC (Chat)|IRC]] for such issues.
* Most of the developers hang around in one development IRC channel or another. On [http://www.freenode.net/ freenode] (irc.kde.org), you can find <nowiki>#akonadi</nowiki> for development discussion on Akonadi, and <nowiki>#kontact</nowiki> for development discussion on Kontact and its components. Please don't post user-questions there.
* [https://doc.qt.io/qt-5/ Qt documentation]
* [http://api.kde.org/ KDE API documentation]
* Visit the [http://techbase.kde.org KDE techbase site] for very detailed information about KDE development. You'll find lots of stuff, e.g. documentation, tutorials, reference guides, etc.
* http://techbase.kde.org/Projects/PIM has lots of information you may read before starting contributing to KDE PIM.
* http://userbase.kde.org/Kontact is the central place for user tips and tricks.

Revision as of 04:22, 30 December 2018

Prerequisites

You might want to make a backup of your valuable data. Most of it lives in ~/.kde. You may also backup your Akonadi server config files in ~/.config/akonadi and your kdepim applications data in ~/.local/share/akonadi. It may be easier to just create an additional user and give it a copy of your data, and run PIM master there.


Compiling KDE PIM

KDE PIM is currently split across 40 modules. To build them all in the correct order, you should use kdesrc-build. Setting it up is detailed at Get Involved/development.

Note

You really need to build and submit patches against Git master to make a positive contribution to KDE PIM. If you work on or with the last released version, you're usually a month or four behind the times, and that makes a huge difference in KDE PIM.


Add the following to your ~/.kdesrc-buildrc file:

include ~/kde/src/kdesrc-build/kf5-frameworks-build-include
include ~/kde/src/kdesrc-build/kf5-kdepim-build-include
include ~/kde/src/kdesrc-build/kf5-applications-build-include
include ~/kde/src/kdesrc-build/kf5-workspace-build-include

In addition, you cannot use the standard prefix.sh file mentioned on the Get Involved/development page; you must use a custom script:

 # This must match the path in kdedir option in kdesrc-buildrc
 export KDE_PREFIX=~/kde/usr
 
 export PATH="${KDE_PREFIX}/bin:${PATH:-/usr/local/bin:/usr/bin:/bin}"
 export LD_LIBRARY_PATH="${KDE_PREFIX}/lib64:${KDE_PREFIX}/lib:$LD_LIBRARY_PATH"
 export QT_PLUGIN_PATH="${KDE_PREFIX}/lib64/plugins:${KDE_PREFIX}/lib/plugins:${QT_PLUGIN_PATH:-/usr/lib64/qt5/plugins:/usr/lib/qt5/plugins}"
 export QML2_IMPORT_PATH="${KDE_PREFIX}/lib64/qml:${KDE_PREFIX}/lib/qml:${QML2_IMPORT_PATH:-/usr/lib64/qt5/qml:/usr/lib/qt5/qml}"
 export PKG_CONFIG_PATH="${KDE_PREFIX}/lib64/pkgconfig:${KDE_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH:-/usr/lib64/pkgconfig:/usr/lib/pkgconfig}"
 export XDG_DATA_DIRS="${KDE_PREFIX}/share:${XDG_DATA_DIRS:-/usr/share}"
 export SASL_PATH="${KDE_PREFIX}/lib64/sasl2:${KDE_PREFIX}/lib/sasl2:${SASL_PATH:-/usr/lib64/sasl2:/usr/lib/sasl2}"
 export XDG_CONFIG_DIRS="${KDE_PREFIX}/etc/xdg:${XDG_CONFIG_DIRS:-/etc/xdg}"
 
 # Un-comment this if you want to have the devel version in parallel with the stable version installed by your distro
 #export AKONADI_INSTANCE=devel

You may need to update some of the variables to fit your environment.

Now, compile everything!

kdesrc-build kde-pimlibs kde-pim

If the build fails, you can check the log file to see why it failed. It will likely be because of a missing dependency.


Running KDE PIM

There are two methods to run KDE PIM:

  • source the custom script you created earlier and then run akonadictl --instance devel start. This will start a new instance of Akonadi which will run in parallel with the system one.
  • Put the contents of the custom script you created earlier into your ~/.bashrc file, then log out and then log back in. Thereafter, whenever you run KDE PIM, it will be from your compiled version


Additional information

  • Now that you can compile KDE PIM from source, when you find a bug you can fix it, create a patch, and send it to us!
  • Subscribe to the kde-pim mailing list. It is for discussion about development. Please don't wildly post all your compilation problems there. Ask on IRC for such issues.
  • Most of the developers hang around in one development IRC channel or another. On freenode (irc.kde.org), you can find #akonadi for development discussion on Akonadi, and #kontact for development discussion on Kontact and its components. Please don't post user-questions there.
  • Qt documentation
  • KDE API documentation
  • Visit the KDE techbase site for very detailed information about KDE development. You'll find lots of stuff, e.g. documentation, tutorials, reference guides, etc.
  • http://techbase.kde.org/Projects/PIM has lots of information you may read before starting contributing to KDE PIM.
  • http://userbase.kde.org/Kontact is the central place for user tips and tricks.