2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "xxHash";
|
2022-01-26 04:04:25 +00:00
|
|
|
version = "0.8.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Cyan4973";
|
|
|
|
repo = "xxHash";
|
|
|
|
rev = "v${version}";
|
2022-01-26 04:04:25 +00:00
|
|
|
sha256 = "sha256-2WoYCO6QRHWrbGP2mK04/sLNTyQLOuL3urVktilAwMA=";
|
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
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
# pkgs/build-support/setup-hooks/compress-man-pages.sh hook fails
|
|
|
|
# to compress symlinked manpages. Avoid compressing manpages until
|
|
|
|
# it's fixed.
|
|
|
|
dontGzipMan = true;
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|