summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/development/libraries/snappy/default.nix13
-rw-r--r--pkgs/development/libraries/snappy/disable-benchmark.patch5
2 files changed, 11 insertions, 7 deletions
diff --git a/pkgs/development/libraries/snappy/default.nix b/pkgs/development/libraries/snappy/default.nix
index 5ce636e6f0cad..8f37302cec50d 100644
--- a/pkgs/development/libraries/snappy/default.nix
+++ b/pkgs/development/libraries/snappy/default.nix
@@ -11,18 +11,17 @@ stdenv.mkDerivation rec {
     sha256 = "1x7r8sjmdqlqjz0xfiwdyrqpgaj5yrvrgb28ivgpvnxgar5qv6m2";
   };
 
+  patches = [ ./disable-benchmark.patch ];
+
   outputs = [ "out" "dev" ];
 
   nativeBuildInputs = [ cmake ];
 
-  # -DNDEBUG for speed
-  configureFlags = [ "CXXFLAGS=-DNDEBUG" ];
+  cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" "-DCMAKE_SKIP_BUILD_RPATH=OFF" ];
+
+  checkTarget = "test";
 
-  # SIGILL on darwin
-  doCheck = !stdenv.isDarwin;
-  checkPhase = ''
-    (cd .. && ./build/snappy_unittest)
-  '';
+  doCheck = true;
 
   meta = with stdenv.lib; {
     homepage = https://google.github.io/snappy/;
diff --git a/pkgs/development/libraries/snappy/disable-benchmark.patch b/pkgs/development/libraries/snappy/disable-benchmark.patch
new file mode 100644
index 0000000000000..c891c13fe74c9
--- /dev/null
+++ b/pkgs/development/libraries/snappy/disable-benchmark.patch
@@ -0,0 +1,5 @@
+--- a/snappy-test.cc
++++ b/snappy-test.cc
+@@ -46 +46 @@
+-DEFINE_bool(run_microbenchmarks, true,
++DEFINE_bool(run_microbenchmarks, false,