2019-12-16 12:16:38 +00:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, static ? false }:
|
2013-02-18 21:12:11 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "snappy";
|
2020-01-26 11:36:21 +00:00
|
|
|
version = "1.1.8";
|
2017-10-26 23:44:19 +00:00
|
|
|
|
2017-11-24 13:20:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "snappy";
|
2019-09-08 23:38:31 +00:00
|
|
|
rev = version;
|
2020-01-26 11:36:21 +00:00
|
|
|
sha256 = "1j0kslq2dvxgkcxl1gakhvsa731yrcvcaipcp5k8k7ayicvkv9jv";
|
2013-02-18 21:12:11 +00:00
|
|
|
};
|
|
|
|
|
2017-12-20 03:28:14 +00:00
|
|
|
patches = [ ./disable-benchmark.patch ];
|
|
|
|
|
2017-11-24 13:20:52 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
2017-03-03 13:29:39 +00:00
|
|
|
|
2017-11-24 13:20:52 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2013-02-18 21:12:11 +00:00
|
|
|
|
2019-12-16 12:16:38 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
|
|
|
|
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
|
|
|
|
];
|
2017-12-20 03:28:14 +00:00
|
|
|
|
2019-04-05 23:07:15 +00:00
|
|
|
postInstall = ''
|
|
|
|
substituteInPlace "$out"/lib/cmake/Snappy/SnappyTargets.cmake \
|
|
|
|
--replace 'INTERFACE_INCLUDE_DIRECTORIES "''${_IMPORT_PREFIX}/include"' 'INTERFACE_INCLUDE_DIRECTORIES "'$dev'"'
|
|
|
|
'';
|
|
|
|
|
2017-12-20 03:28:14 +00:00
|
|
|
checkTarget = "test";
|
2014-09-14 02:13:43 +00:00
|
|
|
|
2017-12-20 03:28:14 +00:00
|
|
|
doCheck = true;
|
2013-02-18 21:12:11 +00:00
|
|
|
|
2014-09-14 02:13:43 +00:00
|
|
|
meta = with stdenv.lib; {
|
2019-12-16 12:16:38 +00:00
|
|
|
homepage = "https://google.github.io/snappy/";
|
2014-09-14 02:13:43 +00:00
|
|
|
license = licenses.bsd3;
|
2013-02-18 21:12:11 +00:00
|
|
|
description = "Compression/decompression library for very high speeds";
|
2019-11-12 19:48:23 +00:00
|
|
|
platforms = platforms.all;
|
2013-02-18 21:12:11 +00:00
|
|
|
};
|
|
|
|
}
|