blob: b4f10662dc97530d04cbe7841e15f352de1afae1 [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"
Patrick Williams213cb262021-08-07 19:21:33 -050010DEPENDS:append:class-target = " googletest grpc-native "
11DEPENDS:append:class-nativesdk = " grpc-native "
Andrew Geissler82c905d2020-04-13 13:39:40 -050012
Andrew Geissler32b11992021-03-31 13:37:05 -050013PACKAGE_BEFORE_PN = "${PN}-compiler"
14
Patrick Williams213cb262021-08-07 19:21:33 -050015RDEPENDS:${PN}-compiler = "${PN}"
16RDEPENDS:${PN}-dev += "${PN}-compiler"
Andrew Geissler32b11992021-03-31 13:37:05 -050017
Andrew Geissler82c905d2020-04-13 13:39:40 -050018S = "${WORKDIR}/git"
Andrew Geissler69721092021-07-23 12:57:00 -040019SRCREV_grpc = "96b73272eadc01afb5fb45b92b408c47e4387274"
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070020BRANCH = "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
Patrick Williams213cb262021-08-07 19:21:33 -050024CXXFLAGS:append:class-native = " -Wl,--no-as-needed"
Andrew Geissler82c905d2020-04-13 13:39:40 -050025
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 \
Andrew Geissler82c905d2020-04-13 13:39:40 -050037 -DgRPC_INSTALL_LIBDIR=${baselib} \
38 -DgRPC_INSTALL_CMAKEDIR=${baselib}/cmake/${BPN} \
39 "
40
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050041PACKAGECONFIG ??= "cpp shared"
Andrew Geissler97771a32021-03-05 15:23:11 -060042PACKAGECONFIG[cpp] = "-DgRPC_BUILD_GRPC_CPP_PLUGIN=ON,-DgRPC_BUILD_GRPC_CPP_PLUGIN=OFF"
43PACKAGECONFIG[csharp] = "-DgRPC_BUILD_GRPC_CSHARP_PLUGIN=ON,-DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF"
44PACKAGECONFIG[node] = "-DgRPC_BUILD_GRPC_NODE_PLUGIN=ON,-DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF"
45PACKAGECONFIG[objective-c] = "-DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=ON,-DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF"
46PACKAGECONFIG[php] = "-DgRPC_BUILD_GRPC_PHP_PLUGIN=ON,-DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF"
47PACKAGECONFIG[python] = "-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=ON,-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF"
48PACKAGECONFIG[ruby] = "-DgRPC_BUILD_GRPC_RUBY_PLUGIN=ON,-DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF"
49PACKAGECONFIG[protobuf-lite] = "-DgRPC_USE_PROTO_LITE=ON,-DgRPC_USE_PROTO_LITE=OFF,protobuf-lite"
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050050PACKAGECONFIG[shared] = "-DBUILD_SHARED_LIBS=ON,-DBUILD_SHARED_LIBS=OFF,,"
Andrew Geissler97771a32021-03-05 15:23:11 -060051
Patrick Williams213cb262021-08-07 19:21:33 -050052do_configure:prepend() {
Andrew Geissler97771a32021-03-05 15:23:11 -060053 sed -i -e "s#lib/pkgconfig/#${baselib}/pkgconfig/#g" ${S}/CMakeLists.txt
54}
55
Patrick Williams213cb262021-08-07 19:21:33 -050056do_configure:prepend:mipsarch() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050057 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
Patrick Williams213cb262021-08-07 19:21:33 -050060do_configure:prepend:powerpc() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050061 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
Patrick Williams213cb262021-08-07 19:21:33 -050064do_configure:prepend:riscv64() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050065 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
Patrick Williams213cb262021-08-07 19:21:33 -050068do_configure:prepend:riscv32() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050069 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
Patrick Williams213cb262021-08-07 19:21:33 -050072do_configure:prepend:toolchain-clang:x86() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050073 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
Patrick Williams213cb262021-08-07 19:21:33 -050078SYSROOT_DIRS_BLACKLIST:append:class-target = " ${baselib}/cmake/grpc"
Andrew Geissler82c905d2020-04-13 13:39:40 -050079
Patrick Williams213cb262021-08-07 19:21:33 -050080FILES:${PN}-compiler += "${bindir}"