# Contributor: Leo # Contributor: Stuart Cardall # Maintainer: Stuart Cardall pkgname=xxhash _pkgname=xxHash pkgver=0.7.2 _pypkg=python-xxhash _pyver=1.4.1 pkgrel=0 pkgdesc="Extremely fast non-cryptographic hash algorithm" url="https://cyan4973.github.io/xxHash/" arch="all" license="BSD-2-Clause GPL-2.0-or-later" makedepends="python3-dev py3-setuptools" subpackages="$pkgname-dev $pkgname-doc py3-$pkgname:_py3 lib$pkgname:libs" source="$_pkgname-$pkgver.tar.gz::https://github.com/Cyan4973/$_pkgname/archive/v$pkgver.tar.gz $_pypkg-$_pyver.tar.gz::https://github.com/ifduyue/$_pypkg/archive/v$_pyver.tar.gz " builddir="$srcdir/"$_pkgname-$pkgver _pybuilddir="$srcdir/"$_pypkg-$_pyver build() { export CFLAGS="$CFLAGS -DXXH_FORCE_MEMORY_ACCESS=1" sed -i 's|--leak-check=yes|-v --leak-check=full --show-leak-kinds=all|' Makefile make cd "$_pybuilddir" ln -s "$srcdir"/$_pkgname-$pkgver/xxhash.c ./deps/xxhash/xxhash.c ln -s "$srcdir"/$_pkgname-$pkgver/xxhash.h ./deps/xxhash/xxhash.h ln -s "$srcdir"/$_pkgname-$pkgver/xxh3.h ./deps/xxhash/xxh3.h python3 setup.py build } check() { case "$CARCH" in armhf) return 0;; # due to "Bus error" *) make check cd "$_pybuilddir" python3 setup.py test ;; esac } package() { make DESTDIR="$pkgdir" PREFIX=/usr install rm -rf "$pkgdir"/usr/lib/libxxhash.a } _py3() { local python="$1" pkgdesc="$pkgdesc (for python3)" depends="python3 xxhash" replaces="py-xxhash" provides="py-xxhash=$pkgver-r$pkgrel" cd "$_pybuilddir" python3 setup.py install --prefix=/usr --root="$subpkgdir" } sha512sums="90d4e7422729441e5013928b306fd6f394ab6f97628ec88369fbb33891c9a2cfae495516d8dd0741eda9c38859132b1bd78f2c7b8dae1dce80eeca8ea5cba575 xxHash-0.7.2.tar.gz 42a333a59cea01f11f13dec1c760759c9b8a32b3029f81d533715cc86e3cf5d0f59e0e4698cdadf5a110baebdc79bd30d0bea81891b193d5a80b9de7b2c4a77b python-xxhash-1.4.1.tar.gz"