archrelease: copy trunk to community-any
[ArchLinux/community.git] / python-jq / trunk / PKGBUILD
blob8fd9ea2c6c8ed1d0cbd2c7567e8f3b8e4929777d
1 # Maintainer: Daniel M. Capella <polyzen@archlinux.org>
2 # Contributor: Mubashshir <ahmubashshir@gmail.com>
4 _name=jq.py
5 pkgname=python-jq
6 pkgver=1.4.1
7 pkgrel=2
8 pkgdesc='Python bindings for jq'
9 arch=('x86_64')
10 url=https://github.com/mwilliamson/jq.py
11 license=('BSD')
12 depends=('jq' 'python')
13 makedepends=('cython' 'git' 'python-build' 'python-installer'
14              'python-setuptools' 'python-wheel')
15 checkdepends=('python-pytest')
16 source=("git+$url.git#tag=$pkgver"
17         'jq-py-setup.patch')
18 b2sums=('SKIP'
19         'ea5061ea7d4bad240c0df82dec3a430a583f1596685a8b4b36f1a0ee6bcae745586f5b1abf3985a8bb0e13523ef084bd6e05f9f430df247c2a6ec2044f99017a')
21 # Devendor
22 prepare() {
23   cd $_name
24   patch --forward --input=../jq-py-setup.patch
27 build() {
28   cd $_name
29   cython -3 jq.pyx
30   python -m build --wheel --skip-dependency-check --no-isolation
33 check() {
34   cd $_name
35   python -m venv --system-site-packages test-env
36   test-env/bin/python -m installer dist/*.whl
37   test-env/bin/python -m pytest
40 package() {
41   cd $_name
42   python -m installer --destdir="$pkgdir" dist/*.whl
44   # Symlink license file
45   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
46   install -d "$pkgdir"/usr/share/licenses/$pkgname
47   ln -s "$site_packages"/jq-$pkgver.dist-info/LICENSE \
48     "$pkgdir"/usr/share/licenses/$pkgname/LICENSE