From a67ca6b1eabaf74cd7228565bc2260f2cb0ba324 Mon Sep 17 00:00:00 2001 From: Weihang Ding <798047000@qq.com> Date: Tue, 8 Aug 2023 00:07:45 +0800 Subject: [PATCH] [libphonenumber] Bump to 8.13.17 & fix linux and macOS build (#32899) * [libphonenumber] Bump to 8.13.17 & fix linux and macOS build * update version database * fix windows icui18n lib name * update version database * fix patches * update version database * fix ci.baseline.txt --- ports/libphonenumber/fix-find-protobuf.patch | 4 +-- .../libphonenumber/fix-icui18n-lib-name.patch | 30 +++++++++++-------- .../libphonenumber/fix-re2-identifiers.patch | 26 ++++++++-------- ports/libphonenumber/portfile.cmake | 9 ++++-- .../re2-2023-07-01-compat.patch | 4 +-- ports/libphonenumber/usage | 4 +++ ports/libphonenumber/vcpkg.json | 4 +-- scripts/ci.baseline.txt | 3 -- versions/baseline.json | 4 +-- versions/l-/libphonenumber.json | 5 ++++ 10 files changed, 52 insertions(+), 41 deletions(-) create mode 100644 ports/libphonenumber/usage diff --git a/ports/libphonenumber/fix-find-protobuf.patch b/ports/libphonenumber/fix-find-protobuf.patch index 19055f6df7..6dd1dcadaa 100644 --- a/ports/libphonenumber/fix-find-protobuf.patch +++ b/ports/libphonenumber/fix-find-protobuf.patch @@ -1,8 +1,8 @@ diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt -index 86f2212..46913fd 100644 +index 10b6dce7..50f06eda 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt -@@ -44,6 +44,7 @@ function (print_error DESCRIPTION FILE) +@@ -46,6 +46,7 @@ function (print_error DESCRIPTION FILE) "Can't find ${DESCRIPTION}: can't locate ${FILE}. Please read the README.") endfunction () diff --git a/ports/libphonenumber/fix-icui18n-lib-name.patch b/ports/libphonenumber/fix-icui18n-lib-name.patch index fc44f7d304..1cc5a41e57 100644 --- a/ports/libphonenumber/fix-icui18n-lib-name.patch +++ b/ports/libphonenumber/fix-icui18n-lib-name.patch @@ -1,13 +1,17 @@ -diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt -index cdd7a08..627f897 100644 ---- a/cpp/CMakeLists.txt -+++ b/cpp/CMakeLists.txt -@@ -192,7 +192,7 @@ set (ICU_INCLUDE_DIR ${ICU_UC_INCLUDE_DIR}) - set (ICU_LIB ${ICU_UC_LIB}) - # If ICU regexp engine is used or if the geocoder is built, use icui18n as well. - if (USE_ICU_REGEXP OR BUILD_GEOCODER) -- find_required_library (ICU_I18N unicode/regex.h icui18n "ICU") -+ find_required_library (ICU_I18N unicode/regex.h icuin "ICU") - check_library_version (PC_ICU_I18N icu-i18n>=4.4) - list (APPEND ICU_INCLUDE_DIR ${ICU_I18N_INCLUDE_DIR}) - list (APPEND ICU_LIB ${ICU_I18N_LIB}) +diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt +index cdd7a081..10b6dce7 100644 +--- a/cpp/CMakeLists.txt ++++ b/cpp/CMakeLists.txt +@@ -192,7 +192,11 @@ set (ICU_INCLUDE_DIR ${ICU_UC_INCLUDE_DIR}) + set (ICU_LIB ${ICU_UC_LIB}) + # If ICU regexp engine is used or if the geocoder is built, use icui18n as well. + if (USE_ICU_REGEXP OR BUILD_GEOCODER) +- find_required_library (ICU_I18N unicode/regex.h icui18n "ICU") ++ if (NOT WIN32) ++ find_required_library (ICU_I18N unicode/regex.h "icui18n" "ICU") ++ else () ++ find_required_library (ICU_I18N unicode/regex.h "icuin" "ICU") ++ endif () + check_library_version (PC_ICU_I18N icu-i18n>=4.4) + list (APPEND ICU_INCLUDE_DIR ${ICU_I18N_INCLUDE_DIR}) + list (APPEND ICU_LIB ${ICU_I18N_LIB}) diff --git a/ports/libphonenumber/fix-re2-identifiers.patch b/ports/libphonenumber/fix-re2-identifiers.patch index 91344ed4fb..41de0befa0 100644 --- a/ports/libphonenumber/fix-re2-identifiers.patch +++ b/ports/libphonenumber/fix-re2-identifiers.patch @@ -1,13 +1,13 @@ -diff --git a/cpp/src/phonenumbers/regexp_adapter_re2.cc b/cpp/src/phonenumbers/regexp_adapter_re2.cc -index bb54223..398f369 100644 ---- a/cpp/src/phonenumbers/regexp_adapter_re2.cc -+++ b/cpp/src/phonenumbers/regexp_adapter_re2.cc -@@ -31,6 +31,8 @@ - namespace i18n { - namespace phonenumbers { - -+using re2::StringPiece; -+ - // Implementation of RegExpInput abstract class. - class RE2RegExpInput : public RegExpInput { - public: +diff --git a/cpp/src/phonenumbers/regexp_adapter_re2.cc b/cpp/src/phonenumbers/regexp_adapter_re2.cc +index bb542234..398f369b 100644 +--- a/cpp/src/phonenumbers/regexp_adapter_re2.cc ++++ b/cpp/src/phonenumbers/regexp_adapter_re2.cc +@@ -31,6 +31,8 @@ + namespace i18n { + namespace phonenumbers { + ++using re2::StringPiece; ++ + // Implementation of RegExpInput abstract class. + class RE2RegExpInput : public RegExpInput { + public: diff --git a/ports/libphonenumber/portfile.cmake b/ports/libphonenumber/portfile.cmake index 788512f381..774ee5e027 100644 --- a/ports/libphonenumber/portfile.cmake +++ b/ports/libphonenumber/portfile.cmake @@ -4,7 +4,7 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO google/libphonenumber REF "v${VERSION}" - SHA512 03bd6a6c4499a7135dbfe30acfd0ede818008a1c9a40068c04c0d3cff5638ea10502e186b625534d9f06cbc69da81c470f7d7308cdd08b41428b1a2e0236f409 + SHA512 b1ec99aa952558d2ba26d95d7c1bdfd8169f992b3190cc4236e1ce17e69db50ef2839b2840a9553541e09c7509b77c463a1036f84251844ec71bd5888ef78555 HEAD_REF master PATCHES fix-re2-identifiers.patch @@ -24,8 +24,11 @@ vcpkg_cmake_configure( -DBUILD_TESTING=OFF) vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT}) + vcpkg_copy_pdbs() -vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT}) -vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/ports/libphonenumber/re2-2023-07-01-compat.patch b/ports/libphonenumber/re2-2023-07-01-compat.patch index 5203a01dc9..2ba8ea67a2 100644 --- a/ports/libphonenumber/re2-2023-07-01-compat.patch +++ b/ports/libphonenumber/re2-2023-07-01-compat.patch @@ -1,8 +1,8 @@ diff --git a/cpp/src/phonenumbers/regexp_adapter_re2.cc b/cpp/src/phonenumbers/regexp_adapter_re2.cc -index bb542234..a4ccb545 100644 +index 398f369b..3dd5d854 100644 --- a/cpp/src/phonenumbers/regexp_adapter_re2.cc +++ b/cpp/src/phonenumbers/regexp_adapter_re2.cc -@@ -39,7 +39,7 @@ class RE2RegExpInput : public RegExpInput { +@@ -41,7 +41,7 @@ class RE2RegExpInput : public RegExpInput { utf8_input_(string_) {} virtual string ToString() const { diff --git a/ports/libphonenumber/usage b/ports/libphonenumber/usage new file mode 100644 index 0000000000..d54aaf85f3 --- /dev/null +++ b/ports/libphonenumber/usage @@ -0,0 +1,4 @@ +libphonenumber provides CMake targets: + + find_package(libphonenumber CONFIG REQUIRED) + target_link_libraries(main PRIVATE libphonenumber::phonenumber) diff --git a/ports/libphonenumber/vcpkg.json b/ports/libphonenumber/vcpkg.json index 37ad8bab25..a8227cfc56 100644 --- a/ports/libphonenumber/vcpkg.json +++ b/ports/libphonenumber/vcpkg.json @@ -1,10 +1,8 @@ { "name": "libphonenumber", - "version": "8.13.13", - "port-version": 1, + "version": "8.13.17", "description": "Google's common Java, C++ and JavaScript library for parsing, formatting, and validating international phone numbers.", "license": "Apache-2.0", - "supports": "!linux & !osx", "dependencies": [ "abseil", "boost-date-time", diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 5d489a8f17..a169b77f2f 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -648,9 +648,6 @@ libosip2:arm64-android=fail libosip2:x64-android=fail libosip2:x64-windows-static-md=fail libp7client:x64-android=fail -libphonenumber:arm-neon-android=fail -libphonenumber:arm64-android=fail -libphonenumber:x64-android=fail libpng-apng:arm64-windows = skip libpng-apng:arm-uwp = skip libpng-apng:x64-linux = skip diff --git a/versions/baseline.json b/versions/baseline.json index 7ec0258412..329e2e8db1 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4465,8 +4465,8 @@ "port-version": 2 }, "libphonenumber": { - "baseline": "8.13.13", - "port-version": 1 + "baseline": "8.13.17", + "port-version": 0 }, "libplist": { "baseline": "1.3.6", diff --git a/versions/l-/libphonenumber.json b/versions/l-/libphonenumber.json index 1ec6a3753b..9b0438921e 100644 --- a/versions/l-/libphonenumber.json +++ b/versions/l-/libphonenumber.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "8c0eab944c22034092f0200dcbdd5a422eddc7f9", + "version": "8.13.17", + "port-version": 0 + }, { "git-tree": "5942baf68c6c369476c955e28dea2dd4fda11d1b", "version": "8.13.13",