aboutsummaryrefslogtreecommitdiffstats
path: root/community/py-lz4/APKBUILD
blob: 914e622779370dfba1dc3e763bd16e9825f2ec9b (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=1.1.0
_pkgname=${pkgname#py-}
pkgrel=0
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="3119247e4334b0898b6258a286ea1e2ffeb2e6da958366ec9aefd48e476f05d16b0f059cf47954ea5efafab5a5de0c3f2a825c9e765b488618d75b2d60726c80  lz4-1.1.0.tar.gz
bfd746ae77169f4b963a386816f8480f817587535415144f3a716a00ad22f18db3dfde5b2bbe69892d2298e19453a88531eec90b72fca13961f404555de41b8b  system-lz4.patch"