[packages/libphonenumber] add patch to fix build without static libs

atler atler at pld-linux.org
Fri Jan 6 02:06:38 CET 2023


commit 7d6fb481e8d50c48b4863f994b2a7edbe7c2d180
Author: Jan Palus <atler at pld-linux.org>
Date:   Fri Jan 6 02:05:37 2023 +0100

    add patch to fix build without static libs

 libphonenumber.spec |  2 ++
 no-static.patch     | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)
---
diff --git a/libphonenumber.spec b/libphonenumber.spec
index 54f32ae..11c4a56 100644
--- a/libphonenumber.spec
+++ b/libphonenumber.spec
@@ -16,6 +16,7 @@ Source0:	https://github.com/google/libphonenumber/archive/v%{version}/%{name}-%{
 # Source0-md5:	f57a5b475bc5939c7ea04faa6e94d601
 Patch0:		%{name}-link.patch
 Patch1:		%{name}-no-fetch.patch
+Patch2:		no-static.patch
 URL:		https://github.com/google/libphonenumber/
 BuildRequires:	abseil-cpp-devel
 BuildRequires:	boost-devel >= 1.40.0
@@ -70,6 +71,7 @@ Statyczne biblioteki libphonenumber.
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %build
 install -d build/cpp
diff --git a/no-static.patch b/no-static.patch
new file mode 100644
index 0000000..078a1c0
--- /dev/null
+++ b/no-static.patch
@@ -0,0 +1,34 @@
+--- libphonenumber-8.12.51/cpp/CMakeLists.txt.orig	2023-01-06 01:42:02.871437832 +0100
++++ libphonenumber-8.12.51/cpp/CMakeLists.txt	2023-01-06 01:49:02.681479463 +0100
+@@ -498,7 +498,9 @@
+   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).
++  if (${BUILD_STATIC_LIB} STREQUAL "ON")
+   target_link_libraries (geocoding ${LIBRARY_DEPS})
++  endif()
+   target_link_libraries (geocoding-shared phonenumber-shared ${LIBRARY_DEPS})
+ endif ()
+ 
+@@ -665,7 +667,9 @@
+ endif ()
+ 
+ if (${BUILD_GEOCODER} STREQUAL "ON")
++  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 ()
+@@ -677,7 +681,11 @@
+     geocoding_test_program
+     "test/phonenumbers/geocoding/geocoding_test_program.cc"
+   )
++  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
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libphonenumber.git/commitdiff/3cce7a690fc389ea252afa569a4ea817a88c415f



More information about the pld-cvs-commit mailing list