blob: c4dd6b9857d20e9ee5e8eca43d2db723a36c5c5f [file] [log] [blame]
Andrew Geissler9aee5002022-03-30 16:27:02 +00001DESCRIPTION = "A high performance, open source, general-purpose RPC framework. \
2Provides gRPC libraries for multiple languages written on top of shared C core library \
3(C++, Node.js, Python, Ruby, Objective-C, PHP, C#)"
4HOMEPAGE = "https://github.com/grpc/grpc"
5SECTION = "libs"
Patrick Williams975a06f2022-10-21 14:42:47 -05006LICENSE = "Apache-2.0 & BSD-3-Clause & MPL-2.0"
7LIC_FILES_CHKSUM = "file://LICENSE;md5=731e401b36f8077ae0c134b59be5c906"
Andrew Geissler9aee5002022-03-30 16:27:02 +00008
9DEPENDS = "c-ares protobuf protobuf-native protobuf-c protobuf-c-native openssl libnsl2 abseil-cpp re2"
10DEPENDS:append:class-target = " googletest grpc-native "
11DEPENDS:append:class-nativesdk = " grpc-native "
12
13PACKAGE_BEFORE_PN = "${PN}-compiler"
14
15RDEPENDS:${PN}-compiler = "${PN}"
16RDEPENDS:${PN}-dev:append:class-native = " ${PN}-compiler"
17# Configuration above allows to cross-compile gRPC applications
18# In order to compile applications on the target, use the dependency below
19# Both dependencies are mutually exclusive
20# RDEPENDS:${PN}-dev += "${PN}-compiler"
21
22S = "${WORKDIR}/git"
Andrew Geissler220dafd2023-10-04 10:18:08 -050023SRCREV_grpc = "c0d1c393d9365664d47df41746e992ae97b651ef"
24BRANCH = "v1.56.x"
Patrick Williams975a06f2022-10-21 14:42:47 -050025SRC_URI = "gitsm://github.com/grpc/grpc.git;protocol=https;name=grpc;branch=${BRANCH} \
Patrick Williams03907ee2022-05-01 06:28:52 -050026 file://0001-cmake-Link-with-libatomic-on-rv32-rv64.patch \
Andrew Geissler9aee5002022-03-30 16:27:02 +000027 "
28# Fixes build with older compilers 4.8 especially on ubuntu 14.04
29CXXFLAGS:append:class-native = " -Wl,--no-as-needed"
30
31inherit cmake pkgconfig
32
33EXTRA_OECMAKE = " \
34 -DgRPC_CARES_PROVIDER=package \
35 -DgRPC_ZLIB_PROVIDER=package \
36 -DgRPC_SSL_PROVIDER=package \
37 -DgRPC_PROTOBUF_PROVIDER=package \
Patrick Williams520786c2023-06-25 16:20:36 -050038 -D_gRPC_PROTOBUF_PROTOC_EXECUTABLE=${STAGING_BINDIR_NATIVE}/protoc \
Andrew Geissler9aee5002022-03-30 16:27:02 +000039 -DgRPC_ABSL_PROVIDER=package \
40 -DgRPC_RE2_PROVIDER=package \
41 -DgRPC_INSTALL=ON \
42 -DCMAKE_CROSSCOMPILING=ON \
43 -DgRPC_INSTALL_LIBDIR=${baselib} \
44 -DgRPC_INSTALL_CMAKEDIR=${baselib}/cmake/${BPN} \
45 "
46
47PACKAGECONFIG ??= "cpp shared"
48PACKAGECONFIG[cpp] = "-DgRPC_BUILD_GRPC_CPP_PLUGIN=ON,-DgRPC_BUILD_GRPC_CPP_PLUGIN=OFF"
49PACKAGECONFIG[csharp] = "-DgRPC_BUILD_GRPC_CSHARP_PLUGIN=ON,-DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF"
50PACKAGECONFIG[node] = "-DgRPC_BUILD_GRPC_NODE_PLUGIN=ON,-DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF"
51PACKAGECONFIG[objective-c] = "-DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=ON,-DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF"
52PACKAGECONFIG[php] = "-DgRPC_BUILD_GRPC_PHP_PLUGIN=ON,-DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF"
53PACKAGECONFIG[python] = "-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=ON,-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF"
54PACKAGECONFIG[ruby] = "-DgRPC_BUILD_GRPC_RUBY_PLUGIN=ON,-DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF"
55PACKAGECONFIG[protobuf-lite] = "-DgRPC_USE_PROTO_LITE=ON,-DgRPC_USE_PROTO_LITE=OFF,protobuf-lite"
56PACKAGECONFIG[shared] = "-DBUILD_SHARED_LIBS=ON,-DBUILD_SHARED_LIBS=OFF,,"
57
58do_configure:prepend() {
59 sed -i -e "s#lib/pkgconfig/#${baselib}/pkgconfig/#g" ${S}/CMakeLists.txt
60}
61
Andrew Geissler9aee5002022-03-30 16:27:02 +000062BBCLASSEXTEND = "native nativesdk"
63
Andrew Geissler9aee5002022-03-30 16:27:02 +000064FILES:${PN}-compiler += " \
65 ${bindir} \
66 ${libdir}/libgrpc_plugin_support${SOLIBS} \
67 "