# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=sink
pkgver=0.7.0
pkgrel=5
pkgdesc="An offline-caching, synchronization and indexing system for PIM data"
arch=(x86_64)
url="https://community.kde.org/KDE_PIM"
license=(LGPL)
depends=(kcontacts kcalcore kasync kimap2 kdav2 lmdb libgit2 xapian-core)
makedepends=(extra-cmake-modules flatbuffers)
source=("https://download.kde.org/unstable/$pkgname/$pkgver/src/$pkgname-$pkgver.tar.xz"
        sink-kdav2-0.3.patch)
sha256sums=('7ef9e89cd3be0274e4b1560cfe035b5f3f056e85af65c9c4e5570878fd0a7e13'
            '53e670cea7ff40c40eb9fd6754a423f54c18c42b3a59074b400db5ba117a0ff8')

prepare() {
  mkdir -p build

  cd $pkgname-$pkgver
  patch -p1 -i ../sink-kdav2-0.3.patch # Fix build with kdav2 0.3
}

build() {
  cd build
  cmake ../$pkgname-$pkgver
  make
}

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