• Get It

    Distribution Packages

    As Kate and KWrite are part of the KDE project, you can get them simply by installing the KDE packages from your Linux distribution. To get Kate for Mac OS X, please visit KDE’s Mac pages. Windows packages are available through the KDE on Windows project.

    Building Kate from Sources

    This quick howto explains how to build Kate without touching your stable KDE installation. Right now, Kate’s source code is located on git.kde.org. To build Kate from git, you need KDE SC >= 4.8. Further,

        1. make sure you have the following packages installed: git and the kdelibs development package (and CMake).
          to install on openSUSE: sudo zypper install git libkde4-devel libkactivities-devel libqjson-devel python-kde4-devel
          to install on Ubuntu and derivates: sudo apt-get install g++ make git cmake kdelibs5-dev libqjson-dev python-kde4-dev python-qt4-dev
          to install on Arch Linux: pacman -S git automoc4 cmake kdebindings-python (installation with base-devel + kde)
          to install on Fedora and RHEL: yum install gcc-c++ kdelibs-devel kactivities-devel qjson-devel sip-devel PyKDE4-devel
        2. create and change into a KDE development directory:
          mkdir -p ~/kde/usr; cd ~/kde
        3. get a copy of the Kate code:
          git clone git://anongit.kde.org/kate
        4. create and change into a build directory inside the kate directory for compilation:
          cd kate; mkdir build; cd build
        5. Use a run.sh script as shown below to set the right environment variables, else make install might fail later.
        6. run the configure process with cmake: (-DBUILD_KTEXTEDITOR=1 will install new ktexteditor interfaces from kate.git, otherwise, you need up-to-date kdelibs)
          For just using Kate, build it optimized but with debugging symbols to get useful backtraces for bugreports:

          cmake .. -DBUILD_KTEXTEDITOR=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
                        -DCMAKE_INSTALL_PREFIX=~/kde/usr \
                        -DINSTALL_PYTHON_FILES_IN_PYTHON_PREFIX=OFF

          For developing Kate, build it with debug support (if you have problems using gdb because of optimizations, swap Debug with DebugFull):

          cmake .. -DBUILD_KTEXTEDITOR=1 -DCMAKE_BUILD_TYPE=Debug \
                        -DCMAKE_INSTALL_PREFIX=~/kde/usr \
                        -DINSTALL_PYTHON_FILES_IN_PYTHON_PREFIX=OFF
        7. compile Kate:
          make
        8. finally install Kate:
          make install

    That’s all! This installs Kate locally into the separate directory ~/kde/usr, so that your global KDE installation will not be touched at all.

    Now on to starting the newly compiled Kate. Create a file ~/kde/run.sh with the following content:

    #!/bin/bash
    export KATE_DIR=~/kde/usr
    export PATH=$KATE_DIR/bin:$PATH
    export LD_LIBRARY_PATH=$KATE_DIR/lib:$KATE_DIR/lib64:$LD_LIBRARY_PATH
    export KDEDIR=$KATE_DIR
    export KDEDIRS=$KDEDIR
    export XDG_DATA_DIRS=$XDG_DATA_DIRS:$KATE_DIR/share
    # update KDE's system configuration cache
    kbuildsycoca4
    # start app
    $@

    Make the script executable with chmod 755 ~/kde/run.sh. Now you can run the compiled Kate version with ~/kde/run.sh kate. Just calling kate directly will start the system version of Kate.

    Your copy of Kate contains all of the Kate code, i.e.: the KTextEditor interfaces, Kate Part, KWrite and the Kate Application. You can keep your copy up-to-date by typing `git pull --rebase` in ~/kde/kate. Feel free to send patches to our mailing list kwrite-devel@kde.org. And join #kate on irc.kde.org :–)

    Building the Kate Handbook

    The current stable version of the Kate Handbook is available on the KDE documentation webpage. We very much welcome any updates to improve the Kate’s documentation. The source of the documentation is in the “doc”-subfolder. To create the final html pages, switch to the “doc”-folder and first create a folder called “html/kate” and “html/kwrite”. Here all the html ouput of the *.docbook files will be generated. Then use meinproc4 to generate the html ouput:

    mkdir -p html/kate
    mkdir -p html/kwrite
    
    # build Kate documentation
    cd html/kate
    meinproc4 --check ../../kate/index.docbook
    
    # or build KWrite documentation
    cd html/kwrite
    meinproc4 --check ../../kwrite/index.docbook

    After a short moment the generation of the documentation will be finished. Then point your web browser e.g. to ~/kde/kate/doc/html/kate/index.html to view the result. We are very happy for every patch!