aboutsummaryrefslogtreecommitdiffstats
path: root/community/xxhash/APKBUILD
blob: 31e2734ba1f84bd6967209d0764993585146cc57 (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
70
71
72
73
74
75
76
# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=xxhash
_pkgname=xxHash
pkgver=0.6.5
_pypkg=python-xxhash
_pyver=0.6.1
pkgrel=1
pkgdesc="Extremely fast non-cryptographic hash algorithm"
url="http://www.xxhash.com"
arch="all"
license="BSD GPL"
depends=""
makedepends="python2-dev python3-dev py-setuptools"
subpackages="$pkgname-dev $pkgname-doc py2-$pkgname:_py2 py3-$pkgname:_py3"
source="$_pkgname-$pkgver.tar.gz::https://github.com/Cyan4973/$_pkgname/archive/v$pkgver.tar.gz
	$_pypkg-$pkgver.tar.gz::https://github.com/ifduyue/$_pypkg/archive/v$_pyver.tar.gz
	lift-XXH_FORCE_MEMORY_ACCESS-condition.patch
	"
builddir="$srcdir/"$_pkgname-$pkgver
pybuilddir="$srcdir/"$_pypkg-$_pyver

build() {
	cd "$builddir"
	sed -i 's|--leak-check=yes|-v --leak-check=full --show-leak-kinds=all|' Makefile
	make CPPFLAGS= xxhsum

	cd "$pybuilddir"
	ln -s "$srcdir"/$_pkgname-$pkgver/xxhash.c ./xxhash/xxhash.c
	ln -s "$srcdir"/$_pkgname-$pkgver/xxhash.h ./xxhash/xxhash.h
	python2 setup.py build
	python3 setup.py build
}

check() {
	cd "$builddir"
	case "$CARCH" in
		armhf) return 0;; # due to "Bus error"
		*) make check;;
	esac
}

package() {
	cd "$builddir"
	mkdir -p "$pkgdir"/usr/bin
	mkdir -p "$pkgdir"/usr/include/xxhash
	mkdir -p "$pkgdir"/usr/share/man/man1
	mkdir -p "$pkgdir"/usr/share/doc/xxhash
	install -m755 xxhsum "$pkgdir"/usr/bin
	install -m644 xxhsum.1 "$pkgdir"/usr/share/man/man1
	install -m644 LICENSE "$pkgdir"/usr/share/doc/xxhash
	install -m644 xxhash.h "$pkgdir"/usr/include/xxhash
	install -m644 xxhash.c "$pkgdir"/usr/include/xxhash
}

_py2() {
	_py python2
}

_py3() {
	_py python3
}

_py() {
	local python="$1"
	pkgdesc="$pkgdesc (for $python)"
	depends=xxhash
	install_if="py-xxhash=$pkgver-r$pkgrel $python"

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

sha512sums="085643b52e091ac0eedd54c4459220b3643d825ca71a11e952d00ea2041c570ff57d8553d0378f34e038ca9ee3b40d2048ed02d44d5aff1fbfcbf5e642487ba0  xxHash-0.6.5.tar.gz
72a99d744ccaac830e9789053acb9728b2da457c7841e2aae96e9748450f09366b9830f6d92b62ac494e938f43c1fea7910c9d5257824ae33c1fe48f199ed9cc  python-xxhash-0.6.5.tar.gz
5503fc4177bbbc8ebac3c921be1a560b7197d1e66cb94064013fa5df750c6659520bb8ddec689b2b3ccb51cec3088508c7dce4bc2cf8c6127053d96e39cd7e6e  lift-XXH_FORCE_MEMORY_ACCESS-condition.patch"