APP=enchant
VERSION=2.2.8
BUILD=1sml
HOMEPAGE='https://abiword.github.io/enchant/'
DOWNLOAD='https://github.com/AbiWord/enchant/releases/download/v2.2.8/enchant-2.2.8.tar.gz'
DESC="spell checking library"
REQUIRES="gcc-libs glib aspell hunspell"

build() {
  mkandenterbuilddir
  rm -rf $APP-$VERSION

  tar xf $SRCDIR/$APP-$VERSION.tar.?z*
  cd $APP-$VERSION
  fixbuilddirpermissions

  ./configure \
    --prefix="" \
    --disable-static 

  # Taken from arch linux's enchant PKGBUILD
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool 
  make
  make install DESTDIR=$PKG

  cp COPYING.LIB $PKGDOCS/

  cd $PKG
  ( cd include ; ln -sfv enchant-2 enchant )
  ( cd bin ; ln -sfv enchant-2 enchant )
  ( cd lib ; ln -sfv libenchant-2.so libenchant.so )
  ( cd lib/pkgconfig ; ln -sfv enchant-2.pc enchant.pc )

  mkfinalpkg
}

SHA512SUMS="
40bc7d5aa40f0460bd500ee1fbe3434ad7f5b99dc75be2dc428694b7ce2d97a4b172535f5f3010bdad77de21f98f155b774acefab8bb7a7f1872700ecf4ed48e  enchant-2.2.8.tar.lz
"
