34 lines
1.2 KiB
Bash
34 lines
1.2 KiB
Bash
termux_setup_cmake() {
|
|
local TERMUX_CMAKE_MAJORVESION=3.15
|
|
local TERMUX_CMAKE_MINORVERSION=5
|
|
local TERMUX_CMAKE_VERSION=$TERMUX_CMAKE_MAJORVESION.$TERMUX_CMAKE_MINORVERSION
|
|
local TERMUX_CMAKE_TARNAME=cmake-${TERMUX_CMAKE_VERSION}-Linux-x86_64.tar.gz
|
|
local TERMUX_CMAKE_TARFILE=$TERMUX_PKG_TMPDIR/$TERMUX_CMAKE_TARNAME
|
|
local TERMUX_CMAKE_FOLDER=$TERMUX_COMMON_CACHEDIR/cmake-$TERMUX_CMAKE_VERSION
|
|
|
|
if [ "$TERMUX_ON_DEVICE_BUILD" = "false" ]; then
|
|
if [ ! -d "$TERMUX_CMAKE_FOLDER" ]; then
|
|
termux_download https://cmake.org/files/v$TERMUX_CMAKE_MAJORVESION/$TERMUX_CMAKE_TARNAME \
|
|
"$TERMUX_CMAKE_TARFILE" \
|
|
03cfd669d0f990040ec89bb63a3ae7f6d61fd17c1c4d5e7ec3d1a35fe1f043f0
|
|
rm -Rf "$TERMUX_PKG_TMPDIR/cmake-${TERMUX_CMAKE_VERSION}-Linux-x86_64"
|
|
tar xf "$TERMUX_CMAKE_TARFILE" -C "$TERMUX_PKG_TMPDIR"
|
|
mv "$TERMUX_PKG_TMPDIR/cmake-${TERMUX_CMAKE_VERSION}-Linux-x86_64" \
|
|
"$TERMUX_CMAKE_FOLDER"
|
|
fi
|
|
|
|
export PATH=$TERMUX_CMAKE_FOLDER/bin:$PATH
|
|
else
|
|
if [ "$(dpkg-query -W -f '${db:Status-Status}\n' cmake 2>/dev/null)" != "installed" ]; then
|
|
echo "Package 'cmake' is not installed."
|
|
echo "You can install it with"
|
|
echo
|
|
echo " pkg install cmake"
|
|
echo
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
export CMAKE_INSTALL_ALWAYS=1
|
|
}
|