termux-packages/packages/libgrpc/build.sh

31 lines
1.2 KiB
Bash
Raw Normal View History

2017-07-11 11:50:43 +02:00
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"
}