Name xxhash
Description Extremely fast non-cryptographic hash algorithm
Version 0.8.3-r0
Package Base xxhash
Homepage https://cyan4973.github.io/xxHash/
Maintainers ['Natanael Copa <ncopa@alpinelinux.org>']
Contributors ['Leo <thinkabit.ukim@gmail.com>', 'Stuart Cardall <developer@it-offshore.co.uk>']
Distro-repo https://gitlab.alpinelinux.org/alpine/aports/-/tree/3.22-stable/main/xxhash
Sources ['$pkgname-0.8.3-r0.tar.gz::https://github.com/Cyan4973/xxHash/archive/v0.8.3-r0.tar.gz']
Dependencies ['libc.musl-x86_64.so.1']
Optional-Dependencies []
Build-Dependencies []
Provides ['cmd:xxh128sum=0.8.3-r0', 'cmd:xxh32sum=0.8.3-r0', 'cmd:xxh3sum=0.8.3-r0', 'cmd:xxh64sum=0.8.3-r0', 'cmd:xxhsum=0.8.3-r0']
Builddate 05-01-2025 23:20:28
Architecture x86_64
Distro-Version v3.22
Licenses ['BSD-2-Clause']
Hash Q11WyF7sxaEMGGJco+8afr+p6m4hQ=
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=xxhash
pkgver=0.8.3
pkgrel=0
pkgdesc="Extremely fast non-cryptographic hash algorithm"
url="https://cyan4973.github.io/xxHash/"
arch="all"
license="BSD-2-Clause"
subpackages="$pkgname-dev $pkgname-doc lib$pkgname:libs"
source="$pkgname-$pkgver.tar.gz::https://github.com/Cyan4973/xxHash/archive/v$pkgver.tar.gz"
builddir="$srcdir/xxHash-$pkgver"

build() {
	export CFLAGS="$CFLAGS -DXXH_FORCE_MEMORY_ACCESS=1 -flto=auto -O2"

	case "$CARCH" in
	x86*)
		# only implemented for x86/x86_64
		local dispatch="1"
		;;
	*)
		local dispatch="0"
		;;
	esac
	make DISPATCH="$dispatch" LIBXXH_DISPATCH="$dispatch"
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" PREFIX=/usr install
	rm -rf "$pkgdir"/usr/lib/libxxhash.a
}

sha512sums="
8b5c8b9aad4e869f28310b12cc314037feda81d92f26c23eaecdb35dc65042ca2e65f2e9606033e62a31bcc737a9a950500ffcbdb8677d6ab20e820ea14f2b79  xxhash-0.8.3.tar.gz
"