Skip to content

Instantly share code, notes, and snippets.

@jedypod
Last active September 22, 2019 02:49
Show Gist options
  • Save jedypod/8a2f27bdd52f89955c00530c8b159294 to your computer and use it in GitHub Desktop.
Save jedypod/8a2f27bdd52f89955c00530c8b159294 to your computer and use it in GitHub Desktop.
Compile Krita 4.2.5 on Centos 7.6 using Docker
# Dockerfile
FROM centos
LABEL maintainer="JED"
ENV HOME /root
WORKDIR $HOME
RUN yum update -y && yum clean all
RUN yum -y install centos-release-scl epel-release
RUN yum -y install python python-devel
# Install python3.6 for cmake3
RUN yum install -y https://centos7.iuscommunity.org/ius-release.rpm
RUN yum install -y python34 python36u python36u-libs python36u-devel python36u-pip
# Install packages
# jack-audio-connection-kit-devel pcre-devel llvm-devel
RUN yum -y install autoconf automake binutils bison flex gcc gcc-c++ gettext libtool make patch pkgconfig \
ctags diffstat doxygen elfutils git indent intltool patchutils rcs swig systemtap \
ant babel chrpath lua nasm git cmake cmake3 \
libX11-devel libXcursor-devel libXi-devel libXinerama-devel libXrandr-devel libXt-devel mesa-libGLU-devel zlib-devel \
tcl yasm which sudo wget openssl-devel \
# QTX11Extras deps
RUN yum install -y libxcb-devel xcb-util-devel xcb-util-keysyms-devel xcb-util-wm-devel libinput libinput-devel libxkbcommon libxkbcommon-devel libxkbcommon-x11 libxkbcommon-x11-devel mesa-libEGL-devel egl-utils gegl-devel libglvnd-egl xcb-util-renderutil-devel
RUN yum install -y xcb-util-keysyms-devel xcb-util-cursor-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-renderutil-devel xcb-util-wm-devel compat-libxcb libxcb xcb-util-renderutil libxcb-devel fontconfig-devel libXrender-devel
RUN yum install -y dbus-c++-devel dbus-python-devel dbus-devel dbus-glib-devel dbus-libs dbus-x11 at-spi-devel
# QTMultimedia deps
RUN yum install -y cdparanoia-libs fftw-libs-double flac-libs glx-utils gsm gstreamer gstreamer-plugins-bad-free gstreamer-plugins-base gstreamer-tools libXv libasyncns libdvdnav libdvdread libmpcdec libofa libogg libsndfile libtheora libvisual libvorbis libvpx opus orc pcre2-utf16 pulseaudio-libs pulseaudio-libs-devel pulseaudio-libs-glib2 soundtouch tcp_wrappers-libs
RUN yum clean all
# Use cmake3
RUN alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 \
--slave /usr/local/bin/ctest ctest /usr/bin/ctest3 \
--slave /usr/local/bin/cpack cpack /usr/bin/cpack3 \
--slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 \
--family cmake
# Use python36
RUN alternatives --install /usr/bin/python3 python3 /bin/python36 20 \
--family python3

Docker Build Image

Try making a docker image to build from

docker build -t kritabuild:v1 .
docker run -it --mount type=bind,source=/pod/compile/krita,target=/root --entrypoint /bin/bash kritab
docker exec -it kritab /bin/bash

git clone https://github.com/KDE/krita.git git checkout tags/v4.2.5 export BUILDROOT=/root export PATH=$BUILDROOT/i/bin:$PATH export PYTHONHOME=$BUILDROOT/i

had to install these packages

yum groupinstall "Development Tools"
yum install centos-release-scl llvm-toolset-7 
scl enable llvm-toolset-7 bash
yum install -y llvm-devel llvm clang openssl-devel python-devel python34-devel

cmake ../krita/3rdparty \
            -DINSTALL_ROOT=$BUILDROOT/i \
            -DEXTERNALS_DOWNLOAD_DIR=$BUILDROOT/d \
            -DCMAKE_INSTALL_PREFIX=$BUILDROOT/i

