aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2020-03-03 17:25:08 +0100
committerKhem Raj <raj.khem@gmail.com>2020-03-03 09:23:08 -0800
commit5abf5531c29b39386f3f83c4086005249f9d391e (patch)
tree2345549ec65656d56e7007c83eef820a7300d7f5 /meta-oe
parent61b4943ee787aedb3ceb9ad379f3de5e1e0da33b (diff)
downloadmeta-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')
-rw-r--r--meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb2
-rw-r--r--meta-oe/recipes-devtools/grpc/grpc/0001-CMakeLists.txt-Fix-grpc_cpp_plugin-path-during-cross.patch45
-rw-r--r--meta-oe/recipes-devtools/grpc/grpc/0001-CMakeLists.txt-Fix-libraries-installation-for-Linux.patch177
-rw-r--r--meta-oe/recipes-devtools/grpc/grpc_1.24.3.bb67
4 files changed, 290 insertions, 1 deletions
diff --git a/meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb b/meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb
index d09653901c..e04b48f85a 100644
--- a/meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb
+++ b/meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb
@@ -110,7 +110,7 @@ RDEPENDS_packagegroup-meta-oe-devtools ="\
android-tools android-tools-conf bootchart breakpad \
capnproto cgdb cscope ctags \
debootstrap dmalloc flatbuffers \
- giflib icon-slicer iptraf-ng jq jsoncpp jsonrpc json-spirit \
+ giflib grpc icon-slicer iptraf-ng jq jsoncpp jsonrpc json-spirit \
kconfig-frontends lemon libedit libgee libsombok3 \
libubox log4cplus lshw ltrace lua mcpp memstat mercurial \
mpich msgpack-c nlohmann-json openocd pax-utils \
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 0000000000..6cad533964
--- /dev/null
+++ b/meta-oe/recipes-devtools/grpc/grpc/0001-CMakeLists.txt-Fix-grpc_cpp_plugin-path-during-cross.patch
@@ -0,0 +1,45 @@
+From 6d606f1101c1a172fb6d738d6f1865aa61849e68 Mon Sep 17 00:00:00 2001
+From: Alexey Firago <alexey_firago@mentor.com>
+Date: Fri, 20 Oct 2017 00:04:19 +0300
+Subject: [PATCH] CMakeLists.txt: Fix grpc_cpp_plugin path during cross-compiling or native build
+
+Signed-off-by: Alexey Firago <alexey_firago@mentor.com>
+Signed-off-by: Hiram Lew <lew@avast.com>
+Signed-off-by: Jan Kaisrlik <jan.kaisrlik@avast.com>
+---
+ CMakeLists.txt | 9 ++++++++-
+ templates/CMakeLists.txt.template | 9 ++++++++-
+ 2 files changed, 16 insertions(+), 2 deletions(-)
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -193,6 +193,13 @@ function(protobuf_generate_grpc_cpp)
+ return()
+ endif()
+
++ #if cross-compiling or nativesdk, find host plugin
++ if(CMAKE_CROSSCOMPILING)
++ find_program(gRPC_CPP_PLUGIN grpc_cpp_plugin)
++ else()
++ set(gRPC_CPP_PLUGIN $<TARGET_FILE:grpc_cpp_plugin>)
++ endif()
++
+ set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR})
+ foreach(FIL ${ARGN})
+ get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
+--- a/templates/CMakeLists.txt.template
++++ b/templates/CMakeLists.txt.template
+@@ -233,6 +233,13 @@
+ return()
+ endif()
+
++ #if cross-compiling or nativesdk, find host plugin
++ if(CMAKE_CROSSCOMPILING)
++ find_program(gRPC_CPP_PLUGIN grpc_cpp_plugin)
++ else()
++ set(gRPC_CPP_PLUGIN $<TARGET_FILE:grpc_cpp_plugin>)
++ endif()
++
+ set(_protobuf_include_path -I . -I <%text>${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR}</%text>)
+ foreach(FIL <%text>${ARGN}</%text>)
+ 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 0000000000..e517355d34
--- /dev/null
+++ b/meta-oe/recipes-devtools/grpc/grpc/0001-CMakeLists.txt-Fix-libraries-installation-for-Linux.patch
@@ -0,0 +1,177 @@
+From 2279e30be5796e9b185545543ea54fe68633cbdd Mon Sep 17 00:00:00 2001
+From: Alexey Firago <alexey_firago@mentor.com>
+Date: Mon, 30 Oct 2017 23:24:49 +0300
+Subject: [PATCH] CMakeLists.txt: Fix libraries installation for Linux
+
+* Set libs versions as in Makefile
+
+Signed-off-by: Alexey Firago <alexey_firago@mentor.com>
+
+---
+ CMakeLists.txt | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 59 insertions(+)
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -30,6 +30,15 @@ set(PACKAGE_TARNAME "${PACKAGE_NAME}-$
+ set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/")
+ project(${PACKAGE_NAME} C CXX)
+
++set (CORE_VERSION_MAJOR "6")
++set (CORE_VERSION "6.0.0")
++
++set (CPP_VERSION_MAJOR "1")
++set (CPP_VERSION "${PACKAGE_VERSION}")
++
++set (CSHARP_VERSION_MAJOR "1")
++set (CSHARP_VERSION "${PACKAGE_VERSION}")
++
+ set(gRPC_INSTALL_BINDIR "bin" CACHE STRING "Installation directory for executables")
+ set(gRPC_INSTALL_LIBDIR "lib" CACHE STRING "Installation directory for libraries")
+ set(gRPC_INSTALL_INCLUDEDIR "include" CACHE STRING "Installation directory for headers")
+@@ -777,6 +786,10 @@ if(WIN32 AND MSVC)
+ endif()
+ endif()
+
++if(_gRPC_PLATFORM_LINUX)
++ set_property(TARGET address_sorting PROPERTY VERSION ${CORE_VERSION})
++ set_property(TARGET address_sorting PROPERTY SOVERSION ${CORE_VERSION_MAJOR})
++endif()
+
+ target_include_directories(address_sorting
+ PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+@@ -903,6 +916,10 @@ if(WIN32 AND MSVC)
+ endif()
+ endif()
+
++if(_gRPC_PLATFORM_LINUX)
++ set_property(TARGET gpr PROPERTY VERSION ${CORE_VERSION})
++ set_property(TARGET gpr PROPERTY SOVERSION ${CORE_VERSION_MAJOR})
++endif()
+
+ target_include_directories(gpr
+ PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+@@ -1367,6 +1384,10 @@ if(WIN32 AND MSVC)
+ endif()
+ endif()
+
++if(_gRPC_PLATFORM_LINUX)
++ set_property(TARGET grpc PROPERTY VERSION ${CORE_VERSION})
++ set_property(TARGET grpc PROPERTY SOVERSION ${CORE_VERSION_MAJOR})
++endif()
+
+ target_include_directories(grpc
+ PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+@@ -1782,6 +1803,10 @@ if(WIN32 AND MSVC)
+ endif()
+ endif()
+
++if(_gRPC_PLATFORM_LINUX)
++ set_property(TARGET grpc_cronet PROPERTY VERSION ${CORE_VERSION})
++ set_property(TARGET grpc_cronet PROPERTY SOVERSION ${CORE_VERSION_MAJOR})
++endif()
+
+ target_include_directories(grpc_cronet
+ PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+@@ -2869,6 +2894,10 @@ if(WIN32 AND MSVC)
+ endif()
+ endif()
+
++if(_gRPC_PLATFORM_LINUX)
++ set_property(TARGET grpc_unsecure PROPERTY VERSION ${CORE_VERSION})
++ set_property(TARGET grpc_unsecure PROPERTY SOVERSION ${CORE_VERSION_MAJOR})
++endif()
+
+ target_include_directories(grpc_unsecure
+ PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+@@ -3206,6 +3235,10 @@ if(WIN32 AND MSVC)
+ endif()
+ endif()
+
++if(_gRPC_PLATFORM_LINUX)
++ set_property(TARGET grpc++ PROPERTY VERSION ${CPP_VERSION})
++ set_property(TARGET grpc++ PROPERTY SOVERSION ${CPP_VERSION_MAJOR})
++endif()
+
+ target_include_directories(grpc++
+ PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+@@ -3589,6 +3622,11 @@ protobuf_generate_grpc_cpp(
+ src/proto/grpc/status/status.proto
+ )
+
++if(_gRPC_PLATFORM_LINUX)
++ set_property(TARGET grpc++_error_details PROPERTY VERSION ${CPP_VERSION})
++ set_property(TARGET grpc++_error_details PROPERTY SOVERSION ${CPP_VERSION_MAJOR})
++endif()
++
+ target_include_directories(grpc++_error_details
+ PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
+@@ -3727,6 +3765,11 @@ protobuf_generate_grpc_cpp(
+ src/proto/grpc/reflection/v1alpha/reflection.proto
+ )
+
++if(_gRPC_PLATFORM_LINUX)
++ set_property(TARGET grpc++_reflection PROPERTY VERSION ${CPP_VERSION})
++ set_property(TARGET grpc++_reflection PROPERTY SOVERSION ${CPP_VERSION_MAJOR})
++endif()
++
+ target_include_directories(grpc++_reflection
+ PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
+@@ -3816,6 +3859,10 @@ target_link_libraries(grpc++_test_config
+ ${_gRPC_GFLAGS_LIBRARIES}
+ )
+
++if(_gRPC_PLATFORM_LINUX)
++ set_property(TARGET grpc++_cronet PROPERTY VERSION ${CPP_VERSION})
++ set_property(TARGET grpc++_cronet PROPERTY SOVERSION ${CPP_VERSION_MAJOR})
++endif()
+
+ endif (gRPC_BUILD_TESTS)
+ if (gRPC_BUILD_TESTS)
+@@ -4307,6 +4354,10 @@ if(WIN32 AND MSVC)
+ endif()
+ endif()
+
++if(_gRPC_PLATFORM_LINUX)
++ set_property(TARGET grpc++_unsecure PROPERTY VERSION ${CPP_VERSION})
++ set_property(TARGET grpc++_unsecure PROPERTY SOVERSION ${CPP_VERSION_MAJOR})
++endif()
+
+ target_include_directories(grpc++_unsecure
+ PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+@@ -4745,6 +4796,10 @@ if(WIN32 AND MSVC)
+ endif()
+ endif()
+
++if(_gRPC_PLATFORM_LINUX)
++ set_property(TARGET grpc_plugin_support PROPERTY VERSION ${CORE_VERSION})
++ set_property(TARGET grpc_plugin_support PROPERTY SOVERSION ${CORE_VERSION_MAJOR})
++endif()
+
+ target_include_directories(grpc_plugin_support
+ PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+@@ -4813,6 +4868,11 @@ protobuf_generate_grpc_cpp(
+ src/proto/grpc/channelz/channelz.proto
+ )
+
++if(_gRPC_PLATFORM_LINUX)
++ set_property(TARGET grpcpp_channelz PROPERTY VERSION ${CPP_VERSION})
++ set_property(TARGET grpcpp_channelz PROPERTY SOVERSION ${CPP_VERSION_MAJOR})
++endif()
++
+ target_include_directories(grpcpp_channelz
+ PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
+@@ -5367,6 +5427,10 @@ if(WIN32 AND MSVC)
+ endif()
+ endif()
+
++if(_gRPC_PLATFORM_LINUX)
++ set_property(TARGET grpc_csharp_ext PROPERTY VERSION ${CSHARP_VERSION})
++ set_property(TARGET grpc_csharp_ext PROPERTY SOVERSION ${CSHARP_VERSION_MAJOR})
++endif()
+
+ target_include_directories(grpc_csharp_ext
+ 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 0000000000..752562eb33
--- /dev/null
+++ b/meta-oe/recipes-devtools/grpc/grpc_1.24.3.bb
@@ -0,0 +1,67 @@
+DESCRIPTION = "A high performance, open source, general-purpose RPC framework. \
+Provides gRPC libraries for multiple languages written on top of shared C core library \
+(C++, Node.js, Python, Ruby, Objective-C, PHP, C#)"
+HOMEPAGE = "https://github.com/grpc/grpc"
+SECTION = "libs"
+LICENSE = "Apache-2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+DEPENDS = "gflags c-ares protobuf protobuf-native protobuf-c protobuf-c-native openssl libnsl2"
+DEPENDS_append_class-target = " googletest grpc-native "
+DEPENDS_append_class-nativesdk = " grpc-native "
+
+S = "${WORKDIR}/git"
+SRCREV_grpc = "2de2e8dd8921e1f7d043e01faf7fe8a291fbb072"
+SRCREV_upb = "9effcbcb27f0a665f9f345030188c0b291e32482"
+BRANCH = "v1.24.x"
+SRC_URI = "git://github.com/grpc/grpc.git;protocol=https;name=grpc;branch=${BRANCH} \
+ git://github.com/protocolbuffers/upb;name=upb;destsuffix=git/third_party/upb \
+ file://0001-CMakeLists.txt-Fix-libraries-installation-for-Linux.patch \
+ "
+SRC_URI_append_class-target = " file://0001-CMakeLists.txt-Fix-grpc_cpp_plugin-path-during-cross.patch \
+ "
+SRC_URI_append_class-nativesdk = " file://0001-CMakeLists.txt-Fix-grpc_cpp_plugin-path-during-cross.patch"
+
+# Fixes build with older compilers 4.8 especially on ubuntu 14.04
+CXXFLAGS_append_class-native = " -Wl,--no-as-needed"
+
+inherit cmake pkgconfig
+
+EXTRA_OECMAKE = " \
+ -DgRPC_CARES_PROVIDER=package \
+ -DgRPC_ZLIB_PROVIDER=package \
+ -DgRPC_SSL_PROVIDER=package \
+ -DgRPC_PROTOBUF_PROVIDER=package \
+ -DgRPC_GFLAGS_PROVIDER=package \
+ -DgRPC_INSTALL=ON \
+ -DCMAKE_CROSSCOMPILING=ON \
+ -DBUILD_SHARED_LIBS=ON \
+ -DgRPC_INSTALL_LIBDIR=${baselib} \
+ -DgRPC_INSTALL_CMAKEDIR=${baselib}/cmake/${BPN} \
+ "
+
+do_configure_prepend_mipsarch() {
+ 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
+}
+
+do_configure_prepend_powerpc() {
+ 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
+}
+
+do_configure_prepend_riscv64() {
+ 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
+}
+
+do_configure_prepend_riscv32() {
+ 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
+}
+
+do_configure_prepend_toolchain-clang_x86() {
+ 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
+}
+
+BBCLASSEXTEND = "native nativesdk"
+
+SYSROOT_DIRS_BLACKLIST_append_class-target = "${baselib}/cmake/grpc"
+
+FILES_${PN}-dev += "${bindir}"