From 131fe8956369cccc883f9742e1c82d99f1f80b90 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 27 May 2022 14:54:24 -0400 Subject: [PATCH] Use new upstream PR#25635 as .pc path fix --- 29826.patch | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ grpc.spec | 13 ++++++++----- 2 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 29826.patch diff --git a/29826.patch b/29826.patch new file mode 100644 index 0000000..5dd709a --- /dev/null +++ b/29826.patch @@ -0,0 +1,50 @@ +From 4138f4bc0347e090431d2476610cbbcaf1397f41 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +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 /lib64, then .pc files should +be installed in /lib64/pkgconfig. Before this commit, they were +always installed in /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}" + @ONLY) + install(FILES "<%text>${output_filepath}" +- DESTINATION "lib/pkgconfig/") ++ DESTINATION "<%text>${gRPC_INSTALL_LIBDIR}/pkgconfig") + endfunction() + + # gpr .pc file + +From 07a8e936c86b3852ebd14f6fccba53fdffb07a63 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +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 diff --git a/grpc.spec b/grpc.spec index 86e2923..3405b50 100644 --- a/grpc.spec +++ b/grpc.spec @@ -307,6 +307,14 @@ Patch: %{forgeurl}/pull/29359.patch # “Segfault in client_lb_end2end_test due to absl::string_view(nullptr)” # https://github.com/grpc/grpc/issues/29567 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} @@ -757,11 +765,6 @@ sed -r -i 's/(std=c\+\+)11/\1%{cpp_std}/g' \ tools/run_tests/artifacts/artifact_targets.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 # ~~~~ C (core) and C++ (cpp) ~~~~