2017-07-16 18:21:22 +02:00
TERMUX_PKG_HOMEPAGE = https://grpc.io/
2017-07-11 11:50:43 +02:00
TERMUX_PKG_DESCRIPTION = "High performance, open source, general RPC framework that puts mobile and HTTP/2 first"
2019-01-21 13:53:58 +01:00
TERMUX_PKG_LICENSE = "Apache-2.0"
2020-07-17 14:18:51 +02:00
TERMUX_PKG_SRCURL = https://github.com/grpc/grpc.git
2020-08-19 17:04:22 +02:00
TERMUX_PKG_VERSION = 1.31.1
2019-12-13 12:53:34 +01:00
TERMUX_PKG_DEPENDS = "libc++, openssl, protobuf, c-ares, zlib"
2019-07-20 10:42:33 +02:00
TERMUX_PKG_BREAKS = "libgrpc-dev"
TERMUX_PKG_REPLACES = "libgrpc-dev"
2019-12-13 12:53:34 +01:00
TERMUX_PKG_BUILD_DEPENDS = "gflags, gflags-static, libprotobuf"
2017-07-11 11:50:43 +02:00
TERMUX_PKG_HOSTBUILD = true
2019-08-12 17:28:41 +02:00
TERMUX_PKG_BUILD_IN_SRC = true
2017-07-11 11:50:43 +02:00
TERMUX_PKG_EXTRA_CONFIGURE_ARGS = "
2020-08-15 07:34:54 +02:00
-DCMAKE_STRIP= $( command -v strip)
-DGIT_EXECUTABLE= $( command -v git)
2018-05-25 12:43:31 +02:00
-DBUILD_SHARED_LIBS= ON
2017-07-11 11:50:43 +02:00
-DgRPC_CARES_PROVIDER= package
-DgRPC_PROTOBUF_PROVIDER= package
-DgRPC_SSL_PROVIDER= package
-DgRPC_ZLIB_PROVIDER= package
2019-12-13 12:53:34 +01:00
-DgRPC_GFLAGS_PROVIDER= package
2018-05-25 12:43:31 +02:00
-DRUN_HAVE_POSIX_REGEX= 0
-DRUN_HAVE_STD_REGEX= 0
-DRUN_HAVE_STEADY_CLOCK= 0
2019-01-13 19:18:17 +01:00
-DProtobuf_PROTOC_LIBRARY= $TERMUX_PREFIX /lib/libprotoc.so
2017-07-11 11:50:43 +02:00
"
2020-07-17 14:18:51 +02:00
termux_step_post_get_source( ) {
2019-05-12 00:08:10 +02:00
termux_setup_protobuf
2018-05-25 12:43:31 +02:00
}
2019-02-08 10:37:29 +01:00
termux_step_host_build( ) {
2017-07-12 00:38:50 +02:00
termux_setup_cmake
2020-08-15 11:18:16 +02:00
termux_setup_ninja
2019-01-13 19:18:17 +01:00
2018-05-25 12:43:31 +02:00
cd $TERMUX_PKG_SRCDIR
export LD = gcc
export LDXX = g++
2019-01-13 23:15:03 +01:00
# -Wno-error=class-memaccess is used to avoid
# src/core/lib/security/credentials/oauth2/oauth2_credentials.cc:336:61: error: ‘ void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘ struct grpc_oauth2_token_fetcher_credentials’ ; use assignment or value-initialization instead [-Werror=class-memaccess]
# memset(c, 0, sizeof(grpc_oauth2_token_fetcher_credentials));
2019-02-03 22:43:46 +01:00
# when building version 1.17.2:
2019-02-07 16:41:57 +01:00
CXXFLAGS = "-Wno-error=class-memaccess" \
2019-01-13 23:15:03 +01:00
CFLAGS = "-Wno-implicit-fallthrough" \
2020-08-15 11:18:16 +02:00
cmake -G Ninja -DCMAKE_INSTALL_PREFIX= $TERMUX_PKG_HOSTBUILD_DIR
ninja -j $TERMUX_MAKE_PROCESSES install
ninja -t clean
rm -rf CMakeCache.txt CMakeFiles
2017-07-11 11:50:43 +02:00
}
2018-05-25 12:43:31 +02:00
termux_step_pre_configure( ) {
sed " s|@PATH_TO_PLUGIN@| $TERMUX_PKG_HOSTBUILD_DIR /bin/grpc_cpp_plugin|g " \
$TERMUX_PKG_BUILDER_DIR /CMakeLists.txt.diff \
| patch -p1
2017-07-11 11:50:43 +02:00
export GRPC_CROSS_COMPILE = true
}