# $Id: PKGBUILD 230739 2015-02-04 09:54:20Z fyan $
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>

pkgname=katepart4
pkgver=4.14.3
pkgrel=3
pkgdesc="A fast and feature-rich text editor component"
arch=('i686' 'x86_64')
license=('GPL' 'LGPL' 'FDL')
url="http://kate-editor.org/about-katepart/"
depends=('kdelibs')
makedepends=('kdelibs' 'cmake' 'automoc4' 'kdebindings-python')
install=$pkgname.install
provides=('kdebase-katepart')
replaces=('kdebase-katepart')
source=("http://download.kde.org/stable/${pkgver}/src/kate-${pkgver}.tar.xz"
        'pkgbuild-syntax-highlight.patch')
sha1sums=('da37195e86b5449fcdfe69a3f7df6373a5da900c'
          '80c324c9db81c07a02374e7a092d75e0bdd6b4ea')

prepare() {
  mkdir build

  cd kate-${pkgver}
  patch -p1 -i "${srcdir}"/pkgbuild-syntax-highlight.patch
}

build() {
  cd build
  cmake ../kate-${pkgver} \
    -DCMAKE_BUILD_TYPE=Release \
    -DKDE4_BUILD_TESTS=OFF \
    -DCMAKE_INSTALL_PREFIX=/usr
  make
}

package() {
  cd build/part
  make DESTDIR="${pkgdir}" install

  cd ../addons/ktexteditor
  make DESTDIR="${pkgdir}" install
}
