# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=gspell
pkgver=1.8.2
pkgrel=1
pkgdesc="a flexible API to implement the spell checking in a GTK+ application"
url="https://wiki.gnome.org/Projects/gspell"
arch=(x86_64)
license=(GPL2)
depends=(gtk3 enchant libxml2 iso-codes)
makedepends=(gobject-introspection vala gtk-doc autoconf-archive git)
_commit=90cf3a18c26948c8c7a083cac1f8708a01838514  # tags/1.8.2^0
source=("git+https://gitlab.gnome.org/GNOME/gspell.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname

  # Our autoconf-archive is too new (AX_CODE_COVERAGE changed API in v28)
  find -name Makefile.am -exec sed -i '/@CODE_COVERAGE_RULES@/d' {} +

  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd "$pkgname"
  ./configure  --prefix=/usr --enable-gtk-doc
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

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