# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Roger Duran <rogerduran@gmail.com>

pkgname=python-xcffib
pkgver=1.6.1
pkgrel=1
pkgdesc="xcffib is the XCB binding for python"
arch=('any')
url="https://pypi.python.org/pypi/xcffib"
license=('Apache-2.0')
depends=('python-cffi' 'libxcb')
makedepends=('git' 'python-setuptools' 'haskell-xcffib')
checkdepends=('python-pytest' 'xorg-server-xvfb' 'xorg-xeyes')
source=("git+https://github.com/tych0/xcffib.git#tag=v$pkgver")
sha512sums=('9697117922b1c1fe588df7ce87b44c946e8285b44f02f60b759535ca325eeea0a6133fb427c00d571776d36ef119b61bb6f5cc10f3a4d9e0b49c0152e3fcda42')

build() {
  cd xcffib
  make xcffib GEN=xcffibgen CABAL=true
  python setup.py build
}

check() {
  cd xcffib
  xvfb-run pytest
}

package() {
  cd xcffib
  python setup.py install --root="$pkgdir/" --optimize=1
}
