1{ lib
2, stdenv
3, fetchFromGitHub
4, cmake
5}:
6
7stdenv.mkDerivation rec {
8 pname = "xxHash";
9 version = "0.8.2";
10
11 src = fetchFromGitHub {
12 owner = "Cyan4973";
13 repo = "xxHash";
14 rev = "v${version}";
15 hash = "sha256-kofPs01jb189LUjYHHt+KxDifZQWl0Hm779711mvWtI=";
16 };
17
18 nativeBuildInputs = [
19 cmake
20 ];
21
22 # Using unofficial CMake build script to install CMake module files.
23 cmakeDir = "../cmake_unofficial";
24
25 cmakeFlags = [
26 "-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}"
27 ];
28
29 meta = with lib; {
30 description = "Extremely fast hash algorithm";
31 longDescription = ''
32 xxHash is an Extremely fast Hash algorithm, running at RAM speed limits.
33 It successfully completes the SMHasher test suite which evaluates
34 collision, dispersion and randomness qualities of hash functions. Code is
35 highly portable, and hashes are identical on all platforms (little / big
36 endian).
37 '';
38 homepage = "https://github.com/Cyan4973/xxHash";
39 license = with licenses; [ bsd2 gpl2 ];
40 mainProgram = "xxhsum";
41 maintainers = with maintainers; [ orivej ];
42 platforms = platforms.all;
43 };
44}