linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / libraries / snappy / default.nix
blobece425e85c4170d824fe39bd6e4a297f4fe96c55
1 { lib, stdenv, fetchFromGitHub, cmake
2 , static ? stdenv.hostPlatform.isStatic
3 }:
5 stdenv.mkDerivation rec {
6   pname = "snappy";
7   version = "1.1.8";
9   src = fetchFromGitHub {
10     owner = "google";
11     repo = "snappy";
12     rev = version;
13     sha256 = "1j0kslq2dvxgkcxl1gakhvsa731yrcvcaipcp5k8k7ayicvkv9jv";
14   };
16   patches = [ ./disable-benchmark.patch ];
18   outputs = [ "out" "dev" ];
20   nativeBuildInputs = [ cmake ];
22   cmakeFlags = [
23     "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
24     "-DCMAKE_SKIP_BUILD_RPATH=OFF"
25   ];
27   postInstall = ''
28     substituteInPlace "$out"/lib/cmake/Snappy/SnappyTargets.cmake \
29       --replace 'INTERFACE_INCLUDE_DIRECTORIES "''${_IMPORT_PREFIX}/include"' 'INTERFACE_INCLUDE_DIRECTORIES "'$dev'"'
30   '';
32   checkTarget = "test";
34   doCheck = true;
36   meta = with lib; {
37     homepage = "https://google.github.io/snappy/";
38     license = licenses.bsd3;
39     description = "Compression/decompression library for very high speeds";
40     platforms = platforms.all;
41   };