2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "xxHash";
|
2020-08-20 17:08:02 +00:00
|
|
|
version = "0.8.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Cyan4973";
|
|
|
|
repo = "xxHash";
|
|
|
|
rev = "v${version}";
|
2020-08-20 17:08:02 +00:00
|
|
|
sha256 = "0hpbzdd6kfki5f61g103vp7pfczqkdj0js63avl0ss552jfb8h96";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
# Upstream Makefile does not anticipate that user may not want to
|
|
|
|
# build .so library.
|
2021-02-05 17:12:51 +00:00
|
|
|
postPatch = lib.optionalString stdenv.hostPlatform.isStatic ''
|
2021-01-15 22:18:51 +00:00
|
|
|
sed -i 's/lib: libxxhash.a libxxhash/lib: libxxhash.a/' Makefile
|
|
|
|
sed -i '/LIBXXH) $(DESTDIR/ d' Makefile
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
makeFlags = [ "PREFIX=$(dev)" "EXEC_PREFIX=$(out)" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Extremely fast hash algorithm";
|
|
|
|
longDescription = ''
|
|
|
|
xxHash is an Extremely fast Hash algorithm, running at RAM speed limits.
|
|
|
|
It successfully completes the SMHasher test suite which evaluates
|
|
|
|
collision, dispersion and randomness qualities of hash functions. Code is
|
|
|
|
highly portable, and hashes are identical on all platforms (little / big
|
|
|
|
endian).
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/Cyan4973/xxHash";
|
|
|
|
license = with licenses; [ bsd2 gpl2 ];
|
|
|
|
maintainers = with maintainers; [ orivej ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|