Merge pull request #143058 from Artturin/snapppypkgconfig

This commit is contained in:
Artturi 2021-11-01 12:08:58 +02:00 committed by GitHub
commit c28d0ceeda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 11 deletions

View file

@ -4,17 +4,15 @@
stdenv.mkDerivation rec {
pname = "snappy";
version = "1.1.8";
version = "1.1.9";
src = fetchFromGitHub {
owner = "google";
repo = "snappy";
rev = version;
sha256 = "1j0kslq2dvxgkcxl1gakhvsa731yrcvcaipcp5k8k7ayicvkv9jv";
sha256 = "sha256-JXWl63KVP+CDNWIXYtz+EKqWLJbPKl3ifhr8dKAp/w8=";
};
patches = [ ./disable-benchmark.patch ];
outputs = [ "out" "dev" ];
nativeBuildInputs = [ cmake ];
@ -22,16 +20,28 @@ stdenv.mkDerivation rec {
cmakeFlags = [
"-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
"-DSNAPPY_BUILD_TESTS=OFF"
"-DSNAPPY_BUILD_BENCHMARKS=OFF"
];
postInstall = ''
substituteInPlace "$out"/lib/cmake/Snappy/SnappyTargets.cmake \
--replace 'INTERFACE_INCLUDE_DIRECTORIES "''${_IMPORT_PREFIX}/include"' 'INTERFACE_INCLUDE_DIRECTORIES "'$dev'"'
mkdir -p $dev/lib/pkgconfig
cat <<EOF > $dev/lib/pkgconfig/snappy.pc
Name: snappy
Description: Fast compressor/decompressor library.
Version: ${version}
Libs: -L$out/lib -lsnappy
Cflags: -I$dev/include
EOF
'';
checkTarget = "test";
#checkTarget = "test";
doCheck = true;
# requires gbenchmark and gtest but it also installs them out $dev
doCheck = false;
meta = with lib; {
homepage = "https://google.github.io/snappy/";

View file

@ -1,5 +0,0 @@
--- a/snappy-test.cc
+++ b/snappy-test.cc
@@ -46 +46 @@
-DEFINE_bool(run_microbenchmarks, true,
+DEFINE_bool(run_microbenchmarks, false,