mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-05 20:12:52 +00:00
41 lines
989 B
Nix
41 lines
989 B
Nix
{ stdenv, fetchFromGitHub, cmake, static ? false }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "snappy";
|
|
version = "1.1.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "google";
|
|
repo = "snappy";
|
|
rev = version;
|
|
sha256 = "1x7r8sjmdqlqjz0xfiwdyrqpgaj5yrvrgb28ivgpvnxgar5qv6m2";
|
|
};
|
|
|
|
patches = [ ./disable-benchmark.patch ];
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
cmakeFlags = [
|
|
"-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
|
|
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
|
|
];
|
|
|
|
postInstall = ''
|
|
substituteInPlace "$out"/lib/cmake/Snappy/SnappyTargets.cmake \
|
|
--replace 'INTERFACE_INCLUDE_DIRECTORIES "''${_IMPORT_PREFIX}/include"' 'INTERFACE_INCLUDE_DIRECTORIES "'$dev'"'
|
|
'';
|
|
|
|
checkTarget = "test";
|
|
|
|
doCheck = true;
|
|
|
|
meta = with stdenv.lib; {
|
|
homepage = "https://google.github.io/snappy/";
|
|
license = licenses.bsd3;
|
|
description = "Compression/decompression library for very high speeds";
|
|
platforms = platforms.all;
|
|
};
|
|
}
|