nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchFromGitHub }:
2
3stdenv.mkDerivation rec {
4 pname = "xxHash";
5 version = "0.8.1";
6
7 src = fetchFromGitHub {
8 owner = "Cyan4973";
9 repo = "xxHash";
10 rev = "v${version}";
11 sha256 = "sha256-2WoYCO6QRHWrbGP2mK04/sLNTyQLOuL3urVktilAwMA=";
12 };
13
14 # Upstream Makefile does not anticipate that user may not want to
15 # build .so library.
16 postPatch = lib.optionalString stdenv.hostPlatform.isStatic ''
17 sed -i 's/lib: libxxhash.a libxxhash/lib: libxxhash.a/' Makefile
18 sed -i '/LIBXXH) $(DESTDIR/ d' Makefile
19 '';
20
21 outputs = [ "out" "dev" ];
22
23 makeFlags = [ "PREFIX=$(dev)" "EXEC_PREFIX=$(out)" ];
24
25 # pkgs/build-support/setup-hooks/compress-man-pages.sh hook fails
26 # to compress symlinked manpages. Avoid compressing manpages until
27 # it's fixed.
28 dontGzipMan = true;
29
30 meta = with lib; {
31 description = "Extremely fast hash algorithm";
32 longDescription = ''
33 xxHash is an Extremely fast Hash algorithm, running at RAM speed limits.
34 It successfully completes the SMHasher test suite which evaluates
35 collision, dispersion and randomness qualities of hash functions. Code is
36 highly portable, and hashes are identical on all platforms (little / big
37 endian).
38 '';
39 homepage = "https://github.com/Cyan4973/xxHash";
40 license = with licenses; [ bsd2 gpl2 ];
41 maintainers = with maintainers; [ orivej ];
42 platforms = platforms.unix;
43 };
44}