- Español, by Gerson Alvarado : Lewatoto's blog
Intro :
Almost a year after I released my Compilscripts on GitHub I discovered I made a mistake.
At the root of the project , Compilscript approach is broken by design. So, I decided to stop support for it.
What was Compilscript ?
Compilscript was a set of scripts to help user to compile and install Krita ( last development version ) and doing maintenance auto-magically. The scripts met a little success. And I'm still proud about all the things I learned while making it.
What's wrong ?
When something irregular happens, Compilscript fail and stop to work ... And irregularities are common on Linux. The user is dependent of a system he doesn't understand. And when it breaks, it breaks his production without letting him know how to fix it. That's not a solution.
A new approach
That’s why I thought the best new approach is the Arch-way not to give an automatic tool , but creating a documentation dead-easy to make artist independent in the 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 ; all of this with a minimal and easy to use documentation.
Fully illustrated
I also offer here a set of illustrations about compiling ( all are released under CC-By ). I hope those picture will 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.
Why a cat ?
Because it's well known on the Internet : you can't go wrong with cats.
Setup directories

- /home/<your-user-name>/kde4/src for the source code.
- /home/<your-user-name>/kde4/build where Krita will be built
- /home/<your-user-name>/kde4/inst where Krita will be installed
Note : understand <your-user-name>as your user name on this documentation ( Ex : /home/deevad/kde4/src )
To do it, open a Terminal, copy the line under (Ctrl+C) then paste it on the Terminal (Ctrl+Shift+V ) :
mkdir -p ~/kde4/src ~/kde4/build ~/kde4/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

cd ~/kde4/src
Install git from your distribution package-manager.
Then ask git to grab source files, pasting this line code in the Terminal , on the ~/kde4/src directory :
git clone git://anongit.kde.org/calligra.git
Get the libraries and dependencies

Krita as a part of Calligra need a large amount of libraries ; and there is not always a single command to get them.
Some distributions ( Ubuntu , OpenSuse ) got a general meta package for this, but other , not.
If your distribution is not listed, let's go plan B and find them one by one on your package manager . it sounds painfull, but it will not take really long.
( Note : Some distributions will get sometime naming convention for libraries <library-name>-dev or <library-name>-devel as package name) .
This list will help you :
git make cmake boost boost-build kdepimlibs eigen2 kdegraphics-okular
libgsf libwpd libwpg libwps pstoedit glew gsl automoc4 boost libkdcraw
libpqxx fftw opengtl lcms2 vc
In rare case, and if your distribution is not recent, it might happen a library provided by your distribution is outdated. You'll need to build this dependencies. Remember , README files and internet search engine are your friends.
Configuring

Also, we will inform cmake our directories structure, and also ask to build only Krita. But before, a cd to do this at the proper place :
cd ~/kde4/build
cmake -DCMAKE_INSTALL_PREFIX=$HOME/kde4/inst $HOME/kde4/src/calligra -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPRODUCTSET=CREATIVE -DBUILD_karbon=OFF
Building

Still on the folder /kde4/build/calligra, 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 .
make -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
Installing

make install -j9
Path and environment variables

Let's show to your system the right path, inside a Terminal, copy line by line :
export KDEDIRS=$HOME/kde4/inst:$KDEDIRS
export PATH=$HOME/kde4/inst/bin:$PATH
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 ).
And then you need to register Krita to the system, kbuildsycoca4 does it by executing in a terminal :
kbuildsycoca4
First run

If this one doesn't show Krita, look at your desktop-environment 's documentation : "how to create a custom launcher" .
Updating

Fine, call git again . This time it will only append to your source folder the missing code lines. Not downloading the whole source pack.

cd ~/kde4/src/calligra/
git pull

cd ~/kde4/build
cmake -DCMAKE_INSTALL_PREFIX=$HOME/kde4/inst $HOME/kde4/src/calligra -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPRODUCTSET=CREATIVE -DBUILD_karbon=OFF
make -j8
make install -j8
If you update daily, you might like to automatise those command by making your own minimal script. I share mine here on 'KDE paste' service .
Rescuing

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.

cd ~/kde4/src/calligra/
git log
With git log , you can consult all the last changes to the code, named 'commit' . What interrest us is the long identification number ( ex: 15c1749105a7e7cc56b646a66919c29646f8653a ). You can scroll git log , copy the ID number then quit ( letter Q on keyboard ). Then time-travel your source directory :
git checkout 15c1749105a7e7cc56b646a66919c29646f8653a
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
git pull

Conclusion
I 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 Calligra building documentation wiki.
- Calligra Git activities and history
- List of the last updated Krita bugs
- Form to enter a Krita bug
- Old Compilscript repository ( will be deleted soon )
- 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 Harelfor feedback and help with corrections.
Gerson Alvarado for Spanish translation.

This article and illustrations are licensed under a
Creative Commons Attribution 3.0 Unported License