mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [RFC 0/1] grpc
@ 2018-10-07 15:54 Clemens Gruber
  2018-10-07 15:54 ` [ptxdist] [RFC 1/1] grpc: new package Clemens Gruber
  0 siblings, 1 reply; 2+ messages in thread
From: Clemens Gruber @ 2018-10-07 15:54 UTC (permalink / raw)
  To: ptxdist; +Cc: Clemens Gruber

Hi,

I am sending the current state of my grpc package for PTXdist.

gRPC is a RPC library, using HTTP/2 and protocol buffers. See grpc.io
for more information.

Because I am not entirely happy with it, I am flagging it as RFC.

Pain points:
- I had to patch the template-generated Makefile for cross-compiling
  (separate target and host packages), see patch 3
- I had to patch version numbers in said Makefile, see patch 4

I tested it successfully with an in-house C++ application which uses
gRPC and the meson build system. I could also send another patch, adding
support for the collectd grpc plugin, for PTXdist to have a testcase
within.

When building the host package, there are several warnings about the
missing c-ares, but it just falls back to using getaddrinfo and is not
important for the host tools/plugins, in my opinion. Also, host-openssl
and host-zlib is not necessary, so the warnings can be ignored.

Would be great if some of you could test it and maybe suggest
improvements.

Thanks,
Clemens

Clemens Gruber (1):
  grpc: new package

 ...rtability-test-for-c-and-make-it-pas.patch | 41 ++++++++++
 ...vent-shell-calls-longer-than-ARG_MAX.patch | 71 ++++++++++++++++
 ...d-proto-plugins-when-cross-compiling.patch | 25 ++++++
 ...0004-Fix-libgrpc-major-version-links.patch | 72 +++++++++++++++++
 patches/grpc-1.15.1/series                    |  7 ++
 rules/grpc.in                                 | 19 +++++
 rules/grpc.make                               | 80 +++++++++++++++++++
 rules/host-grpc.in                            |  6 ++
 rules/host-grpc.make                          | 30 +++++++
 9 files changed, 351 insertions(+)
 create mode 100644 patches/grpc-1.15.1/0001-Add-a-gcc-8.1-portability-test-for-c-and-make-it-pas.patch
 create mode 100644 patches/grpc-1.15.1/0002-Prevent-shell-calls-longer-than-ARG_MAX.patch
 create mode 100644 patches/grpc-1.15.1/0003-Do-not-build-proto-plugins-when-cross-compiling.patch
 create mode 100644 patches/grpc-1.15.1/0004-Fix-libgrpc-major-version-links.patch
 create mode 100644 patches/grpc-1.15.1/series
 create mode 100644 rules/grpc.in
 create mode 100644 rules/grpc.make
 create mode 100644 rules/host-grpc.in
 create mode 100644 rules/host-grpc.make

-- 
2.19.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ptxdist] [RFC 1/1] grpc: new package
  2018-10-07 15:54 [ptxdist] [RFC 0/1] grpc Clemens Gruber
@ 2018-10-07 15:54 ` Clemens Gruber
  0 siblings, 0 replies; 2+ messages in thread
From: Clemens Gruber @ 2018-10-07 15:54 UTC (permalink / raw)
  To: ptxdist; +Cc: Clemens Gruber

gRPC is a modern, open source, high-performance remote procedure call
(RPC) framework.

