2022-06-04 18:46:32 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
2022-06-16 09:35:54 +02:00
|
|
|
, fetchpatch
|
2022-06-04 18:46:32 +02:00
|
|
|
}:
|
2017-10-20 06:57:45 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "xxHash";
|
2022-01-09 02:03:53 +01:00
|
|
|
version = "0.8.1";
|
2017-10-20 06:57:45 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Cyan4973";
|
2019-02-24 20:19:08 +01:00
|
|
|
repo = "xxHash";
|
|
|
|
rev = "v${version}";
|
2022-01-09 02:03:53 +01:00
|
|
|
sha256 = "sha256-2WoYCO6QRHWrbGP2mK04/sLNTyQLOuL3urVktilAwMA=";
|
2017-10-20 06:57:45 +02:00
|
|
|
};
|
|
|
|
|
2022-06-16 09:35:54 +02:00
|
|
|
# CMake build fixes
|
2022-06-04 18:46:32 +02:00
|
|
|
patches = [
|
|
|
|
# Merged in https://github.com/Cyan4973/xxHash/pull/649
|
|
|
|
# Should be present in next release
|
2022-06-16 09:35:54 +02:00
|
|
|
(fetchpatch {
|
|
|
|
name = "cmake-install-fix";
|
2022-06-04 18:46:32 +02:00
|
|
|
url = "https://github.com/Cyan4973/xxHash/commit/636f966ecc713c84ddd3b7ccfde2bfb2cc7492a0.patch";
|
2022-06-16 09:35:54 +02:00
|
|
|
sha256 = "sha256-B1PZ/0BXlOrSiPvgCPLvI/sjQvnR0n5PQHOO38LOij0=";
|
|
|
|
})
|
|
|
|
|
|
|
|
# Submitted at https://github.com/Cyan4973/xxHash/pull/723
|
|
|
|
(fetchpatch {
|
|
|
|
name = "cmake-pkgconfig-fix";
|
|
|
|
url = "https://github.com/Cyan4973/xxHash/commit/5db353bbd05ee5eb1f90afc08d10da9416154e55.patch";
|
|
|
|
sha256 = "sha256-dElgSu9DVo2hY6TTVHLTtt0zkXmQV3nc9i/KbrDkK8s=";
|
2022-06-04 18:46:32 +02:00
|
|
|
})
|
|
|
|
];
|
2020-12-25 01:00:00 +01:00
|
|
|
|
2017-10-20 06:57:45 +02:00
|
|
|
|
2022-06-04 18:46:32 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
];
|
2017-10-20 06:57:45 +02:00
|
|
|
|
2022-06-04 18:46:32 +02:00
|
|
|
# Using unofficial CMake build script to install CMake module files.
|
|
|
|
cmakeDir = "../cmake_unofficial";
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}"
|
|
|
|
];
|
2022-01-09 02:03:53 +01:00
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
meta = with lib; {
|
2017-10-20 06:57:45 +02: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).
|
|
|
|
'';
|
2020-03-06 03:26:57 +01:00
|
|
|
homepage = "https://github.com/Cyan4973/xxHash";
|
2017-10-20 06:57:45 +02:00
|
|
|
license = with licenses; [ bsd2 gpl2 ];
|
2019-03-15 21:10:37 +01:00
|
|
|
maintainers = with maintainers; [ orivej ];
|
2022-06-04 18:46:32 +02:00
|
|
|
platforms = platforms.all;
|
2017-10-20 06:57:45 +02:00
|
|
|
};
|
|
|
|
}
|