# Maintainer (Arch): Felix Yan <felixonmars@archlinux.org>
# Maintainer (Arch): Antonio Rojas <arojas@archlinux.org>
# Contributor (Arch): Andrea Scarpino <andrea@archlinux.org>
# Contributor (Arch): Pierre Schmitz <pierre@archlinux.de>
# Contributor: André Silva <emulatorman@hyperbola.info>

pkgname=kdepim-runtime
pkgver=18.12.3
pkgrel=3
pkgrel+=.parabola1
pkgdesc='Extends the functionality of kdepim'
pkgdesc+=' (built without nonfree qt5-webengine)'
arch=(x86_64)
arch+=(i686 armv7h)
url='https://kontact.kde.org'
license=(GPL LGPL FDL)
depends=(libkolabxml kdav akonadi-calendar knotifyconfig kalarmcal kmbox pimcommon akonadi-notes kdelibs4support akonadi)
makedepends=(extra-cmake-modules kdoctools boost kdesignerplugin qca qt5-networkauth)
optdepends=('qca: EWS resource' 'qt5-networkauth: EWS resource')
conflicts=(kio-pim)
source=("https://download.kde.org/stable/applications/$pkgver/src/$pkgname-$pkgver.tar.xz"{,.sig}
        'libre.patch')
sha256sums=('f3a5da19bb0f60e148d071cf07fd9fd4e6ea116f6125567c767c03b98ea844c3'
            'SKIP'
            '312d76a56e3b39151465a8cd7e96b522f05eb53bac7f7d984fa09858498f4a2b')
validpgpkeys=(CA262C6C83DE4D2FB28A332A3A6A4DB839EAA6D7  # Albert Astals Cid <aacid@kde.org>
              F23275E4BF10AFC1DF6914A6DBD2CE893E2D1C87) # Christoph Feck <cfeck@kde.org>

prepare() {
  mkdir -p build

  cd $pkgname-$pkgver
  patch -p1 -i ../libre.patch
}

build() {
  cd build
  cmake ../$pkgname-$pkgver \
    -DBUILD_TESTING=OFF \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib
  make
}

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