Patches are necessary to fix building with GCC 8, cross-compilation in
general and problems in the template-generated Makefile.

Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
---
 ...rtability-test-for-c-and-make-it-pas.patch | 41 ++++++++++
 ...vent-shell-calls-longer-than-ARG_MAX.patch | 71 ++++++++++++++++
 ...d-proto-plugins-when-cross-compiling.patch | 25 ++++++
 ...0004-Fix-libgrpc-major-version-links.patch | 72 +++++++++++++++++
 patches/grpc-1.15.1/series                    |  7 ++
 rules/grpc.in                                 | 19 +++++
 rules/grpc.make                               | 80 +++++++++++++++++++
 rules/host-grpc.in                            |  6 ++
 rules/host-grpc.make                          | 30 +++++++
 9 files changed, 351 insertions(+)
 create mode 100644 patches/grpc-1.15.1/0001-Add-a-gcc-8.1-portability-test-for-c-and-make-it-pas.patch
 create mode 100644 patches/grpc-1.15.1/0002-Prevent-shell-calls-longer-than-ARG_MAX.patch
 create mode 100644 patches/grpc-1.15.1/0003-Do-not-build-proto-plugins-when-cross-compiling.patch
 create mode 100644 patches/grpc-1.15.1/0004-Fix-libgrpc-major-version-links.patch
 create mode 100644 patches/grpc-1.15.1/series
 create mode 100644 rules/grpc.in
 create mode 100644 rules/grpc.make
 create mode 100644 rules/host-grpc.in
 create mode 100644 rules/host-grpc.make

