Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 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.0" |
| 7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=6e4cf218112648d22420a84281b68b88" |
| 8 | |
| 9 | DEPENDS = "c-ares protobuf protobuf-native protobuf-c protobuf-c-native openssl libnsl2 abseil-cpp re2" |
| 10 | DEPENDS:append:class-target = " googletest grpc-native " |
| 11 | DEPENDS:append:class-nativesdk = " grpc-native " |
| 12 | |
| 13 | PACKAGE_BEFORE_PN = "${PN}-compiler" |
| 14 | |
| 15 | RDEPENDS:${PN}-compiler = "${PN}" |
| 16 | RDEPENDS:${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 | |
| 22 | S = "${WORKDIR}/git" |
| 23 | SRCREV_grpc = "494b08ada4009ead0d0b70e44d354be72f9c283a" |
| 24 | BRANCH = "v1.45.x" |
| 25 | SRC_URI = "git://github.com/grpc/grpc.git;protocol=https;name=grpc;branch=${BRANCH} \ |
| 26 | file://0001-Revert-Changed-GRPCPP_ABSEIL_SYNC-to-GPR_ABSEIL_SYNC.patch \ |
| 27 | " |
| 28 | # Fixes build with older compilers 4.8 especially on ubuntu 14.04 |
| 29 | CXXFLAGS:append:class-native = " -Wl,--no-as-needed" |
| 30 | |
| 31 | inherit cmake pkgconfig |
| 32 | |
| 33 | EXTRA_OECMAKE = " \ |
| 34 | -DgRPC_CARES_PROVIDER=package \ |
| 35 | -DgRPC_ZLIB_PROVIDER=package \ |
| 36 | -DgRPC_SSL_PROVIDER=package \ |
| 37 | -DgRPC_PROTOBUF_PROVIDER=package \ |
| 38 | -DgRPC_ABSL_PROVIDER=package \ |
| 39 | -DgRPC_RE2_PROVIDER=package \ |
| 40 | -DgRPC_INSTALL=ON \ |
| 41 | -DCMAKE_CROSSCOMPILING=ON \ |
| 42 | -DgRPC_INSTALL_LIBDIR=${baselib} \ |
| 43 | -DgRPC_INSTALL_CMAKEDIR=${baselib}/cmake/${BPN} \ |
| 44 | " |
| 45 | |
| 46 | PACKAGECONFIG ??= "cpp shared" |
| 47 | PACKAGECONFIG[cpp] = "-DgRPC_BUILD_GRPC_CPP_PLUGIN=ON,-DgRPC_BUILD_GRPC_CPP_PLUGIN=OFF" |
| 48 | PACKAGECONFIG[csharp] = "-DgRPC_BUILD_GRPC_CSHARP_PLUGIN=ON,-DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF" |
| 49 | PACKAGECONFIG[node] = "-DgRPC_BUILD_GRPC_NODE_PLUGIN=ON,-DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF" |
| 50 | PACKAGECONFIG[objective-c] = "-DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=ON,-DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF" |
| 51 | PACKAGECONFIG[php] = "-DgRPC_BUILD_GRPC_PHP_PLUGIN=ON,-DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF" |
| 52 | PACKAGECONFIG[python] = "-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=ON,-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF" |
| 53 | PACKAGECONFIG[ruby] = "-DgRPC_BUILD_GRPC_RUBY_PLUGIN=ON,-DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF" |
| 54 | PACKAGECONFIG[protobuf-lite] = "-DgRPC_USE_PROTO_LITE=ON,-DgRPC_USE_PROTO_LITE=OFF,protobuf-lite" |
| 55 | PACKAGECONFIG[shared] = "-DBUILD_SHARED_LIBS=ON,-DBUILD_SHARED_LIBS=OFF,," |
| 56 | |
| 57 | do_configure:prepend() { |
| 58 | sed -i -e "s#lib/pkgconfig/#${baselib}/pkgconfig/#g" ${S}/CMakeLists.txt |
| 59 | } |
| 60 | |
| 61 | do_configure:prepend:mipsarch() { |
| 62 | 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 |
| 63 | } |
| 64 | |
| 65 | do_configure:prepend:powerpc() { |
| 66 | 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 |
| 67 | } |
| 68 | |
| 69 | do_configure:prepend:riscv64() { |
| 70 | 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 |
| 71 | } |
| 72 | |
| 73 | do_configure:prepend:riscv32() { |
| 74 | 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 |
| 75 | } |
| 76 | |
| 77 | do_configure:prepend:toolchain-clang:x86() { |
| 78 | 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 |
| 79 | } |
| 80 | |
| 81 | BBCLASSEXTEND = "native nativesdk" |
| 82 | |
| 83 | SYSROOT_DIRS_IGNORE:append:class-target = " ${baselib}/cmake/grpc" |
| 84 | |
| 85 | FILES:${PN}-compiler += " \ |
| 86 | ${bindir} \ |
| 87 | ${libdir}/libgrpc_plugin_support${SOLIBS} \ |
| 88 | " |