= Building Kleopatra git master = There is a lot of documentation available at techbase.kde.org this page mainly is an example on how you can do this. == Dependencies == This is a list of dependencies needed system to compile the required frameworks and Kleopatra. Please add additional dependencies if you needed them. === Debian Jessie === {{{ apt-get install libxcb1 libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libasound2-dev \ libnss3-dev libjson-perl 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-icccm1-dev libxcb-sync1 \ libxcb-sync1-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-xfixes0-dev libxrender-dev \ libxcb-shape0-dev libxcb-randr0-dev libxcb-glx0-dev git build-essential cmake \ libgpgme11-dev libgcrypt20-dev }}} === Ubuntu Trusty === {{{ apt-get build-dep qtbase5-dev apt-get install libbz2-dev libxslt-dev libxml2-dev shared-mime-info oxygen-icon-theme \ libgif-dev libvlc-dev libvlccore-dev doxygen gperf bzr libxapian-dev fontforge libgcrypt20-dev \ libattr1-dev network-manager-dev libgtk-3-dev xsltproc xserver-xorg-dev \ xserver-xorg-input-synaptics-dev libpwquality-dev modemmanager-dev libxcb-keysyms1-dev libepoxy-dev \ libpolkit-agent-1-dev libnm-util-dev libnm-glib-dev libegl-mesa-dev libxcb-xkb-dev \ libqt5x11extras5-dev libboost-all-dev libical-dev, libsasl2-dev, libgpgme11-dev \ libcap-dev libpci-dev libjson-perl libgstreamer1.0-dev }}} == Compiling into a custom prefix == This is an example how to compile Kleopatra and installing it into a custom prefix. The example prefix is kf5. The example snippets use make -j === Preparing the environment === {{{ export CUSTOM_PREFIX=~/kf5 mkdir -p $CUSTOM_PREFIX/src cd $CUSTOM_PREFIX/src }}} === Qt 5 === {{{ cd $CUSTOM_PREFIX/src git clone git://code.qt.io/qt/qt5.git --branch 5.6 cd qt5 ./init-repository ./configure -prefix $CUSTOM_PREFIX/qt5 -opensource -confirm-license -nomake tests -nomake examples -dbus -no-separate-debug-info -xcb -qpa xcb -no-gtkstyle -release -force-debug-info -reduce-relocations -optimized-qmake make -j`nproc` && make install }}} === KDE Frameworks === You should take a look at the KDE documentation: https://community.kde.org/Frameworks/Building Here are my notes how I did this: {{{ git config --global url."git://anongit.kde.org/".insteadOf kde: && \ git config --global url."ssh://git@git.kde.org/".pushInsteadOf kde: cd $CUSTOM_PREFIX/src mkdir -p extragear/utils git clone kde:kdesrc-build extragear/utils/kdesrc-build ln -s extragear/utils/kdesrc-build/kdesrc-build . wget "http://www.davidfaure.fr/kde/kf5-qt5-kdesrc-buildrc" -O "kdesrc-buildrc" }}} Now edit the paths in the kdesrc-buildrc. Example: {{{ global qtdir /home/aheinecke/arbeit/kf5/qt5 source-dir /home/aheinecke/arbeit/kf5/src build-dir /home/aheinecke/arbeit/kf5/build kdedir /home/aheinecke/arbeit/kf5 git-repository-base kde-projects kde: cmake-options -DCMAKE_BUILD_TYPE:STRING=debug -DKDE4_BUILD_TESTS=false make-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 branch-group kf5-qt5 end global include extragear/utils/kdesrc-build/kf5-qt5-build-include }}} Now we can start compiling: {{{ ./kdesrc-build --include-dependencies kdepim }}} Look out for errors and fix them :-) == Runtime Setup == The script [[attachment:frameworks-env.sh]] is an example that sets up your environment and adds some convenience build functions. Take a look at the script first and edit paths where necessary. To use KF5 from your prefix set the following environment variables: {{{ export KF5=$CUSTOM_PREFIX export QTDIR=$CUSTOM_PREFIX/qt5 export XDG_DATA_DIRS=$KF5/share:$XDG_DATA_DIRS:/usr/share export XDG_CONFIG_DIRS=$KF5/etc/xdg:$XDG_CONFIG_DIRS:/etc/xdg export PATH=$KF5/sbin:$KF5/bin:$QTDIR/bin:$PATH export QT_PLUGIN_PATH=$KF5/lib/plugins:$KF5/lib64/plugins:$KF5/lib/x86_64-linux-gnu/plugins:$QTDIR/plugins:$QT_PLUGIN_PATH export KDE_SESSION_VERSION=5 export KDE_FULL_SESSION=true export XDG_DATA_HOME=$KF5/.local/share export XDG_CONFIG_HOME=$KF5/.config export XDG_CACHE_HOME=$KF5/.cache export CMAKE_PREFIX_PATH=$KF5:$CMAKE_PREFIX_PATH export LD_LIBRARY_PATH=$KF5/lib:$LD_LIBRARY_PATH export PKG_CONFIG_PATH=$KF5/lib/pkgconfig:$PKG_CONFIG_PATH export KSYCOCA=$CUSTOM_PREFIX/sycoca2 }}} == Tipps == === Logging === To get a nicer logging pattern: {{{ export QT_MESSAGE_PATTERN="`echo -e "\033[32m%{time h:mm:ss.zzz}%{if-category}\033[32m %{category}:%{endif} %{if-debug}\033[35m%{function}%{endif}%{if-warning}\033[33m%{backtrace depth=3}%{endif}%{if-critical}\033[31m%{backtrace depth=3}%{endif}%{if-fatal}\033[31m%{backtrace depth=3}%{endif}\033[0m %{message}"`" }}} To configure logging: {{{ export QT_LOGGING_CONF=$CUSTOM_PREFIX/src/logging.rules echo [Rules] > $CUSTOM_PREFIX/src/logging.rules echo log_kleopatra.debug=true >> $CUSTOM_PREFIX/src/logging.rules echo kdepim.kleopatra.debug=true >> $CUSTOM_PREFIX/src/logging.rules }}} === VIM === There is a very useful vim script available at: [[https://techbase.kde.org/Policies/Kdelibs_Coding_Style#Vim]] Vim users should take a look at it.