archrelease: copy trunk to community-any
[ArchLinux/community.git] / python-xkbcommon / trunk / PKGBUILD
blob0d74b38ca9c24b89b6c8ffa14c4056ee34f4589d
1 # Maintainer: David Runge <dvzrv@archlinux.org>
3 _name=xkbcommon
4 pkgname=python-xkbcommon
5 pkgver=0.8
6 pkgrel=2
7 pkgdesc="Python bindings for libxkbcommon using cffi"
8 arch=(x86_64)
9 url="https://github.com/sde1000/python-xkbcommon"
10 license=(MIT)
11 depends=(python-cffi libxkbcommon)
12 makedepends=(python-build python-installer python-setuptools python-wheel)
13 checkdepends=(python-pytest)
14 source=(https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz)
15 sha512sums=('d6390b427f751d25fe607383cd8239fb439fed62bcaafe980e1a776dac605a474fc3be573a8450d1d52900c06ce3dd0c791c657c556a15198754f7e416dc4d67')
16 b2sums=('5b4a5313ab5dc07328702d96c4228e96a00db221156f69a2a1afb2c753f82bae40c4f950c5c93b1ed2cb8b27f23f35e3bc66d027411aa8d55cbc34d8c003f3f4')
18 build() {
19   cd $_name-$pkgver
20   python $_name/ffi_build.py
21   python -m build --wheel --no-isolation
24 check() {
25   local _site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
27   cd $_name-$pkgver
28   # install to temporary location, as importlib is used
29   python -m installer --destdir=test_dir dist/*.whl
30   export PYTHONPATH="test_dir/$_site_packages:$PYTHONPATH"
31   pytest -v
34 package() {
35   cd $_name-$pkgver
36   python -m installer --destdir="$pkgdir" dist/*.whl
37   install -vDm 644 README.rst -t "$pkgdir/usr/share/doc/$pkgname/"
38   install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"