cmake3 --build . --config RelWithDebInfo --target ext_qt -j 4
cmake3 --build . --config RelWithDebInfo --target ext_zlib -j 4
cmake3 --build . --config RelWithDebInfo --target ext_boost -j 4
cmake3 --build . --config RelWithDebInfo --target ext_eigen3 -j 4
cmake3 --build . --config RelWithDebInfo --target ext_exiv2 -j 4
cmake3 --build . --config RelWithDebInfo --target ext_fftw3 -j 4
cmake3 --build . --config RelWithDebInfo --target ext_ilmbase -j 4
cmake3 --build . --config RelWithDebInfo --target ext_jpeg -j 4
cmake3 --build . --config RelWithDebInfo --target ext_lcms2 -j 4
cmake3 --build . --config RelWithDebInfo --target ext_ocio -j 4
cmake3 --build . --config RelWithDebInfo --target ext_openexr -j 4
cmake3 --build . --config RelWithDebInfo --target ext_png -j 4
cmake3 --build . --config RelWithDebInfo --target ext_tiff -j 4
cmake3 --build . --config RelWithDebInfo --target ext_gsl -j 4
cmake3 --build . --config RelWithDebInfo --target ext_vc -j 4
cmake3 --build . --config RelWithDebInfo --target ext_libraw -j 4
cmake3 --build . --config RelWithDebInfo --target ext_giflib -j 4

This one is missing from the readme cmake3 --build . --config RelWithDebInfo --target ext_python -j 4

Had to add python to LD_LIBRARY_PATH export LD_LIBRARY_PATH=/root/b/ext_python/ext_python-prefix/src/ext_python-build/

cmake3 --build . --config RelWithDebInfo --target ext_sip -j 4 cmake3 --build . --config RelWithDebInfo --target ext_pyqt -j 4

This builds ext_frameworks cmake3 --build . --config RelWithDebInfo --target ext_kcrash -j 4

Error

 -- Could NOT find XCB_KEYSYMS (missing: XCB_KEYSYMS_LIBRARY XCB_KEYSYMS_INCLUDE_DIR) (found version "")
-- Could NOT find XCB (missing: KEYSYMS) (found version "1.13")
CMake Error at /root/i/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package):
  Could not find a package configuration file provided by "Qt5X11Extras" with
  any of the following names:

    Qt5X11ExtrasConfig.cmake
    qt5x11extras-config.cmake

  Add the installation prefix of "Qt5X11Extras" to CMAKE_PREFIX_PATH or set
  "Qt5X11Extras_DIR" to a directory containing one of the above files.  If
  "Qt5X11Extras" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  CMakeLists.txt:57 (find_package)


-- Configuring incomplete, errors occurred!
See also "/root/b/ext_frameworks/ext_kwindowsystem-prefix/src/ext_kwindowsystem-build/CMakeFiles/CMakeOutput.log".
gmake[3]: *** [ext_frameworks/ext_kwindowsystem-prefix/src/ext_kwindowsystem-stamp/ext_kwindowsystem-configure] Error 1
gmake[2]: *** [ext_frameworks/CMakeFiles/ext_kwindowsystem.dir/all] Error 2
gmake[1]: *** [ext_frameworks/CMakeFiles/ext_kcrash.dir/rule] Error 2
gmake: *** [ext_kcrash] Error 2

Trying with

yum install -y xcb-util-keysyms-devel xcb-util-cursor-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-renderutil-devel xcb-util-wm-devel compat-libxcb libxcb xcb-util-renderutil libxcb-devel fontconfig-devel libXrender-devel
yum install -y dbus-c++-devel dbus-python-devel dbus-devel dbus-glib-devel dbus-libs dbus-x11 at-spi-devel

Try to rebuild ext_qt with -xcb added on :110 of /root/b/ext_qt/CMakeFiles/ext_qt.dir/build.make

Looks like qt5x11extras compiled this time /root/b/ext_qt/ext_qt-prefix/src/ext_qt/qtx11extras/

ext_kcrash builds successfully

cmake3 --build . --config RelWithDebInfo --target ext_gmic -j 4

Compile Krita, finally

cd $BUILDROOT
mkdir build
cd build
cmake3 ../krita -DCMAKE_INSTALL_PREFIX=BUILDROOT/i -DDEFINE_NO_DEPRECATED=1 -DBUILD_TESTING=OFF -DKDE4_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo

Error

-- Could NOT find PythonInterp: Found unsuitable version "2.7.5", but required is at least "3.0" (found /usr/bin/python)                                 
CMake Error at /usr/share/cmake3/Modules/FindPackageHandleStandardArgs.cmake:137 (message):                                                              
  Could NOT find PythonInterp: Found unsuitable version "2.7.5", but required
  is at least "3.0" (found /usr/bin/python) 

