# Maintainer: bill-auger <bill-auger@programmer.net>


pkgname=toot
pkgver=0.25.2
pkgrel=1
pkgdesc="CLI and TUI clients for Mastodon federated services"
arch=('any')
url=https://github.com/ihabunek/toot
license=('GPL3')

depends=('python>=3.8' 'python<3.9'
         'python-requests' 'python-beautifulsoup4' 'python-urwid' 'python-wcwidth')
source=(https://github.com/ihabunek/toot/archive/${pkgver}.tar.gz)

sha256sums=('9dfba770da228b81ded867da8aaf7a0c20410563959e851f3bdd648715b6cdd3')


_release=${pkgname}-${pkgver}
_default_host='floss.social' # TODO: host our own?


prepare()
{
  cd "${srcdir}/${pkgname}-${pkgver}"

  sed -i "s|^DEFAULT_INSTANCE = .*|DEFAULT_INSTANCE = '${_default_host}'|" ./toot/__init__.py
}

build()
{
  cd "${srcdir}/${pkgname}-${pkgver}"

  python setup.py build
}

package()
{
  cd "${srcdir}/${pkgname}-${pkgver}"

  python setup.py install --root="${pkgdir}/" --optimize=1 --skip-build
}
