2019-02-26 21:35:27 +01:00
|
|
|
termux_setup_cmake() {
|
2020-08-09 00:52:31 +02:00
|
|
|
local TERMUX_CMAKE_MAJORVESION=3.18
|
2020-10-17 21:02:48 +02:00
|
|
|
local TERMUX_CMAKE_MINORVERSION=4
|
2019-02-26 21:35:27 +01:00
|
|
|
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
|
2020-10-22 21:45:33 +02:00
|
|
|
local TERMUX_CMAKE_FOLDER
|
|
|
|
|
|
|
|
if [ "${TERMUX_PACKAGES_OFFLINE-false}" = "true" ]; then
|
|
|
|
TERMUX_CMAKE_FOLDER=$TERMUX_SCRIPTDIR/build-tools/cmake-$TERMUX_CMAKE_VERSION
|
|
|
|
else
|
|
|
|
TERMUX_CMAKE_FOLDER=$TERMUX_COMMON_CACHEDIR/cmake-$TERMUX_CMAKE_VERSION
|
|
|
|
fi
|
2019-08-06 14:39:42 +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 "$TERMUX_CMAKE_FOLDER" ]; then
|
|
|
|
termux_download https://cmake.org/files/v$TERMUX_CMAKE_MAJORVESION/$TERMUX_CMAKE_TARNAME \
|
2019-02-26 21:35:27 +01:00
|
|
|
"$TERMUX_CMAKE_TARFILE" \
|
2020-10-17 21:02:48 +02:00
|
|
|
149e0cee002e59e0bb84543cf3cb099f108c08390392605e944daeb6594cbc29
|
2019-08-06 14:39:42 +02:00
|
|
|
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
|
2019-02-26 21:35:27 +01:00
|
|
|
fi
|
2019-08-06 14:39:42 +02:00
|
|
|
|
2019-02-26 21:35:27 +01:00
|
|
|
export CMAKE_INSTALL_ALWAYS=1
|
|
|
|
}
|