From 8b0dd2b1a24809c7284dad93f71051f44cd8093d8ae854e1e26e1c536892bf11 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 13 Sep 2023 10:49:19 +0000 Subject: [PATCH 1/2] Accepting request 1110833 from home:pazhukov fix `gRPCConfig.cmake` OBS-URL: https://build.opensuse.org/request/show/1110833 OBS-URL: https://build.opensuse.org/package/show/devel:tools/grpc?expand=0&rev=156 --- fix_grpconfig_cmake.patch | 32 ++++++++++++++++++++++++++++++++ grpc.spec | 1 + 2 files changed, 33 insertions(+) create mode 100644 fix_grpconfig_cmake.patch diff --git a/fix_grpconfig_cmake.patch b/fix_grpconfig_cmake.patch new file mode 100644 index 0000000..c0e335f --- /dev/null +++ b/fix_grpconfig_cmake.patch @@ -0,0 +1,32 @@ +From 117dc80eb43021dd5619023ef6d02d0d6ec7ae7a Mon Sep 17 00:00:00 2001 +From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> +Date: Wed, 7 Jun 2023 13:06:49 +0800 +Subject: [PATCH] [Build] fix `gRPCConfig.cmake` + +Without this change, calling `find_package(gRPC REQUIRED)` errors out +with + + CMake Error at /opt/homebrew/lib/cmake/grpc/gRPCConfig.cmake:8 (find_dependency): + Unknown CMake command "find_dependency". + +The issue is that `find_dependency` is provided by the +`CMakeFindDependencyMacro` module[^1], so we need to `include` it before +use. + +[^1]: https://cmake.org/cmake/help/v3.26/module/CMakeFindDependencyMacro.html +--- + cmake/protobuf.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cmake/protobuf.cmake b/cmake/protobuf.cmake +index 80181c62186c..fab2eb00e964 100644 +--- a/cmake/protobuf.cmake ++++ b/cmake/protobuf.cmake +@@ -86,6 +86,6 @@ elseif(gRPC_PROTOBUF_PROVIDER STREQUAL "package") + set(_gRPC_PROTOBUF_PROTOC_EXECUTABLE ${PROTOBUF_PROTOC_EXECUTABLE}) + endif() + endif() +- set(_gRPC_FIND_PROTOBUF "find_dependency(Protobuf CONFIG)") ++ set(_gRPC_FIND_PROTOBUF "include(CMakeFindDependencyMacro)\nfind_dependency(Protobuf CONFIG)") + endif() + endif() diff --git a/grpc.spec b/grpc.spec index 10ede0b..d38b4a1 100644 --- a/grpc.spec +++ b/grpc.spec @@ -39,6 +39,7 @@ BuildRequires: pkgconfig(openssl) >= 1.0.1 BuildRequires: pkgconfig(protobuf) >= 22 BuildRequires: pkgconfig(re2) BuildRequires: pkgconfig(zlib) +Patch0: fix_grpconfig_cmake.patch %description The reference implementation of the gRPC protocol, done on top of From 070343649e0dfd1fd79a59b067116ae66af3f84e246e770be8911fb0330e09fa Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 13 Sep 2023 11:25:58 +0000 Subject: [PATCH 2/2] replace fix_grpconfig_cmake.patch by authentic version OBS-URL: https://build.opensuse.org/package/show/devel:tools/grpc?expand=0&rev=157 --- fix_grpconfig_cmake.patch | 17 +++++++++++------ grpc.changes | 6 ++++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/fix_grpconfig_cmake.patch b/fix_grpconfig_cmake.patch index c0e335f..b073878 100644 --- a/fix_grpconfig_cmake.patch +++ b/fix_grpconfig_cmake.patch @@ -1,25 +1,27 @@ -From 117dc80eb43021dd5619023ef6d02d0d6ec7ae7a Mon Sep 17 00:00:00 2001 +From 5c9e4050c1e8c66b1b8b4e93d48b8e23ff1ea818 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> -Date: Wed, 7 Jun 2023 13:06:49 +0800 -Subject: [PATCH] [Build] fix `gRPCConfig.cmake` +Date: Wed, 6 Sep 2023 03:35:47 +0800 +Subject: [PATCH] [Build] fix `gRPCConfig.cmake` (#33361) Without this change, calling `find_package(gRPC REQUIRED)` errors out with - CMake Error at /opt/homebrew/lib/cmake/grpc/gRPCConfig.cmake:8 (find_dependency): +CMake Error at /opt/homebrew/lib/cmake/grpc/gRPCConfig.cmake:8 +(find_dependency): Unknown CMake command "find_dependency". The issue is that `find_dependency` is provided by the `CMakeFindDependencyMacro` module[^1], so we need to `include` it before use. -[^1]: https://cmake.org/cmake/help/v3.26/module/CMakeFindDependencyMacro.html +[^1]: +https://cmake.org/cmake/help/v3.26/module/CMakeFindDependencyMacro.html --- cmake/protobuf.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/protobuf.cmake b/cmake/protobuf.cmake -index 80181c62186c..fab2eb00e964 100644 +index 80181c6218..fab2eb00e9 100644 --- a/cmake/protobuf.cmake +++ b/cmake/protobuf.cmake @@ -86,6 +86,6 @@ elseif(gRPC_PROTOBUF_PROVIDER STREQUAL "package") @@ -30,3 +32,6 @@ index 80181c62186c..fab2eb00e964 100644 + set(_gRPC_FIND_PROTOBUF "include(CMakeFindDependencyMacro)\nfind_dependency(Protobuf CONFIG)") endif() endif() +-- +2.42.0 + diff --git a/grpc.changes b/grpc.changes index a8393a3..bfb8a31 100644 --- a/grpc.changes +++ b/grpc.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Sep 13 10:49:31 UTC 2023 - Jan Engelhardt + +- Add fix_grpconfig_cmake.patch to make find_package(gRPC) in + downstream using packages functional again. + ------------------------------------------------------------------- Wed Sep 6 16:02:40 UTC 2023 - Jan Engelhardt