#!/usr/bin/bash
# JOBoRun		: Jwm OpenBox Obarun RUNit
# Maintainer	: Joe Bo Run <joborun@disroot.org>
# PkgSource		: url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
# Website		: https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------

pkgname=enchant
pkgver=2.3.4
pkgrel=01
pkgdesc="A wrapper library for generic spell checking"
url="https://abiword.github.io/enchant/"
depends=('glib2')
makedepends=('aspell' 'hunspell' 'hspell' 'nuspell' 'libvoikko')
checkdepends=('unittestpp')
optdepends=('aspell: for aspell based spell checking support'
            'hunspell: for hunspell based spell checking support'
            'libvoikko: for libvoikko based spell checking support'
            'hspell: for hspell based spell checking support'
            'nuspell: for nuspell based spell checking support')
provides=('libenchant-2.so') # enchant_voikko.so enchant_nuspell.so enchant_hunspell.so enchant_hspell.so enchant_aspell.so)
source=("https://github.com/AbiWord/enchant/releases/download/v$pkgver/enchant-$pkgver.tar.gz")

prepare() {
  cd $pkgname-$pkgver
  autoreconf -vfi
}

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

check() {
  cd $pkgname-$pkgver
  make check
}

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

#---- arch license gpg-key & sha256sums ----

arch=(x86_64)

license=(LGPL)
 
sha256sums=(1f7e26744db1c9a0fea61d2169f4e5c1ce435cf8c2731c37e3e4054119e994a0) # enchant-2.3.4.tar.gz

##  8a02f6e8f69d69dad91f0a3723905e3a0f674c0a8109c27a486681a7e4b5b415  enchant-2.3.4-01-x86_64.pkg.tar.lz


