Krita/linuxbuild: Difference between revisions

From KDE Community Wiki
(Move all dependency info into one page)
 
No edit summary
 
(41 intermediate revisions by 7 users not shown)
Line 1: Line 1:
== Build instructions ==
Please check the manual: [https://docs.krita.org/en/untranslatable_pages.html Contributors Manual]
 
This guide explains how to build Krita from standard Qt 5 and KDE Frameworks 5 development packages provided with your favorite linux distribution.  Building Krita is fundamentally [https://community.kde.org/Calligra/Building/3 similiar to building Calligra], but there are a few differences. I am too lazy to copy all of those instructions into this page, it would be nice if you did it though. <tt>=)</tt>
 
=== Dependencies ===
The full set of dependencies for Krita 3.0 pre-alpha:
 
* [http://www.qt.io/ Qt 5], at least 5.3 is required, but the newer the better. You need the following components:
** Core
** Gui
** Widgets
** Xml
** Network
** PrintSupport
** Svg
** Test
** Concurrent
** OpenGL (optional, but really, really recommended)
** Quick (optional, for sketch/Gemini)
** DBus (optional)
** X11Extras (only on Linux)
 
* The following KDE Frameworks:
** extra-cmake-modules
** [http://api.kde.org/frameworks-api/frameworks5-apidocs/karchive/html/index.html Archive]
** [http://api.kde.org/frameworks-api/frameworks5-apidocs/kconfig/html/index.html Config]
** [http://api.kde.org/frameworks-api/frameworks5-apidocs/kwidgetaddons/html/index.html WidgetAddons]
** [http://api.kde.org/frameworks-api/frameworks5-apidocs/kcompletion/html/index.html Completion]
** [http://api.kde.org/frameworks-api/frameworks5-apidocs/kcoreaddons/html/index.html CoreAddons]
** [http://api.kde.org/frameworks-api/frameworks5-apidocs/kguiaddons/html/index.html GuiAddons]
** [http://api.kde.org/frameworks-api/frameworks5-apidocs/ki18n/html/index.html I18n]
** [http://api.kde.org/frameworks-api/frameworks5-apidocs/kitemmodels/html/index.html ItemModels]
** [http://api.kde.org/frameworks-api/frameworks5-apidocs/kitemviews/html/index.html ItemViews]
** [http://api.kde.org/frameworks-api/frameworks5-apidocs/kwindowsystem/html/index.html WindowSystem]
** [http://api.kde.org/frameworks-api/frameworks5-apidocs/kio/html/index.html KIO (optional, only on linux)]
 
* The following required packages
** Eigen3
** Exiv2
** lcms2
** GSL
** Boost (headers and the boost system library)
** zlib
** libtiff
** libpng
** libjpeg
** perl (need to check if this is really true, I doubt it)
 
* The following optional packages
** SharedMimeInfo
** Poppler
** OpenEXR
** pthreads (for G'Mic)
** openmp (for G'Mic)
** curl (for G'mic)
** libraw
** fftw3 (for G'mic and performance improvements)
** Vc 0.7
** OpenColorIO
 
 
Krita can be built successfully omitting several optional packages. KIO is for optional thumbnail integration with Dilphing. QtDeclarative is 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, and is necessary for a usable painting experience on anything but the smallest canvases.  SharedMimeInfo is for determining file types.  If you want to build Krita without these features, you can omit the package.
 
 
=== Debian/Ubuntu dependencies ===
Here are the names of the above packages in the Debian repositories.
 
sudo apt install extra-cmake-modules  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
 
=== Arch Linux dependencies ===
 
Building Krita 3.x on Arch requires slightly more dependencies than running 2.9.9; this should get you going (90% of these are 2.9.9 dependencies already):
 
sudo pacman -S attica-qt4 qca-qt4 libdbusmenu-qt4 polkit-qt4 exiv2 strigi docbook-xml
docbook-xsl libplist libusbmuxd libimobiledevice upower libatasmart udisks2
cdparanoia libvisual gst-plugins-base phonon-qt4-gstreamer libqzeitgeist
phonon-qt4 media-player-info qtwebkit kdelibs libakonadi-qt4 libical libdmtx
qrencode prison qjson kdepimlibs4 libkactivities4 calligra-libs librevenge
libwpd libodfgen calligra-filters libspnav calligra-plugins qt5-xmlpatterns
qt5-declarative solid karchive gamin kcoreaddons kwidgetsaddons qt5-x11extras
kjobwidgets kconfig kwindowsystem kcrash kdbusaddons kglobalaccel kcompletion
qt5-script ki18n kservice qt5-svg polkit-qt5 kauth kcodecs kguiaddons
kconfigwidgets kitemviews kiconthemes sonnet ktextwidgets attica-qt5 kxmlgui
kbookmarks phonon-qt5-gstreamer phonon-qt5 libdbusmenu-qt5 knotifications
gpgmepp kwallet kio kpackage kdeclarative kcmutils kactivities-frameworks
sound-theme-freedesktop libcanberra oxygen-icons kdebase-runtime opencolorio
libraw libkdcraw fftw gsl
 
 
== Building Krita ==
Once you have installed the dependencies, you are ready to clone the Krita repository.
 
cd ~/kf5/src              (Or, wherever you want to download the source code)
git clone kde:krita
 
 
=== CMake command ===
Krita's build system has diverged from the Calligra build system and will continue to do so.  For example, since there is only one product, Krita does not use productsets any longer.  For your initial build of Krita, you probably don't want to run the tests. <tt>RelWithDebInfo</tt> optimization level is nearly always good enough for everyday debugging, but it is also fast enough to paint with.  <tt>=)</tt>
 
cd ~/kf5/build/krita
cmake -DCMAKE_INSTALL_PREFIX=$HOME/kde/inst5 $HOME/kde/src/calligra -DCMAKE_BUILD_TYPE=RelWithDebInfo
      -DBUILD_TESTING=OFF
make -j12
 
 
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>
 
== Environment variables for debugging ==
'''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. (For example, if it thinks the plugin path is <tt>./build/krita/plugins/</tt> then it will miss the plugins contained in <tt>./build/plugins/</tt>.  It may be possible in the future to fix this by altering Krita's codebase, but such large changes are not yet possible until the break with Calligra repo is more complete.)
 
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"
 
'''QT_MESSAGE_FORMAT''' and '''QT_LOGGING_RULES'''
See <tt>main.cc</tt> and http://woboq.com/blog/nice-debug-output-with-qt.html

Latest revision as of 11:12, 15 January 2019

Please check the manual: Contributors Manual