2019-05-12 00:08:10 +02:00
|
|
|
termux_setup_protobuf() {
|
2020-06-08 13:44:57 +02:00
|
|
|
local _PROTOBUF_VERSION=$(bash -c ". $TERMUX_SCRIPTDIR/packages/libprotobuf/build.sh; echo \${TERMUX_PKG_VERSION:2}")
|
2019-05-12 00:08:10 +02:00
|
|
|
local _PROTOBUF_ZIP=protoc-$_PROTOBUF_VERSION-linux-x86_64.zip
|
2020-10-22 21:45:33 +02:00
|
|
|
local _PROTOBUF_FOLDER
|
|
|
|
|
|
|
|
if [ "${TERMUX_PACKAGES_OFFLINE-false}" = "true" ]; then
|
|
|
|
_PROTOBUF_FOLDER=${TERMUX_SCRIPTDIR}/build-tools/protobuf-${_PROTOBUF_VERSION}
|
|
|
|
else
|
|
|
|
_PROTOBUF_FOLDER=${TERMUX_COMMON_CACHEDIR}/protobuf-${_PROTOBUF_VERSION}
|
|
|
|
fi
|
2019-05-12 00:08:10 +02:00
|
|
|
|
2019-08-12 23:16:07 +02:00
|
|
|
if [ "$TERMUX_ON_DEVICE_BUILD" = "false" ]; then
|
2019-08-06 14:39:42 +02:00
|
|
|
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 \
|
2021-10-21 08:38:51 +02:00
|
|
|
2994b7256f7416b90ad831dbf76a27c0934386deb514587109f39141f2636f37
|
2019-05-12 00:08:10 +02:00
|
|
|
|
2019-08-06 14:39:42 +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
|
|
|
|
2019-08-06 14:39:42 +02:00
|
|
|
export PATH=$_PROTOBUF_FOLDER/bin/:$PATH
|
|
|
|
fi
|
2019-05-12 00:08:10 +02:00
|
|
|
}
|