Jump to content

Calligra/Building/Building Calligra: Difference between revisions

From KDE Community Wiki
Cyrille (talk | contribs)
Created page with 'These instructions are for Unix and similar operating systems. See also: *../Nightly Builds/ *../Developing With KDevelop/ *../Developing With QtCreator/ *[http://te...'
 
Cyrille (talk | contribs)
No edit summary
Line 8: Line 8:
*[http://techbase.kde.org/Getting_Started/Build/KDE4/Mac_OS_X Pages about compiling KDE software for Mac OS X]
*[http://techbase.kde.org/Getting_Started/Build/KDE4/Mac_OS_X Pages about compiling KDE software for Mac OS X]
*[https://wiki.kubuntu.org/CompilingKoffice2 Community HOWTO dedicated to building for Kubuntu]
*[https://wiki.kubuntu.org/CompilingKoffice2 Community HOWTO dedicated to building for Kubuntu]
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]
*[http://git.or.cz/course/svn.html git crash course]


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].
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].


= Preparation =
= Preparation =
{{Warning|First, to avoid conflicting copies of software, '''make sure you do not have other copy of KOffice software''' either installed through the package manager of your distribution or installed in any other way.}}
{{Warning|First, to avoid conflicting copies of software, '''make sure you do not have other copy of Calligra or Calligra software''' either installed through the package manager of your distribution or installed in any other way. Calligra and Calligra are mutually exclusive!}}


== Recommended setup ==
== Recommended setup ==
Here is recommendation of a directory structure:
Here is recommendation of a directory structure:
;$HOME/kde4/src:source code
;$HOME/kde4/src/:source code
;$HOME/kde4/build/koffice:directory that KOffice will be built in
;$HOME/kde4/build/calligra:directory that Calligra will be built in
;$HOME/kde4/inst:directory that KOffice will be installed in
;$HOME/kde4/inst:directory that Calligra will be installed in


The ''build'' directory is needed because you cannot (or should not) build KOffice inside the source directory; the source and build directory have to be separated.  
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.  


'''Advantages of this setup:'''
'''Advantages of this setup:'''
Line 32: Line 37:


=== Geting the source code for the latest stable version ===
=== Geting the source code for the latest stable version ===
The latest stable KOffice version is '''{{Calligra/Stable}}'''.
* Visit download.kde.org for the latest source code: [http://download.kde.org/download.php?url=stable/koffice-{{Calligra/Stable}}/koffice-{{Calligra/Stable}}.tar.bz2 koffice-{{Calligra/Stable}}.tar.bz2]
* Check release notes on [http://www.koffice.org/ koffice.org]
* Alternatively, you can checkout the '''{{StableBranch}} branch''' from:
cd $HOME/kde4/src
svn co svn://anonsvn.kde.org/home/kde/branches/koffice/{{StableBranch}}/koffice


This will create directory $HOME/kde4/src/koffice.
The latest stable Calligra version is '''{{Stable}}'''.
* Visit download.kde.org for the latest source code: [http://download.kde.org/download.php?url=stable/calligra-{{Stable}}/calligra-{{Stable}}.tar.bz2 calligra-{{Stable}}.tar.bz2]
* Check release notes on [http://www.calligra-suite.org/ calligra.org]
 


=== Get the source code for the development version ===
=== Get the source code for the development version ===
The latest development version of KOffice is '''{{Calligra/Unstable}}'''; developers always refer to it as to '''trunk'''. Once tested and released, it will become new stable version {{UnstableBranch}}.


*'''Option 1: when you do not use KDE developer account''' you can get the latest source code from subversion:
{{Warning|You cannot convert your KOffice SVN checkout to a Calligra git checkout. You will need to get the Calligra source code using git and manually apply your changes again.}}
  cd $HOME/kde4/src
 
  svn co svn://anonsvn.kde.org/home/kde/trunk/koffice
The latest development version of Calligra is '''{{Unstable}}'''; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{UnstableBranch}}.
 
XXX: Here we should explain local branches, staging and always-release-ready Master, if we have that setup. XXX
 
*'''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:
 
  [url "git://anongit.kde.org/"]
    insteadOf = kde://
  [url "ssh://git@git.kde.org/"]
    pushInsteadOf = kde://
 
Then execute
 
$ git clone kde://calligra
 
By using the kde:// prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.
 
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).
 
The $HOME/kde4/src/calligra directory will be created regardless of the way how the source code has been downloaded.
 
*'''Option 2: download a repository tarball'''


*'''Option 2: when you have a KDE developer account''' you can get the latest source code from subversion:
Go to https://projects.kde.org/projects/extragear/calligra. Press the "Tarball" button. Copy the url text and paste it on your command line. It will look like:
**If you have https access ('''it's apparently no longer available option!'''):<strike>
cd $HOME/kde4/src
svn co --username=login https://svn.kde.org/home/kde/trunk/koffice
</strike>
**If you have svn+ssh access:
cd $HOME/kde4/src
svn co  svn+ssh://username@svn.kde.org/home/kde/trunk/koffice


For more information see [http://techbase.kde.org/Getting_Started/Sources/Using_Subversion_with_KDE using subversion with KDE].
wget -c http://anongit1.kde.org/calligra/calligra-latest.tar.gz


Directory $HOME/kde4/src/koffice will be created regardless of the way how the source code has been downloaded.
Unpack and cd into directory, then run


*'''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/koffice-latest/ koffice-latest]. Uncompress the code so that $HOME/kde4/src/koffice is created.
$./initrepo.sh


*'''Option 4: Daily source code snapshots''' can be found at ftp://ftp.kde.org/pub/kde/snapshots/koffice-svn.tar.bz2, and once installed it can be updated using Subversion command "svn update". Uncompress the code so that $HOME/kde4/src/koffice is created.
From now on, you can run


{{Note|There is no guarantee that the content of the snapshot can be build successfully}}
$git pull
 
to update, or
 
$ git rebase origin/master
 
if you have local changes
 
 
*'''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/kde4/src/calligra is created.


*(no longer an option, because of migration to git)<strike>'''Note that doing a new Subversion checkout takes a long time.''' So, download svn trunk snapshots from [http://kdesvn-build.kde.org/other/svn-checkout-tarballs.php kdesvn-build.kde.org]. Uncompress the code so that $HOME/kde4/src/koffice is created.
** <code>svn revert -R .</code>
** If you have an svn account: svn switch --relocate svn://anonsvn.kde.org/ svn+ssh://[email protected]/ (replace svn+ssh by https if you are using the https protocol)</strike>


= Build requirements =
= Build requirements =
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the KOffice software.
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.


== Hard dependencies ==
== Hard dependencies ==


{{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 koffice[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.}}
{{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 calligra[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.}}


Following are the general must-have dependencies for KOffice:
Following are the general must-have dependencies for Calligra:
* Qt 4.6.0
* Qt 4.6.0
* kdelibs, the minimal requirement is currently 4.3.0. But KOffice should build fine with either kdelibs from svn (see [http://techbase.kde.org/Getting_Started/Build/KDE4 techbase] for an explanation on how to compile kdelibs from svn), or any 4.3, 4.4 or 4.5 release packaged in your distribution (4.4.x is recommended)
* kdelibs, the minimal requirement is currently 4.3.0. But Calligra should build fine with either kdelibs from svn (see [http://techbase.kde.org/Getting_Started/Build/KDE4 techbase] for an explanation on how to compile kdelibs from svn), or any 4.3, 4.4 or 4.5 release packaged in your distribution (4.4.x is recommended) Parts of Calligra build with the Mobile Frameworks Profile of the KDE platform (kword, kspread, kpresenter, krita)
* kdebase/runtime 4.3 (4.4.x is recommended)
* kdebase/runtime 4.3 (4.4.x is recommended)
* kdepimlibs 4.3 (4.4.x is recommended)
* kdepimlibs 4.3 (4.4.x is recommended)
Line 93: Line 118:
* libexiv2 >= 0.16
* libexiv2 >= 0.16
* libqimageblitz
* libqimageblitz
For KPresenter:
* boost


For Kexi:
For Kexi:
Line 105: Line 134:
  apt-get build-dep {packagename}
  apt-get build-dep {packagename}
for instance on Ubuntu:
for instance on Ubuntu:
  sudo apt-get build-dep koffice
  sudo apt-get build-dep calligra


*'''OpenSuSE:''' All the dependencies used for building KOffice can be installed by running:
*'''OpenSuSE:''' All the dependencies used for building Calligra can be installed by running:
  zypper si -d koffice2
  zypper si -d calligra2


*'''ArchLinux:''' All the dependencies used for building KOffice can be installed by running:
*'''ArchLinux:''' All the dependencies used for building Calligra can be installed by running:
  sudo pacman -S docbook-xml exiv2 glew graphicsmagick gsl kdebase-runtime kdepimlibs lcms libwpd poppler-qt pstoedit qca qimageblitz shared-mime-info wv2 xdg-utils
  sudo pacman -S docbook-xml exiv2 glew graphicsmagick gsl kdebase-runtime kdepimlibs lcms libwpd poppler-qt pstoedit qca qimageblitz shared-mime-info wv2 xdg-utils


= Build KOffice =
= Build Calligra =
{{Note|It is '''not''' possible to build KOffice in the source directory. Set up your directories as described in the [[Calligra/Building/Building_KOffice#Recommended_setup|Recommended setup]] section above}}
{{Note|It is '''not''' possible to build Calligra in the source directory. Set up your directories as described in the [[Building/Building_Calligra#Recommended_setup|Recommended setup]] section above}}


Type:
Type:
  mkdir -p $HOME/kde4/build/koffice
  mkdir -p $HOME/kde4/build/calligra
  mkdir -p $HOME/kde4/inst
  mkdir -p $HOME/kde4/inst
  cd $HOME/kde4/build/koffice
  cd $HOME/kde4/build/calligra
  cmake -DCMAKE_INSTALL_PREFIX=$HOME/kde4/inst $HOME/kde4/src/koffice -DCMAKE_BUILD_TYPE=RelWithDebInfo
  cmake -DCMAKE_INSTALL_PREFIX=$HOME/kde4/inst $HOME/kde4/src/calligra -DCMAKE_BUILD_TYPE=RelWithDebInfo


''cmakekde'' tool can be used as explained on [http://techbase.kde.org/Getting_Started/Build/KDE4 the build instructions for KDE4].
''cmakekde'' tool can be used as explained on [http://techbase.kde.org/Getting_Started/Build/KDE4 the build instructions for KDE4].
Line 135: Line 164:
  make install
  make install


'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized KOffice with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower KOffice but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.


Please follow the [[Calligra/Building/Building_KOffice#Running_KOffice_applications|Running KOffice Applications]] instructions before trying to run an application.
Please follow the [[Building/Building_Calligra#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.


= Updating the already built software =
= Updating the already built software =
Line 143: Line 172:


Type:
Type:
  cd $HOME/kde4/src/koffice
  cd $HOME/kde4/src/calligra
  svn up
  git pull
  cd $HOME/kde4/build/koffice
  cd $HOME/kde4/build/calligra
  make
  make
  make install
  make install
Line 153: Line 182:
{{Note|The above recipe will not work if the source code has not been obtained from Subversion}}
{{Note|The above recipe will not work if the source code has not been obtained from Subversion}}


= Build only selected applications from KOffice =
= Build only selected applications from Calligra =
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and before executing make. To use it, go to the build directory and issue the following commands:
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and before executing make. To use it, go to the build directory and issue the following commands:
  cd $HOME/kde4/build/koffice
  cd $HOME/kde4/build/calligra
  ccmake .
  ccmake .


Line 162: Line 191:
Alternatively you can run "-DBUILD_{application}=off" from the cmake command line.
Alternatively you can run "-DBUILD_{application}=off" from the cmake command line.


= Running KOffice applications =
= Running Calligra applications =
There are two options to make the KOffice applications available for running.
There are two options to make the Calligra applications available for running.


*'''Option 1: Being able to run KOffice applications from the command line.''' If you have installed KOffice in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable:  
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable:  


  export KDEDIRS=$KDEDIRS:/path/to/install
  export KDEDIRS=$KDEDIRS:/path/to/install
Line 177: Line 206:
  export PATH=$PATH:$HOME/kde4/inst/bin
  export PATH=$PATH:$HOME/kde4/inst/bin


*'''Option 2: Being able to run KOffice applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:


  [Directories]
  [Directories]
Line 185: Line 214:
  kbuildsycoca4
  kbuildsycoca4


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


Line 214: Line 243:


= Resources =
= Resources =
*[[Calligra/DeveloperInfo|Useful hints for who wants to hack on KOffice]]
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of KOffice 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 =
= Possible issues =
Line 222: Line 251:
If you get errors when running an application like:
If you get errors when running an application like:


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


or crashes when starting an application, then you very likely have a version of KOffice installed through your package manager. '''As emphasized earlier in this document, you can only have one version of KOffice, and you should uninstall your packaged KOffice'''.
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'''.

Revision as of 08:47, 7 December 2010

These instructions are for Unix and similar operating systems.

See also:


Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the build instructions on techbase.


Preparation

Warning

First, to avoid conflicting copies of software, make sure you do not have other copy of Calligra or Calligra software either installed through the package manager of your distribution or installed in any other way. Calligra and Calligra are mutually exclusive!


Recommended setup

Here is recommendation of a directory structure:

$HOME/kde4/src/
source code
$HOME/kde4/build/calligra
directory that Calligra will be built in
$HOME/kde4/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.

Advantages of this setup:

  • It is possible to have different builds (e.g. with different options out of the same source code)
  • 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 Techbase instructions on setting up a build environment. That contains some useful scripts and functions.

Geting the source code

There are two options: to get the source code for the latest stable version or for the for the development version. The later option is 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.

Geting the source code for the latest stable version

The latest stable Calligra version is Template:Stable.


Get the source code for the development version

Warning

You cannot convert your KOffice SVN checkout to a Calligra git checkout. You will need to get the Calligra source code using git and manually apply your changes again.


The latest development version of Calligra is Template:Unstable; developers always refer to it as to Master. Once tested and released, it will become the new current stable version Template:UnstableBranch.

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

  • 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:

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

Then execute

$ git clone kde://calligra

By using the kde:// prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.

Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).

The $HOME/kde4/src/calligra directory will be created regardless of the way how the source code has been downloaded.

  • Option 2: download a repository tarball

Go to https://projects.kde.org/projects/extragear/calligra. Press the "Tarball" button. Copy the url text and paste it on your command line. It will look like:

wget -c http://anongit1.kde.org/calligra/calligra-latest.tar.gz

Unpack and cd into directory, then run

$./initrepo.sh

From now on, you can run

$git pull

to update, or

$ git rebase origin/master

if you have local changes


  • Option 3: if beta or rc version was released, the source code for the latest beta can be found on KDE's ftp calligra-latest. Uncompress the code so that $HOME/kde4/src/calligra is created.


Build requirements

This section provides information about hard (required) and optional software packages needed to build the Calligra software.

Hard dependencies

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.


Following are the general must-have dependencies for Calligra:

  • Qt 4.6.0
  • kdelibs, the minimal requirement is currently 4.3.0. But Calligra should build fine with either kdelibs from svn (see techbase for an explanation on how to compile kdelibs from svn), or any 4.3, 4.4 or 4.5 release packaged in your distribution (4.4.x is recommended) Parts of Calligra build with the Mobile Frameworks Profile of the KDE platform (kword, kspread, kpresenter, krita)
  • kdebase/runtime 4.3 (4.4.x is recommended)
  • kdepimlibs 4.3 (4.4.x is recommended)
  • cmake 2.6.2
  • lcms 1.18

For KSpread:

  • libeigen 2.0

For Krita:

  • libeigen 2.0
  • libexiv2 >= 0.16
  • libqimageblitz

For KPresenter:

  • boost

For Kexi:

  • sqlite and sqlite-devel packages (package names can differ on various distributions), version >= 3.6.16

Optional dependencies

All 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 bot be built because given missing dependency.

Simplified installation of dependencies on various distributions

  • deb-based distributions (Debian, Ubuntu...): All the dependencies used for the packages can be installed by running
apt-get build-dep {packagename}

for instance on Ubuntu:

sudo apt-get build-dep calligra
  • OpenSuSE: All the dependencies used for building Calligra can be installed by running:
zypper si -d calligra2
  • ArchLinux: All the dependencies used for building Calligra can be installed by running:
sudo pacman -S docbook-xml exiv2 glew graphicsmagick gsl kdebase-runtime kdepimlibs lcms libwpd poppler-qt pstoedit qca qimageblitz shared-mime-info wv2 xdg-utils

Build Calligra

Note

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


Type:

mkdir -p $HOME/kde4/build/calligra
mkdir -p $HOME/kde4/inst
cd $HOME/kde4/build/calligra
cmake -DCMAKE_INSTALL_PREFIX=$HOME/kde4/inst $HOME/kde4/src/calligra -DCMAKE_BUILD_TYPE=RelWithDebInfo

cmakekde tool can be used as explained on the build instructions for KDE4.

Then type:

make

Note that on dual-core machines compilation can be greatly speed up with the -j parameter of the make program, for example for dual-core:

make -j4

and for quad-core:

make -j8

Then type this command to install the software:

make install

Debugging options. Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace -DCMAKE_BUILD_TYPE=RelWithDebInfo in the above cmake command with -DCMAKE_BUILD_TYPE=Debug.

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

Updating the already built software

If the source code has been checked out Subversion from trunk or a branch, 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/kde4/src/calligra
git pull
cd $HOME/kde4/build/calligra
make
make install

Note

make -j4 or make -j8 can be used instead of make to speedup the build on multicore machines


Note

The above recipe will not work if the source code has not been obtained from Subversion


Build only selected applications from Calligra

CMake comes with a command-line tool ccmake that lets you configure build options. You can use it after executing cmake and before executing make. To use it, go to the build directory and issue the following commands:

cd $HOME/kde4/build/calligra
ccmake .

For applications that you do not want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting BUILD_krita to off will prevent Krita from being built.

Alternatively you can run "-DBUILD_{application}=off" from the cmake command line.

Running Calligra applications

There are two options to make the Calligra applications available for running.

  • Option 1: Being able to run Calligra applications from the command line. If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable:
export KDEDIRS=$KDEDIRS:/path/to/install
export PATH=$PATH:/path/to/install/bin

And then you need to execute:

kbuildsycoca4

For example for the recommended directory structure:

export KDEDIRS=$KDEDIRS:$HOME/kde4/inst
export PATH=$PATH:$HOME/kde4/inst/bin
  • Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons. 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 execute:

kbuildsycoca4

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

[Directories]
prefixes=$HOME/kde4/inst.

Executing unit tests

To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command cmake -DKDE4_BUILD_TESTS=ON, or by running ccmake .. Both commands must be executed in the build directory.

You can then run the test by executing:

make test

or individually in the tests directories.

It is recommended to execute

make install

before running tests.

CMake Build Options

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

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.