[Edit 2019]: If you plan to follow this guide in 2019 or later; you might consider to follow instead the updated building instruction on the official documentation and now maintained by the Krita team directly. The illustrations of this article were ported to this place where it receive now a better maintainance while keeping the same 'keep it simple' philosophy. I'll keep the article under as it is for referencement and to keep a souvenir.
[2019-03-28] The guide was ported to Krita official documentation here, thanks to Wolthera.
[2017-09-09] Remove specific obsolete notes
[2017-08-20] Krita 4.x, and specific notes for Linux Mint 18.2 / Ubuntu 16.04
[2016-04-24] moving from calligra repository, Krita 3.0, adding library for plasma/Qt 5.0
[2015-05-07] Refactoring for using the 2.9 branch while Krita split Calligra
[2013-11-18] First publishing, during Krita 2.7 development
I wrote this guide after maintaining during a full-year a set of scripts to help user to compile and install Krita. This project was named Compilscripts. I decided to discontinue it because the script was always breaking. But this script was useful for many artist who wanted to beta-test Krita. So I had to find a solution and I thought the best approach was "the Arch-way": not providing any automatic tool, but a badass and dead-easy documentation to make artist independent in the full process and understand what they do. Artists should be able to install, update, go back in the history of code if something doesn’t work for them.
I also decided to illustrate the article with funny pictures (all licensed under CC-By). I hope those pictures will also help other project's documentation to be more user friendly and appear more simple to understand by using a simple analogy : a cat building a house.
But why for cats ?
Because it's well known on the Internet : you can't go wrong with cats. =^.^=
- /home/<your-user-name>/krita/src for the source code.
- /home/<your-user-name>/krita/build where Krita will be built
- /home/<your-user-name>/krita/inst where Krita will be installed
Note : understand <your-user-name> as your user name on this documentation ( Ex : /home/deevad/krita/src )
To do it, open a Terminal, copy the line under (Ctrl+C) then paste it on the Terminal (Ctrl+Shift+V ) :
mkdir -p ~/krita/src ~/krita/build ~/krita/inst
Also check with your distribution package-manager that no calligra and krita packages are installed.
Use the search field of your package manager and remove packages.
Get the source code
Install git from your distribution package-manager ( eg. for Ubuntu; sudo apt install git )
Then ask git to download the source files in your src folder, pasting this line code in the Terminal , on the ~/krita directory :
git clone https://anongit.kde.org/krita.git src
So we enter the Krita source folder, then check if everything is updated :
Get the libraries and dependencies
Krita needs a large amount of very fresh libraries and you'll need a GNU/Linux distribution with fresh packages for that ; CentOS, Debian Stable, Linux Mint, Elementary or Ubuntu L.T.S are often too outdated to build Krita...
Also, we will inform cmake our directories structure :
cd ~/krita/build cmake -DCMAKE_INSTALL_PREFIX=$HOME/krita/inst $HOME/krita/src -DWITH_GMIC=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPRODUCTSET=ALL -DPACKAGERS_BUILD=ON -DBUILD_TESTING=OFF -DKDE4_BUILD_TESTS=OFF
Still on the folder /krita/build, call make with -j<number>, where <number> has to be replaced with the number of parallel job your processor is able to do ( and +1 recommended sometime ). Mine is a 8 core, let's use -j9 .
Tip : if you don't know the number of core you have, this little command will answer you the number :
cat /proc/cpuinfo | grep processor | wc -l
make install -j9
Path and environment variables
Let's show to your system the right path, inside a Terminal, copy line by line :
Unfortunately those environment variable are not persistent, and will be lost after a shutdown or a restart of your system and our bridge will collapse.
To set them at any login , write them with your favorite text editor at the end of your ~/.profile file ( on certain distribution, the profile is named xprofile , check your hidden file in your home/<your-user-name> folder ).
If this one doesn't show Krita, look at your desktop-environment 's documentation : "how to create a custom launcher" .
Fine, call git again . This time it will only append to your source folder the missing code lines. Not downloading the whole source pack.
cmake -DCMAKE_INSTALL_PREFIX=$HOME/krita/inst $HOME/krita/src -DWITH_GMIC=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPRODUCTSET=ALL -DPACKAGERS_BUILD=ON -DBUILD_TESTING=OFF -DKDE4_BUILD_TESTS=OFF
make install -j8
If you update daily, you might like to automatise those command by making your own minimal bash script.
It might affect your productivity if you don't know how to 'go back in time' ( ex: your favorite brush doesn't work anymore ).
But If you know how to do it, no issue can really affect you, because you know how to come back to a previous state.
With git log , you can consult all the last changes to the code, named 'commit' . What interrest us is the long identification number ( ex: cca5819b19e0da3434192c5b352285b987a48796 ). You can scroll git log , copy the ID number then quit ( letter Q on keyboard ). Then time-travel your source directory :
git checkout cca5819b19e0da3434192c5b352285b987a48796
Now, configure, compile, and you'll be again in a safe place. Note that I advice the packages gitg or gitk to have a graphic user interface to visualise git history. Also an online version exist here .
To update again to the actual and fresh from a minute ago source-code named master , simply ask git to come back to it with git checkout then pull to update :
git checkout master
ConclusionI hope this documentation will help many user to have good time using Krita development version.
Use the comments to give your feedbacks or ask questions, I'll do my best to update the information on this page.
Useful Links :
- Official Krita development wiki 'Build instructions'.
- Krita Git activities and history
- List of the last updated Krita bugs
- Form to enter a Krita bug
- Krita blog
- Krita forum
- Krita IRC channel ( answer can arrive sometime after 1 or 2h, be patient )
Special Thanks :
Boudewijn Rempt, Aurélien Gâteau, M.Beast, Yu Asakusa, Matthieu Harel for feedback and help with corrections.
Gerson Alvarado for Spanish translation.