Skip to content

Commit 1fdd2e7

Browse files
author
nephros
committed
1 parent b588fb6 commit 1fdd2e7

3 files changed

Lines changed: 38 additions & 0 deletions

File tree

rpm/0003-cmake-absl.patch

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
2+
index b3ecc4f..7864618 100644
3+
--- a/cpp/CMakeLists.txt
4+
+++ b/cpp/CMakeLists.txt
5+
@@ -203,7 +203,8 @@ add_custom_command (
6+
)
7+
8+
if (${BUILD_GEOCODER} STREQUAL "ON")
9+
- find_package(absl)
10+
+ # Use "CONFIG" as there is no built-in cmake module for absl.
11+
+ find_package(absl CONFIG REQUIRED)
12+
13+
# Geocoding data cpp file generation
14+
set (TOOLS_DIR "${CMAKE_CURRENT_BINARY_DIR}/tools")
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
2+
index b3ecc4f..a35c680 100644
3+
--- a/cpp/CMakeLists.txt
4+
+++ b/cpp/CMakeLists.txt
5+
@@ -479,7 +479,7 @@ endif ()
6+
# Safeguarding against any potential link errors as mentioned in
7+
# https://github.com/abseil/abseil-cpp/issues/225
8+
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
9+
-list (APPEND LIBRARY_DEPS absl::node_hash_set absl::strings absl::synchronization)
10+
+list (APPEND LIBRARY_DEPS absl::node_hash_set absl::strings absl::synchronization absl::log_internal_message absl::log_internal_check_op)
11+
12+
if (APPLE)
13+
list (APPEND COMMON_DEPS ${COREFOUNDATION_LIB} ${FOUNDATION_LIB})

rpm/libphonenumber.spec

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ Source0: %{name}-%{version}.tar.gz
99
# https://github.com/google/libphonenumber/pull/2556
1010
Patch1: 0001-Fix-geocoding-build-when-static-libraries-are-off.patch
1111
Patch2: 0002-Ensure-build-reproducibility.patch
12+
# "Backport" of https://github.com/google/libphonenumber/pull/3213
13+
Patch3: 0003-cmake-absl.patch
14+
# "Backport" of https://github.com/google/libphonenumber/pull/3215
15+
Patch4: 0004-Update-absl-dependencies-in-CMakeLists.txt
1216

1317
BuildRequires: gcc-c++
1418
BuildRequires: cmake
@@ -71,6 +75,11 @@ Contains files needed to development with %{name}.
7175
# USE_RE2=OFF - don't use google's re2 library (ICU is already in our default install, RE2 isn't)
7276
# BUILD_STATIC_LIB=OFF - we don't need static libraries
7377
# CMAKE_BUILD_TYPE=RelWithDebInfo - among other things this helps to achieve build reproducibility by defining the NDEBUG macro
78+
#
79+
# abseil protobuf pkgconfig bug:
80+
# https://github.com/protocolbuffers/protobuf/issues/12746#issuecomment-1625152336
81+
# CMAKE_FIND_PACKAGE_PREFER_CONFIG=ON \
82+
# protobuf_MODULE_COMPATIBLE=ON \
7483

7584
touch cpp/src/phonenumbers/test_metadata.h
7685
%cmake -DBUILD_GEOCODER=ON \
@@ -83,6 +92,8 @@ touch cpp/src/phonenumbers/test_metadata.h
8392
-DBUILD_STATIC_LIB=OFF \
8493
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
8594
-DCMAKE_CXX_STANDARD=17 \
95+
-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON \
96+
-Dprotobuf_MODULE_COMPATIBLE=ON \
8697
cpp
8798

8899
%make_build

0 commit comments

Comments
 (0)