Use new upstream PR#25635 as .pc path fix

This commit is contained in:
Benjamin A. Beasley 2022-05-27 14:54:24 -04:00
parent 09de79aa68
commit 131fe89563
2 changed files with 58 additions and 5 deletions

50
29826.patch Normal file
View File

@ -0,0 +1,50 @@
From 4138f4bc0347e090431d2476610cbbcaf1397f41 Mon Sep 17 00:00:00 2001
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
Date: Fri, 27 May 2022 14:41:08 -0400
Subject: [PATCH 1/2] Use gRPC_INSTALL_LIBDIR for pkgconfig files
Fixes #25635.
If grpc libraries are installed in <prefix>/lib64, then .pc files should
be installed in <prefix>/lib64/pkgconfig. Before this commit, they were
always installed in <prefix>/lib/pkgconfig.
---
templates/CMakeLists.txt.template | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template
index 9096d9125965..ee3e1782533b 100644
--- a/templates/CMakeLists.txt.template
+++ b/templates/CMakeLists.txt.template
@@ -850,7 +850,7 @@
"<%text>${output_filepath}</%text>"
@ONLY)
install(FILES "<%text>${output_filepath}</%text>"
- DESTINATION "lib/pkgconfig/")
+ DESTINATION "<%text>${gRPC_INSTALL_LIBDIR}/pkgconfig</%text>")
endfunction()
# gpr .pc file
From 07a8e936c86b3852ebd14f6fccba53fdffb07a63 Mon Sep 17 00:00:00 2001
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
Date: Fri, 27 May 2022 14:45:52 -0400
Subject: [PATCH 2/2] Re-generate projects
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e7aa97e9fcff..76c9ef0eede9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19820,7 +19820,7 @@ function(generate_pkgconfig name description version requires
"${output_filepath}"
@ONLY)
install(FILES "${output_filepath}"
- DESTINATION "lib/pkgconfig/")
+ DESTINATION "${gRPC_INSTALL_LIBDIR}/pkgconfig")
endfunction()
# gpr .pc file

View File

@ -307,6 +307,14 @@ Patch: %{forgeurl}/pull/29359.patch
# “Segfault in client_lb_end2end_test due to absl::string_view(nullptr)” # “Segfault in client_lb_end2end_test due to absl::string_view(nullptr)”
# https://github.com/grpc/grpc/issues/29567 # https://github.com/grpc/grpc/issues/29567
Patch: %{forgeurl}/pull/29568.patch Patch: %{forgeurl}/pull/29568.patch
# Use gRPC_INSTALL_LIBDIR for pkgconfig files
# https://github.com/grpc/grpc/pull/29826
#
# Fixes:
#
# Should install pkgconfig files under gRPC_INSTALL_LIBDIR
# https://github.com/grpc/grpc/issues/25635
Patch: %{forgeurl}/pull/29826.patch
Requires: grpc-data = %{version}-%{release} Requires: grpc-data = %{version}-%{release}
@ -757,11 +765,6 @@ sed -r -i 's/(std=c\+\+)11/\1%{cpp_std}/g' \
tools/run_tests/artifacts/artifact_targets.py \ tools/run_tests/artifacts/artifact_targets.py \
tools/distrib/python/grpcio_tools/setup.py tools/distrib/python/grpcio_tools/setup.py
echo '===== Fixing .pc install path =====' 2>&1
# Fix the install path for .pc files
# https://github.com/grpc/grpc/issues/25635
sed -r -i 's|lib(/pkgconfig)|\${gRPC_INSTALL_LIBDIR}\1|' CMakeLists.txt
%build %build
# ~~~~ C (core) and C++ (cpp) ~~~~ # ~~~~ C (core) and C++ (cpp) ~~~~