termux-packages/scripts/build/setup/termux_setup_protobuf.sh

22 lines
903 B
Bash
Raw Normal View History

2019-05-12 00:08:10 +02:00
termux_setup_protobuf() {
local _PROTOBUF_VERSION=$(bash -c ". $TERMUX_SCRIPTDIR/packages/libprotobuf/build.sh; echo \$TERMUX_PKG_VERSION")
local _PROTOBUF_ZIP=protoc-$_PROTOBUF_VERSION-linux-x86_64.zip
local _PROTOBUF_FOLDER=$TERMUX_COMMON_CACHEDIR/protobuf-$_PROTOBUF_VERSION
if [ "$TERMUX_ON_DEVICE_BUILD" = "false" ]; then
if [ ! -d "$_PROTOBUF_FOLDER" ]; then
termux_download \
2019-05-12 00:08:10 +02:00
https://github.com/protocolbuffers/protobuf/releases/download/v$_PROTOBUF_VERSION/$_PROTOBUF_ZIP \
$TERMUX_PKG_TMPDIR/$_PROTOBUF_ZIP \
15e395b648a1a6dda8fd66868824a396e9d3e89bc2c8648e3b9ab9801bea5d55
2019-05-12 00:08:10 +02:00
rm -Rf "$TERMUX_PKG_TMPDIR/protoc-$_PROTOBUF_VERSION-linux-x86_64"
unzip $TERMUX_PKG_TMPDIR/$_PROTOBUF_ZIP -d $TERMUX_PKG_TMPDIR/protobuf-$_PROTOBUF_VERSION
mv "$TERMUX_PKG_TMPDIR/protobuf-$_PROTOBUF_VERSION" \
$_PROTOBUF_FOLDER
fi
2019-05-12 00:08:10 +02:00
export PATH=$_PROTOBUF_FOLDER/bin/:$PATH
fi
2019-05-12 00:08:10 +02:00
}