diff --git a/patches/grpc-1.15.1/0001-Add-a-gcc-8.1-portability-test-for-c-and-make-it-pas.patch b/patches/grpc-1.15.1/0001-Add-a-gcc-8.1-portability-test-for-c-and-make-it-pas.patch
new file mode 100644
index 000000000..a7d4b17b3
--- /dev/null
+++ b/patches/grpc-1.15.1/0001-Add-a-gcc-8.1-portability-test-for-c-and-make-it-pas.patch
@@ -0,0 +1,41 @@
+From: Alexander Polcyn <apolcyn@google.com>
+Date: Wed, 23 May 2018 18:04:20 -0700
+Subject: [PATCH] Add a gcc-8.1 portability test for c and make it pass
+
+Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
+[cg: Reduced patch to Makefile changes in order to avoid conflicts]
+---
+ Makefile | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 54823a31167d..4c0ea191eb21 100644
+--- a/Makefile
++++ b/Makefile
+@@ -348,7 +348,7 @@ HOST_LD ?= $(LD)
+ HOST_LDXX ?= $(LDXX)
+ 
+ CFLAGS += -std=c99 -Wsign-conversion -Wconversion $(W_SHADOW) $(W_EXTRA_SEMI)
+-CXXFLAGS += -std=c++11
++CXXFLAGS += -std=c++11 -Wno-class-memaccess -Wno-ignored-qualifiers -Wno-stringop-truncation -Wno-sizeof-pointer-div
+ ifeq ($(SYSTEM),Darwin)
+ CXXFLAGS += -stdlib=libc++
+ endif
+@@ -7864,7 +7864,7 @@ LIBBORINGSSL_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename
+ 
+ $(LIBBORINGSSL_OBJS): CPPFLAGS += -Ithird_party/boringssl/include -fvisibility=hidden -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN -D_HAS_EXCEPTIONS=0 -DNOMINMAX
+ $(LIBBORINGSSL_OBJS): CXXFLAGS += -fno-rtti -fno-exceptions
+-$(LIBBORINGSSL_OBJS): CFLAGS += -Wno-sign-conversion -Wno-conversion -Wno-unused-value -Wno-unknown-pragmas -Wno-implicit-function-declaration -Wno-unused-variable -Wno-sign-compare -Wno-implicit-fallthrough $(NO_W_EXTRA_SEMI)
++$(LIBBORINGSSL_OBJS): CFLAGS += -Wno-sign-conversion -Wno-conversion -Wno-unused-value -Wno-unknown-pragmas -Wno-implicit-function-declaration -Wno-unused-variable -Wno-sign-compare -Wno-implicit-fallthrough -Wno-cast-function-type $(NO_W_EXTRA_SEMI)
+ 
+ $(LIBDIR)/$(CONFIG)/libboringssl.a: $(ZLIB_DEP) $(CARES_DEP) $(ADDRESS_SORTING_DEP)  $(LIBBORINGSSL_OBJS) 
+ 	$(E) "[AR]      Creating $@"
+@@ -10059,7 +10059,7 @@ PUBLIC_HEADERS_C += \
+ LIBARES_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBARES_SRC))))
+ 
+ $(LIBARES_OBJS): CPPFLAGS += -Ithird_party/cares -Ithird_party/cares/cares -fvisibility=hidden -D_GNU_SOURCE $(if $(subst Darwin,,$(SYSTEM)),,-Ithird_party/cares/config_darwin) $(if $(subst FreeBSD,,$(SYSTEM)),,-Ithird_party/cares/config_freebsd) $(if $(subst Linux,,$(SYSTEM)),,-Ithird_party/cares/config_linux) $(if $(subst OpenBSD,,$(SYSTEM)),,-Ithird_party/cares/config_openbsd) -DWIN32_LEAN_AND_MEAN -D_HAS_EXCEPTIONS=0 -DNOMINMAX $(if $(subst MINGW32,,$(SYSTEM)),-DHAVE_CONFIG_H,)
+-$(LIBARES_OBJS): CFLAGS += -Wno-sign-conversion $(if $(subst Darwin,,$(SYSTEM)),,-Wno-shorten-64-to-32) $(if $(subst MINGW32,,$(SYSTEM)),-Wno-invalid-source-encoding,)
++$(LIBARES_OBJS): CFLAGS += -Wno-sign-conversion -Wno-sizeof-pointer-memaccess -Wno-stringop-overflow $(if $(subst Darwin,,$(SYSTEM)),,-Wno-shorten-64-to-32) $(if $(subst MINGW32,,$(SYSTEM)),-Wno-invalid-source-encoding,)
+ 
+ $(LIBDIR)/$(CONFIG)/libares.a:  $(LIBARES_OBJS) 
+ 	$(E) "[AR]      Creating $@"
diff --git a/patches/grpc-1.15.1/0002-Prevent-shell-calls-longer-than-ARG_MAX.patch b/patches/grpc-1.15.1/0002-Prevent-shell-calls-longer-than-ARG_MAX.patch
new file mode 100644
index 000000000..4dc8135fe
--- /dev/null
+++ b/patches/grpc-1.15.1/0002-Prevent-shell-calls-longer-than-ARG_MAX.patch
@@ -0,0 +1,71 @@
+From: Dario Berzano <dario.berzano@cern.ch>
+Date: Tue, 21 Aug 2018 16:42:47 +0200
+Subject: [PATCH] Prevent shell calls longer than ARG_MAX
+
+This patch we breaks the relevant paths array into multiple shorter arrays in
+order to make the shell calls succeed.
+
+Credits: @vikasvashisht
+
+Fixes grpc/grpc#14844
+---
+ Makefile | 18 ++++++++++++++++--
+ 1 file changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 4c0ea191eb21..4bc4b9bb584b 100644
+--- a/Makefile
++++ b/Makefile
+@@ -2946,8 +2946,14 @@ install-headers_c:
+ 
+ install-headers_cxx:
+ 	$(E) "[INSTALL] Installing public C++ headers"
+-	$(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1
+-	$(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1
++	$(Q) $(foreach h, $(PUBLIC_HEADERS_CXX1), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1
++	$(Q) $(foreach h, $(PUBLIC_HEADERS_CXX1), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1
++	$(Q) $(foreach h, $(PUBLIC_HEADERS_CXX2), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1
++	$(Q) $(foreach h, $(PUBLIC_HEADERS_CXX2), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1
++	$(Q) $(foreach h, $(PUBLIC_HEADERS_CXX3), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1
++	$(Q) $(foreach h, $(PUBLIC_HEADERS_CXX3), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1
++	$(Q) $(foreach h, $(PUBLIC_HEADERS_CXX4), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1
++	$(Q) $(foreach h, $(PUBLIC_HEADERS_CXX4), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1
+ 
+ install-static: install-static_c install-static_cxx
+ 
+@@ -5278,6 +5284,8 @@ PUBLIC_HEADERS_CXX += \
+     include/grpc++/support/stub_options.h \
+     include/grpc++/support/sync_stream.h \
+     include/grpc++/support/time.h \
++
++PUBLIC_HEADERS_CXX1 += \
+     include/grpcpp/alarm.h \
+     include/grpcpp/channel.h \
+     include/grpcpp/client_context.h \
+@@ -5325,6 +5333,8 @@ PUBLIC_HEADERS_CXX += \
+     include/grpcpp/support/stub_options.h \
+     include/grpcpp/support/sync_stream.h \
+     include/grpcpp/support/time.h \
++
++PUBLIC_HEADERS_CXX2 += \
+     include/grpc/support/alloc.h \
+     include/grpc/support/atm.h \
+     include/grpc/support/atm_gcc_atomic.h \
+@@ -5376,6 +5386,8 @@ PUBLIC_HEADERS_CXX += \
+     include/grpc/impl/codegen/propagation_bits.h \
+     include/grpc/impl/codegen/slice.h \
+     include/grpc/impl/codegen/status.h \
++
++PUBLIC_HEADERS_CXX3 += \
+     include/grpc++/impl/codegen/async_stream.h \
+     include/grpc++/impl/codegen/async_unary_call.h \
+     include/grpc++/impl/codegen/byte_buffer.h \
+@@ -5406,6 +5418,8 @@ PUBLIC_HEADERS_CXX += \
+     include/grpc++/impl/codegen/stub_options.h \
+     include/grpc++/impl/codegen/sync_stream.h \
+     include/grpc++/impl/codegen/time.h \
++
++PUBLIC_HEADERS_CXX4 += \
+     include/grpcpp/impl/codegen/async_generic_service.h \
+     include/grpcpp/impl/codegen/async_stream.h \
+     include/grpcpp/impl/codegen/async_unary_call.h \
diff --git a/patches/grpc-1.15.1/0003-Do-not-build-proto-plugins-when-cross-compiling.patch b/patches/grpc-1.15.1/0003-Do-not-build-proto-plugins-when-cross-compiling.patch
new file mode 100644
index 000000000..a4dd8a20a
--- /dev/null
+++ b/patches/grpc-1.15.1/0003-Do-not-build-proto-plugins-when-cross-compiling.patch
@@ -0,0 +1,25 @@
+From: Clemens Gruber <clemens.gruber@pqgruber.com>
+Date: Sun, 30 Sep 2018 16:58:19 +0200
+Subject: [PATCH] Do not build proto plugins when cross-compiling
+
+This is necessary for splitting it up in a host-grpc and a grpc package.
+---
+ Makefile | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index 4bc4b9bb584b..d7fdb8f165c5 100644
+--- a/Makefile
++++ b/Makefile
+@@ -818,7 +818,11 @@ endif
+ else
+ PC_LIBS_GRPCXX = -lprotobuf
+ endif
++ifeq ($(GRPC_CROSS_COMPILE),true)
++PROTOC_PLUGINS =
++else
+ PROTOC_PLUGINS = $(PROTOC_PLUGINS_ALL)
++endif
+ else
+ ifeq ($(HAS_EMBEDDED_PROTOBUF),true)
+ PROTOBUF_DEP = $(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a
diff --git a/patches/grpc-1.15.1/0004-Fix-libgrpc-major-version-links.patch b/patches/grpc-1.15.1/0004-Fix-libgrpc-major-version-links.patch
new file mode 100644
index 000000000..711b95739
--- /dev/null
+++ b/patches/grpc-1.15.1/0004-Fix-libgrpc-major-version-links.patch
@@ -0,0 +1,72 @@
+From: Clemens Gruber <clemens.gruber@pqgruber.com>
+Date: Sun, 30 Sep 2018 18:45:30 +0200
+Subject: [PATCH] Fix libgrpc++ major version links
+
+Makefile.template seems to be broken and always uses
+settings.core_version.major in install_shared().
+(Instead of settings.cpp_version.major when install_shared("c++") is
+called)
+
+Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
+---
+ Makefile | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index d7fdb8f165c5..f1b18cea4a16 100644
+--- a/Makefile
++++ b/Makefile
+@@ -3060,7 +3060,7 @@ install-shared_cxx: shared_cxx strip-shared_cxx install-shared_c install-pkg-con
+ ifeq ($(SYSTEM),MINGW32)
+ 	$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++.a
+ else ifneq ($(SYSTEM),Darwin)
+-	$(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++.so.6
++	$(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++.so.1
+ 	$(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++.so
+ endif
+ 	$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
+@@ -3069,7 +3069,7 @@ endif
+ ifeq ($(SYSTEM),MINGW32)
+ 	$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_cronet$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_cronet.a
+ else ifneq ($(SYSTEM),Darwin)
+-	$(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_cronet.so.6
++	$(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_cronet.so.1
+ 	$(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_cronet.so
+ endif
+ 	$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
+@@ -3078,7 +3078,7 @@ endif
+ ifeq ($(SYSTEM),MINGW32)
+ 	$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_error_details$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_error_details.a
+ else ifneq ($(SYSTEM),Darwin)
+-	$(Q) ln -sf $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_error_details.so.6
++	$(Q) ln -sf $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_error_details.so.1
+ 	$(Q) ln -sf $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_error_details.so
+ endif
+ 	$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
+@@ -3087,7 +3087,7 @@ endif
+ ifeq ($(SYSTEM),MINGW32)
+ 	$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_reflection.a
+ else ifneq ($(SYSTEM),Darwin)
+-	$(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_reflection.so.6
++	$(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_reflection.so.1
+ 	$(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_reflection.so
+ endif
+ 	$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
+@@ -3096,7 +3096,7 @@ endif
+ ifeq ($(SYSTEM),MINGW32)
+ 	$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_unsecure.a
+ else ifneq ($(SYSTEM),Darwin)
+-	$(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_unsecure.so.6
++	$(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_unsecure.so.1
+ 	$(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_unsecure.so
+ endif
+ 	$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpcpp_channelz$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
+@@ -3105,7 +3105,7 @@ endif
+ ifeq ($(SYSTEM),MINGW32)
+ 	$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpcpp_channelz$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpcpp_channelz.a
+ else ifneq ($(SYSTEM),Darwin)
+-	$(Q) ln -sf $(SHARED_PREFIX)grpcpp_channelz$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpcpp_channelz.so.6
++	$(Q) ln -sf $(SHARED_PREFIX)grpcpp_channelz$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpcpp_channelz.so.1
+ 	$(Q) ln -sf $(SHARED_PREFIX)grpcpp_channelz$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpcpp_channelz.so
+ endif
+ ifneq ($(SYSTEM),MINGW32)
diff --git a/patches/grpc-1.15.1/series b/patches/grpc-1.15.1/series
new file mode 100644
index 000000000..09ca65f92
--- /dev/null
+++ b/patches/grpc-1.15.1/series
@@ -0,0 +1,7 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-Add-a-gcc-8.1-portability-test-for-c-and-make-it-pas.patch
+0002-Prevent-shell-calls-longer-than-ARG_MAX.patch
+0003-Do-not-build-proto-plugins-when-cross-compiling.patch
+0004-Fix-libgrpc-major-version-links.patch
+# 287c32c25f39de2aa71f3e5d0b3a2f61  - git-ptx-patches magic
diff --git a/rules/grpc.in b/rules/grpc.in
new file mode 100644
index 000000000..184bb13bd
--- /dev/null
+++ b/rules/grpc.in
@@ -0,0 +1,19 @@
+## SECTION=system_libraries
+
+config GRPC
+	tristate
+	select HOST_GRPC
+	select GCCLIBS_CXX
+	select GCCLIBS_GCC_S
+	select LIBC_DL
+	select LIBC_M
+	select LIBC_PTHREAD
+	select LIBC_RT
+	select C_ARES
+	select OPENSSL
+	select PROTOBUF
+	select ZLIB
+	prompt "grpc                          "
+	help
+	  gRPC is a modern, open source, high-performance remote procedure
+	  call (RPC) framework.
diff --git a/rules/grpc.make b/rules/grpc.make
new file mode 100644
index 000000000..2e88629c9
--- /dev/null
+++ b/rules/grpc.make
@@ -0,0 +1,80 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2018 by Clemens Gruber <clemens.gruber@pqgruber.com>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_GRPC) += grpc
+
+#
+# Paths and names
+#
+GRPC_VERSION	:= 1.15.1
+GRPC_MD5	:= 135f62364f13d598634ad3e0c686f11f
+GRPC		:= grpc-$(GRPC_VERSION)
+GRPC_SUFFIX	:= tar.gz
+GRPC_URL	:= https://github.com/grpc/grpc/archive/v$(GRPC_VERSION).$(GRPC_SUFFIX)
+GRPC_SOURCE	:= $(SRCDIR)/$(GRPC).$(GRPC_SUFFIX)
+GRPC_DIR	:= $(BUILDDIR)/$(GRPC)
+GRPC_LICENSE	:= BSD-3-Clause
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+GRPC_CONF_TOOL	:= NO
+
+GRPC_MAKE_OPT	:= \
+	prefix=$(GRPC_PKGDIR)/usr \
+	PKG_CONFIG=$(CROSS_PKG_CONFIG) \
+	AR=$(CROSS_AR) \
+	AROPTS='rcs' \
+	CC=$(CROSS_CC) \
+	CXX=$(CROSS_CXX) \
+	LD=$(CROSS_CC) \
+	LDXX=$(CROSS_CXX) \
+	GRPC_CROSS_COMPILE=true \
+	HAS_SYSTEM_PROTOBUF=true \
+	PROTOC=$(PTXDIST_SYSROOT_HOST)/bin/protoc \
+	PROTOC_PLUGINS_DIR=$(PTXDIST_SYSROOT_HOST)/bin \
+	shared
+
+GRPC_INSTALL_OPT:= \
+	$(GRPC_MAKE_OPT) \
+	install-headers_c \
+	install-headers_cxx \
+	install-pkg-config_c \
+	install-pkg-config_cxx \
+	install-shared_c \
+	install-shared_cxx
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/grpc.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, grpc)
+	@$(call install_fixup, grpc,PRIORITY,optional)
+	@$(call install_fixup, grpc,SECTION,base)
+	@$(call install_fixup, grpc,AUTHOR,"Clemens Gruber <clemens.gruber@pqgruber.com")
+	@$(call install_fixup, grpc,DESCRIPTION,missing)
+
+	@$(call install_lib, grpc, 0, 0, 0644, libaddress_sorting)
+	@$(call install_lib, grpc, 0, 0, 0644, libgpr)
+	@$(call install_lib, grpc, 0, 0, 0644, libgrpc)
+	@$(call install_lib, grpc, 0, 0, 0644, libgrpc++)
+
+	@$(call install_finish, grpc)
+
+	@$(call touch)
+
+# vim: syntax=make
diff --git a/rules/host-grpc.in b/rules/host-grpc.in
new file mode 100644
index 000000000..d1f9832ed
--- /dev/null
+++ b/rules/host-grpc.in
@@ -0,0 +1,6 @@
+## SECTION=hosttools_noprompt
+
+config HOST_GRPC
+	tristate
+	default ALLYES
+	select HOST_PROTOBUF
diff --git a/rules/host-grpc.make b/rules/host-grpc.make
new file mode 100644
index 000000000..b00a738d6
--- /dev/null
+++ b/rules/host-grpc.make
@@ -0,0 +1,30 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2018 by Clemens Gruber <clemens.gruber@pqgruber.com>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+HOST_PACKAGES-$(PTXCONF_HOST_GRPC) += host-grpc
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+HOST_GRPC_CONF_TOOL	:= NO
+
+HOST_GRPC_MAKE_OPT	:= \
+	prefix=$(HOST_GRPC_PKGDIR)/usr \
+	plugins
+
+HOST_GRPC_INSTALL_OPT	:= \
+	prefix=$(HOST_GRPC_PKGDIR) \
+	install-plugins
+
+# vim: syntax=make
-- 
2.19.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-07 15:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-07 15:54 [ptxdist] [RFC 0/1] grpc Clemens Gruber
2018-10-07 15:54 ` [ptxdist] [RFC 1/1] grpc: new package Clemens Gruber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox