# Maintainer (Arch): Ronald van Haren <ronald.archlinux.org>
# Maintainer: Andreas Grapentin <andreas@grapentin.org>
# Contributor: Michał Masłowski <mtjm@mtjm.eu>
# Contributor: André Silva <emulatorman@hyperbola.info>
# Contributor: Damir Perisa <damir.perisa@bluewin.ch>

pkgname=kile
pkgver=2.9.93
pkgrel=5
pkgdesc='A user friendly TeX/LaTeX frontend for KDE'
pkgdesc+=', without nonfree Adobe Reader recommendation'
arch=(x86_64)
arch+=(i686 armv7h)
license=(GPL2)
url='https://apps.kde.org/kile/'
depends=(gcc-libs
         glibc
         kcodecs5
         kcompletion5
         kconfig5
         kconfigwidgets5
         kcoreaddons5
         kcrash5
         kdbusaddons5
         kguiaddons5
         khtml
         ki18n5
         kiconthemes5
         kinit
         kio5
         kjobwidgets5
         kparts5
         kservice5
         ktexteditor5
         ktextwidgets5
         kwidgetsaddons5
         kwindowsystem5
         kxmlgui5
         okular
         perl
         poppler-qt5
         qt5-base
         qt5-script
         texlive-basic)
makedepends=(extra-cmake-modules
             kdoctools5)
optdepends=('konsole: embedded terminal' 'imagemagick: for some file type conversions')
source=(https://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.bz2)
source+=(libre.patch)
sha256sums=('04499212ffcb24fb3a6829149a7cae4c6ad5d795985f080800d6df72f88c5df0'
            '254eb9ef48c53d67eac107c6b99f7a10c69d88327f860543d35c4240cec9a2ed')

prepare() {
  # Remove nonfree Adobe Reader recommendation
  patch -d $pkgname-$pkgver -p1 < libre.patch
}

build() {
  cmake -B build -S $pkgname-$pkgver
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
