summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 07454043219b4038d86a9c82b10d80bd651185fd (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: Luis Martinez <luis dot martinez at disroot dot org>
# Maintainer: Kaizhao Zhang <zhangkaizhao@gmail.com>

pkgname=python-google-crc32c
_name="${pkgname/-google/}"
pkgver=1.2.0
pkgrel=1
pkgdesc="Wraps Google's CRC32C library into a Python wrapper"
arch=('any')
url="https://github.com/googleapis/python-crc32c"
license=('APACHE')
depends=('python>=3.6')
optdepends=('google-crc32c: use C extension instead of pure Python implementation (requires rebuild)')
makedepends=('python-setuptools')
checkdepends=('python-pytest')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('7cb079223a4f175c685d2c2c26efc5176d72b23eae65f532a83db227e24dce79')

build() {
	export CRC32C_INSTALL_PREFIX=/usr
	cd "$_name-$pkgver"
	python setup.py build
}

check() {
	cd "$_name-$pkgver"
	local _ver="$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')"
	PYTHONPATH="$PWD/build/lib.linux-$CARCH-$_ver" pytest tests
}

package() {
	cd "$_name-$pkgver"
	PYTHONHASHSEED=0 python setup.py install --root="$pkgdir/" --optimize=1 --skip-build
	install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}