# Maintainer: Felix Yan <felixonmars@gmail.com>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: dorphell <dorphell@archlinux.org>

pkgname=enchant
pkgver=2.2.6
pkgrel=1
pkgdesc="A wrapper library for generic spell checking"
arch=('x86_64')
url="https://abiword.github.io/enchant/"
license=('LGPL')
depends=('aspell' 'hunspell' 'hspell' 'libvoikko' 'glib2')
makedepends=('git')
source=("$pkgname-$pkgver.tar.gz::https://github.com/AbiWord/enchant/archive/v$pkgver.tar.gz")
sha512sums=('6c17e04e3e122582c2f420fd64f7217438f7186994e8448f1a745b3b786d75c9871befb13ec46b7c8fd2efa135206017ec45e5e920efe230f599322b9d70247f')

prepare() {
  cd $pkgname-$pkgver
  ./bootstrap
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr \
    --disable-static \
    --disable-ispell \
    --with-myspell-dir=/usr/share/myspell
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
}
