Difference between revisions of "Calligra/Building/3"

(Getting error "fatal: remote error: Please use the https: protocol to connect to anongit" when using "git:" protocol, so I fixed it by substituting "git" to "https")
 
(75 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Note|'''Work in progress, don't trust these instructions. They are for the Qt5-based Calligra 3.x on Unix and similar operating systems.''' For the (latest stable - {{Calligra/Stable}}) Qt4-based Calligra, look at [[Calligra/Building/2]]. For Windows, click [[Calligra/Building_Calligra_on_Windows|here]], for Mac OS X click [[Calligra/Building_Calligra_on_OSX|here]].}}
+
{{Note|'''These instructions are for the Qt 5-based Calligra 3.x on Unix-like operating systems. Work in progress.'''
  
= Preparation =
+
To build the stable Qt 4 based Calligra see [[Calligra/Building/2]].
{{Warning|First, to avoid conflicting copies of software, '''make sure you do not have other copy of Calligra or KOffice''' either installed through the package manager of your distribution or installed in any other way. Calligra and KOffice are mutually exclusive!}}
 
  
{{Warning|Follow this guide as an ordinary user. Do not login as '''root'''!}}
+
'''Exception for apps that are have separate git repositories and build systems:
 +
*Krita ≥ 3.0 → see [[Krita#Build_Instructions|here]]
 +
*Kexi ≥ 3.0 → see [[Kexi/Building|here]] (not ready, points back to this page)
 +
*Plan ≥ 3.2 → Has pt no build instructions
  
{{Warning|Some distributions (*Buntu, Arch) are now making Qt5 the defaulft! That does not work. Do not try to use Qt5, use Qt4. Make sure packages like qt4-default are installed. You might have to also switch your default Qt setup with a tool like qtchooser}}
 
  
== Recommended Setup ==
+
'''Building for 'special' OSes:'''
Here is recommendation of a directory structure:
+
*Windows → see [[Calligra/Building_Calligra_on_Windows|here]]
;$HOME/kde/src/:source code
+
*Mac OS X → see [[Calligra/Building_Calligra_on_OSX|here]]
;$HOME/kde/build/calligra:directory that Calligra will be built in
 
;$HOME/kde/inst:directory that Calligra will be installed in
 
  
The ''build'' directory is needed because you cannot (or should not) build Calligra inside the source directory; the source and build directory have to be separated.
 
  
Create these directories with:
+
'''You are encouraged to update these pages with any new information you come across.'''}}
  
  mkdir -p ~/kde/src; mkdir -p ~/kde/build; mkdir -p ~/kde/inst
+
= Preparation =
 +
{{Warning|Follow this guide as an ordinary user. '''Do not login as root or issue commands with sudo'''! Calligra should install and run correctly within in your home directory. If it doesn't, you have discovered a bug.}}
 +
{{Warning|First, to avoid conflicting copies of configuration files, '''make sure you do not have other copy of Calligra installed''' on your computer, be it from an older build or your package manager.  If you have installed Calligra through a package manager, purge the settings files during your uninstall if the option is available.}}
 +
{{Note | These instructions are meant as a high-level guide to getting Calligra running from source code.  Getting under the hood will to make changes require you learn details about Qt, KDE frameworks, as are comfortable with development applications like cmake and git.  You can find information, tools and tutorials on KDE's TechBase Wiki. 
  
'''Advantages of this setup:'''
+
https://techbase.kde.org/}}
*It is possible to have different builds (e.g. with different options out of the same source code)
 
*[http://techbase.kde.org/Getting_Started/Increased_Productivity_in_KDE4_with_Scripts David Faure's scripts] can be used to make development easier. With those scripts "make" can be typed in the source directory and building will happen in the right (build) directory automatically.
 
  
Also, check the [http://techbase.kde.org/Getting_Started/Build Techbase instructions on setting up a build environment]. That contains some useful scripts and functions.
 
  
== Getting the Source Code ==
+
== Recommended Setup ==
There are two most useful options:
 
#'''Get the source code for the latest stable version.'''
 
#'''Get the source code for the current development version.''' Needed to test, check and give feedback about features that is in development and have not been released yet.
 
  
If unsure pick the stable version.
+
You must begin with a C++ development toolkit including gcc, git, and cmake.  These applications will be available in your distribution's package repositories.
  
=== Latest Stable Version ===
+
Next you must prepare a directory structure to contain your build.  These instructions will assume the following following recommended layout:
 +
;$HOME/kde/src/:source code
 +
;$HOME/kde/build/calligra:directory that Calligra will be built in
 +
;$HOME/kde/inst5:directory that Calligra will be installed in
  
The latest stable Calligra version is '''{{Calligra/Stable}}'''.
+
The build directory for Calligra ''must'' be separate from the source directory. You can see more discussion why this is [https://techbase.kde.org/Development/CMake/Building here]. The build configuration given here is compatible with build automation scripts found on that page.
  
*'''Option 1: It can be downloaded as a single archive file''' from http://download.kde.org/stable/calligra-{{Calligra/Stable}}/calligra-{{Calligra/Stable}}.tar.xz. Right now it weights about 114 MiB. The source code has to be uncompressed using:
+
Create these directories with:
 +
mkdir -p $HOME/kde/build/calligra
 +
mkdir -p $HOME/kde/inst5
 +
mkdir -p $HOME/kde/src
  
 +
You may also want to check the [http://techbase.kde.org/Getting_Started/Build Techbase instructions on setting up a build environment], which links to additional useful scripts and functions.
  
tar xJf calligra-{{Calligra/Stable}}.tar.xz
+
== Getting the Source Code ==
 
+
Here we will walk through obtaining the source code to build the Calligra configuration of your choosing.
:Then ''calligra-{{Calligra/Stable}}'' will appear. You '''do not''' need to execute initrepo.sh in it, the code is ready to build. Please note there is a price for smaller download: to update the source code to a newer version, another .tar.xz should be downloaded. See the option 2 to see how to address this with one-time bigger updatable download.
 
 
 
:When the source code is properly downloaded, the next step is to ensure that [[#Build_Requirements|build requirements]] are met and to [[#Build_Calligra|build Calligra]].
 
 
 
*'''Option 2: Alternative download from the git repository''', what weights about 650MB. If you prefer, stable versions are also available on the git repository too. It is heavier but one-time download, the advantage is that lightweight updates can be obtained without a need for downloading entire source code again.
 
  
:To get stable version x.y (currently {{Calligra/Stable}}) from git, first follow instructions for downloading [[#Development Version|the development version]] below, either the Option #1 (directly from git) or the Option #2 (download a repository tarball). Then you need to switch from the development version to stable version of the source code. To do so, in the main Calligra source code directory that has been downloaded, type:
+
=== Download instructions ===
 +
We will configure Git for easier access to KDE.   Add the following text to your ~/.gitconfig:  
  
git checkout calligra/{{Calligra/StableBranch}}
+
  <nowiki>[url "https://anongit.kde.org/"]</nowiki>
 
 
:''calligra/x.y'' is a notation for branches in the Calligra project. For the latest stable version {{Calligra/Stable}} the branch is called calligra/{{Calligra/StableBranch}} and contains code updates for current minor stable release '''{{Calligra/Stable}}''' plus updates for the next minor planned stable update (if there is any [[../Schedules|planned]]).
 
 
 
:When the source code is properly downloaded, the next step is to ensure that [[#Build_Requirements|build requirements]] are met and to [[#Build_Calligra|build Calligra]].
 
 
 
=== Development Version ===
 
 
 
The latest development version of Calligra is '''{{Calligra/Unstable}} {{Calligra/Stage}}'''; developers always refer to it as to '''master'''. Applications from ''Master'' should always compile and be reasonably stable. Calligra developers never place experimental features there. Once tested and released, ''Master'' becomes the new current stable version {{Calligra/UnstableBranch}}.
 
 
 
''TODO: Here we should explain local branches, staging and always-release-ready Master, if we have that setup.''
 
 
 
*'''Option 1: directly from git'''
 
 
 
To retrieve the source code from Git you have to use the following setup:
 
 
 
Add the following text to your ~/.gitconfig:
 
 
 
  <nowiki>[url "git://anongit.kde.org/"]</nowiki>
 
 
     insteadOf = kde:
 
     insteadOf = kde:
 
  [url "ssh://[email protected]/"]
 
  [url "ssh://[email protected]/"]
 
     pushInsteadOf = kde:
 
     pushInsteadOf = kde:
  
Then execute
+
This sets up a kde: prefix which allows us to use a shorthand for the KDE repository URL to use in Git.  It sets up read access to happen anonymously, and directs pushes to authenticated SSH. 
  
$ git clone kde:calligra
+
Now navigate to your build directory and pull the repository by executing:
 +
  cd $HOME/kde/src/
 +
  git clone kde:calligra
 +
 
 +
Git will expand kde:calligra to https://anongit.kde.org/calligra automatically based on your configuration.  If you are following the recommended directory layout you should now have a source folder <code>$HOME/kde/src/calligra</code> containing the source code.  If you accidentally cloned the source to the wrong place, you can simply move it to the new location.  Git is extremely flexible about the location of its files.
  
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.
+
=== Choosing the right branch to build ===
 +
Now that you have got the Calligra repository you will be able to switch to the branch of your choosing.
 +
The latest development version of Calligra is '''{{Calligra/Unstable}} {{Calligra/Stage}}'''; developers always refer to it as to '''master'''. Applications from '''master''' should always compile and be reasonably stable. Calligra developers never place experimental features there. Once tested and released, '''master''' becomes the new current stable version {{Calligra/UnstableBranch}}.  
  
Note that pushing your changes will only work if you have a KDE developer identity. You can get a contributor account as explained on [http://techbase.kde.org/Contribute/Get_a_Contributor_Account the KDE Techbase].
+
''TODO: Here we should explain local branches, staging and always-release-ready master, if we have that setup.''
  
The $HOME/kde/src/calligra directory will be created regardless of the way how the source code has been downloaded.
+
= Build Requirements =
 +
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.  Thankfully, obtaining the dependencies for Calligra in the major distributions is often fairly straightforward through the package managers.
  
*'''Option 2: download a repository tarball'''
+
The exact commands needed will vary from distribution to distribution.  For more information on how to use your package manager to obtain the dependencies below, please consult the [[#Distribution_Specific_Configuration_Instructions|distribution specific instructions]].  At the end of this section, you should have most of the dependencies from the list below installed on your machine.
  
Go to https://projects.kde.org/projects/calligra/repository. Press the "Tarball" button. Copy the url text and paste it on your command line. It will look like:
 
  
wget -c http://anongit.kde.org/calligra/calligra-latest.tar.gz
+
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, a request with an explanation of the reason must be posted on calligra-[email protected]kde.org to discuss with the developers and maintainers. Only dependencies available in all of the major widely used distributions (i.e. Fedora, OpenSuSE, and Debian/(K)ubuntu) will be considered.}}
  
Unpack and cd into directory, then run
+
=== List of required dependencies ===
 +
The following are the general must-have dependencies for Calligra.  If you are selecting packages by hand please be sure you  install the development library versions, preferably with debug symbols.
  
  $ ./initrepo.sh
+
'''For all applications''':
 +
* Qt 5.3.0 or newer
 +
* KDE Frameworks version 5.7.0 or newer. Not every single component is needed, see below.
 +
* boost
 +
* lcms 2.4 or newer
  
From now on to update, you can run
+
'''For Calligra Sheets:'''
 +
* libeigen 3.0
  
  $ git pull
+
=== Optional Dependencies ===
 +
Some packages are not necessary to build but will provide a better experience if present. If your main intention is to use an upstream version of Calligra for personal use you should include these.
  
or if you have local changes:
+
'''Breeze widgets:'''
 +
* If you do not use the Plasma 5 desktop, you can provide the widget style through your package manager or by building directly, by building and installing first the kde:kdecoration repository and then the kde:breeze repository. 
 +
* To set the style to breeze, add to the kdeglobals file (somewhere in your .config/ subdir, depending on the XDG settings):
 +
[General]
 +
widgetStyle=breeze
 +
[Icons]
 +
Theme=Breeze
 +
 
 +
=== Missing Packages ===
 +
Sometimes not everything goes as planned, and you won't have all the dependencies you needed.  Such missing dependencies, both mandatory and optional ones, will be logged at the end of the CMake run. It should be clear to figure out if anything is missing.  If this happens, you can simply browse through your package repository to install it.  Please update this page with any issues you run into.
  
$ git pull --rebase origin master
+
Although Calligra's CMake scripts specify that only Qt5 should be use, it is possible that CMake will slurp up Qt4 libraries erroneously. If this happens, you may need to specify the version of Qt you want to use through the external configuration tool "qtchooser." Make sure Qt5 will be used.
  
 +
= Build Calligra =
 +
'''Reminder''': it is ''not'' possible to build Calligra in the source directory. Set up your directories as described in the [[#Recommended_setup|Recommended setup]] section above.
  
 +
If you are using the recommended directory structure:
 +
cd $HOME/kde/build/calligra
  
 +
A standard cmake configuration will build all products.  This is achieved by the command:
  
*'''Option 3: if beta or rc version was released''', the source code for the latest beta can be found on KDE's ftp [ftp://ftp.kde.org/pub/kde/unstable/calligra-latest/ calligra-latest]. Uncompress the code so that $HOME/kde/src/calligra is created.
+
cmake -DCMAKE_INSTALL_PREFIX=$HOME/kde/inst5 $HOME/kde/src/calligra \
 +
      -DCMAKE_BUILD_TYPE=RelWithDebInfo
  
=== Working with Multiple Versions ===
+
This step can be greatly customized through CMake's powerful interface; there are more details [[#CMake_Build_Options|in the next section]].
You will often want to have more than one build environment in parallel, for example if you want to work on stable (master, calligra/x.y) and various ''feature'' branches.
 
  
'''Recommended way is to use ''git-new-workdir'' tool.''' This solution saves space (300MiB for a calligra branch instead of 1200MiB) and time. It based on a single git repository clone multiplied to many separate source directories for each branch you wish to use, all without performing full clone (what consumes disk space and requires fetching each clone separately). It is explained in the Techbase article [http://techbase.kde.org/Development/Git/Configuration#Multiple_Work_Branches Multiple Work Branches] and you can find the script there.
+
Building Calligra is a CPU intensive procedure, and the more processor cores you utilize the better.  Multicore builds are governed by the -j parameter in GNU Make. You usually want to start more processes than you have cores, though too many is sometimes inefficient.  For a four-core machine, six processes should do the trick, so you'd want to use:  
 +
make -j6
  
Example commands to have code for both Calligra ''{{Calligra/UnstableBranch}}.x'' and ''master'' versions:
+
Then type this command to install the software (though multiple cores are less important here):
 +
make install -j6
  
To get the ''master'' into <tt>$HOME/kde/src/calligra</tt>:
+
Please follow the [[Calligra/Building#Running_Calligra_Applications|Running Calligra Applications]] instructions before trying to run an application.
$ git clone kde:calligra
 
  
Then, to get the Calligra ''{{Calligra/UnstableBranch}}.x'' into <tt>$HOME/kde/src/calligra-{{Calligra/UnstableBranch}}</tt>:
+
= CMake Build Options =
$ git-new-workdir $HOME/kde/src/calligra $HOME/kde/src/calligra-{{Calligra/UnstableBranch}} calligra/{{Calligra/UnstableBranch}}
+
CMake is a tool that automatically generates a list of configurations based on variables you feed it and the system configuration it detects.  You may want to change the default options depending on your intentions.
  
The above means ''git-new-workdir <original clone's directory> <new source directory> <branch name>''. As you see the <original clone's directory> is the master branch, and this is recommended convention.
+
=== The CMake Cache ===
 +
When CMake finishes running, one of the files it produces in the build directory is called CMakeCache.txt - this file lists the values of every variable that was generated during the build process.  If you notice a problem, it is a good place to look.  There are several methods to edit these options.
  
'''Working with Qt Creator.''' Every source directory can be opened as a project in Qt Creator (by opening the central CMakeLists.txt, see [[/Developing With QtCreator/]]). Creator supports many projects opened concurrently. One of them is made ''active''. Remember to set up variables for all Qt Creator projects (for each source directory) that you want to use in this IDE (see [[/Developing With QtCreator/]] again for instructions). Then you can switch between projects easily in Creator, build, run and debug projects.
+
; Re-run CMake in the current directory.
 +
: This would look like <code>cmake . -DCMAKE_OPTION=NEW_VALUE</code>  The command line directive -D specifies you are setting the value of the variable CMAKE_OPTION to NEW_VALUE.  Note that all CMake variables are strings.
 +
; Enter the build directory and run cmake-gui.
 +
: This runs a gui where you can edit files.  On Ubuntu this program is found in package <code>cmake-qt-gui.</code>
 +
; Edit CMakeCache.txt by hand.  
 +
: This is quite easy to do with a good text editor; CMake adds documentation strings that it finds listed with the variables.
 +
; Use an IDE that supports CMake.
 +
: This includes KDevelop and Qt Creator. Both provide a cmake-gui style configuration editor.
  
'''Build directories.''' Please use separate build directory per branch, never share the same build directory for many branches if you don't want to encounter compile and configuration errors. A good naming scheme for building kde/src/{branchname} code is kde/build/{branchname}.
+
===Faster re-builds with Ninja===
 +
The Ninja build tool can perform very fast build tree parsing. Although it is not possible to improve the initial build or the linking stage, Ninja is very useful when making small changes to the code and rebuilding, as the recompile is nearly instantaneous.  Another benefit of Ninja is that its build instructions are contained in a single file, build.ninja, so it is very easy to examine any commands that have gone wrong.  You can install Ninja from your package repos, although if you encounter problems the source version may be more up to date.
  
When many build directories are used, it's easy to switch between builds: just type <tt>make -j*** install</tt> in given build dir.
+
To request CMake generate Ninja build files instead of GNU Make build files, add the -G"Ninja" generator to your cmake command line:  
 +
  cmake -G"Ninja" -[other options...] /path/to/code/  
  
'''Removing directories.''' If you no longer need a build directory, you can safely remove it to safe space. You can also remove source directory that you created using ''git-new-workdir'' before. But the ''base'' source directory used by the git-new-workdir (or <original clone's directory> as mentioned before, typically containing master branch code, '''shall not be removed'''. Otherwise, 'workdir' branches (such as kde/src/calligra-x.y) will no longer work. This is because ''hard links'' to files in the <original clone's directory> are used while by each 'workdir'.
+
Although it is possible to reconfigure many cmake options using commands such as  <code>'cmake . -DNEW_OPTION=1'</code>, it is not possible to switch between a Ninja and GNU Make build in the same build directory.
  
= Build Requirements =
+
Ninja will automatically use all available CPU cores.  To use it, simply replace <code>make -j6</code> with
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.
+
  ninja
  
== Required Dependencies ==
+
and replace <code>make -j6 install</code> with
 +
  ninja install
  
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on [email protected]. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}
+
===Debugging options===
 +
'''Recommended for accurate debugging:''' The default build setting for CMake is <code>RelWithDebInfo</code> which is best for personal use if you want to use the latest upstream features.  However this inhibits debugging using breakpoints, watchpoints, and using step by step commands in debuggers like gdb, as the code optimizer will some of the source code logic to speed it up. If you intend to develop Calligra, even if you will not use breakpoints you very likely want to turn on debug mode, as this also guarantees assertions, and makes sure all debug and warning messages are printed.   To turn this on, set the Debug build mode by replacing <code>-DCMAKE_BUILD_TYPE=RelWithDebInfo</code> in the above with:
 +
  -DCMAKE_BUILD_TYPE=debug
  
Following are the general must-have dependencies for Calligra (unless you really need to do otherwise, just install relevant binary packages):
+
Using <code>Debug</code> will result in a slower code but this can be acceptable in most cases during testing and development given the machine is fast enough.
* Qt 5.3.0 or newer (recommended)
 
* KDE Development Frameworks version 5.3.0 or newer
 
**On opensuse the development package is called (TODO?); on Ubuntu and Debian it is called (TODO?). (TODO: add info for other distributions)
 
**Calligra should also build fine with either kdelibs from ''git'' repository (see [http://techbase.kde.org/Getting_Started/Build/KDE4 techbase] for an explanation on how to compile kdelibs from svn), needed for parts of Calligra build with the Mobile Frameworks Profile of the KDE platform (Calligra Words, Calligra Sheets, Calligra Stage, krita)
 
* kdebase/runtime 4.3 or newer
 
* cmake 2.8.12 or newer (3.x works too)
 
* lcms 2.4 or newer
 
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)
 
** development packages for other libraries may be needed; on ubuntu/Debian these can be installed using 'apt-get build-dep kdelibs5'
 
  
For Calligra Sheets:
+
=== Using Product Sets ===
* libeigen 3.0
+
By default, the build system tries to build all applications. Unless you are a great polymath or you find watching very long compiles relaxing it is unlikely that you want to build all of Calligra at once.  Luckily Calligra defines a <code>PRODUCTSET</code> variable for CMake. You can either specify programs to use, or use predefined product sets.
  
For Krita:
+
For example, to build only Words and all modules needed for it, specify the <code>WORDS</code> product set by passing to CMake:
* libeigen 3.0
 
* libexiv2 >= 0.16
 
  
For Stage:
+
-DPRODUCTSET=WORDS
* boost
 
  
For Kexi:
+
If you want to build several programs and their needed modules at once, you can use a list as follows:
* KDb (master branch from the kde:kdb repository, packages may not exist yet, in turn KDb requires recommends icu, libicu and libicu-devel for unicode support as a dependency, and recommends SQLite and/or MySQL/PostgrerSQL client libraries)
 
  
For Kexi and Plan:
+
-DPRODUCTSET="WORDS SHEETS"
* KReport (master branch from the kde:kreport repository, packages may not exist yet)
 
* KProperty (master branch from the kde:kproperty repository, packages may not exist yet)
 
  
== Optional Dependencies ==
+
Alternatively, you can use one of the predefined product sets:
Optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will not be built because given missing dependency.
 
  
=== Optional Dependencies for Krita ===
+
-DPRODUCTSET=DESKTOP
For users who want to use Krita it is also recommended to install the [http://code.compeng.uni-frankfurt.de/projects/vc Vc library]. It is optional, but makes the performance much higher. Use version 0.7.
 
  
=== Look & Feel ===
+
[[#Product_Sets|More information about these options here]].
If you use the Plasma 5 desktop, you probably have the Breeze QWidget style and icon theme installed and ready for use. Otherwise you can build them as follows:
 
*Dependency of the Breeze style: build the kde:kdecoration repository in a standard way
 
*Breeze QWidget style and icon theme: build the kde:breeze repository using Qt5
 
  
To set the style to breeze, edit the kdeglobals (somewhere in your .config/ subdir, depending on the XDG settings);
+
= Running Calligra Applications =
 +
After you have compiled and installed your desired application, there are two options to now make the Calligra applications available for running.
  
[General]
+
== Running from Command Line ==
widgetStyle=breeze
+
If you have installed Calligra in a custom prefix (which is recommended in this document), you have to set the environment variables as follows. '''These are example values reflecting the recommended directory structure''':
  
To set the icon theme, in the same file:
+
export XDG_DATA_DIRS=$HOME/kde/inst5/share:$XDG_DATA_DIRS
  [Icons]
+
export XDG_CONFIG_DIRS=$HOME/kde/inst5/etc/xdg:$XDG_CONFIG_DIRS
  Theme=Breeze
+
export PATH=$HOME/kde/inst5/bin:$PATH
 +
  export QT_PLUGIN_PATH=$HOME/kde/inst5/lib64/plugins:$HOME/kde/inst5/lib/plugins:$HOME/kde/inst5/lib/x86_64-linux-gnu/plugins:$QT_PLUGIN_PATH
 +
export QML_IMPORT_PATH=$HOME/kde/inst5/lib64/qml:$HOME/kde/inst5/lib/qml:$HOME/kde/inst5/lib/x86_64-linux-gnu/qml
 +
export QML2_IMPORT_PATH=$HOME/kde/inst5/lib64/qml:$HOME/kde/inst5/lib/qml:$HOME/kde/inst5/lib/x86_64-linux-gnu/qml
 +
 +
export XDG_CONFIG_HOME=$HOME/kde/Settings
 +
export KDETMP=/tmp/kdedev-$USER
 +
export KDEVARTMP=/var/tmp/kdedev-$USER
 +
  export KDESYCOCA=$KDEVARTMP/ksycoca
  
== Distribution Specific Instructions ==
+
Make sure temporary directories exist:
 +
mkdir -p $KDETMP
 +
mkdir -p $KDEVARTMP
  
=== Debian-based Distributions ===
+
{{note|It is important to set XDG_CONFIG_HOME to a directory different of the default $HOME/.config or whatever you might have set. If the directory does not exist, it will be created automatically.}}
On '''Debian''', '''Ubuntu''', '''Kubuntu''' and '''Mint''', all the dependencies used for the packages can be installed by running :
 
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo apt-get build-dep calligra</pre>
 
Note you'll need to activate 'software sources' in your repositories.  
 
  
Additional more or less mandatory libraries for Ubuntu and derivatives:
+
In case you want to use the commandline util <code>calligra</code> to start a matching Calligra application for a given file, then you also need in this special environment to register the Calligra applications to the system, by executing:
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo apt-get install libeigen3-dev libxi-dev phonon-backend-gstreamer kdelibs5-dev libboost-dev libboost-all-dev exiv2</pre>
 
(Note: libeigen3-dev, libxi-dev, phonon-backend-gstreamer, kdelibs5-dev, and libboost-dev are already marked as build dependencies for Calligra in Kubuntu.  Is this the case in Debian?)
 
  
For a better appearance on non-KDE desktop environment :
+
kbuildsycoca5
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo apt-get install kde-style-oxygen</pre>
 
  
On '''Linux Mint''' , you'll need to activate the software sources repositories manually. ( Search for 'Software Sources' in your menu then open it,  On the tab 'Linux Mint Software' , check to activate 'Source code', On the tab 'Other Software' check to activate 'Ubuntu **.** <name> (source code) then close the windows to finish )''
+
{{note|Calling <code>kbuildsycoca5</code> is, other than in previous Calligra versions 2.9 and before, no longer needed for registering the Calligra-internal plugins. Those should be found now automatically by the Calligra apps.}}
  
=== OpenSuSE ===
+
== Running from Menus or Desktop Icons ==
All the dependencies used for building Calligra can be installed by running:
+
TODO: verify, fix
 +
<strike>Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:
  
  zypper si -d calligra
+
  [Directories]
 +
prefixes=/path/to/install
  
''( Note : enable in 'Yast' > 'Software Repository' the sources packages )''
+
And then you need to register all the Calligra internal plugins to the system, by executing:
  
=== Fedora ===
+
  kbuildsycoca4
All the dependencies used for building Calligra can be installed by running:
 
  yum-builddep calligra
 
yum install gcc gcc-c++
 
Note : you'll need to compile the VC library on your own, version 0.7, follow recommendation of this comment :
 
[http://www.davidrevoy.com/article193/guide-building-krita-on-linux-for-cats#c1417788906-1]
 
  
=== Arch Linux & Manjaro ===
+
The advantage of this is that KDE will always look for the services where Calligra is installed.
All the dependencies used for building Calligra can be installed by running:
+
For example for the recommended directory structure:
  
<syntaxhighlight lang="bash">
+
[Directories]
# pacman -Syu
+
prefixes=$HOME/kde/inst5
# pacman -S base-devel
+
</strike>
# pacman -S cmake automoc4 boost kdepimlibs eigen2 kdeedu-marble lcms2 libmariadbclient freetds xbase libwpg opencolorio libwps gsl glew fftw poppler-qt libkdcraw libodfgen openjpeg kdegraphics-okular pstoedit vc libvisio libetonyek libpqxx libspnav
 
</syntaxhighlight>
 
  
=== Chakra ===
+
== Common issues ==
All the dependencies used for building Calligra can be installed by running:
+
In theory, this is all you need to have your new copy of Calligra up and running.  It is very often the case that you your program will instead crash immediately with a strange error.  Here is a collection of common errors ones you might encounter.
  
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo pacman -S kdelibs kdepimlibs eigen freetds kdegraphics-okular kdeedu-marble xbase libgsf libwpd libwpg libwps libvisio pstoedit glew gsl cmake automoc4 libspnav libqtgtl boost libkdcraw libpqxx fftw opengtl docbook-xsl create-resources lcms2 qrencode libdmtx</pre>
+
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed,
 +
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so:  
 +
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:
 +
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 )
  
===Mageia ===
+
These symbol clashes mean you have multiple libraries with conflicting version information.  It is very likely have a version of Calligra installed through your package manager, or you have not cleaned up a previous build of Calligra.
(Mageia 5 alpha 1/Cauldron recommended for current git master version)<br>
 
All the dependencies used for building Calligra can be installed by running as root:
 
  
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap;
+
  "XXX plugin is not installed. Program will quit now."
word-wrap:break-word">urpmi task-c++-devel git li64boost-static-devel && urpmi --buildrequires http://mirror.internode.on.net/pub/mageia/distrib/cauldron/SRPMS/core/release/calligra-2.8.5-1.mga5.src.rpm </pre>
 
  
{{Note| change the link to the src.rpm file to an actual up-to-date location.}}
+
This error means you have not configured your plugins and environment variables correctly.
{{Note| TODO: Dependency list tested for Krita+Karbon, only librevenge is missing required library. We probably need to add some more dependencies for other calligra applications.}}
 
  
= Build Calligra =
+
= Executing Unit Tests =
{{Note|It is '''not''' possible to build Calligra in the source directory. Set up your directories as described in the [[#Recommended_setup|Recommended setup]] section above}}
+
1. To be able to execute unit tests, you need to explicitly enable them in the build configuration. To do so, set the BUILD_TESTING variable to "ON", either by issuing the command in the build directory:
  
Type:
 
mkdir -p $HOME/kde/build/calligra
 
mkdir -p $HOME/kde/inst
 
 
  cd $HOME/kde/build/calligra
 
  cd $HOME/kde/build/calligra
 +
cmake -DBUILD_TESTING=ON .
  
'''Read the advice below''' regarding speeding up the build process and adding extra debugging capabilities.
+
Or you can run <code>ccmake .</code> in the buld directory and set BUILD_TESTING to "on".
  
If you don't plan to develop Kexi, just type this command:
+
2. Then run the test by executing:
  
  cmake -DCMAKE_INSTALL_PREFIX=$HOME/kde/inst $HOME/kde/src/calligra \
+
  make test
      -DCMAKE_BUILD_TYPE=RelWithDebInfo
 
  
'''Note:''' if version of your Qt framework is exactly 4.8.0 or 4.8.1 add an extra parameter to the above command [[/Qt 4.8.0 and 4.8.1 patch/|as explained here]].
+
or run a test app individually in the tests directories.
  
(''cmakekde'' tool can be used as explained on [http://techbase.kde.org/Getting_Started/Build/KDE4 the build instructions for KDE])
+
3. Note: It is recommended to execute
  
Then type:
 
make
 
 
Then type this command to install the software:
 
 
  make install
 
  make install
  
Please follow the [[Calligra/Building#Running_Calligra_Applications|Running Calligra Applications]] instructions before trying to run an application.
+
before running tests as some unit tests requires this.
 
 
==Speed up==
 
'''Recommended: Taking advantage of multi-core processors.''' On dual-core machines compilation can be '''greatly speed up''' with the <tt>-j</tt> parameter of the <tt>make</tt> program. For example whenever you are invoking <tt>make</tt>, for dual-core processor try to invoke:
 
make -j3
 
Similarly, for quad-core processor:
 
make -j5
 
 
 
Generaly for ''N-core'' processor use the <tt>-jN+1</tt> parameter.
 
 
 
'''Recommended: Faster linking on Linux.''' [http://en.wikipedia.org/wiki/Linker_%28computing%29 Linking] can take noticeable time in large software such as Calligra. On Linux [http://en.wikipedia.org/wiki/Gold_%28linker%29 Gold linker] can be used to speed up this task. If you're building for Linux, install the Gold linker package and add the following to your <tt>cmake</tt> command:
 
-DCMAKE_C_FLAGS=-fuse-linker-plugin -DCMAKE_CXX_FLAGS=-fuse-linker-plugin
 
 
 
(you can set the <tt>CMAKE_C_FLAGS</tt> adn <tt>CMAKE_CXX_FLAGS</tt> variables in your {build dir}/CMakeCache.txt file either using text editor or the <tt>ccmake</tt> tool)
 
 
 
==Debugging options==
 
'''Recommended for accurate debugging:''' The default debug setting is <tt>RelWithDebInfo</tt> which is suitable only for obtaining backtraces. If you are developing or debugging an application by setting breakpoints, watchpoints, using step by step command accurately in your debugger, if you rely on assertions, debug and warning messages, you can replace <tt>-DCMAKE_BUILD_TYPE=RelWithDebInfo</tt> with:
 
-DCMAKE_BUILD_TYPE=debug
 
 
 
Using <tt>Debug</tt> results in a slower code but this can be acceptable in most cases during testing and development given the machine is fast enough. It is not intended for production releases of the software unless you know what you're doing.
 
 
 
'''Special case for Krita:''' If you are working on Krita, always use the <tt>KritaDevs</tt> option by setting:
 
-DCMAKE_BUILD_TYPE=KritaDevs
 
  
 
= Updating and Rebuilding =
 
= Updating and Rebuilding =
Line 294: Line 265:
 
  git pull --rebase
 
  git pull --rebase
 
  cd $HOME/kde/build/calligra
 
  cd $HOME/kde/build/calligra
  make
+
  make -j6
  make install
+
  make install -j6
  
(note that you can always append the <tt>-jN</tt> option to the <tt>make</tt> command to speed up the build as explained earlier in the [[#Speed_up|Speed up]] section.
+
=== Working with Multiple Versions ===
 +
{{Note|'''Git >{{=}} 2.5.0''' allows to replace the external script explained below '''git-new-workdir''' with a new ''[https://git-scm.com/docs/git-worktree git-worktree]'' built-in command. It apparently works on Windows too because: "''A replacement for contrib/workdir/git-new-workdir does not rely on symbolic links and make sharing of objects and refs safer by making the borrowee and borrowers aware of each other. Consider this as still an experimental feature; its UI is still likely to change.''"[https://github.com/git/git/blob/22aca1b3ac10af7188dccf033b44a36926f04d4b/Documentation/RelNotes/2.5.0.txt#L25-L27]}}
 +
{{Note|2.5.0 isn't the officially supported version (Aug 2015) so it's not always available for you in a binary form. There's previous solution for Windows: https://github.com/joero74/git-new-workdir. Make sure you read warnings there.}}
  
= Building Selected Applications =
+
You will often want to have more than one build environment in parallel, for example if you want to work on stable (master, calligra/x.y) and various ''feature'' branches.
== Using Product Sets ==
 
By default, the build system tries to build all applications. The recommended way to change this is to specify a different product set by setting the <tt>PRODUCTSET</tt> CMake variable. The following table illustrates the most interesting predefined product sets.
 
  
{| class="wikitable" style="margin: 1em auto; text-align: center;"
+
'''Recommended way is to use ''git-new-workdir'' tool.''' This solution saves space (300MiB for a calligra branch instead of 1200MiB) and time. It based on a single git repository clone multiplied to many separate source directories for each branch you wish to use, all without performing full clone (what consumes disk space and requires fetching each clone separately). It is explained in the Techbase article [http://techbase.kde.org/Development/Git/Configuration#Multiple_Work_Branches Multiple Work Branches] and you can find the script there.
  ! rowspan="2" width="100"| Application
 
  ! colspan="5" | Product Set
 
|-
 
!width="100"| DESKTOP
 
!width="100"| CREATIVE
 
!width="100"| ACTIVE
 
!width="100"| OSX
 
!width="100"| ALL
 
|-
 
!style="text-align: right; padding: 0.5em;"| Active
 
|
 
|
 
| X
 
|
 
| X
 
|-
 
!style="text-align: right; padding: 0.5em;"| Author
 
| X
 
|
 
|
 
| X
 
| X
 
|-
 
!style="text-align: right; padding: 0.5em;"| Braindump
 
| X
 
|
 
|
 
| X
 
| X
 
|-
 
!style="text-align: right; padding: 0.5em;"| Converter
 
| X
 
| X
 
|
 
| X
 
| X
 
|-
 
!style="text-align: right; padding: 0.5em;"| Flow
 
| X
 
|
 
|
 
| X
 
| X
 
|-
 
!style="text-align: right; padding: 0.5em;"| Karbon
 
| X
 
| X
 
|
 
| X
 
| X
 
|-
 
!style="text-align: right; padding: 0.5em;"| Kexi
 
| X
 
|
 
|
 
| X
 
| X
 
|-
 
!style="text-align: right; padding: 0.5em;"| Krita
 
| X
 
| X
 
|
 
| X
 
| X
 
|-
 
!style="text-align: right; padding: 0.5em;"| Plan
 
| X
 
|
 
|
 
| X
 
| X
 
|-
 
!style="text-align: right; padding: 0.5em;"| Sheets
 
| X
 
|
 
|
 
| X
 
| X
 
|-
 
!style="text-align: right; padding: 0.5em;"| Stage
 
| X
 
|
 
|
 
| X
 
| X
 
|-
 
!style="text-align: right; padding: 0.5em;"| Words
 
| X
 
|
 
|
 
| X
 
| X
 
|-
 
|}
 
  
For example, to build the <tt>CREATIVE</tt> product set, pass
+
Example commands to have code for both Calligra ''{{Calligra/UnstableBranch}}.x'' and ''master'' versions:
  
  -DPRODUCTSET=CREATIVE
+
To get the ''master'' into <code>$HOME/kde/src/calligra</code>:
 +
  $ git clone kde:calligra
  
on the CMake command line.
+
Then, to get the Calligra ''{{Calligra/UnstableBranch}}.x'' into <code>$HOME/kde/src/calligra-{{Calligra/UnstableBranch}}</code>:
 +
$ git-new-workdir $HOME/kde/src/calligra $HOME/kde/src/calligra-{{Calligra/UnstableBranch}} calligra/{{Calligra/UnstableBranch}}
  
{{note|The set of included plugins, import/export filters and extra tools may differ between product sets. Consult the product set definitions in the <tt>cmake/productsets</tt> directory of the Calligra sources for detailed information about what is included in each product set.}}
+
The above means ''git-new-workdir <original clone's directory> <new source directory> <branch name>''. As you see the <original clone's directory> is the master branch, and this is recommended convention.
  
For those interested only in a single application, there are also product sets per application. These will only build all those internal products which are required or useful for the respective application.
+
'''Working with Qt Creator.''' Every source directory can be opened as a project in Qt Creator (by opening the central CMakeLists.txt, see [[/Developing With QtCreator/]]). Creator supports many projects opened concurrently. One of them is made ''active''. Remember to set up variables for all Qt Creator projects (for each source directory) that you want to use in this IDE (see [[/Developing With QtCreator/]] again for instructions). Then you can switch between projects easily in Creator, build, run and debug projects.
  
The app-specific products sets are named by the app name:
+
'''Build directories.''' Please use separate build directory per branch, never share the same build directory for many branches if you don't want to encounter compile and configuration errors. A good naming scheme for building kde/src/{branchname} code is kde/build/{branchname}.
  
<tt>ACTIVE</tt>, <tt>AUTHOR</tt>, <tt>BRAINDUMP</tt>, <tt>FLOW</tt>, <tt>GEMINI</tt> (since 2.9), <tt>KARBON</tt>, <tt>KEXI</tt>, <tt>KRITA</tt>, <tt>PLAN</tt>, <tt>SHEETS</tt>, <tt>STAGE</tt>, <tt>WORDS</tt>.
+
When many build directories are used, it's easy to switch between builds: just type <code>make -j*** install</code> in given build dir.
  
For example, to just build the <tt>KRITA</tt> product set, pass
+
'''Removing directories.''' If you no longer need a build directory, you can safely remove it to safe space. You can also remove source directory that you created using ''git-new-workdir'' before. But the ''base'' source directory used by the git-new-workdir (or <original clone's directory> as mentioned before, typically containing master branch code, '''shall not be removed'''. Otherwise, 'workdir' branches (such as kde/src/calligra-x.y) will no longer work. This is because ''hard links'' to files in the <original clone's directory> are used while by each 'workdir'.
  
-DPRODUCTSET=KRITA
+
= Using kdesrc-build =
  
on the CMake command line.
+
== Completely separate config file ==
  
== Fine-grained Selection ==
+
You might also want a separate config file to build all of Calligra and the now external-Calligra libs like KDiagram etc. with kdesrc-build.
Advanced users and developers wishing to design completely own product sets can do so. An introduction into the product set system and how to define own sets can be found in the file [https://projects.kde.org/projects/calligra/repository/revisions/master/entry/CalligraProducts.cmake CalligraProducts.cmake] in the toplevel directory of the Calligra sources. This file also contains the complete list of internal products and their internal dependencies. Defining own product sets in a separate file, like described at the end there, is the recommended solution for this wish.
 
  
The easist approach is to combine multiple product sets together directly on the call to cmake, e.g.:
+
For that store this file in the toplevel dir of where the sources should be placed with the name "kdesrc-buildrc". Adapt anything tagged with "TOADAPT" where needed and save the file again.
-DPRODUCTSET="KEXI SHEETS"
+
Then run "kdesrc-build" in that directory (UNTESTED, please try and improve):
This combines and tries to build all internal required and useful dependencies of the apps Kexi and Sheets.
 
  
Alternatively, though not recommended, instead of designing completely own productsets, it is also possible to disabe products from a selected pre-defined productset. One does so by setting the corresponding <tt>BUILD_{application}</tt> variable to <tt>OFF</tt>. For example, to disable compilation of Krita and Karbon, you can pass
+
global
 +
  # TOADAPT: these dirs to what you like
 +
  source-dir /home/user/kde/src/
 +
  build-dir /home/user/kde/build/calligra
 +
  kdedir /home/user/kde/inst5
 +
 +
  git-repository-base kde-projects kde:
 +
 +
  # TOADAPT: LIB_SUFFIX as needed by your system
 +
  cmake-options -DCMAKE_BUILD_TYPE:STRING=debug -DBUILD_TESTING=true  -DLIB_SUFFIX=64
 +
 +
  cxxflags -pipe -DQT_STRICT_ITERATORS -DQURL_NO_CAST_FROM_STRING -DQT_NO_HTTP -DQT_NO_FTP -Wformat -Werror=format-security -Werror=return-type -Wno-variadic-macros -Wlogical-op -Wmissing-include-dirs
 +
 +
  # TOADAPT: adapt number of jobs to what your system can do :)
 +
  make-options -j1
 +
 +
  branch-group kf5-qt5
 +
end global
 +
 +
module-set kdiagram
 +
    repository kde-projects
 +
    use-modules kdiagram
 +
end module-set
 +
 
 +
module-set calligra
 +
  repository kde-projects
 +
  use-modules calligra
 +
end module-set
  
-DBUILD_krita=OFF -DBUILD_karbon=OFF
+
= Contributing to Calligra =
 +
''TODO: Specific instructions''
  
on the CMake command line. You can also do this using the <tt>ccmake</tt> tool included with CMake, which you may run ''after'' the initial CMake run but ''before'' you run <tt>make</tt>.
+
Note that pushing your patches to the Calligra codebase yourself will only work if you have a KDE developer identity. This requires logging an SSH key. Please consider submitting your first patches using [https://phabricator.kde.org/ Phabricator] (see also the [https://techbase.kde.org/Development/Phabricator HowTo]).  Once you are comfortable putting together an acceptable patch, you can apply for a contributor account as explained on [https://techbase.kde.org/Contribute/Get_a_Contributor_Account the KDE Techbase].
  
{{note|The <tt>BUILD_{something}</tt> variables are intended for backwards compatibility. For that reason, they are only supported for the <tt>braindump</tt>, <tt>flow</tt>, <tt>karbon</tt>, <tt>kexi</tt>, <tt>krita</tt>, <tt>plan</tt>, <tt>sheets</tt>, <tt>stage</tt> and <tt>words</tt> products, and may be dropped for another mechanism in the future.}}
+
= Distribution Specific Configuration Instructions =
  
= Running Calligra Applications =
+
=== Debian-based Distributions ===
After you installed them, there are two options to now make the Calligra applications available for running.
+
'''Debian''', '''Ubuntu''', '''Kubuntu''' and '''Mint''' should all follow the basic build instructions:
  
== Running from Command Line ==
+
<strike>
If you have installed Calligra in a different prefix than KDElibs (which is recommended in this document), you have to set the environment variables as folows. '''These are example values reflecting the the recommended directory structure''':
+
<syntaxhighlight lang="bash">
 +
  sudo apt-get build-dep calligra
 +
  sudo apt-get install libboost-all-dev exiv2
 +
</syntaxhighlight>
 +
</strike>
 +
''TODO: update for Calligra 3''
  
export KDEDIRS=$HOME/kde/inst:$KDEDIRS
+
It may be needed to install further packages (please add them here). If you find you are missing any KDE Frameworks parts, these can be installed using
export PATH=$HOME/kde/inst/bin:$PATH
+
<syntaxhighlight lang="bash">
export KDEHOME=$HOME/kde/.kde
+
  sudo apt-get build-dep kdelibs5
export KDETMP=/tmp/kdedev-$USER
+
</syntaxhighlight>
export KDEVARTMP=/var/tmp/kdedev-$USER
 
export KDESYCOCA=$KDEVARTMP/ksycoca
 
  
Make sure temporary directories exist:
+
If you do not have the Plasma desktop environment installed, you possibly must also install the Breeze icon set:
mkdir -p $KDETMP
+
<syntaxhighlight lang="bash">
mkdir -p $KDEVARTMP
+
  sudo apt-get install breeze-icon-theme
 +
</syntaxhighlight>
  
{{note|It is important to set KDEHOME to a directory different of $HOME/.kde, and if the directory does not exist, it will be created automatically.}}
+
On '''Linux Mint''' , you'll need to activate the software sources repositories manually. ( Search for 'Software Sources' in your menu then open it, On the tab 'Linux Mint Software' , check to activate 'Source code', On the tab 'Other Software' check to activate 'Ubuntu **.** <name> (source code) then close the windows to finish )''
  
Then in this special environment you need to register all the Calligra internal plugins, by executing:
+
=== OpenSuSE ===
 +
All the dependencies used for building Calligra can be installed by running:
 +
<strike>
 +
<syntaxhighlight lang="bash">
 +
zypper si -d calligra
 +
</syntaxhighlight>
 +
</strike>
 +
''TODO: update for Calligra 3''
  
kbuildsycoca4
+
''( Note : enable in 'Yast' > 'Software Repository' the sources packages )''
  
== Running from Menus or Desktop Icons ==
+
=== Fedora ===
Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:
+
All the dependencies used for building Calligra can be installed by running:
 +
<strike>
 +
<syntaxhighlight lang="bash">
 +
yum-builddep calligra
 +
yum install gcc gcc-c++
 +
</syntaxhighlight>
 +
</strike>
 +
''TODO: update for Calligra 3''
  
[Directories]
+
=== Arch Linux & Manjaro ===
prefixes=/path/to/install
+
All the dependencies used for building Calligra can be installed by running:
  
And then you need to register all the Calligra internal plugins to the system, by executing:
+
<strike>
 +
<syntaxhighlight lang="bash">
 +
pacman -Syu
 +
pacman -S base-devel
 +
pacman -S cmake automoc4 boost kdepimlibs eigen2 kdeedu-marble lcms2 libmariadbclient freetds xbase libwpg opencolorio libwps gsl glew fftw poppler-qt libkdcraw libodfgen openjpeg kdegraphics-okular pstoedit vc libvisio libetonyek libpqxx libspnav
 +
</syntaxhighlight>
 +
</strike>
 +
''TODO: update for Calligra 3''
  
kbuildsycoca4
+
=== Chakra ===
 +
All the dependencies used for building Calligra can be installed by running:
  
The advantage of this is that KDE will always look for the services where Calligra is installed.
+
<strike>
For example for the recommended directory structure:
+
<syntaxhighlight lang="bash">
 +
sudo pacman -S kdelibs kdepimlibs eigen freetds kdegraphics-okular kdeedu-marble xbase libgsf libwpd libwpg libwps libvisio pstoedit glew gsl cmake automoc4 libspnav libqtgtl boost libkdcraw libpqxx fftw opengtl docbook-xsl create-resources lcms2 qrencode libdmtx</pre>
 +
</syntaxhighlight>
 +
</strike>
 +
''TODO: update for Calligra 3''
  
[Directories]
+
===Mageia ===
prefixes=$HOME/kde/inst
 
  
= Executing Unit Tests =
+
All the dependencies used for building Calligra can be installed by running as root:
1. To be able to execute unit tests, you need to explicitly enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:
 
  
  cd $HOME/kde/build/calligra
+
<strike>
cmake -DKDE4_BUILD_TESTS=ON .
+
<syntaxhighlight lang="bash">
 +
  urpmi task-c++-devel git li64boost-static-devel && urpmi --buildrequires http://mirror.internode.on.net/pub/mageia/distrib/cauldron/SRPMS/core/release/calligra-2.8.5-1.mga5.src.rpm </pre>
 +
</syntaxhighlight>
 +
</strike>
 +
''TODO: update for Calligra 3''
  
Or you can run <code>ccmake .</code> in the buld directory and set KDE4_BUILD_TESTS to "on".
+
{{Note| change the link to the src.rpm file to an actual up-to-date location.}}
 +
{{Note| TODO: Dependency list tested for Krita+Karbon, only librevenge is missing required library. We probably need to add some more dependencies for other calligra applications.}}
  
2. Then run the test by executing:
+
= List of Product Sets =
 +
Here you can find a list of the different Calligra product sets.
  
make test
+
{{CalligraProductSets}}
  
or run a test app individually in the tests directories.
+
Advanced users and developers wishing to design completely own product sets can do so. An introduction into the product set system and how to define own sets can be found in the file [https://projects.kde.org/projects/calligra/repository/revisions/master/entry/CalligraProducts.cmake CalligraProducts.cmake] in the toplevel directory of the Calligra sources.  
  
3. Note: It is recommended to execute
 
  
make install
+
= Further Resources =
 
+
*[[../../Developer Info|Useful hints for anyone who wants to hack on Calligra]]
before running tests.
+
*[[/Developing With KDevelop/]] The premiere IDE for KDE development and a great editor overall.
 
+
*[[/Developing With QtCreator/]] Recommended for more integrated Qt-specific documentation, and easier to install on Windows
= CMake Build Options =
+
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]
When you enter your build directory, you can type "ccmake ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.
 
 
 
Here is list for Krita related options:
 
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.
 
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.
 
 
 
= Resources =
 
*[[../Developer Info|Useful hints for who wants to hack on Calligra]]
 
 
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]
 
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]
 
= Possible Issues =
 
 
If you get errors when running an application like:
 
 
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed,
 
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so:
 
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:
 
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 )
 
 
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.
 
 
= See also =
 
*[[/Developing With QtCreator/]] (recommended for convenient studying the code, coding and debugging)
 
 
*[http://community.kde.org/Calligra/Building_Calligra_on_Windows Bulding Calligra on Windows]
 
*[http://community.kde.org/Calligra/Building_Calligra_on_Windows Bulding Calligra on Windows]
*[[/Nightly Builds/]]
 
*[[/Developing With KDevelop/]]
 
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]
 
 
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].
 

Latest revision as of 08:30, 27 June 2020

Note
These instructions are for the Qt 5-based Calligra 3.x on Unix-like operating systems. Work in progress.

To build the stable Qt 4 based Calligra see Calligra/Building/2.

Exception for apps that are have separate git repositories and build systems:

  • Krita ≥ 3.0 → see here
  • Kexi ≥ 3.0 → see here (not ready, points back to this page)
  • Plan ≥ 3.2 → Has pt no build instructions


Building for 'special' OSes:

  • Windows → see here
  • Mac OS X → see here


You are encouraged to update these pages with any new information you come across.


Preparation

Warning
Follow this guide as an ordinary user. Do not login as root or issue commands with sudo! Calligra should install and run correctly within in your home directory. If it doesn't, you have discovered a bug.
Warning
First, to avoid conflicting copies of configuration files, make sure you do not have other copy of Calligra installed on your computer, be it from an older build or your package manager. If you have installed Calligra through a package manager, purge the settings files during your uninstall if the option is available.
Note
These instructions are meant as a high-level guide to getting Calligra running from source code. Getting under the hood will to make changes require you learn details about Qt, KDE frameworks, as are comfortable with development applications like cmake and git. You can find information, tools and tutorials on KDE's TechBase Wiki. https://techbase.kde.org/


Recommended Setup

You must begin with a C++ development toolkit including gcc, git, and cmake. These applications will be available in your distribution's package repositories.

Next you must prepare a directory structure to contain your build. These instructions will assume the following following recommended layout:

$HOME/kde/src/
source code
$HOME/kde/build/calligra
directory that Calligra will be built in
$HOME/kde/inst5
directory that Calligra will be installed in

The build directory for Calligra must be separate from the source directory. You can see more discussion why this is here. The build configuration given here is compatible with build automation scripts found on that page.

Create these directories with:

mkdir -p $HOME/kde/build/calligra
mkdir -p $HOME/kde/inst5
mkdir -p $HOME/kde/src

You may also want to check the Techbase instructions on setting up a build environment, which links to additional useful scripts and functions.

Getting the Source Code

Here we will walk through obtaining the source code to build the Calligra configuration of your choosing.

Download instructions

We will configure Git for easier access to KDE. Add the following text to your ~/.gitconfig:

[url "https://anongit.kde.org/"]
    insteadOf = kde:
[url "ssh://[email protected]/"]
    pushInsteadOf = kde:

This sets up a kde: prefix which allows us to use a shorthand for the KDE repository URL to use in Git. It sets up read access to happen anonymously, and directs pushes to authenticated SSH.

Now navigate to your build directory and pull the repository by executing:

 cd $HOME/kde/src/
 git clone kde:calligra

Git will expand kde:calligra to https://anongit.kde.org/calligra automatically based on your configuration. If you are following the recommended directory layout you should now have a source folder $HOME/kde/src/calligra containing the source code. If you accidentally cloned the source to the wrong place, you can simply move it to the new location. Git is extremely flexible about the location of its files.

Choosing the right branch to build

Now that you have got the Calligra repository you will be able to switch to the branch of your choosing. The latest development version of Calligra is 3.1.0 Alpha; developers always refer to it as to master. Applications from master should always compile and be reasonably stable. Calligra developers never place experimental features there. Once tested and released, master becomes the new current stable version 3.1.

TODO: Here we should explain local branches, staging and always-release-ready master, if we have that setup.

Build Requirements

This section provides information about hard (required) and optional software packages needed to build the Calligra software. Thankfully, obtaining the dependencies for Calligra in the major distributions is often fairly straightforward through the package managers.

The exact commands needed will vary from distribution to distribution. For more information on how to use your package manager to obtain the dependencies below, please consult the distribution specific instructions. At the end of this section, you should have most of the dependencies from the list below installed on your machine.


Note
A note for developers: to add (or remove) a hard dependency, a request with an explanation of the reason must be posted on [email protected] to discuss with the developers and maintainers. Only dependencies available in all of the major widely used distributions (i.e. Fedora, OpenSuSE, and Debian/(K)ubuntu) will be considered.


List of required dependencies

The following are the general must-have dependencies for Calligra. If you are selecting packages by hand please be sure you install the development library versions, preferably with debug symbols.

For all applications:

  • Qt 5.3.0 or newer
  • KDE Frameworks version 5.7.0 or newer. Not every single component is needed, see below.
  • boost
  • lcms 2.4 or newer

For Calligra Sheets:

  • libeigen 3.0

Optional Dependencies

Some packages are not necessary to build but will provide a better experience if present. If your main intention is to use an upstream version of Calligra for personal use you should include these.

Breeze widgets:

  • If you do not use the Plasma 5 desktop, you can provide the widget style through your package manager or by building directly, by building and installing first the kde:kdecoration repository and then the kde:breeze repository.
  • To set the style to breeze, add to the kdeglobals file (somewhere in your .config/ subdir, depending on the XDG settings):
[General]
widgetStyle=breeze
[Icons]
Theme=Breeze

Missing Packages

Sometimes not everything goes as planned, and you won't have all the dependencies you needed. Such missing dependencies, both mandatory and optional ones, will be logged at the end of the CMake run. It should be clear to figure out if anything is missing. If this happens, you can simply browse through your package repository to install it. Please update this page with any issues you run into.

Although Calligra's CMake scripts specify that only Qt5 should be use, it is possible that CMake will slurp up Qt4 libraries erroneously. If this happens, you may need to specify the version of Qt you want to use through the external configuration tool "qtchooser." Make sure Qt5 will be used.

Build Calligra

Reminder: it is not possible to build Calligra in the source directory. Set up your directories as described in the Recommended setup section above.

If you are using the recommended directory structure:

cd $HOME/kde/build/calligra

A standard cmake configuration will build all products. This is achieved by the command:

cmake -DCMAKE_INSTALL_PREFIX=$HOME/kde/inst5 $HOME/kde/src/calligra \
      -DCMAKE_BUILD_TYPE=RelWithDebInfo

This step can be greatly customized through CMake's powerful interface; there are more details in the next section.

Building Calligra is a CPU intensive procedure, and the more processor cores you utilize the better. Multicore builds are governed by the -j parameter in GNU Make. You usually want to start more processes than you have cores, though too many is sometimes inefficient. For a four-core machine, six processes should do the trick, so you'd want to use:

make -j6

Then type this command to install the software (though multiple cores are less important here):

make install -j6

Please follow the Running Calligra Applications instructions before trying to run an application.

CMake Build Options

CMake is a tool that automatically generates a list of configurations based on variables you feed it and the system configuration it detects. You may want to change the default options depending on your intentions.

The CMake Cache

When CMake finishes running, one of the files it produces in the build directory is called CMakeCache.txt - this file lists the values of every variable that was generated during the build process. If you notice a problem, it is a good place to look. There are several methods to edit these options.

Re-run CMake in the current directory.
This would look like cmake . -DCMAKE_OPTION=NEW_VALUE The command line directive -D specifies you are setting the value of the variable CMAKE_OPTION to NEW_VALUE. Note that all CMake variables are strings.
Enter the build directory and run cmake-gui.
This runs a gui where you can edit files. On Ubuntu this program is found in package cmake-qt-gui.
Edit CMakeCache.txt by hand.
This is quite easy to do with a good text editor; CMake adds documentation strings that it finds listed with the variables.
Use an IDE that supports CMake.
This includes KDevelop and Qt Creator. Both provide a cmake-gui style configuration editor.

Faster re-builds with Ninja

The Ninja build tool can perform very fast build tree parsing. Although it is not possible to improve the initial build or the linking stage, Ninja is very useful when making small changes to the code and rebuilding, as the recompile is nearly instantaneous. Another benefit of Ninja is that its build instructions are contained in a single file, build.ninja, so it is very easy to examine any commands that have gone wrong. You can install Ninja from your package repos, although if you encounter problems the source version may be more up to date.

To request CMake generate Ninja build files instead of GNU Make build files, add the -G"Ninja" generator to your cmake command line:

 cmake -G"Ninja" -[other options...] /path/to/code/ 

Although it is possible to reconfigure many cmake options using commands such as 'cmake . -DNEW_OPTION=1', it is not possible to switch between a Ninja and GNU Make build in the same build directory.

Ninja will automatically use all available CPU cores. To use it, simply replace make -j6 with

 ninja

and replace make -j6 install with

 ninja install

Debugging options

Recommended for accurate debugging: The default build setting for CMake is RelWithDebInfo which is best for personal use if you want to use the latest upstream features. However this inhibits debugging using breakpoints, watchpoints, and using step by step commands in debuggers like gdb, as the code optimizer will some of the source code logic to speed it up. If you intend to develop Calligra, even if you will not use breakpoints you very likely want to turn on debug mode, as this also guarantees assertions, and makes sure all debug and warning messages are printed. To turn this on, set the Debug build mode by replacing -DCMAKE_BUILD_TYPE=RelWithDebInfo in the above with:

 -DCMAKE_BUILD_TYPE=debug 

Using Debug will result in a slower code but this can be acceptable in most cases during testing and development given the machine is fast enough.

Using Product Sets

By default, the build system tries to build all applications. Unless you are a great polymath or you find watching very long compiles relaxing it is unlikely that you want to build all of Calligra at once. Luckily Calligra defines a PRODUCTSET variable for CMake. You can either specify programs to use, or use predefined product sets.

For example, to build only Words and all modules needed for it, specify the WORDS product set by passing to CMake:

-DPRODUCTSET=WORDS

If you want to build several programs and their needed modules at once, you can use a list as follows:

-DPRODUCTSET="WORDS SHEETS"

Alternatively, you can use one of the predefined product sets:

-DPRODUCTSET=DESKTOP

More information about these options here.

Running Calligra Applications

After you have compiled and installed your desired application, there are two options to now make the Calligra applications available for running.

Running from Command Line

If you have installed Calligra in a custom prefix (which is recommended in this document), you have to set the environment variables as follows. These are example values reflecting the recommended directory structure:

export XDG_DATA_DIRS=$HOME/kde/inst5/share:$XDG_DATA_DIRS
export XDG_CONFIG_DIRS=$HOME/kde/inst5/etc/xdg:$XDG_CONFIG_DIRS
export PATH=$HOME/kde/inst5/bin:$PATH
export QT_PLUGIN_PATH=$HOME/kde/inst5/lib64/plugins:$HOME/kde/inst5/lib/plugins:$HOME/kde/inst5/lib/x86_64-linux-gnu/plugins:$QT_PLUGIN_PATH
export QML_IMPORT_PATH=$HOME/kde/inst5/lib64/qml:$HOME/kde/inst5/lib/qml:$HOME/kde/inst5/lib/x86_64-linux-gnu/qml
export QML2_IMPORT_PATH=$HOME/kde/inst5/lib64/qml:$HOME/kde/inst5/lib/qml:$HOME/kde/inst5/lib/x86_64-linux-gnu/qml

export XDG_CONFIG_HOME=$HOME/kde/Settings
export KDETMP=/tmp/kdedev-$USER
export KDEVARTMP=/var/tmp/kdedev-$USER
export KDESYCOCA=$KDEVARTMP/ksycoca

Make sure temporary directories exist:

mkdir -p $KDETMP
mkdir -p $KDEVARTMP
Note
It is important to set XDG_CONFIG_HOME to a directory different of the default $HOME/.config or whatever you might have set. If the directory does not exist, it will be created automatically.


In case you want to use the commandline util calligra to start a matching Calligra application for a given file, then you also need in this special environment to register the Calligra applications to the system, by executing:

kbuildsycoca5
Note
Calling kbuildsycoca5 is, other than in previous Calligra versions 2.9 and before, no longer needed for registering the Calligra-internal plugins. Those should be found now automatically by the Calligra apps.


Running from Menus or Desktop Icons

TODO: verify, fix Instead of using KDEDIRS, you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:

[Directories]
prefixes=/path/to/install

And then you need to register all the Calligra internal plugins to the system, by executing:

kbuildsycoca4

The advantage of this is that KDE will always look for the services where Calligra is installed. For example for the recommended directory structure:

[Directories]
prefixes=$HOME/kde/inst5

Common issues

In theory, this is all you need to have your new copy of Calligra up and running. It is very often the case that you your program will instead crash immediately with a strange error. Here is a collection of common errors ones you might encounter.

krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, 
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: 
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) 

These symbol clashes mean you have multiple libraries with conflicting version information. It is very likely have a version of Calligra installed through your package manager, or you have not cleaned up a previous build of Calligra.

 "XXX plugin is not installed.  Program will quit now."

This error means you have not configured your plugins and environment variables correctly.

Executing Unit Tests

1. To be able to execute unit tests, you need to explicitly enable them in the build configuration. To do so, set the BUILD_TESTING variable to "ON", either by issuing the command in the build directory:

cd $HOME/kde/build/calligra
cmake -DBUILD_TESTING=ON .

Or you can run ccmake . in the buld directory and set BUILD_TESTING to "on".

2. Then run the test by executing:

make test

or run a test app individually in the tests directories.

3. Note: It is recommended to execute

make install

before running tests as some unit tests requires this.

Updating and Rebuilding

If the source code has been cloned using Git, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.

Type:

cd $HOME/kde/src/calligra
git pull --rebase
cd $HOME/kde/build/calligra
make -j6
make install -j6

Working with Multiple Versions

Note
Git >= 2.5.0 allows to replace the external script explained below git-new-workdir with a new git-worktree built-in command. It apparently works on Windows too because: "A replacement for contrib/workdir/git-new-workdir does not rely on symbolic links and make sharing of objects and refs safer by making the borrowee and borrowers aware of each other. Consider this as still an experimental feature; its UI is still likely to change."[1]
Note
2.5.0 isn't the officially supported version (Aug 2015) so it's not always available for you in a binary form. There's previous solution for Windows: https://github.com/joero74/git-new-workdir. Make sure you read warnings there.


You will often want to have more than one build environment in parallel, for example if you want to work on stable (master, calligra/x.y) and various feature branches.

Recommended way is to use git-new-workdir tool. This solution saves space (300MiB for a calligra branch instead of 1200MiB) and time. It based on a single git repository clone multiplied to many separate source directories for each branch you wish to use, all without performing full clone (what consumes disk space and requires fetching each clone separately). It is explained in the Techbase article Multiple Work Branches and you can find the script there.

Example commands to have code for both Calligra 3.1.x and master versions:

To get the master into $HOME/kde/src/calligra:

$ git clone kde:calligra

Then, to get the Calligra 3.1.x into $HOME/kde/src/calligra-3.1:

$ git-new-workdir $HOME/kde/src/calligra $HOME/kde/src/calligra-3.1 calligra/3.1

The above means git-new-workdir <original clone's directory> <new source directory> <branch name>. As you see the <original clone's directory> is the master branch, and this is recommended convention.

Working with Qt Creator. Every source directory can be opened as a project in Qt Creator (by opening the central CMakeLists.txt, see Developing With QtCreator). Creator supports many projects opened concurrently. One of them is made active. Remember to set up variables for all Qt Creator projects (for each source directory) that you want to use in this IDE (see Developing With QtCreator again for instructions). Then you can switch between projects easily in Creator, build, run and debug projects.

Build directories. Please use separate build directory per branch, never share the same build directory for many branches if you don't want to encounter compile and configuration errors. A good naming scheme for building kde/src/{branchname} code is kde/build/{branchname}.

When many build directories are used, it's easy to switch between builds: just type make -j*** install in given build dir.

Removing directories. If you no longer need a build directory, you can safely remove it to safe space. You can also remove source directory that you created using git-new-workdir before. But the base source directory used by the git-new-workdir (or <original clone's directory> as mentioned before, typically containing master branch code, shall not be removed. Otherwise, 'workdir' branches (such as kde/src/calligra-x.y) will no longer work. This is because hard links to files in the <original clone's directory> are used while by each 'workdir'.

Using kdesrc-build

Completely separate config file

You might also want a separate config file to build all of Calligra and the now external-Calligra libs like KDiagram etc. with kdesrc-build.

For that store this file in the toplevel dir of where the sources should be placed with the name "kdesrc-buildrc". Adapt anything tagged with "TOADAPT" where needed and save the file again. Then run "kdesrc-build" in that directory (UNTESTED, please try and improve):

global
  # TOADAPT: these dirs to what you like
  source-dir /home/user/kde/src/
  build-dir /home/user/kde/build/calligra
  kdedir /home/user/kde/inst5

  git-repository-base kde-projects kde:

  # TOADAPT: LIB_SUFFIX as needed by your system
  cmake-options -DCMAKE_BUILD_TYPE:STRING=debug -DBUILD_TESTING=true  -DLIB_SUFFIX=64

  cxxflags -pipe -DQT_STRICT_ITERATORS -DQURL_NO_CAST_FROM_STRING -DQT_NO_HTTP -DQT_NO_FTP -Wformat -Werror=format-security -Werror=return-type -Wno-variadic-macros -Wlogical-op -Wmissing-include-dirs

  # TOADAPT: adapt number of jobs to what your system can do :)
  make-options -j1

  branch-group kf5-qt5
end global

module-set kdiagram
    repository kde-projects
    use-modules kdiagram
end module-set
 
module-set calligra
  repository kde-projects
  use-modules calligra
end module-set

Contributing to Calligra

TODO: Specific instructions

Note that pushing your patches to the Calligra codebase yourself will only work if you have a KDE developer identity. This requires logging an SSH key. Please consider submitting your first patches using Phabricator (see also the HowTo). Once you are comfortable putting together an acceptable patch, you can apply for a contributor account as explained on the KDE Techbase.

Distribution Specific Configuration Instructions

Debian-based Distributions

Debian, Ubuntu, Kubuntu and Mint should all follow the basic build instructions:

   sudo apt-get build-dep calligra
   sudo apt-get install libboost-all-dev exiv2

TODO: update for Calligra 3

It may be needed to install further packages (please add them here). If you find you are missing any KDE Frameworks parts, these can be installed using

  sudo apt-get build-dep kdelibs5

If you do not have the Plasma desktop environment installed, you possibly must also install the Breeze icon set:

  sudo apt-get install breeze-icon-theme

On Linux Mint , you'll need to activate the software sources repositories manually. ( Search for 'Software Sources' in your menu then open it, On the tab 'Linux Mint Software' , check to activate 'Source code', On the tab 'Other Software' check to activate 'Ubuntu **.** <name> (source code) then close the windows to finish )

OpenSuSE

All the dependencies used for building Calligra can be installed by running:

 zypper si -d calligra

TODO: update for Calligra 3

( Note : enable in 'Yast' > 'Software Repository' the sources packages )

Fedora

All the dependencies used for building Calligra can be installed by running:

 yum-builddep calligra
 yum install gcc gcc-c++

TODO: update for Calligra 3

Arch Linux & Manjaro

All the dependencies used for building Calligra can be installed by running:

 pacman -Syu
 pacman -S base-devel
 pacman -S cmake automoc4 boost kdepimlibs eigen2 kdeedu-marble lcms2 libmariadbclient freetds xbase libwpg opencolorio libwps gsl glew fftw poppler-qt libkdcraw libodfgen openjpeg kdegraphics-okular pstoedit vc libvisio libetonyek libpqxx libspnav

TODO: update for Calligra 3

Chakra

All the dependencies used for building Calligra can be installed by running:

 sudo pacman -S kdelibs kdepimlibs eigen freetds kdegraphics-okular kdeedu-marble xbase libgsf libwpd libwpg libwps libvisio pstoedit glew gsl cmake automoc4 libspnav libqtgtl boost libkdcraw libpqxx fftw opengtl docbook-xsl create-resources lcms2 qrencode libdmtx</pre>

TODO: update for Calligra 3

Mageia

All the dependencies used for building Calligra can be installed by running as root:

 urpmi task-c++-devel git li64boost-static-devel && urpmi --buildrequires http://mirror.internode.on.net/pub/mageia/distrib/cauldron/SRPMS/core/release/calligra-2.8.5-1.mga5.src.rpm </pre>

TODO: update for Calligra 3

Note
change the link to the src.rpm file to an actual up-to-date location.
Note
TODO: Dependency list tested for Krita+Karbon, only librevenge is missing required library. We probably need to add some more dependencies for other calligra applications.


List of Product Sets

Here you can find a list of the different Calligra product sets.

Application Product Set
DESKTOP OSX ALL Comment
Braindump X X X Not maintained, will (probably) be removed
Karbon X X X
Sheets X X X
Stage X X X
Words X X X
Gemini X X X Includes Words, Sheets and Stage
Other
Format Converter X X X
Filemanager plugins X X X
Okular plugins X X X

Advanced users and developers wishing to design completely own product sets can do so. An introduction into the product set system and how to define own sets can be found in the file CalligraProducts.cmake in the toplevel directory of the Calligra sources.


Further Resources


This page was last edited on 27 June 2020, at 08:30. Content is available under Creative Commons License SA 4.0 unless otherwise noted.