summaryrefslogtreecommitdiff
path: root/dev-libs/libphonenumber/files/libphonenumber-8.12.37-testing.patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2021-12-05 02:47:11 +0000
committerV3n3RiX <venerix@koprulu.sector>2021-12-05 02:47:11 +0000
commit2771f79232c273bc2a57d23bf335dd81ccf6af28 (patch)
treec8af0fd04194aed03cf067d44e53c7edd3e9ab84 /dev-libs/libphonenumber/files/libphonenumber-8.12.37-testing.patch
parente9d044d4b9b71200a96adfa280848858c0f468c9 (diff)
gentoo resync : 05.12.2021
Diffstat (limited to 'dev-libs/libphonenumber/files/libphonenumber-8.12.37-testing.patch')
-rw-r--r--dev-libs/libphonenumber/files/libphonenumber-8.12.37-testing.patch110
1 files changed, 110 insertions, 0 deletions
diff --git a/dev-libs/libphonenumber/files/libphonenumber-8.12.37-testing.patch b/dev-libs/libphonenumber/files/libphonenumber-8.12.37-testing.patch
new file mode 100644
index 000000000000..0ea039aea2bd
--- /dev/null
+++ b/dev-libs/libphonenumber/files/libphonenumber-8.12.37-testing.patch
@@ -0,0 +1,110 @@
+From 387f1daf0f9cd25ffa2654cc536e5678dd96a571 Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <asturm@gentoo.org>
+Date: Mon, 15 Nov 2021 19:13:37 +0100
+Subject: [PATCH] Add BUILD_TESTING option
+
+Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
+---
+ cpp/CMakeLists.txt | 13 +++++++++++--
+ tools/cpp/CMakeLists.txt | 17 +++++++++--------
+ 2 files changed, 20 insertions(+), 10 deletions(-)
+
+diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
+index 44db6834..f8e40978 100644
+--- a/cpp/CMakeLists.txt
++++ b/cpp/CMakeLists.txt
+@@ -32,7 +32,9 @@ endif ()
+ # depends on.
+
+ include (GNUInstallDirs)
+-include (../tools/cpp/gtest.cmake)
++if (BUILD_TESTING)
++ include (../tools/cpp/gtest.cmake)
++endif()
+
+ function (print_error DESCRIPTION FILE)
+ message (FATAL_ERROR
+@@ -90,6 +92,7 @@ option ("USE_STD_MAP" "Force the use of std::map" "OFF")
+ option ("BUILD_STATIC_LIB" "Build static libraries" "ON")
+ option ("USE_STDMUTEX" "Use C++ 2011 std::mutex for multi-threading" "OFF")
+ option ("USE_POSIX_THREAD" "Use Posix api for multi-threading" "OFF")
++option ("BUILD_TESTING" "Build unit tests (gtest sources are needed)" "ON")
+
+ if (${USE_ALTERNATE_FORMATS} STREQUAL "ON")
+ add_definitions ("-DI18N_PHONENUMBERS_USE_ALTERNATE_FORMATS")
+@@ -121,7 +124,9 @@ if (${USE_BOOST} STREQUAL "OFF" AND ${USE_STDMUTEX} STREQUAL "OFF")
+ find_package (Threads)
+ endif()
+
+-find_or_build_gtest ()
++if (BUILD_TESTING)
++ find_or_build_gtest ()
++endif()
+
+ if (${USE_RE2} STREQUAL "ON")
+ find_required_library (RE2 re2/re2.h re2 "Google RE2")
+@@ -492,11 +497,13 @@ if (${BUILD_GEOCODER} STREQUAL "ON")
+ endif ()
+
+ # Build a specific library for testing purposes.
++if (BUILD_TESTING)
+ add_library (phonenumber_testing STATIC ${TESTING_LIBRARY_SOURCES})
+ if (${BUILD_GEOCODER} STREQUAL "ON")
+ add_dependencies (phonenumber_testing generate_geocoding_data)
+ endif ()
+ target_link_libraries (phonenumber_testing ${LIBRARY_DEPS})
++endif()
+
+ if (${BUILD_GEOCODER} STREQUAL "ON")
+ # Test geocoding data cpp files generation.
+@@ -551,6 +558,7 @@ if (${USE_ICU_REGEXP} STREQUAL "ON")
+ endif ()
+
+ # Build the testing binary.
++if (BUILD_TESTING)
+ include_directories ("test")
+ add_executable (libphonenumber_test ${TEST_SOURCES})
+ set (TEST_LIBS phonenumber_testing ${GTEST_LIB})
+@@ -575,6 +583,7 @@ else ()
+ DEPENDS libphonenumber_test
+ )
+ endif ()
++endif ()
+
+ # Install rules.
+ install (FILES
+diff --git a/tools/cpp/CMakeLists.txt b/tools/cpp/CMakeLists.txt
+index fafa8469..0c3a84e0 100644
+--- a/tools/cpp/CMakeLists.txt
++++ b/tools/cpp/CMakeLists.txt
+@@ -20,11 +20,10 @@ project (generate_geocoding_data)
+
+ # Helper functions dealing with finding libraries and programs this library
+ # depends on.
+-
+-include (gtest.cmake)
+-
+-find_or_build_gtest ()
+-
++if (BUILD_TESTING)
++ include (gtest.cmake)
++ find_or_build_gtest ()
++endif ()
+ set (
+ SOURCES
+ "src/cpp-build/generate_geocoding_data.cc"
+@@ -52,6 +51,8 @@ if (NOT WIN32)
+ endif ()
+
+ # Build the testing binary.
+-include_directories ("test")
+-add_executable (generate_geocoding_data_test ${TEST_SOURCES})
+-target_link_libraries (generate_geocoding_data_test ${TEST_LIBS})
++if (BUILD_TESTING)
++ include_directories ("test")
++ add_executable (generate_geocoding_data_test ${TEST_SOURCES})
++ target_link_libraries (generate_geocoding_data_test ${TEST_LIBS})
++endif ()
+--
+2.33.1
+