aboutsummaryrefslogtreecommitdiffstats
path: root/community/py-lz4/APKBUILD
blob: c3197845055c5c3d52a368f709604790f0ef9bac (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
68
69
# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=py-lz4
pkgver=0.17.0
_pkgname=${pkgname#py-}
pkgrel=1
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"

# FIXME: check fails on s390x
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
	system-lz4.patch"
builddir="$srcdir/$_pkgname-$pkgver"

prepare() {
	default_prepare
	rm lz4libs/lz4*.[ch]
}
build() {
	cd "$builddir"
	python2 setup.py build
	python3 setup.py build
}

check() {
	cd "$builddir"
	python3 setup.py test
}

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
}

sha512sums="29af6839733cd57ee607e7e608a1aa2ab8c99aeb494b415af35ecad4efe26b1809a56a35dce045f1425043ebc9313fd99dcc81a1ac6d572b52d6debd14451207  lz4-0.17.0.tar.gz
bfd746ae77169f4b963a386816f8480f817587535415144f3a716a00ad22f18db3dfde5b2bbe69892d2298e19453a88531eec90b72fca13961f404555de41b8b  system-lz4.patch"