summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c47cc813d5f80c24f653e17b2a3d48d8fe07c14b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-http-parser
pkgver=0.9.0
pkgrel=8
pkgdesc="HTTP request/response parser for Python"
arch=('x86_64')
license=('MIT')
url="https://github.com/benoitc/http-parser"
depends=('python')
makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel' 'cython')
checkdepends=('python-pytest')
source=("https://github.com/benoitc/http-parser/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('75e51bef43d9d7698aad69f8bfe651e24784b97603cac55f33bf4c12c86792c8c71d6206f31847d052e4d8621a5ea65a7b34eca5bebdb8189f58e6d98d33139d')

prepare() {
  rm http-parser-$pkgver/http_parser/parser.c
}

build() {
  cd "$srcdir"/http-parser-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd "$srcdir"/http-parser-$pkgver
  PYTHONPATH="$PWD/build/lib.linux-$CARCH-3.10:$PYTHONPATH" \
  py.test testing/
}

package() {
  cd http-parser-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}