diff options
author | V3n3RiX <venerix@koprulu.sector> | 2021-12-05 02:47:11 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2021-12-05 02:47:11 +0000 |
commit | 2771f79232c273bc2a57d23bf335dd81ccf6af28 (patch) | |
tree | c8af0fd04194aed03cf067d44e53c7edd3e9ab84 /dev-libs/libphonenumber | |
parent | e9d044d4b9b71200a96adfa280848858c0f468c9 (diff) |
gentoo resync : 05.12.2021
Diffstat (limited to 'dev-libs/libphonenumber')
-rw-r--r-- | dev-libs/libphonenumber/Manifest | 5 | ||||
-rw-r--r-- | dev-libs/libphonenumber/files/libphonenumber-8.12.37-cmake.patch | 54 | ||||
-rw-r--r-- | dev-libs/libphonenumber/files/libphonenumber-8.12.37-testing.patch | 110 | ||||
-rw-r--r-- | dev-libs/libphonenumber/libphonenumber-8.12.37.ebuild | 48 | ||||
-rw-r--r-- | dev-libs/libphonenumber/metadata.xml | 12 |
5 files changed, 229 insertions, 0 deletions
diff --git a/dev-libs/libphonenumber/Manifest b/dev-libs/libphonenumber/Manifest new file mode 100644 index 000000000000..2c773467ee92 --- /dev/null +++ b/dev-libs/libphonenumber/Manifest @@ -0,0 +1,5 @@ +AUX libphonenumber-8.12.37-cmake.patch 1963 BLAKE2B 4ca131a59bb4a5558b01eb1428cf9be4e8c006c85235800f09689960c7c489a4da52d044eb0b11b40172bc37382545f46872f35571b0f349a9749ce21237da64 SHA512 feb365105ad3aa6437b495e0ea86d8050bed06444adb6ce79628186f3d8a5cc67f496b1a73ee8bee049d12e6e108921d76cdfd2d0d1a9095b4d5bc0acf5d2deb +AUX libphonenumber-8.12.37-testing.patch 3349 BLAKE2B 1c96a9efd1919c04ed86ad63713e89ea8a6a21139faaa0b4cff406f0d168c57b981b0af1aedf54e54ed753cfa1c8ea815e78fde86c578c9151bdb5d98e6b4ad2 SHA512 00ed243396507f1d7448faed83f82009de7be1418b499f560b0961ea9796bfe7285d9c04c43dc5f3cd8baa90314a487e377f4fba571c5b492e065a97056ce375 +DIST libphonenumber-8.12.37.tar.gz 11005274 BLAKE2B 2bcffe898ca7aa667a35e9a7340a54f880cdb9f290e807e9ff7f6ee778df83dd80023703595781a97355a43a8096bdc957a7f79336b5bf9d892ada26e35ae025 SHA512 420ea841679c1ff420289b3fea0bb6d86d4d1e99525fce00cc90025c8ade99e56e2dcbb7fca64190437ff0a889cdc7373f182e7699db20a072c32e984b8dff33 +EBUILD libphonenumber-8.12.37.ebuild 1138 BLAKE2B 4e251ed825d964f9a10ae6dde8cdf7060f94e84363d18d4e077e5fe2b888a1c730358a3c992ca9170d198d8e37d8f273b287205044428e08515ead53cd0dc85c SHA512 9ab9079d4ebe31ba07aeaef1c082450c500ef84437955f119f2e15091ea03dfa24c881319b9b7ffd690bc8b9428139bfffbdf3ffeaa4a8e289376511015376d6 +MISC metadata.xml 417 BLAKE2B 95de59ae08b1ea02b4e31e2db29ed6e17040d243c0254ae64eaa0c1a4195244063714ebe9f29e0979a9f6be728eecdf47f8bfac77f674128fc37f52eaf8c8896 SHA512 6fc39161d18efec9984fac508c586a579d93ae12a3cd3d4671630af04d8c86db1b86a5f43ac421fa7c0a4b38f7e333676fc36c8066fe08ebe2a92e56f1acb882 diff --git a/dev-libs/libphonenumber/files/libphonenumber-8.12.37-cmake.patch b/dev-libs/libphonenumber/files/libphonenumber-8.12.37-cmake.patch new file mode 100644 index 000000000000..bfc7e8701a5d --- /dev/null +++ b/dev-libs/libphonenumber/files/libphonenumber-8.12.37-cmake.patch @@ -0,0 +1,54 @@ +Upstream: no, I probably should, although this patch isn't nice, but + neither is their cmake code + +From a0c72f32b3c318f66975400af81b9b44d8a8d9c7 Mon Sep 17 00:00:00 2001 +From: Heiko Becker <heirecka@exherbo.org> +Date: Wed, 27 Mar 2019 21:07:22 +0100 +Subject: [PATCH] Fix build with BUILD_STATIC_LIB=ON + +--- + cpp/CMakeLists.txt | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt +index 38ce1f50..dd9399be 100644 +--- a/cpp/CMakeLists.txt ++++ b/cpp/CMakeLists.txt +@@ -441,7 +441,9 @@ if (${BUILD_GEOCODER} STREQUAL "ON") + list (APPEND GEOCODER_DEPS ${COMMON_DEPS}) + # Note that the subset of base/ on which the geocoder relies is implemented + # on top of Boost header-only libraries (e.g. scoped_ptr.hpp). +- target_link_libraries (geocoding ${LIBRARY_DEPS}) ++ if (${BUILD_STATIC_LIB} STREQUAL "ON") ++ target_link_libraries (geocoding ${LIBRARY_DEPS}) ++ endif() + target_link_libraries (geocoding-shared ${LIBRARY_DEPS}) + endif () + +@@ -599,7 +601,9 @@ if (BUILD_SHARED_LIB) + endif () + + if (${BUILD_GEOCODER} STREQUAL "ON") +- install (TARGETS geocoding LIBRARY DESTINATION ${LIBDIR} ARCHIVE DESTINATION ${LIBDIR}) ++ if (${BUILD_STATIC_LIB} STREQUAL "ON") ++ install (TARGETS geocoding LIBRARY DESTINATION ${LIBDIR} ARCHIVE DESTINATION ${LIBDIR}) ++ endif() + install (TARGETS geocoding-shared LIBRARY DESTINATION ${LIBDIR} ARCHIVE + DESTINATION ${LIBDIR}) + endif () +@@ -611,7 +615,11 @@ if (${BUILD_GEOCODER} STREQUAL "ON") + geocoding_test_program + "test/phonenumbers/geocoding/geocoding_test_program.cc" + ) +- target_link_libraries (geocoding_test_program geocoding phonenumber) ++ if (${BUILD_STATIC_LIB} STREQUAL "ON") ++ target_link_libraries (geocoding_test_program geocoding phonenumber) ++ else () ++ target_link_libraries (geocoding_test_program geocoding-shared phonenumber-shared) ++ endif () + endif () + + # Build an RPM +-- +2.21.0 + 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 + diff --git a/dev-libs/libphonenumber/libphonenumber-8.12.37.ebuild b/dev-libs/libphonenumber/libphonenumber-8.12.37.ebuild new file mode 100644 index 000000000000..ca29ba7d46e6 --- /dev/null +++ b/dev-libs/libphonenumber/libphonenumber-8.12.37.ebuild @@ -0,0 +1,48 @@ +# Copyright 2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +CMAKE_MAKEFILE_GENERATOR="emake" # broken w/ ninja +inherit cmake + +DESCRIPTION="Library for parsing, formatting, and validating international phone numbers" +HOMEPAGE="https://github.com/google/libphonenumber" +SRC_URI="https://github.com/google/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" +CMAKE_USE_DIR="${WORKDIR}"/${P}/cpp + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="amd64 arm64" +IUSE="test" + +RESTRICT="test !test? ( test )" + +DEPEND=" + dev-libs/icu:= + dev-libs/protobuf:= + dev-libs/boost:= +" +RDEPEND="${DEPEND}" +BDEPEND=" + virtual/pkgconfig + test? ( dev-cpp/gtest ) +" + +PATCHES=( + # it is either this, or disable BUILD_GEOCODER + # https://github.com/google/libphonenumber/pull/2556 + "${FILESDIR}"/${P}-cmake.patch + # see also https://github.com/google/libphonenumber/pull/2459 + # using a stripped-down patch w/ BUILD_TESTING + "${FILESDIR}"/${P}-testing.patch +) + +src_configure() { + local mycmakeargs=( + -DBUILD_STATIC_LIB=OFF + -DBUILD_TESTING=$(usex test) + -DREGENERATE_METADATA=OFF # avoid JRE dependency + ) + cmake_src_configure +} diff --git a/dev-libs/libphonenumber/metadata.xml b/dev-libs/libphonenumber/metadata.xml new file mode 100644 index 000000000000..d9319561d8a1 --- /dev/null +++ b/dev-libs/libphonenumber/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>kde@gentoo.org</email> + <name>Gentoo KDE Project</name> + </maintainer> + <upstream> + <bugs-to>https://issuetracker.google.com/issues?q=componentid:192347</bugs-to> + <remote-id type="github">google/libphonenumber</remote-id> + </upstream> +</pkgmetadata> |