blob: 2095d81d4a872f6ec48014ade7f8c3c6503e961f [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001DESCRIPTION = "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"
6LICENSE = "Apache-2"
7LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
8
Andrew Geissler97771a32021-03-05 15:23:11 -06009DEPENDS = "c-ares protobuf protobuf-native protobuf-c protobuf-c-native openssl libnsl2 abseil-cpp re2"
Andrew Geissler82c905d2020-04-13 13:39:40 -050010DEPENDS_append_class-target = " googletest grpc-native "
11DEPENDS_append_class-nativesdk = " grpc-native "
12
Andrew Geissler32b11992021-03-31 13:37:05 -050013PACKAGE_BEFORE_PN = "${PN}-compiler"
14
15RDEPENDS_${PN}-compiler = "${PN}"
16RDEPENDS_${PN}-dev += "${PN}-compiler"
17
Andrew Geissler82c905d2020-04-13 13:39:40 -050018S = "${WORKDIR}/git"
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070019SRCREV_grpc = "54dc182082db941aa67c7c3f93ad858c99a16d7d"
20BRANCH = "v1.38.x"
Andrew Geissler82c905d2020-04-13 13:39:40 -050021SRC_URI = "git://github.com/grpc/grpc.git;protocol=https;name=grpc;branch=${BRANCH} \
Andrew Geissler82c905d2020-04-13 13:39:40 -050022 "
Andrew Geissler82c905d2020-04-13 13:39:40 -050023# Fixes build with older compilers 4.8 especially on ubuntu 14.04
24CXXFLAGS_append_class-native = " -Wl,--no-as-needed"
25
26inherit cmake pkgconfig
27
28EXTRA_OECMAKE = " \
29 -DgRPC_CARES_PROVIDER=package \
30 -DgRPC_ZLIB_PROVIDER=package \
31 -DgRPC_SSL_PROVIDER=package \
32 -DgRPC_PROTOBUF_PROVIDER=package \
Andrew Geissler97771a32021-03-05 15:23:11 -060033 -DgRPC_ABSL_PROVIDER=package \
34 -DgRPC_RE2_PROVIDER=package \
Andrew Geissler82c905d2020-04-13 13:39:40 -050035 -DgRPC_INSTALL=ON \
36 -DCMAKE_CROSSCOMPILING=ON \
37 -DBUILD_SHARED_LIBS=ON \
38 -DgRPC_INSTALL_LIBDIR=${baselib} \
39 -DgRPC_INSTALL_CMAKEDIR=${baselib}/cmake/${BPN} \
40 "
41
Andrew Geissler97771a32021-03-05 15:23:11 -060042PACKAGECONFIG ??= "cpp"
43PACKAGECONFIG[cpp] = "-DgRPC_BUILD_GRPC_CPP_PLUGIN=ON,-DgRPC_BUILD_GRPC_CPP_PLUGIN=OFF"
44PACKAGECONFIG[csharp] = "-DgRPC_BUILD_GRPC_CSHARP_PLUGIN=ON,-DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF"
45PACKAGECONFIG[node] = "-DgRPC_BUILD_GRPC_NODE_PLUGIN=ON,-DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF"
46PACKAGECONFIG[objective-c] = "-DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=ON,-DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF"
47PACKAGECONFIG[php] = "-DgRPC_BUILD_GRPC_PHP_PLUGIN=ON,-DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF"
48PACKAGECONFIG[python] = "-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=ON,-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF"
49PACKAGECONFIG[ruby] = "-DgRPC_BUILD_GRPC_RUBY_PLUGIN=ON,-DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF"
50PACKAGECONFIG[protobuf-lite] = "-DgRPC_USE_PROTO_LITE=ON,-DgRPC_USE_PROTO_LITE=OFF,protobuf-lite"
51
52do_configure_prepend() {
53 sed -i -e "s#lib/pkgconfig/#${baselib}/pkgconfig/#g" ${S}/CMakeLists.txt
54}
55
Andrew Geissler82c905d2020-04-13 13:39:40 -050056do_configure_prepend_mipsarch() {
57 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
58}
59
60do_configure_prepend_powerpc() {
61 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
62}
63
64do_configure_prepend_riscv64() {
65 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
66}
67
68do_configure_prepend_riscv32() {
69 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
70}
71
72do_configure_prepend_toolchain-clang_x86() {
73 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
74}
75
76BBCLASSEXTEND = "native nativesdk"
77
Andrew Geissler4b7c1152020-11-30 19:55:29 -060078SYSROOT_DIRS_BLACKLIST_append_class-target = " ${baselib}/cmake/grpc"
Andrew Geissler82c905d2020-04-13 13:39:40 -050079
Andrew Geissler32b11992021-03-31 13:37:05 -050080FILES_${PN}-compiler += "${bindir}"