export BUILDROOT=/root export PATH=$BUILDROOT/i/bin:$PATH export PYTHONHOME=$BUILDROOT/i export LD_LIBRARY_PATH=$BUILDROOT/i/lib

cmake3 ../krita -DCMAKE_INSTALL_PREFIX=BUILDROOT/i -DDEFINE_NO_DEPRECATED=1 -DBUILD_TESTING=OFF -DKDE4_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBOOST_ROOT=BUILDROOT/i/include/boost -DEIGEN3_INCLUDE_DIR=BUILDROOT/i/include

-DBOOST_INCLUDEDIR=c:\dev\i\include -DBOOST_DEBUG=ON -DBOOST_ROOT=c:\dev\i -DBOOST_LIBRARYDIR=c:\dev\i\lib -DCMAKE_INSTALL_PREFIX=c:\dev\i -DCMAKE_PREFIX_PATH=c:\dev\i -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF -DKDE4_BUILD_TESTS=OFF -DHAVE_MEMORY_LEAK_TRACKER=OFF -Wno-dev -DDEFINE_NO_DEPRECATED=1

Fuuuuuuuck - need to compile Qt5Multimedia

  Could not find a package configuration file provided by "Qt5Multimedia"
  (requested version 5.9.0) with any of the following names:
    Qt5MultimediaConfig.cmake
    qt5multimedia-config.cmake 

Installing deps for qt-multimedia

yum install -y cdparanoia-libs fftw-libs-double flac-libs glx-utils gsm gstreamer gstreamer-plugins-bad-free gstreamer-plugins-base gstreamer-tools libXv libasyncns libdvdnav libdvdread libmpcdec libofa libogg libsndfile libtheora libvisual libvorbis libvpx opus orc pcre2-utf16 pulseaudio-libs pulseaudio-libs-devel pulseaudio-libs-glib2 soundtouch tcp_wrappers-libs

Qt Multimedia:
ALSA ................................... no GStreamer 1.0 .......................... no GStreamer 0.10 ......................... no Video for Linux ........................ yes OpenAL ................................. no PulseAudio ............................. yes Resource Policy (libresourceqt5) ....... no Windows Audio Services ................. no
DirectShow ............................. no Windows Media Foundation ............... no

yum install -y alsa-lib alsa-utils alsa-lib-devel gstreamer-devel gstreamer1-devel openal-soft openal-soft-devel

#####################################################

Trying again from the beginning


Commit change to docker image

docker commit cc5c069bb235 kritab:v2
docker image ls
    kritab              v2                  f8f148b41e80        16 seconds ago      1.54GB

OR if it's not running docker run -it --mount type=bind,source=/pod/compile/krita,target=/root --entrypoint /bin/bash kritab

docker exec -it cc5c069bb235 /bin/bash


