be0b9e9331
First step of making possibility to have offline snapshots of 'termux-packages' repo. Useful for making full repo snapshots. That will allow to preinstall tools like Cmake, Go, Meson to directory stored within packages tree and will not be wiped when using ./clean.sh. Next steps will also implement offlining of the package sources and NDK standalone toolchain.
28 lines
1.1 KiB
Bash
28 lines
1.1 KiB
Bash
termux_setup_protobuf() {
|
|
local _PROTOBUF_VERSION=$(bash -c ". $TERMUX_SCRIPTDIR/packages/libprotobuf/build.sh; echo \${TERMUX_PKG_VERSION:2}")
|
|
local _PROTOBUF_ZIP=protoc-$_PROTOBUF_VERSION-linux-x86_64.zip
|
|
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
|
|
|
|
if [ "$TERMUX_ON_DEVICE_BUILD" = "false" ]; then
|
|
if [ ! -d "$_PROTOBUF_FOLDER" ]; then
|
|
termux_download \
|
|
https://github.com/protocolbuffers/protobuf/releases/download/v$_PROTOBUF_VERSION/$_PROTOBUF_ZIP \
|
|
$TERMUX_PKG_TMPDIR/$_PROTOBUF_ZIP \
|
|
4a3b26d1ebb9c1d23e933694a6669295f6a39ddc64c3db2adf671f0a6026f82e
|
|
|
|
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
|
|
|
|
export PATH=$_PROTOBUF_FOLDER/bin/:$PATH
|
|
fi
|
|
}
|