makedepends=(chrpath)
run=(alsa-lib)

description="A lightweight speech synthesis engine"
url="http://www.festvox.org/flite/"

packager="Great-OS Team"
maintainer="Great-OS Team"

name="flite"
version="2.2"
release=1

source=(https://github.com/festvox/flite/archive/v$version/flite-$version.tar.gz)
prepare() {
    cd $name-$version
    sed '/^#VOXES.*$/d; s/+//g; s/cmu_indic_lex/&\nVOXES = cmu_us_kal16 cmu_us_slt/' config/android.lv > config/great-os.lv
    sed -i '/$(INSTALL) -m 755 $(BINDIR)\/flite_time $(DESTDIR)$(INSTALLBINDIR)/d' main/Makefile
}
build() { 
    cd $name-$version;
    ./configure --prefix=/usr --libdir=/usr/lib --enable-shared --with-audio=alsa --with-vox=cmu_us_kal16 --with-langvox=great-os
    make -j1
    make DESTDIR="$PKG" install
    install -D -m644 COPYING "$PKG"/usr/share/licenses/$name/LICENSE
    chrpath -d "$PKG"/usr/bin/*
}
