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.
This commit is contained in:
Adriaan de Groot
2022-01-22 22:29:09 +01:00
parent 1c634c300b
commit 652e447482
4 changed files with 73 additions and 6 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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 (