aboutsummaryrefslogtreecommitdiffstats
path: root/community/py-lz4/APKBUILD
blob: ff2a6dbeee003324887fb3198c4b36bd9eecfc94 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=py-lz4
pkgver=0.10.0
_pkgname=${pkgname#py-}
pkgrel=2
pkgdesc="LZ4 Bindings for Python"
url="https://pypi.python.org/pypi/lz4"
arch="all"
license="BSD"
makedepends="python2-dev python3-dev py-setuptools lz4-dev"
checkdepends="py-nose"
if [ "$CARCH" = "s390x" ]; then
	options="!check"
fi
subpackages="py3-${pkgname/py-/}:_py3 py2-${pkgname/py-/}:_py2 $pkgname-tests:_tests:noarch"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz
	disable-failing-test.patch
	"

builddir="$srcdir/$_pkgname-$pkgver"

build() {
	cd "$builddir"
	python2 setup.py build || return 1
	python3 setup.py build || return 1
}

package() {
	mkdir -p "$pkgdir"
}

_py() {
	local python=$1
	pkgdesc="$pkgdesc ${python#python}"
	depends="$python"
	install_if="$pkgname=$pkgver-r$pkgrel $python"

	cd "$builddir"
	$python setup.py install --prefix=/usr --root="$subpkgdir"
}

_py2() {
	replaces="$pkgname"
	_py python2
}

_py3() {
	_py python3
}

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

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

check() {
	cd "$builddir"
	# issue opened for failing test:
	# https://github.com/python-lz4/python-lz4/issues/19
	python setup.py test
}

sha512sums="5a998eb2a541e7a6b8ff7a2d8c1fc0e6d30cddb35ec2b400f60726a6c9d996e2488c738dd841c16069a13d3eaadad3479ca173cd8c863c7e73cd5a26d77ef658  lz4-0.10.0.tar.gz
6fb99988e604a3a2f72d6297d2c0596586bdf7cc66c740061c362502de04a2fe9f814708c5722874b45df6cddd14303a3920de1249ca3b98a5a8eb19bb981a04  disable-failing-test.patch"