(Created page with "This page provides information about how to build and install Krita 3 from source using the kdesrc-build tool. This installation of Krita will be separate from any existing pl...")
This page provides information about how to build and install Krita 3 from source using the kdesrc-build tool. This installation of Krita will be separate from any existing plasma installation, so that either of them can be run as desired.
This section provides information about 'building Qt5, Kf5 and Krita3.
= Preparation =
If you want to figure out bugs in Qt5 and Kf5, you need to build those, too, and need this guide. If you just want to build krita from git master, you should be able to install the kf5 and qt5 devel packages through your package manager and build krita in the usual way.
== Git remote prefix ==
Let's setup a "kde:" prefix for git commands. Add the following text to your ~/.gitconfig:
To build Qt5 and Kf5 follow the instructions in [https://community.kde.org/Frameworks/Building Frameworks/Building] on Techbase. I assume that you are building in $HOME/kf5. The result will be completely independent from your kde4 build of Krita. The frameworks instructions have the deps you need for Qt5 and kf5, but you also need Krita's own deps, of course.
<syntaxhighlight lang="ini">
[url "git://anongit.kde.org/"]
insteadOf = kde:
[url "ssh://git@git.kde.org/"]
pushInsteadOf = kde:
</syntaxhighlight>
==Create directories for build and installation==
you can build just the frameworks with:
<syntaxhighlight lang="bash">
sudo mkdir -p ~/kf5/{sources,build,install,logs}
sudo chown -R $USER:$GROUP ~/kf5
mkdir -p ~/.kde5/{local,config,cache} # Optional, only if you want separate directory for config files in your home
</syntaxhighlight>
== Clone kdesrc-build ==
First you need kdesrc-build:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
cd ~/kf5/sources
./kdesrc-build frameworks
git clone kde:kdesrc-build
cd kdesrc-build
</syntaxhighlight>
</syntaxhighlight>
The rest of the commands will be run from inside this directory.
== kdesrc-build configuration==
{{Note|To get all the right things build you need Solid build, and solid depends on udev. On Ubuntu 14.04 this is package libudev-dev}}
Save the following as <code>~/.kdesrc-buildrc</code>.
<pre>
global
#qtdir /path/to/custom/qt # Uncomment if you have your own qt build
Here's my kdesrcbuildrc, adjust to your home directory:
* Adjust the paths to wherever you want to build and install Krita 3
branch-group kf5-qt5
* Adjust the value of 'make-options -j4'. It is usually recommended to set to the number of CPU cores.
* Uncomment the last two lines if you also want to build the Applications and PIM suite.
Explore other available options in the [https://kdesrc-build.kde.org/documentation/conf-options-table.html official documentation]
end global
=Building=
==Dependencies==
Krita 3 will need various dependencies to be installed. You can find a list of dependencies for atleast the frameworks [https://community.kde.org/Frameworks/Building#Dependencies here]. Any other dependencies can be figured out and installed as you continue building the modules one by one.
At the very minimum, <code>qt5</code>, <code>cmake</code>, <code>g++</code>, <code>git</code>, <code>bzr</code>, <code>libwww-perl</code>, <code>libjson-perl</code> and <code>libxml-parser-perl</code> needs to be installed to get started.
===Kubuntu===
{{warning| Building Krita using these instructions does not work on Kubuntu due to the way they have incorrectly set up Qt.
Please use any non Debian based distro}}
For Kubuntu 15.04, here's a list of packages that should satisfy all the dependencies of the default kdesrc-build projects, including Frameworks, Applications and Krita Workspace but excluding kdegames. Just copy-paste this to your terminal: <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: normal;">sudo apt-get install libxslt1-dev libpolkit-agent-1-dev libpolkit-gobject-1-dev libpolkit-backend-1-dev debhelper dh-apparmor icu-devtools libboost1.55-dev libcln-dev libglib2.0-dev libgmp-dev libgmpxx4ldbl libgps-dev libicu-dev libqalculate-dev libqimageblitz-dev libqt5sensors5 libqt5sensors5-dev libqt5webkit5-dev libqt5x11extras5-dev libraw1394-dev libudev-dev libusb-dev libxapian-dev libxcb-composite0-dev libxcb-cursor-dev libxcb-cursor0 libxcb-damage0-dev libxcb-dpms0 libxcb-dpms0-dev libxcb-ewmh-dev libxcb-ewmh2 libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-record0-dev libxcb-render-util0-dev libxcb-res0 libxcb-res0-dev libxcb-screensaver0 libxcb-screensaver0-dev libxcb-shm0-dev libxcb-util0-dev libxcb-xevie0 libxcb-xevie0-dev libxcb-xf86dri0 libxcb-xf86dri0-dev libxcb-xinerama0 libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xprint0 libxcb-xprint0-dev libxcb-xtest0-dev libxcb-xv0 libxcb-xv0-dev libxcb-xvmc0 libxcb-xvmc0-dev libxml2-dev pkg-kde-tools po-debconf qttools5-dev xcb-proto xvfb qtscript5-dev qtdeclarative5-dev qtbase5-dev qtbase5-dev-tools qt5-qmake doxygen bzr libjson-perl perl-modules cmake cmake-data libapr1 libaprutil1 libserf-1-1 libsvn1 libxml-parser-perl subversion git build-essential libqt5svg5-dev libgpgme11-dev libgcrypt20-dev libepoxy-dev libssl-dev libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev libgif-dev qtbase5-private-dev qtxmlpatterns5-dev-tools libqt5xmlpatterns5-dev libqt5xmlpatterns5-private-dev libvlc-dev libvlccore-dev gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 libasound2-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libnm-util-dev libnm-glib-dev libattr1-dev qtquick1-5-dev libgrantlee5-dev liblcms2-dev libexiv2-dev libarchive-dev libcups2-dev libfakekey-dev libpam-dev libxrender-dev libpng-dev libxcursor-dev liblmdb-dev libsm-dev</pre>
===Arch===
For Arch, here's a list of packages that should satisfy all the dependencies of the default kdesrc-build projects, including Frameworks, Applications and Krita Workspace but excluding kdegames. Just copy-paste this to your terminal: <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: normal;">
include extragear/utils/kdesrc-build/data/build-include/kf5-qt5.ksb
Run kdesrc-build as:
<syntaxhighlight lang="bash">
./kdesrc-build --debug
</syntaxhighlight>
</syntaxhighlight>
By default, kdesrc-build sends all output to log files. --debug will print build and install progress in the terminal too.
Sometimes a build will fail, and if <code>stop-on-failure true</code> is present in the options (as above), kdesrc-build will stop here. After the reason for the build failure has been analysed and fixed, you can resume building from that module by:
The following script will setup all the paths. You should save the script as, say, ~/kf5/kf5.sh and source it when you want to do a spot of Krita3 building.
<syntaxhighlight lang="bash">
./kdesrc-build --debug --resume-from=<name>
</syntaxhighlight>
If that application build cannot be fixed at present, you can skip building it by:
#On some distros, this is $KF5/lib64/qml:$QTDIR/qml or something similar. After the installation, choose the directory/directories which contains the "qt/qml" folder.
export QML2_IMPORT_PATH=$KF5/lib/qml:$QTDIR/qml
#Fixes for Debian's "look at me, I'm so important" setups
Because dbus will load all these new paths each time you login, you should rename these files (to eg system-local.conf.bk and session-local.conf.bk) before starting your default Krita 4 or other distro sessions.
After building Qt and Kf5 as per instructions, you should end up with the following items in the top-level kf5 directory:
Finally, there are two ways of running Krita 3. Choose the one which suits you best.
Edit /usr/share/xsessions/plasma.desktop and change the paths as:
~/kf5/qt5/
<pre>
~/kf5/src/
Exec=/usr/share/xsessions/runKrita5.sh
TryExec=/usr/share/xsessions/runKrita5.sh
Name=Krita Git
</pre>
</pre>
After this logout of your current session, select Krita Git in the options and login. You should now have the last Krita 3 running.
==From the command line==
Edit your xinitrc file:
<syntaxhighlight lang="bash">
mv ~/.xinitrc ~/.xinitrc.bk # Backup any existing xinitrc file
ln -s ~/kf5/runKrita5.sh ~/.xinitrc
</syntaxhighlight>
Log out of your current session, login to a tty (eg tty2 by pressing <code>Ctrl+Alt+F2</code>) and run <code>startx</code>. This should read your ~/.xinitrc and log you into a Krita 3 desktop.
=Updating=
Run kdesrc-build each time you want the latest updates.
<syntaxhighlight lang="bash">
cd ~/kf5/sources/kdesrc-build
git pull # First update kdesrc-build
./kdesrc-build --debug
</syntaxhighlight>
=Troubleshooting=
You may not be able to successfully build or run Krita 3 at first go.
* You may not have all dependencies installed. Read the output to see what missing dependency it is complaining about, search for the corresponding package for your disto, and install it.
* If you get a build failure, simple fix might be to delete the build folder for that module and try building it again.
* Because we are compiling from the source code, some latest changes might be the cause of build failures. You may try going back to a previous code version (git skills required), wait sometime for the developers to fix the code, or even better, try to fix the build yourself and [https://techbase.kde.org/Development/Review_Board submit a patch] :)
For any help, [https://community.kde.org/Getinvolved/development#Communicating_with_the_team communicate with the KDE team].
If everything has been built, you can checkout the krita src in ~/kf5/src, build it in ~/kf5/build and install to ~/kf5/inst. There are no weird cmake incantations needed.
Latest revision as of 17:43, 10 December 2023
This section provides information about 'building Qt5, Kf5 and Krita3.
If you want to figure out bugs in Qt5 and Kf5, you need to build those, too, and need this guide. If you just want to build krita from git master, you should be able to install the kf5 and qt5 devel packages through your package manager and build krita in the usual way.
To build Qt5 and Kf5 follow the instructions in Frameworks/Building on Techbase. I assume that you are building in $HOME/kf5. The result will be completely independent from your kde4 build of Krita. The frameworks instructions have the deps you need for Qt5 and kf5, but you also need Krita's own deps, of course.
you can build just the frameworks with:
./kdesrc-buildframeworks
Note
To get all the right things build you need Solid build, and solid depends on udev. On Ubuntu 14.04 this is package libudev-dev
Here's my kdesrcbuildrc, adjust to your home directory:
# Adjust all these settings at will
global
qtdir/home/boud/kf5/qt5/qtbase
source-dir/home/boud/kf5/src
build-dir/home/boud/kf5/build
kdedir/home/boud/kf5/inst
git-repository-basekde-projectskde:
cmake-options-DCMAKE_BUILD_TYPE:STRING=relwithdebinfo-DBUILD_TESTING=false# If you want to use ninja instead of make (it's faster!), uncomment the next line#custom-build-command ninjamake-options-j8
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-std=c++11
#install-session-driver truebranch-groupkf5-qt5
endglobal
includeextragear/utils/kdesrc-build/data/build-include/kf5-qt5.ksb
The following script will setup all the paths. You should save the script as, say, ~/kf5/kf5.sh and source it when you want to do a spot of Krita3 building.
If everything has been built, you can checkout the krita src in ~/kf5/src, build it in ~/kf5/build and install to ~/kf5/inst. There are no weird cmake incantations needed.