commit:     7bc9121746499f5c207cdd4c20893f5ab60c5952
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 24 07:45:10 2021 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sun Oct 24 07:48:21 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7bc91217

dev-libs/leveldb: remove test dependency on dev-cpp/benchmark

Only one test executable is using benchmark, and that is only for a
badly placed benchmark. So just patch it out.
dev-cpp/benchmark is problematic to keyword for multiple arches
(for example sparc #762727), so it is better to just patch it out.

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 .../files/leveldb-1.23-remove-benchmark-dep.patch  | 44 ++++++++++++++++++++++
 .../files/leveldb-1.23-system-testdeps.patch       |  3 +-
 ...{leveldb-1.23.ebuild => leveldb-1.23-r1.ebuild} |  6 +--
 3 files changed, 47 insertions(+), 6 deletions(-)

diff --git a/dev-libs/leveldb/files/leveldb-1.23-remove-benchmark-dep.patch 
b/dev-libs/leveldb/files/leveldb-1.23-remove-benchmark-dep.patch
new file mode 100644
index 00000000000..be5ce7386ed
--- /dev/null
+++ b/dev-libs/leveldb/files/leveldb-1.23-remove-benchmark-dep.patch
@@ -0,0 +1,44 @@
+Only one test executable is using benchmark, and that is only for a badly
+placed benchmark.
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -323,7 +323,7 @@ if(LEVELDB_BUILD_TESTS)
+
+         "${test_file}"
+     )
+-    target_link_libraries("${test_target_name}" leveldb gmock gtest benchmark)
++    target_link_libraries("${test_target_name}" leveldb gmock gtest)
+     target_compile_definitions("${test_target_name}"
+       PRIVATE
+         ${LEVELDB_PLATFORM_NAME}=1
+--- a/db/db_test.cc
++++ b/db/db_test.cc
+@@ -9,7 +9,6 @@
+ #include <string>
+
+ #include "gtest/gtest.h"
+-#include "benchmark/benchmark.h"
+ #include "db/db_impl.h"
+ #include "db/filename.h"
+ #include "db/version_set.h"
+@@ -2301,6 +2300,7 @@ std::string MakeKey(unsigned int num) {
+   return std::string(buf);
+ }
+
++#if 0
+ static void BM_LogAndApply(benchmark::State& state) {
+   const int num_base_files = state.range(0);
+ 
+@@ -2357,10 +2357,10 @@ static void BM_LogAndApply(benchmark::State& state) {
+ }
+
+ BENCHMARK(BM_LogAndApply)->Arg(1)->Arg(100)->Arg(10000)->Arg(100000);
++#endif
+ }  // namespace leveldb
+
+ int main(int argc, char** argv) {
+   testing::InitGoogleTest(&argc, argv);
+-  benchmark::RunSpecifiedBenchmarks();
+   return RUN_ALL_TESTS();
+ }

diff --git a/dev-libs/leveldb/files/leveldb-1.23-system-testdeps.patch 
b/dev-libs/leveldb/files/leveldb-1.23-system-testdeps.patch
index 232d74aa2cc..8165050048c 100644
--- a/dev-libs/leveldb/files/leveldb-1.23-system-testdeps.patch
+++ b/dev-libs/leveldb/files/leveldb-1.23-system-testdeps.patch
@@ -1,6 +1,6 @@
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -296,20 +296,12 @@
+@@ -296,20 +296,11 @@
    set(build_gmock ON)
  
    # This project is tested using GoogleTest.
@@ -19,7 +19,6 @@
 -    set_property(TARGET gmock
 -        APPEND PROPERTY COMPILE_OPTIONS -Wno-missing-field-initializers)
 -  endif(LEVELDB_HAVE_NO_MISSING_FIELD_INITIALIZERS)
-+  find_package(benchmark REQUIRED)
  
    function(leveldb_test test_file)
      get_filename_component(test_target_name "${test_file}" NAME_WE)

diff --git a/dev-libs/leveldb/leveldb-1.23.ebuild 
b/dev-libs/leveldb/leveldb-1.23-r1.ebuild
similarity index 90%
rename from dev-libs/leveldb/leveldb-1.23.ebuild
rename to dev-libs/leveldb/leveldb-1.23-r1.ebuild
index c5f192ceb0a..0d2eed03d09 100644
--- a/dev-libs/leveldb/leveldb-1.23.ebuild
+++ b/dev-libs/leveldb/leveldb-1.23-r1.ebuild
@@ -20,13 +20,11 @@ DEPEND="crc32c? ( dev-libs/crc32c )
        snappy? ( app-arch/snappy )
        tcmalloc? ( dev-util/google-perftools )"
 RDEPEND="${DEPEND}"
-BDEPEND="test? (
-       dev-cpp/benchmark
-       dev-cpp/gtest
-)"
+BDEPEND="test? ( dev-cpp/gtest )"
 
 PATCHES=(
        "${FILESDIR}"/${PN}-1.23-system-testdeps.patch
+       "${FILESDIR}"/${PN}-1.23-remove-benchmark-dep.patch
 )
 
 src_configure() {

Reply via email to