setupenv: Add dependency check

Soda
BodgeMaster 2022-09-11 10:11:17 +02:00
parent aab91a2523
commit 8b92d24ab9
1 changed files with 67 additions and 1 deletions

View File

@ -51,4 +51,70 @@ if [ -f "$PROJECT_BASE_DIR/.localenv.bashrc" ]; then
echo "Loaded local environment customizations."
fi
echo ">>> Done."
echo ">>> Checking for dependencies..."
MISSING_DEPS=0
if command -v wget > /dev/null 2>&1; then
true
else
if command -v curl > /dev/null 2>&1; then
true
else
echo "WARNING: `wget` or `curl` is needed to download some additional dependencies."
MISSING_DEPS=1
fi
fi
if command -v sha256sum > /dev/null 2>&1; then
true
else
if command -v sha256 > /dev/null 2>&1; then
true
else
echo "WARNING: Coreutils `sha256sum` or a `sha256` as found on NetBSD is needed to verify downloaded files."
MISSING_DEPS=1
fi
fi
if command -v gzip > /dev/null 2>&1; then
true
else
echo "WARNING: `gzip` is needed to decompress downloaded dependencies."
MISSING_DEPS=1
fi
if command -v tar > /dev/null 2>&1; then
true
else
echo "WARNING: `tar` is needed to unpack downloaded dependencies."
MISSING_DEPS=1
fi
if command -v cmake > /dev/null 2>&1; then
true
else
echo "WARNING: `cmake` is needed to build downloaded dependencies."
MISSING_DEPS=1
fi
if [ -z "$CXX" ]; then
if command -v c++ > /dev/null 2>&1; then
true
else
echo "WARNING: Your system does not appear to have a standard C++ compiler. If you have a C++ compiler installed, but not linked to `c++` on your PATH, set it manually using `CXX=/path/to/your/compiler`."
MISSING_DEPS=1
fi
fi
if command -v xxd > /dev/null 2>&1; then
true
else
echo "WARNING: `xxd` is needed for some tool scripts."
MISSING_DEPS=1
fi
if [ "$MISSING_DEPS" -eq 0 ]; then
echo "All set."
fi
unset MISSING_DEPS