aboutsummaryrefslogtreecommitdiffstats
path: root/community/py3-lz4/APKBUILD
blob: cc2c8e42dfd47dace5dd273e7f36132f6c3aa594 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=py3-lz4
pkgver=2.2.1
_pkgname=${pkgname#py3-}
pkgrel=0
pkgdesc="LZ4 Bindings for Python"
url="https://pypi.python.org/pypi/lz4"
arch="all"
license="BSD-3-Clause"
makedepends="python3-dev py3-setuptools lz4-dev linux-headers"
checkdepends="py3-pytest py3-psutil py3-pytest-cov py3-coverage"

# FIXME: check fails on s390x
if [ "$CARCH" = "s390x" ]; then
	options="!check"
fi

subpackages="$pkgname-tests:_tests:noarch"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz
	system-libs.patch
	"
builddir="$srcdir/$_pkgname-$pkgver"

replaces="py-lz4" # Backwards compatibility
provides="py-lz4=$pkgver-r$pkgrel" # Backwards compatibility

prepare() {
	default_prepare
	rm lz4libs/lz4*.[ch]
}

build() {
	python3 setup.py build
}

check() {
	python3 setup.py test
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

_tests() {
	pkgdesc="$pkgdesc (tests)"

	mkdir -p "$subpkgdir"/usr/share/$pkgname
	mv "$builddir"/tests "$subpkgdir"/usr/share/$pkgname
}

sha512sums="3f6400c0ac02182306fcb0e76fc78fdcec604bd89baa288c71261cce05350de244eb0d4263e4c1c1d647a529426beac409b3ff20c170c3ea19c7dd82cfae834b  lz4-2.2.1.tar.gz
32928c49a6231106fbd7c73a1931c158a9d943132a22217e5f80ea0c20cc4a7259d9aca7dc5f7961b65e7e1e64f5740fd963f67d5078ebd9dec022fcbafa6181  system-libs.patch"