# $Id: PKGBUILD 121423 2014-10-26 11:52:34Z muflone $
# Maintainer: Muflone http://www.muflone.com/contacts/english/
# Contributor: archtux <antonio dot arias99999 at gmail dot com>

pkgname=gespeaker
pkgver=0.8.5
pkgrel=1
pkgdesc="A GTK+ frontend for espeak and mbrola to speech the read text."
url="http://www.muflone.com/gespeaker/"
arch=('any')
license=('GPL2')
depends=('espeak' 'librsvg' 'pygtk' 'python2-dbus' 'python2-xdg' 'alsa-utils')
optdepends=('libpulse: PulseAudio output')
source=("${pkgname}-${pkgver}.tar.gz"::"https://github.com/muflone/${pkgname}/archive/${pkgver}.tar.gz")
sha256sums=('73163e94f03e00c08d92bc0dedab84cfba6409064fedbc90962db24bb4999766')

prepare() {
  cd "${pkgname}-${pkgver}"
  # Python2 fix
  for _file in setup.py gespeaker src/gespeaker.py
  do
    sed -i 's#env python#env python2#' "${_file}"
  done
}

build() {
  cd "${pkgname}-${pkgver}"
  python2 setup.py build
}

package() {
  cd "${pkgname}-${pkgver}"
  python2 setup.py install --optimize=1 --root "${pkgdir}"
}

