git: 652e44748290 - main - devel/libphonenumber: update to 8.12.41, latest upstream

From: Adriaan de Groot <adridg_at_FreeBSD.org>
Date: Sat, 22 Jan 2022 21:42:07 UTC
The branch main has been updated by adridg:

URL: https://cgit.FreeBSD.org/ports/commit/?id=652e44748290eb15a703091838db7f05ff63e445

commit 652e44748290eb15a703091838db7f05ff63e445
Author:     Adriaan de Groot <adridg@FreeBSD.org>
AuthorDate: 2022-01-22 21:29:09 +0000
Commit:     Adriaan de Groot <adridg@FreeBSD.org>
CommitDate: 2022-01-22 21:42:05 +0000

    devel/libphonenumber: update to 8.12.41, latest upstream
    
    This update introduces new tools, which use abseil. The build
    system tries to git-clone the abseil repo and build that.
    Instead, use devel/abseil. However, devel/abseil is built as
    C++17, so we need to patch the build to force C++17 on
    libphonenumber as well (otherwise, abseil introduces pre-C++17
    versions of string_view and link failures follow).
    
    We set WRKSRC_SUBDIR, but the build system now *also*
    goes off to ../tools/cpp (from that SUBDIR), so .. I suppose
    we could drop the SUBDIR setting and instead try some other
    way of invoking CMake for only the C++ parts. Rather than doing
    that, keep SUBDIR, but that gives us a patch with path ../tools/
    which deservers mention. Consider it mentioned.
---
 devel/libphonenumber/Makefile                      |  7 ++--
 devel/libphonenumber/distinfo                      |  6 +--
 devel/libphonenumber/files/patch-CMakeLists.txt    | 19 +++++++++
 .../files/patch-tools_CMakeLists.txt               | 47 ++++++++++++++++++++++
 4 files changed, 73 insertions(+), 6 deletions(-)

diff --git a/devel/libphonenumber/Makefile b/devel/libphonenumber/Makefile
index c992db756030..03b90566dcf6 100644
--- a/devel/libphonenumber/Makefile
+++ b/devel/libphonenumber/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	libphonenumber
 DISTVERSIONPREFIX=	v
-DISTVERSION=	8.12.39
+DISTVERSION=	8.12.41
 CATEGORIES=	devel
 
 MAINTAINER=	kde@FreeBSD.org
@@ -8,12 +8,13 @@ COMMENT=	Library for parsing, formatting, and validating phone numbers
 
 LICENSE=	APACHE20
 
-BUILD_DEPENDS=	googletest>0:devel/googletest
+BUILD_DEPENDS=	googletest>0:devel/googletest \
+		abseil>0:devel/abseil
 LIB_DEPENDS=	libboost_atomic.so:devel/boost-libs \
 		libicui18n.so:devel/icu \
 		libprotobuf.so:devel/protobuf
 
-USES=		cmake:noninja compiler:c++11-lang
+USES=		cmake:noninja compiler:c++17-lang pkgconfig
 USE_GITHUB=	yes
 GH_ACCOUNT=	google
 
diff --git a/devel/libphonenumber/distinfo b/devel/libphonenumber/distinfo
index acf7257d15d0..11bd22691df8 100644
--- a/devel/libphonenumber/distinfo
+++ b/devel/libphonenumber/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1639245846
-SHA256 (google-libphonenumber-v8.12.39_GH0.tar.gz) = ff16330f130917e42bc0b1a7efe5e4fba46633bfa62e35268acec855e17e385c
-SIZE (google-libphonenumber-v8.12.39_GH0.tar.gz) = 11007180
+TIMESTAMP = 1642801609
+SHA256 (google-libphonenumber-v8.12.41_GH0.tar.gz) = 5960f19594f4cbca4a5ff172e12d2bc6e8a7e7399522ba82cd4f58cb0d7270c4
+SIZE (google-libphonenumber-v8.12.41_GH0.tar.gz) = 11010227
diff --git a/devel/libphonenumber/files/patch-CMakeLists.txt b/devel/libphonenumber/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..041833fa47c9
--- /dev/null
+++ b/devel/libphonenumber/files/patch-CMakeLists.txt
@@ -0,0 +1,19 @@
+--- CMakeLists.txt.orig	2022-01-21 23:54:09.004204000 +0100
++++ CMakeLists.txt	2022-01-22 17:06:23.060147000 +0100
+@@ -18,7 +18,7 @@
+ 
+ # Pick the C++ standard to compile with.
+ # Abseil currently supports C++11, C++14, and C++17.
+-set(CMAKE_CXX_STANDARD 11)
++set(CMAKE_CXX_STANDARD 17)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
+ 
+ project (libphonenumber)
+@@ -101,6 +101,7 @@
+ endif ()
+ 
+ # Find all the required libraries and programs.
++find_package(absl REQUIRED)
+ if (${USE_BOOST} STREQUAL "ON")
+   add_definitions ("-DI18N_PHONENUMBERS_USE_BOOST")
+   if (WIN32)
diff --git a/devel/libphonenumber/files/patch-tools_CMakeLists.txt b/devel/libphonenumber/files/patch-tools_CMakeLists.txt
new file mode 100644
index 000000000000..0cf95c7abdb3
--- /dev/null
+++ b/devel/libphonenumber/files/patch-tools_CMakeLists.txt
@@ -0,0 +1,47 @@
+This patch applies from WRKSRC_SUBDIR, ie. from cpp/ , but even
+when building in that subdir, the tools/ directory is built
+as well. That is why the patch applies to ..
+
+- use system abseil instead of fetching it on our own.
+- force C++17 because abseil has it, too.
+
+--- ../tools/cpp/CMakeLists.txt.orig	2022-01-11 10:41:37.000000000 +0100
++++ ../tools/cpp/CMakeLists.txt	2022-01-22 17:06:39.284013000 +0100
+@@ -18,7 +18,7 @@
+ 
+ # Pick the C++ standard to compile with.
+ # Abseil currently supports C++11, C++14, and C++17.
+-set(CMAKE_CXX_STANDARD 11)
++set(CMAKE_CXX_STANDARD 17)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
+ 
+ project (generate_geocoding_data)
+@@ -28,27 +28,11 @@
+ include (gtest.cmake)
+ include (FetchContent)
+ 
+-# Downloading the abseil sources.
+-FetchContent_Declare(
+-    abseil-cpp
+-    GIT_REPOSITORY  https://github.com/abseil/abseil-cpp.git
+-    GIT_TAG         origin/master
+-)
++find_package(absl REQUIRED)
+ 
+-# Building the abseil binaries
+-FetchContent_GetProperties(abseil-cpp)
+-if (NOT abseil-cpp_POPULATED)
+-    FetchContent_Populate(abseil-cpp)
+-endif ()
+-
+-if (NOT abseil-cpp_POPULATED)
+-   message (FATAL_ERROR "Could not build abseil-cpp binaries.")
+-endif ()
+-
+ # Safeguarding against any potential link errors as mentioned in
+ # https://github.com/abseil/abseil-cpp/issues/225
+ set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
+-add_subdirectory(${abseil-cpp_SOURCE_DIR} ${abseil-cpp_BINARY_DIR})
+ 
+ find_or_build_gtest ()
+ set (