# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=py3-httptools
pkgver=0.6.1
pkgrel=1
pkgdesc="Fast HTTP parser"
url="https://github.com/MagicStack/httptools"
license="MIT"
arch="all"
makedepends="py3-setuptools python3-dev cython http-parser-dev llhttp-dev"
checkdepends="py3-pytest py3-aiohttp py3-openssl py3-psutil"
subpackages="$pkgname-pyc"
source="https://github.com/MagicStack/httptools/archive/v$pkgver/py3-httptools-$pkgver.tar.gz
	cython3.patch"
builddir="$srcdir/httptools-$pkgver"

build() {
	python3 setup.py build build_ext --inplace \
		--use-system-http-parser --use-system-llhttp
}

check() {
	PYTHONPATH="$(echo "$PWD"/build/lib.linux-*)" pytest
}

package() {
	python3 setup.py install --root="$pkgdir" --skip-build
}

sha512sums="
28dc7e91dd15d9b26b1136428b8de2aaaaa3746d40aafce8e4f8ee68ec4b7f7e95a2677904810e34cd2aa1dd3738c43eef7497cbb751648d41929dc38927c426  py3-httptools-0.6.1.tar.gz
81c73a5173266b3f331fffb7baf093729742103f2b6c24e6ba84a114acae7b187825634e5d396e7daf9ec7ebb416f915e535fd70344d80f2fe7627696e2276aa  cython3.patch
"
