From b3bb2c60a85555e895975b82fe70f78033459ea1 Mon Sep 17 00:00:00 2001 From: Mathieu Bridon Date: Mon, 17 Dec 2018 11:46:12 +0100 Subject: [PATCH] Only build the Ruby plugin on Fedora >= 30 Fedora < 30 have protobuf 3.5, which doesn't have the required parts to build the Ruby plugin. We can't update protobuf there, because upstream bumped the soname which goes contrary to the Fedora update policy. As a result, if we want Fedora 28 and 29 to have gRPC, we have to disable its Ruby plugin. Upstream doesn't seem to have an easy way to just not build it, so this commit introduces a patch to remove it from the Makefile. This should be okay, since it's only temporary anyway: Fedora 30 (and future releases) already have a recent enough protobuf so this won't be necessary any more. --- 0001-Do-not-build-the-Ruby-plugin.patch | 43 +++++++++++++++++++++++++ grpc.spec | 4 +++ 2 files changed, 47 insertions(+) create mode 100644 0001-Do-not-build-the-Ruby-plugin.patch diff --git a/0001-Do-not-build-the-Ruby-plugin.patch b/0001-Do-not-build-the-Ruby-plugin.patch new file mode 100644 index 0000000..399816d --- /dev/null +++ b/0001-Do-not-build-the-Ruby-plugin.patch @@ -0,0 +1,43 @@ +From ad0cae3d6eb5a47e8ec0a52b78013e658aa1720b Mon Sep 17 00:00:00 2001 +From: Mathieu Bridon +Date: Mon, 17 Dec 2018 11:41:34 +0100 +Subject: [PATCH] Do not build the Ruby plugin + +Unfortunately, this can't build without protobuf 3.6, so we must disable +it for Fedora 28 and 29 which only have protobuf 3.5. +--- + Makefile | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/Makefile b/Makefile +index 066c191..09ad70a 100644 +--- a/Makefile ++++ b/Makefile +@@ -802,7 +802,7 @@ PC_LIBS_GRPCXX = + + CPPFLAGS := -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googlemock/include $(CPPFLAGS) + +-PROTOC_PLUGINS_ALL = $(BINDIR)/$(CONFIG)/grpc_cpp_plugin $(BINDIR)/$(CONFIG)/grpc_csharp_plugin $(BINDIR)/$(CONFIG)/grpc_node_plugin $(BINDIR)/$(CONFIG)/grpc_objective_c_plugin $(BINDIR)/$(CONFIG)/grpc_php_plugin $(BINDIR)/$(CONFIG)/grpc_python_plugin $(BINDIR)/$(CONFIG)/grpc_ruby_plugin ++PROTOC_PLUGINS_ALL = $(BINDIR)/$(CONFIG)/grpc_cpp_plugin $(BINDIR)/$(CONFIG)/grpc_csharp_plugin $(BINDIR)/$(CONFIG)/grpc_node_plugin $(BINDIR)/$(CONFIG)/grpc_objective_c_plugin $(BINDIR)/$(CONFIG)/grpc_php_plugin $(BINDIR)/$(CONFIG)/grpc_python_plugin + PROTOC_PLUGINS_DIR = $(BINDIR)/$(CONFIG) + + ifeq ($(HAS_SYSTEM_PROTOBUF),true) +@@ -3151,7 +3151,6 @@ install-plugins: $(PROTOC_PLUGINS) + $(Q) $(INSTALL) -d $(prefix)/bin + $(Q) $(INSTALL) $(BINDIR)/$(CONFIG)/grpc_python_plugin $(prefix)/bin/grpc_python_plugin + $(Q) $(INSTALL) -d $(prefix)/bin +- $(Q) $(INSTALL) $(BINDIR)/$(CONFIG)/grpc_ruby_plugin $(prefix)/bin/grpc_ruby_plugin + + install-grpc-cli: grpc_cli + $(E) "[INSTALL] Installing grpc cli" +@@ -7162,7 +7161,6 @@ LIBGRPC_PLUGIN_SUPPORT_SRC = \ + src/compiler/objective_c_generator.cc \ + src/compiler/php_generator.cc \ + src/compiler/python_generator.cc \ +- src/compiler/ruby_generator.cc \ + + PUBLIC_HEADERS_CXX += \ + include/grpc++/impl/codegen/config_protobuf.h \ +-- +2.17.2 + diff --git a/grpc.spec b/grpc.spec index d683e9b..e975a4d 100644 --- a/grpc.spec +++ b/grpc.spec @@ -25,6 +25,10 @@ Patch0: 0001-enforce-system-crypto-policies.patch # https://github.com/grpc/grpc/pull/15532 Patch1: 0002-patch-from-15532.patch +%if 0%{?fedora} < 30 +Patch2: 0001-Do-not-build-the-Ruby-plugin.patch +%endif + %description gRPC is a modern open source high performance RPC framework that can run in any environment. It can efficiently connect services in and across data centers