# Maintainer: Balló György <ballogyor+arch at gmail dot com>

pkgname=qtspell
pkgver=0.8.5
pkgrel=3
url="https://github.com/manisandro/qtspell"
pkgdesc="Spell checking for Qt text widgets"
arch=(x86_64)
license=(GPL3)
depends=(enchant iso-codes qt5-base)
makedepends=(cmake qt5-tools)
source=($pkgname-$pkgver.tar.gz::https://github.com/manisandro/$pkgname/archive/$pkgver.tar.gz)
sha256sums=('4d13b8b07b6c572fd6e1896dd87f6516113f36c31aa2d1f3aa9d6bfe672461c5')

prepare() {
  [[ -d build ]] || mkdir build
  cd $pkgname-$pkgver

  # Fix location of translations
  sed -i 's|share/${QT_VER}/translations)|share/qt/translations)|' CMakeLists.txt
}

build() {
  cd build
  cmake -G "Unix Makefiles" ../$pkgname-$pkgver/ \
    -DCMAKE_INSTALL_PREFIX=/usr
  make
}

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