Krita/debbuild: Difference between revisions

From KDE Community Wiki
Line 32: Line 32:
Remember that you can change build settings with <tt>cmake . -DNEW_SETTING</tt>  or by using <tt>cmake-gui</tt> found in the package <tt>cmake-qt-gui</tt>
Remember that you can change build settings with <tt>cmake . -DNEW_SETTING</tt>  or by using <tt>cmake-gui</tt> found in the package <tt>cmake-qt-gui</tt>


=== Other things to note ===
=== Environment variables ===
If you are OK installing in your home folder, with -DCMAKE_INSTALL_PREFIX=~/, you need only one environment variable to run Krita:
'''XDG_DATA_DIRS.''' If you are OK installing in your home folder, with -DCMAKE_INSTALL_PREFIX=~/, you need only one environment variable to run Krita:
  export XDG_DATA_DIRS=$HOME/kde/inst5/share:$XDG_DATA_DIRS
  export XDG_DATA_DIRS=$HOME/kde/inst5/share:$XDG_DATA_DIRS


If you plan to develop Krita, you can get faster builds with ninja, gold linker and ccache. See the Calligra building page above for more information.
'''KRITA_PLUGIN_PATH.''' Currently, running inside a debugger can be a bit fragile due to plugin loading.  Krita's plugins are built in several different paths inside the source directory, and the installation process copies them into a single folder. However the debugger might accidentally not catch onto the plugin installation directory. You can force Krita to look in a specific folder for plugins using the environment variable <tt>KRITA_PLUGIN_PATH</tt>. For example, using Kubuntu and installing Krita in ~/, I can use a debugger if I set the environment variable:
export KRITA_PLUGIN_PATH="${HOME}/lib/x86_64-linux-gnu"

Revision as of 15:35, 26 October 2015

This guide explains how to build Krita from standard Qt 5 and KDE Frameworks 5 development packages provided with Debian/Ubuntu. Building Krita is fundamentally similiar to building Calligra, but three differences. I am too lazy to copy all of those instructions into this page, it would be nice if you did it though. =)

Krita's dependencies

The first difference is that Krita's dependencies are different. Drumroll, please:

sudo apt install extra-cmake-modules  kdelibs5-dev libkf5archive-dev libkf5completion-dev libkf5config-dev
libkf5coreaddons-dev libkf5guiaddons-dev libkf5i18n-dev libkf5itemmodels-dev libkf5itemviews-dev
libkf5widgetsaddons-dev libkf5windowsystem-dev libkf5kiocore5 qtbase5-dev libqt5svg5-dev
qtdeclarative5-dev libqt5x11extras5-dev libqt5opengl5-dev libeigen3-dev libxi-dev libboost-all-dev
libopenexr-dev vc-dev libexiv2-dev libgsl0-dev liblcms2-dev libpoppler-qt5-dev shared-mime-info


Technically you can get away without each and every one. KIO and QtDeclarative are for Krita Sketch. Poppler is for PDF import. GSL is for the transform tool and eventually the magnetic lasso tool. Vc is for faster SIMD accelerated painting. SharedMimeInfo is for determining file types. If you want to build Krita without these features, you can omit the package.

Krita's repository

The second difference is that Krita's source repository is different.

cd ~/kf5/src               (Or, wherever you want to download the source code)
git clone kde:krita


CMake command

The third difference is that Krita's build system has diverged. For example, since there is only one product, Krita does not use productsets any longer. This will turn of building tests, and the docbook, so that building is faster. RelWithDebInfo optimization level is nearly always good enough for everyday debugging, but it is also fast enough to paint with. =)

cd ~/kf5/build/krita
cmake -DCMAKE_INSTALL_PREFIX=$HOME/kde/inst5 $HOME/kde/src/calligra -DCMAKE_BUILD_TYPE=RelWithDebInfo 
      -DBUILD_TESTING=OFF -DBUILD_doc=OFF
make -j12


Remember that you can change build settings with cmake . -DNEW_SETTING or by using cmake-gui found in the package cmake-qt-gui

Environment variables

XDG_DATA_DIRS. If you are OK installing in your home folder, with -DCMAKE_INSTALL_PREFIX=~/, you need only one environment variable to run Krita:

export XDG_DATA_DIRS=$HOME/kde/inst5/share:$XDG_DATA_DIRS

KRITA_PLUGIN_PATH. Currently, running inside a debugger can be a bit fragile due to plugin loading. Krita's plugins are built in several different paths inside the source directory, and the installation process copies them into a single folder. However the debugger might accidentally not catch onto the plugin installation directory. You can force Krita to look in a specific folder for plugins using the environment variable KRITA_PLUGIN_PATH. For example, using Kubuntu and installing Krita in ~/, I can use a debugger if I set the environment variable:

export KRITA_PLUGIN_PATH="${HOME}/lib/x86_64-linux-gnu"