# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contrinutor: shining <shiningxc@gmail.com>
# Contributor: phillid <dbphillipsnz _at_thingy_that_swirly_a_symbol gmaildott comm>

pkgname=python-pydot
pkgver=2.0.0
pkgrel=1
pkgdesc="Python interface to Graphviz's Dot"
arch=(any)
url="https://github.com/erocarrera/pydot"
license=('MIT')
depends=('python-pyparsing' 'graphviz')
makedepends=('python-setuptools')
checkdepends=('python-chardet')
source=("$pkgname-$pkgver.tar.gz::https://github.com/erocarrera/pydot/archive/v$pkgver.tar.gz")
sha512sums=('09102930a59ac4339e1d1e4f7a9d075f99eda6cb060885631a72f1fded90d001bd02940b55addc0c92856e95321cb3b344a1797b4809ac7c9048ac57c81d4707')

build() {
  cd pydot-$pkgver
  python setup.py build
}

check() {
  # https://github.com/pydot/pydot/issues/204

  cd "$srcdir"/pydot-$pkgver/test
  PYTHONPATH="$PWD/../build/lib:$PYTHONPATH" python pydot_unittest.py || echo "Tests failed"
}

package() {
  cd pydot-$pkgver
  python setup.py install -O1 --root="$pkgdir"
  install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
