libgrpc: add package (#1122)

This commit is contained in:
Vishal Biswas 2017-07-11 15:20:43 +05:30 committed by Fredrik Fornwall
parent e3973eb004
commit ca98427d8f
4 changed files with 72 additions and 0 deletions

View File

@ -0,0 +1,11 @@
--- ./CMakeLists.txt 2017-07-09 09:11:13.314844730 +0530
+++ ../CMakeLists.txt 2017-07-09 09:14:19.309615851 +0530
@@ -322,7 +322,7 @@
COMMAND ${_gRPC_PROTOBUF_PROTOC}
ARGS --grpc_out=generate_mock_code=true:${_gRPC_PROTO_GENS_DIR}
--cpp_out=${_gRPC_PROTO_GENS_DIR}
- --plugin=protoc-gen-grpc=$<TARGET_FILE:grpc_cpp_plugin>
+ --plugin=protoc-gen-grpc=@PATH_TO_PLUGIN@
${_protobuf_include_path}
${REL_FIL}
DEPENDS ${ABS_FIL} ${_gRPC_PROTOBUF_PROTOC} grpc_cpp_plugin

View File

@ -0,0 +1,20 @@
--- ./CMakeLists.txt 2017-06-28 01:16:01.000000000 +0530
+++ ../CMakeLists.txt 2017-07-08 22:10:35.062570096 +0530
@@ -272,7 +272,7 @@
if(_gRPC_PLATFORM_MAC)
set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} m pthread)
elseif(UNIX)
- set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} rt m pthread)
+ set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} m)
endif()
if(WIN32 AND MSVC)
@@ -305,7 +305,7 @@
return()
endif()
- set(_protobuf_include_path -I . -I ${PROTOBUF_WELLKNOWN_IMPORT_DIR})
+ set(_protobuf_include_path -I . -I @TERMUX_PREFIX@/include)
foreach(FIL ${ARGN})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(FIL_WE ${FIL} NAME_WE)

30
packages/libgrpc/build.sh Normal file
View File

@ -0,0 +1,30 @@
TERMUX_PKG_VERSION=1.4.1
TERMUX_PKG_DESCRIPTION="High performance, open source, general RPC framework that puts mobile and HTTP/2 first"
TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas"
TERMUX_PKG_SRCURL=https://github.com/grpc/grpc/archive/v$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_DEPENDS="openssl, protobuf, c-ares"
TERMUX_PKG_SHA256=60840ef0e9b71f47cb73d4e220089b3d1e78dbfa011ae128f7688622f287b543
TERMUX_PKG_FOLDERNAME=grpc-$TERMUX_PKG_VERSION
TERMUX_PKG_HOSTBUILD=true
TERMUX_PKG_KEEP_STATIC_LIBRARIES=true
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-DgRPC_CARES_PROVIDER=package
-DgRPC_PROTOBUF_PROVIDER=package
-DgRPC_SSL_PROVIDER=package
-DgRPC_ZLIB_PROVIDER=package
-D_gRPC_PROTOBUF_PROTOC=$TERMUX_TOPDIR/libprotobuf/host-build/src/protoc
"
termux_step_host_build () {
cmake $TERMUX_PKG_SRCDIR -G "Unix Makefiles" \
$TERMUX_PKG_EXTRA_CONFIGURE_ARGS \
-DCMAKE_CXX_FLAGS="-Wl,-L$TERMUX_TOPDIR/libprotobuf/host-build/src/.libs -Wl,-lprotobuf -Wl,-lprotoc"
make -j $TERMUX_MAKE_PROCESSES grpc_cpp_plugin
}
termux_step_pre_configure () {
sed "s|@PATH_TO_PLUGIN@|$TERMUX_PKG_HOSTBUILD_DIR/grpc_cpp_plugin|g" $TERMUX_PKG_BUILDER_DIR/CMakeLists.txt.diff | patch -p1
export GRPC_CROSS_COMPILE=true
LDFLAGS="$LDFLAGS -lprotobuf -lprotoc -lcares -llog -lz"
}

View File

@ -0,0 +1,11 @@
--- ./include/grpc++/impl/codegen/config.h 2017-06-28 01:16:01.000000000 +0530
+++ ../config.h 2017-07-08 22:48:38.993186926 +0530
@@ -49,8 +49,6 @@
typedef GRPC_CUSTOM_STRING string;
-using std::to_string;
-
} // namespace grpc
#endif // GRPCXX_IMPL_CODEGEN_CONFIG_H