. aliases
cd b
rm -rf */*-prefix*



export BUILDROOT=/root
export PATH=$BUILDROOT/i/bin:$PATH
export LD_LIBRARY_PATH=$BUILDROOT/i/lib

cmake ../krita/3rdparty \
            -DINSTALL_ROOT=$BUILDROOT/i \
            -DEXTERNALS_DOWNLOAD_DIR=$BUILDROOT/d \
            -DCMAKE_INSTALL_PREFIX=$BUILDROOT/i

Fix::110 of /root/b/ext_qt/CMakeFiles/ext_qt.dir/build.make remove -skip qtmultimedia

cmake3 --build . --config RelWithDebInfo --target ext_qt -j 4

cmake3 --build . --config RelWithDebInfo --target ext_zlib -j 4
cmake3 --build . --config RelWithDebInfo --target ext_boost -j 4
cmake3 --build . --config RelWithDebInfo --target ext_eigen3 -j 4
cmake3 --build . --config RelWithDebInfo --target ext_exiv2 -j 4
cmake3 --build . --config RelWithDebInfo --target ext_fftw3 -j 4
cmake3 --build . --config RelWithDebInfo --target ext_ilmbase -j 4
cmake3 --build . --config RelWithDebInfo --target ext_jpeg -j 4
cmake3 --build . --config RelWithDebInfo --target ext_lcms2 -j 4
cmake3 --build . --config RelWithDebInfo --target ext_ocio -j 4
cmake3 --build . --config RelWithDebInfo --target ext_openexr -j 4
cmake3 --build . --config RelWithDebInfo --target ext_png -j 4
cmake3 --build . --config RelWithDebInfo --target ext_tiff -j 4
cmake3 --build . --config RelWithDebInfo --target ext_gsl -j 4
cmake3 --build . --config RelWithDebInfo --target ext_vc -j 4
cmake3 --build . --config RelWithDebInfo --target ext_libraw -j 4
cmake3 --build . --config RelWithDebInfo --target ext_giflib -j 4

cmake3 --build . --config RelWithDebInfo --target ext_python -j 4
cmake3 --build . --config RelWithDebInfo --target ext_sip -j 4
cmake3 --build . --config RelWithDebInfo --target ext_pyqt -j 4
export PYTHONHOME=$BUILDROOT/i
cmake3 --build . --config RelWithDebInfo --target ext_kcrash -j 4
cmake3 --build . --config RelWithDebInfo --target ext_gmic -j 4

Compile quazip (not in the 3rd party deps but is definitely a dep)

mkdir quazip
cd quazip
wget https://github.com/stachenov/quazip/archive/v0.8.1.tar.gz
tar xvf v0.8.1.tar.gz
cd quazip-0.8.1
mkdir build
cd build
unset LD_LIBRARY_PATH
cmake .. -DCMAKE_INSTALL_PREFIX=$BUILDROOT/i
make -j4
make install
export LD_LIBRARY_PATH=$BUILDROOT/i/lib


cd $BUILDROOT
mkdir build
cd build
cmake3 ../krita -DCMAKE_INSTALL_PREFIX=$BUILDROOT/i -DDEFINE_NO_DEPRECATED=1 -DBUILD_TESTING=OFF -DKDE4_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo

Error!

/usr/bin/ld: /root/i/lib/libgsl.a(blas.c.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
cd ../b/
rm -rf ext_gsl/*-prefix
cmake3 --build . --config RelWithDebInfo --target ext_gsl -j 4
^C
:662 in /pod/compile/krita/b/ext_gsl/ext_gsl-prefix/src/ext_gsl/CMakeLists.txt
add_definitions(-fPIC)
cmake3 --build . --config RelWithDebInfo --target ext_gsl -j 4

cmake3 ../krita -DCMAKE_INSTALL_PREFIX=$BUILDROOT/i -DDEFINE_NO_DEPRECATED=1 -DBUILD_TESTING=OFF -DKDE4_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo

Error!

[ 52%] Linking CXX shared library libkritaui.so
CMakeFiles/kritaui.dir/kis_png_converter.cpp.o: In function `KisPNGConverter::buildImage(QIODevice*)':
/root/krita/libs/ui/kis_png_converter.cpp:460: undefined reference to `png_set_option'
CMakeFiles/kritaui.dir/kis_png_converter.cpp.o: In function `KisPNGConverter::buildFile(QIODevice*, QRect const&, double, double, KisSharedPtr<KisPaintDevice>, QTypedArrayData<KisSharedPtr<KisAnnotation> >::iterator, QTypedArrayData<KisSharedPtr<KisAnnotation> >::iterator, KisPNGOptions, KisMetaData::Store*)':
/root/krita/libs/ui/kis_png_converter.cpp:967: undefined reference to `png_set_option'
collect2: error: ld returned 1 exit status
make[2]: *** [libs/ui/libkritaui.so.18.0.0] Error 1
make[1]: *** [libs/ui/CMakeFiles/kritaui.dir/all] Error 2
make: *** [all] Error 2

Try commenting out lines with png_set_option :/

cmake3 ../krita -DCMAKE_INSTALL_PREFIX=$BUILDROOT/i -DDEFINE_NO_DEPRECATED=1 -DBUILD_TESTING=OFF -DKDE4_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo

Error!

[ 87%] Generating krita/sipkritapart0.cpp

sip: Unable to find file "QtCore/QtCoremod.sip"
make[2]: *** [plugins/extensions/pykrita/sip/krita/sipkritapart0.cpp] Error 1
make[2]: *** Deleting file `plugins/extensions/pykrita/sip/krita/sipkritapart0.cpp'
make[1]: *** [plugins/extensions/pykrita/sip/CMakeFiles/python_module_PyKrita_krita.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 87%] Building CXX object krita/CMakeFiles/krita.dir/qrc_aboutdata.cpp.o
[ 87%] Building CXX object plugins/dockers/touchdocker/CMakeFiles/kritatouchdocker.dir/kritatouchdocker_autogen/mocs_compilation.cpp.o
[ 87%] Building CXX object krita/CMakeFiles/krita.dir/qrc_shaders.cpp.o
[ 87%] Building CXX object krita/CMakeFiles/krita.dir/qrc_cursors.cpp.o
[ 87%] Building CXX object krita/CMakeFiles/krita.dir/krita_autogen/mocs_compilation.cpp.o
[ 87%] Linking CXX executable krita
[ 87%] Built target krita
[ 87%] Linking CXX shared module kritatouchdocker.so
[ 87%] Built target kritatouchdocker
make: *** [all] Error 2

but it exists here... /root/i/share/sip/QtCore/QtCoremod.sip https://phabricator.kde.org/D14182 ?

This changes the behavior... export SIP_DEFAULT_SIP_DIR=/root/i/share/sip/QtCore/

[ 68%] Built target kritawaveletdecompose
[ 68%] Automatic MOC for target python_module_PyKrita_krita
[ 68%] Built target python_module_PyKrita_krita_autogen
[ 68%] Generating krita/sipkritapart0.cpp

sip: Unable to find file "QtCore/QtCoremod.sip"
make[2]: *** [plugins/extensions/pykrita/sip/krita/sipkritapart0.cpp] Error 1
make[2]: *** Deleting file `plugins/extensions/pykrita/sip/krita/sipkritapart0.cpp'
make[1]: *** [plugins/extensions/pykrita/sip/CMakeFiles/python_module_PyKrita_krita.dir/all] Error 2
make: *** [all] Error 2

Changed the include dirs in /root/krita/plugins/extensions/pykrita/sip/CMakeLists.txt to: (Adding /root/i/share/sip)

    ${SIP_DEFAULT_SIP_DIR}
    ${PYQT5_SIP_DIR}
    ${PYQT_SIP_DIR_OVERRIDE}
     ./krita
     /root/i/share/sip/)

Holy shit it compiled completely

make install

On Centos 7

export LD_LIBRARY_PATH=$BUILDROOT/i/lib64:$BUILDROOT/i/lib:$BUILDROOT/i/plugins/platforms

Error

QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib64/kde4/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/kde4/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/opt/krita/i/bin/platforms" ...
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Aborted (core dumped)

https://www.reddit.com/r/archlinux/comments/bzowkd/pyqt5_fails_to_load_could_not_load_the_qt/ https://stackoverflow.com/questions/42575571/qt-5-5-1-cannot-find-libqt5xcbqpa-so-5 https://stackoverflow.com/questions/43983936/deploying-dynamically-linked-qt-5-7-widgets-application-on-centos-7-cannot-ope/43988232#43988232

export BUILDROOT=/pod/compile/krita
export LD_LIBRARY_PATH=$BUILDROOT/i/lib64:$BUILDROOT/i/lib:$BUILDROOT/i/plugins/platforms
$BUILDROOT/i/bin/krita

On Fedora:

libicui18n.so.50 => not found
libicuuc.so.50 => not found
libicudata.so.50 => not found

tried linking ...

cd $BUILDROOT/i/plugins/platforms
ln -s libqxcb.so libxcb.so.1

Now get

Interesting...

/opt/krita/i/lib $ strace ../bin/krita
access("/usr/lib64/kde4/plugins/platforms/.", F_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/kde4/plugins/platforms/.", F_OK) = -1 ENOENT (No such file or directory)
access("/opt/krita/i/bin/platforms/.", F_OK) = -1 ENOENT (No such file or directory)
access("/opt/krita/i/bin/qt.conf", F_OK) = -1 ENOENT (No such file or directory)
open("/root/i/qtlogging.ini", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)
stat("/home/jed/.config/QtProject/qtlogging.ini", 0x7ffc9def6f60) = -1 ENOENT (No such file or directory)
stat("/etc/xdg/QtProject/qtlogging.ini", 0x7ffc9def6f60) = -1 ENOENT (No such file or directory)
write(2, "qt.qpa.plugin: Could not find th"..., 65qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
) = 65
write(2, "This application failed to start"..., 137This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

) = 137
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
tgkill(27732, 27732, SIGABRT)           = 0
--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=27732, si_uid=1000} ---
+++ killed by SIGABRT (core dumped) +++
Aborted (core dumped)

# OR
/opt/krita/i/lib $ export QT_DEBUG_PLUGINS=1
/opt/krita/i/lib $ ./../bin/krita
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib64/kde4/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/kde4/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/opt/krita/i/bin/platforms" ...
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Aborted (core dumped)

Hmmmmm

/opt/krita/i/bin $ ln -sf ../plugins/platforms 

It launches! And then Crashes!
loaded library "/opt/krita/i/lib64/kritaplugins/kritapykrita.so"
loaded library "libpython3.5m"
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'

Current thread 0x00007ff41dade940 (most recent call first):
Aborted (core dumped)
/opt/krita/i/bin $ echo $PYTHONHOME

Setting PYTHONHOME seems to fix it!

export BUILDROOT=/pod/compile/krita
export LD_LIBRARY_PATH=$BUILDROOT/i/lib64:$BUILDROOT/i/lib
export PYTHONHOME=$BUILDROOT/i
export SIP_DEFAULT_SIP_DIR=$BUILDROOT/i/share/sip/QtCore/


# When saving as PNG:
libpng warning: Application built with libpng-1.6.34 but running with 1.5.13
"/mnt/cave/tmp/test.png does not exist after writing. Try saving again under a different name, in another location."

Bash Wrapper for Launcher

#!/usr/bin/env bash
export KRITA_ROOT=/opt/krita
export PATH=${KRITA_ROOT}/bin:${PATH}
export PYTHONHOME=${KRITA_ROOT}/lib/python3.5
export PYTHONPATH=${KRITA_ROOT}/lib/python3.5
# export SIP_DEFAULT_SIP_DIR=${KRITA_ROOT}/share/sip/QtCore
export QT_PLUGIN_PATH=${KRITA_ROOT}/plugins
export LD_LIBRARY_PATH=${KRITA_ROOT}/lib64:${KRITA_ROOT}/lib
${KRITA_ROOT}/bin/krita "$@"

Compile Krita 4.2.6

Launch Docker Image

docker run -it --mount type=bind,source=/pod/sw/compile/krita,target=/root --entrypoint /bin/bash kritab:v2
docker ps
~ $ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
d58cfcb9f670        kritab:v2           "/bin/bash"         33 seconds ago      Up 25 seconds                           brave_brattain

docker exec -it d58cfcb9f670 /bin/bash

Download krita 4.2.6 source

wget https://download.kde.org/stable/krita/4.2.6/krita-4.2.6.tar.xz

export BUILDROOT=/root
export PATH=$BUILDROOT/i/bin:$PATH
export LD_LIBRARY_PATH=$BUILDROOT/i/lib


cd $BUILDROOT
mkdir build-krita-4.2.6
cd build-krita-4.2.6

Fix Stuff

vi ../krita-4.2.6/plugins/extensions/pykrita/sip/CMakeLists.txt
# Add:
     /root/i/share/sip

$BUILDROOT/krita/libs/ui/kis_png_converter.cpp
bash-4.2# diff /root/krita/libs/ui/kis_png_converter.cpp /root/krita-4.2.6/libs/ui/kis_png_converter.cpp
460c460
<     //png_set_option(png_ptr, PNG_SKIP_sRGB_CHECK_PROFILE, PNG_OPTION_ON);
---
>     png_set_option(png_ptr, PNG_SKIP_sRGB_CHECK_PROFILE, PNG_OPTION_ON);
967c967
<     //png_set_option(png_ptr, PNG_SKIP_sRGB_CHECK_PROFILE, PNG_OPTION_ON);
---
>     png_set_option(png_ptr, PNG_SKIP_sRGB_CHECK_PROFILE, PNG_OPTION_ON);

cp /root/krita/libs/ui/kis_png_converter.cpp /root/krita-4.2.6/libs/ui/kis_png_converter.cpp



cmake3 ../krita-4.2.6 -DCMAKE_INSTALL_PREFIX=$BUILDROOT/i -DDEFINE_NO_DEPRECATED=1 -DBUILD_TESTING=OFF -DKDE4_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j4
make install

Bash Wrapper for Launcher

#!/usr/bin/env bash
export KRITA_ROOT=/opt/krita-4.2.6
export PATH=${KRITA_ROOT}/bin:${PATH}
export PYTHONHOME=${KRITA_ROOT}/lib/python3.5
export PYTHONPATH=${KRITA_ROOT}/lib/python3.5
# export SIP_DEFAULT_SIP_DIR=${KRITA_ROOT}/share/sip/QtCore
export QT_PLUGIN_PATH=${KRITA_ROOT}/plugins
export LD_LIBRARY_PATH=${KRITA_ROOT}/lib64:${KRITA_ROOT}/lib
${KRITA_ROOT}/bin/krita "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment