diff options
author | Martin Jansa <martin.jansa@gmail.com> | 2020-03-03 17:25:08 +0100 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2020-03-03 09:23:08 -0800 |
commit | 5abf5531c29b39386f3f83c4086005249f9d391e (patch) | |
tree | 2345549ec65656d56e7007c83eef820a7300d7f5 /meta-oe/recipes-devtools/grpc | |
parent | 61b4943ee787aedb3ceb9ad379f3de5e1e0da33b (diff) | |
download | meta-openembedded-5abf5531c29b39386f3f83c4086005249f9d391e.tar.gz |
grpc: move from meta-networking to meta-oe
* because sysdig from meta-oe depends on it now, since:
commit ed798c764319d83ad9eb1b963bfc99b1fa1a791a
Author: Khem Raj <raj.khem@gmail.com>
Date: Wed Jan 2 17:59:20 2019 -0800
sysdig: Upgrade to 0.26.5
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-devtools/grpc')
3 files changed, 289 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/grpc/grpc/0001-CMakeLists.txt-Fix-grpc_cpp_plugin-path-during-cross.patch b/meta-oe/recipes-devtools/grpc/grpc/0001-CMakeLists.txt-Fix-grpc_cpp_plugin-path-during-cross.patch new file mode 100644 index 000000000..6cad53396 --- /dev/null +++ b/meta-oe/recipes-devtools/grpc/grpc/0001-CMakeLists.txt-Fix-grpc_cpp_plugin-path-during-cross.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | From 6d606f1101c1a172fb6d738d6f1865aa61849e68 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alexey Firago <alexey_firago@mentor.com> | ||
3 | Date: Fri, 20 Oct 2017 00:04:19 +0300 | ||
4 | Subject: [PATCH] CMakeLists.txt: Fix grpc_cpp_plugin path during cross-compiling or native build | ||
5 | |||
6 | Signed-off-by: Alexey Firago <alexey_firago@mentor.com> | ||
7 | Signed-off-by: Hiram Lew <lew@avast.com> | ||
8 | Signed-off-by: Jan Kaisrlik <jan.kaisrlik@avast.com> | ||
9 | --- | ||
10 | CMakeLists.txt | 9 ++++++++- | ||
11 | templates/CMakeLists.txt.template | 9 ++++++++- | ||
12 | 2 files changed, 16 insertions(+), 2 deletions(-) | ||
13 | |||
14 | --- a/CMakeLists.txt | ||
15 | +++ b/CMakeLists.txt | ||
16 | @@ -193,6 +193,13 @@ function(protobuf_generate_grpc_cpp) | ||
17 | return() | ||
18 | endif() | ||
19 | |||
20 | + #if cross-compiling or nativesdk, find host plugin | ||
21 | + if(CMAKE_CROSSCOMPILING) | ||
22 | + find_program(gRPC_CPP_PLUGIN grpc_cpp_plugin) | ||
23 | + else() | ||
24 | + set(gRPC_CPP_PLUGIN $<TARGET_FILE:grpc_cpp_plugin>) | ||
25 | + endif() | ||
26 | + | ||
27 | set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR}) | ||
28 | foreach(FIL ${ARGN}) | ||
29 | get_filename_component(ABS_FIL ${FIL} ABSOLUTE) | ||
30 | --- a/templates/CMakeLists.txt.template | ||
31 | +++ b/templates/CMakeLists.txt.template | ||
32 | @@ -233,6 +233,13 @@ | ||
33 | return() | ||
34 | endif() | ||
35 | |||
36 | + #if cross-compiling or nativesdk, find host plugin | ||
37 | + if(CMAKE_CROSSCOMPILING) | ||
38 | + find_program(gRPC_CPP_PLUGIN grpc_cpp_plugin) | ||
39 | + else() | ||
40 | + set(gRPC_CPP_PLUGIN $<TARGET_FILE:grpc_cpp_plugin>) | ||
41 | + endif() | ||
42 | + | ||
43 | set(_protobuf_include_path -I . -I <%text>${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR}</%text>) | ||
44 | foreach(FIL <%text>${ARGN}</%text>) | ||
45 | get_filename_component(ABS_FIL <%text>${FIL}</%text> ABSOLUTE) | ||
diff --git a/meta-oe/recipes-devtools/grpc/grpc/0001-CMakeLists.txt-Fix-libraries-installation-for-Linux.patch b/meta-oe/recipes-devtools/grpc/grpc/0001-CMakeLists.txt-Fix-libraries-installation-for-Linux.patch new file mode 100644 index 000000000..e517355d3 --- /dev/null +++ b/meta-oe/recipes-devtools/grpc/grpc/0001-CMakeLists.txt-Fix-libraries-installation-for-Linux.patch | |||
@@ -0,0 +1,177 @@ | |||
1 | From 2279e30be5796e9b185545543ea54fe68633cbdd Mon Sep 17 00:00:00 2001 | ||
2 | From: Alexey Firago <alexey_firago@mentor.com> | ||
3 | Date: Mon, 30 Oct 2017 23:24:49 +0300 | ||
4 | Subject: [PATCH] CMakeLists.txt: Fix libraries installation for Linux | ||
5 | |||
6 | * Set libs versions as in Makefile | ||
7 | |||
8 | Signed-off-by: Alexey Firago <alexey_firago@mentor.com> | ||
9 | |||
10 | --- | ||
11 | CMakeLists.txt | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
12 | 1 file changed, 59 insertions(+) | ||
13 | |||
14 | --- a/CMakeLists.txt | ||
15 | +++ b/CMakeLists.txt | ||
16 | @@ -30,6 +30,15 @@ set(PACKAGE_TARNAME "${PACKAGE_NAME}-$ | ||
17 | set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/") | ||
18 | project(${PACKAGE_NAME} C CXX) | ||
19 | |||
20 | +set (CORE_VERSION_MAJOR "6") | ||
21 | +set (CORE_VERSION "6.0.0") | ||
22 | + | ||
23 | +set (CPP_VERSION_MAJOR "1") | ||
24 | +set (CPP_VERSION "${PACKAGE_VERSION}") | ||
25 | + | ||
26 | +set (CSHARP_VERSION_MAJOR "1") | ||
27 | +set (CSHARP_VERSION "${PACKAGE_VERSION}") | ||
28 | + | ||
29 | set(gRPC_INSTALL_BINDIR "bin" CACHE STRING "Installation directory for executables") | ||
30 | set(gRPC_INSTALL_LIBDIR "lib" CACHE STRING "Installation directory for libraries") | ||
31 | set(gRPC_INSTALL_INCLUDEDIR "include" CACHE STRING "Installation directory for headers") | ||
32 | @@ -777,6 +786,10 @@ if(WIN32 AND MSVC) | ||
33 | endif() | ||
34 | endif() | ||
35 | |||
36 | +if(_gRPC_PLATFORM_LINUX) | ||
37 | + set_property(TARGET address_sorting PROPERTY VERSION ${CORE_VERSION}) | ||
38 | + set_property(TARGET address_sorting PROPERTY SOVERSION ${CORE_VERSION_MAJOR}) | ||
39 | +endif() | ||
40 | |||
41 | target_include_directories(address_sorting | ||
42 | PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
43 | @@ -903,6 +916,10 @@ if(WIN32 AND MSVC) | ||
44 | endif() | ||
45 | endif() | ||
46 | |||
47 | +if(_gRPC_PLATFORM_LINUX) | ||
48 | + set_property(TARGET gpr PROPERTY VERSION ${CORE_VERSION}) | ||
49 | + set_property(TARGET gpr PROPERTY SOVERSION ${CORE_VERSION_MAJOR}) | ||
50 | +endif() | ||
51 | |||
52 | target_include_directories(gpr | ||
53 | PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
54 | @@ -1367,6 +1384,10 @@ if(WIN32 AND MSVC) | ||
55 | endif() | ||
56 | endif() | ||
57 | |||
58 | +if(_gRPC_PLATFORM_LINUX) | ||
59 | + set_property(TARGET grpc PROPERTY VERSION ${CORE_VERSION}) | ||
60 | + set_property(TARGET grpc PROPERTY SOVERSION ${CORE_VERSION_MAJOR}) | ||
61 | +endif() | ||
62 | |||
63 | target_include_directories(grpc | ||
64 | PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
65 | @@ -1782,6 +1803,10 @@ if(WIN32 AND MSVC) | ||
66 | endif() | ||
67 | endif() | ||
68 | |||
69 | +if(_gRPC_PLATFORM_LINUX) | ||
70 | + set_property(TARGET grpc_cronet PROPERTY VERSION ${CORE_VERSION}) | ||
71 | + set_property(TARGET grpc_cronet PROPERTY SOVERSION ${CORE_VERSION_MAJOR}) | ||
72 | +endif() | ||
73 | |||
74 | target_include_directories(grpc_cronet | ||
75 | PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
76 | @@ -2869,6 +2894,10 @@ if(WIN32 AND MSVC) | ||
77 | endif() | ||
78 | endif() | ||
79 | |||
80 | +if(_gRPC_PLATFORM_LINUX) | ||
81 | + set_property(TARGET grpc_unsecure PROPERTY VERSION ${CORE_VERSION}) | ||
82 | + set_property(TARGET grpc_unsecure PROPERTY SOVERSION ${CORE_VERSION_MAJOR}) | ||
83 | +endif() | ||
84 | |||
85 | target_include_directories(grpc_unsecure | ||
86 | PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
87 | @@ -3206,6 +3235,10 @@ if(WIN32 AND MSVC) | ||
88 | endif() | ||
89 | endif() | ||
90 | |||
91 | +if(_gRPC_PLATFORM_LINUX) | ||
92 | + set_property(TARGET grpc++ PROPERTY VERSION ${CPP_VERSION}) | ||
93 | + set_property(TARGET grpc++ PROPERTY SOVERSION ${CPP_VERSION_MAJOR}) | ||
94 | +endif() | ||
95 | |||
96 | target_include_directories(grpc++ | ||
97 | PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
98 | @@ -3589,6 +3622,11 @@ protobuf_generate_grpc_cpp( | ||
99 | src/proto/grpc/status/status.proto | ||
100 | ) | ||
101 | |||
102 | +if(_gRPC_PLATFORM_LINUX) | ||
103 | + set_property(TARGET grpc++_error_details PROPERTY VERSION ${CPP_VERSION}) | ||
104 | + set_property(TARGET grpc++_error_details PROPERTY SOVERSION ${CPP_VERSION_MAJOR}) | ||
105 | +endif() | ||
106 | + | ||
107 | target_include_directories(grpc++_error_details | ||
108 | PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
109 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} | ||
110 | @@ -3727,6 +3765,11 @@ protobuf_generate_grpc_cpp( | ||
111 | src/proto/grpc/reflection/v1alpha/reflection.proto | ||
112 | ) | ||
113 | |||
114 | +if(_gRPC_PLATFORM_LINUX) | ||
115 | + set_property(TARGET grpc++_reflection PROPERTY VERSION ${CPP_VERSION}) | ||
116 | + set_property(TARGET grpc++_reflection PROPERTY SOVERSION ${CPP_VERSION_MAJOR}) | ||
117 | +endif() | ||
118 | + | ||
119 | target_include_directories(grpc++_reflection | ||
120 | PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
121 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} | ||
122 | @@ -3816,6 +3859,10 @@ target_link_libraries(grpc++_test_config | ||
123 | ${_gRPC_GFLAGS_LIBRARIES} | ||
124 | ) | ||
125 | |||
126 | +if(_gRPC_PLATFORM_LINUX) | ||
127 | + set_property(TARGET grpc++_cronet PROPERTY VERSION ${CPP_VERSION}) | ||
128 | + set_property(TARGET grpc++_cronet PROPERTY SOVERSION ${CPP_VERSION_MAJOR}) | ||
129 | +endif() | ||
130 | |||
131 | endif (gRPC_BUILD_TESTS) | ||
132 | if (gRPC_BUILD_TESTS) | ||
133 | @@ -4307,6 +4354,10 @@ if(WIN32 AND MSVC) | ||
134 | endif() | ||
135 | endif() | ||
136 | |||
137 | +if(_gRPC_PLATFORM_LINUX) | ||
138 | + set_property(TARGET grpc++_unsecure PROPERTY VERSION ${CPP_VERSION}) | ||
139 | + set_property(TARGET grpc++_unsecure PROPERTY SOVERSION ${CPP_VERSION_MAJOR}) | ||
140 | +endif() | ||
141 | |||
142 | target_include_directories(grpc++_unsecure | ||
143 | PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
144 | @@ -4745,6 +4796,10 @@ if(WIN32 AND MSVC) | ||
145 | endif() | ||
146 | endif() | ||
147 | |||
148 | +if(_gRPC_PLATFORM_LINUX) | ||
149 | + set_property(TARGET grpc_plugin_support PROPERTY VERSION ${CORE_VERSION}) | ||
150 | + set_property(TARGET grpc_plugin_support PROPERTY SOVERSION ${CORE_VERSION_MAJOR}) | ||
151 | +endif() | ||
152 | |||
153 | target_include_directories(grpc_plugin_support | ||
154 | PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
155 | @@ -4813,6 +4868,11 @@ protobuf_generate_grpc_cpp( | ||
156 | src/proto/grpc/channelz/channelz.proto | ||
157 | ) | ||
158 | |||
159 | +if(_gRPC_PLATFORM_LINUX) | ||
160 | + set_property(TARGET grpcpp_channelz PROPERTY VERSION ${CPP_VERSION}) | ||
161 | + set_property(TARGET grpcpp_channelz PROPERTY SOVERSION ${CPP_VERSION_MAJOR}) | ||
162 | +endif() | ||
163 | + | ||
164 | target_include_directories(grpcpp_channelz | ||
165 | PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
166 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} | ||
167 | @@ -5367,6 +5427,10 @@ if(WIN32 AND MSVC) | ||
168 | endif() | ||
169 | endif() | ||
170 | |||
171 | +if(_gRPC_PLATFORM_LINUX) | ||
172 | + set_property(TARGET grpc_csharp_ext PROPERTY VERSION ${CSHARP_VERSION}) | ||
173 | + set_property(TARGET grpc_csharp_ext PROPERTY SOVERSION ${CSHARP_VERSION_MAJOR}) | ||
174 | +endif() | ||
175 | |||
176 | target_include_directories(grpc_csharp_ext | ||
177 | PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
diff --git a/meta-oe/recipes-devtools/grpc/grpc_1.24.3.bb b/meta-oe/recipes-devtools/grpc/grpc_1.24.3.bb new file mode 100644 index 000000000..752562eb3 --- /dev/null +++ b/meta-oe/recipes-devtools/grpc/grpc_1.24.3.bb | |||
@@ -0,0 +1,67 @@ | |||
1 | DESCRIPTION = "A high performance, open source, general-purpose RPC framework. \ | ||
2 | Provides gRPC libraries for multiple languages written on top of shared C core library \ | ||
3 | (C++, Node.js, Python, Ruby, Objective-C, PHP, C#)" | ||
4 | HOMEPAGE = "https://github.com/grpc/grpc" | ||
5 | SECTION = "libs" | ||
6 | LICENSE = "Apache-2" | ||
7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" | ||
8 | |||
9 | DEPENDS = "gflags c-ares protobuf protobuf-native protobuf-c protobuf-c-native openssl libnsl2" | ||
10 | DEPENDS_append_class-target = " googletest grpc-native " | ||
11 | DEPENDS_append_class-nativesdk = " grpc-native " | ||
12 | |||
13 | S = "${WORKDIR}/git" | ||
14 | SRCREV_grpc = "2de2e8dd8921e1f7d043e01faf7fe8a291fbb072" | ||
15 | SRCREV_upb = "9effcbcb27f0a665f9f345030188c0b291e32482" | ||
16 | BRANCH = "v1.24.x" | ||
17 | SRC_URI = "git://github.com/grpc/grpc.git;protocol=https;name=grpc;branch=${BRANCH} \ | ||
18 | git://github.com/protocolbuffers/upb;name=upb;destsuffix=git/third_party/upb \ | ||
19 | file://0001-CMakeLists.txt-Fix-libraries-installation-for-Linux.patch \ | ||
20 | " | ||
21 | SRC_URI_append_class-target = " file://0001-CMakeLists.txt-Fix-grpc_cpp_plugin-path-during-cross.patch \ | ||
22 | " | ||
23 | SRC_URI_append_class-nativesdk = " file://0001-CMakeLists.txt-Fix-grpc_cpp_plugin-path-during-cross.patch" | ||
24 | |||
25 | # Fixes build with older compilers 4.8 especially on ubuntu 14.04 | ||
26 | CXXFLAGS_append_class-native = " -Wl,--no-as-needed" | ||
27 | |||
28 | inherit cmake pkgconfig | ||
29 | |||
30 | EXTRA_OECMAKE = " \ | ||
31 | -DgRPC_CARES_PROVIDER=package \ | ||
32 | -DgRPC_ZLIB_PROVIDER=package \ | ||
33 | -DgRPC_SSL_PROVIDER=package \ | ||
34 | -DgRPC_PROTOBUF_PROVIDER=package \ | ||
35 | -DgRPC_GFLAGS_PROVIDER=package \ | ||
36 | -DgRPC_INSTALL=ON \ | ||
37 | -DCMAKE_CROSSCOMPILING=ON \ | ||
38 | -DBUILD_SHARED_LIBS=ON \ | ||
39 | -DgRPC_INSTALL_LIBDIR=${baselib} \ | ||
40 | -DgRPC_INSTALL_CMAKEDIR=${baselib}/cmake/${BPN} \ | ||
41 | " | ||
42 | |||
43 | do_configure_prepend_mipsarch() { | ||
44 | sed -i -e "s/set(_gRPC_ALLTARGETS_LIBRARIES \${CMAKE_DL_LIBS} rt m pthread)/set(_gRPC_ALLTARGETS_LIBRARIES \${CMAKE_DL_LIBS} atomic rt m pthread)/g" ${S}/CMakeLists.txt | ||
45 | } | ||
46 | |||
47 | do_configure_prepend_powerpc() { | ||
48 | sed -i -e "s/set(_gRPC_ALLTARGETS_LIBRARIES \${CMAKE_DL_LIBS} rt m pthread)/set(_gRPC_ALLTARGETS_LIBRARIES \${CMAKE_DL_LIBS} atomic rt m pthread)/g" ${S}/CMakeLists.txt | ||
49 | } | ||
50 | |||
51 | do_configure_prepend_riscv64() { | ||
52 | sed -i -e "s/set(_gRPC_ALLTARGETS_LIBRARIES \${CMAKE_DL_LIBS} rt m pthread)/set(_gRPC_ALLTARGETS_LIBRARIES \${CMAKE_DL_LIBS} atomic rt m pthread)/g" ${S}/CMakeLists.txt | ||
53 | } | ||
54 | |||
55 | do_configure_prepend_riscv32() { | ||
56 | sed -i -e "s/set(_gRPC_ALLTARGETS_LIBRARIES \${CMAKE_DL_LIBS} rt m pthread)/set(_gRPC_ALLTARGETS_LIBRARIES \${CMAKE_DL_LIBS} atomic rt m pthread)/g" ${S}/CMakeLists.txt | ||
57 | } | ||
58 | |||
59 | do_configure_prepend_toolchain-clang_x86() { | ||
60 | sed -i -e "s/set(_gRPC_ALLTARGETS_LIBRARIES \${CMAKE_DL_LIBS} rt m pthread)/set(_gRPC_ALLTARGETS_LIBRARIES \${CMAKE_DL_LIBS} atomic rt m pthread)/g" ${S}/CMakeLists.txt | ||
61 | } | ||
62 | |||
63 | BBCLASSEXTEND = "native nativesdk" | ||
64 | |||
65 | SYSROOT_DIRS_BLACKLIST_append_class-target = "${baselib}/cmake/grpc" | ||
66 | |||
67 | FILES_${PN}-dev += "${bindir}" | ||