So you are wanting to build Krita from scratch, but don't want all the headache of figuring out paths to installed software that you might or might not have, or figuring out which packages you need? Well, here is a guide to build Krita from a completely fresh Ubuntu install, so you are sure to get it working after following all steps. I hope this guide is useful to people who experience issues with other guides.
The first thing we need to do is make sure our package manager is aware of all the newest updates. Then we download all the required packages for the whole process.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install all the dependencies | |
sudo apt-get update | |
sudo apt-get -y install git cmake zlib1g-dev bzip2 liblzma-dev libxfixes-dev libboost-all-dev libgsl0-dev libpng12-dev libtiff5-dev libjpeg-dev libraw-dev libfftw3-dev libopencolorio-dev libgl1-mesa-dev libeigen3-dev libexiv2-dev curl libxi-dev | |
sudo apt-get -y install libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync1 libxcb-sync-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-glx0-dev libxcb-util0-dev |
- b - Used to build Krita dependencies
- d - Used to download Krita dependencies
- build - Used to build Krita
- i - Used to install Krita and its dependencies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define INSTALL_ROOT as our base installation directory | |
export INSTALL_ROOT=$HOME/Krita | |
# Make the folder we just set as our base | |
mkdir $INSTALL_ROOT | |
# Go into it | |
cd $INSTALL_ROOT | |
# Make the folders we will need later for building | |
mkdir b i d build | |
# Add INSTALL_ROOT/i/bin as the folder that will contain our executables | |
export PATH=$INSTALL_ROOT/i/bin:$PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download the Qt 5.7 release from their website | |
wget http://download.qt.io/official_releases/qt/5.7/5.7.0/single/qt-everywhere-opensource-src-5.7.0.tar.gz | |
# Unpack the tar file into our base installation directory | |
tar -xvf qt-everywhere-opensource-src-5.7.0.tar.gz | |
# Enter the unpacked folder | |
cd qt-everywhere-opensource-src-5.7.0 | |
# Configure Qt for building | |
./configure -developer-build -debug -nomake examples -nomake tests \ | |
-skip qt3d -skip qtactiveqt -skip qtcanvas3d \ | |
-skip qtconnectivity -skip qtdoc -skip qtgraphicaleffects \ | |
-skip qtlocation -skip qtmultimedia -skip qtsensors \ | |
-skip qtserialport -skip qtwayland -skip qtwebchannel \ | |
-skip qtwebengine -skip qtwebsockets -skip qtxmlpatterns \ | |
-opengl -opensource -confirm-license \ | |
-qt-xkbcommon-x11 -qt-xcb -xcb-xlib | |
# Start building | |
make -j8 | |
# Temporarily add this Qt version to our path for building Krita | |
export PATH=$INSTALL_ROOT/qt-everywhere-opensource-src-5.7.0/qtbase/bin/:$PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enter our base installation directory | |
cd $INSTALL_ROOT | |
# Clone krita from git into a folder called krita containing the source code | |
git clone git://anongit.kde.org/krita.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enter our dependency building folder | |
cd b | |
# Prepare all dependencies | |
cmake ../krita/3rdparty -DINSTALL_ROOT=$INSTALL_ROOT/i -DEXTERNALS_DOWNLOAD_DIR=$INSTALL_ROOT/d -DCMAKE_INSTALL_PREFIX=$INSTALL_ROOT/i | |
# Build the KCrash extension, this is useful for debugging crashes | |
cmake --build . --config RelWithDebInfo --target ext_kcrash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enter our Krita building folder | |
cd $INSTALL_ROOT/build | |
# Generate the appropriate Krita makefiles | |
cmake ../krita -DCMAKE_INSTALL_PREFIX=$INSTALL_ROOT/i -DDEFINE_NO_DEPRECATED=1 -DPACKAGERS_BUILD=ON -DBUILD_TESTING=OFF -DKDE4_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo | |
# Start building with 8 threads at the same time | |
make -j8 | |
# Install Krita into our i directory | |
make install | |
# Launch Krita!! | |
../i/bin/krita |
If you followed all the steps, you should now have a working Krita build. Let me know down below whether this worked for you :)