From 88db56be470f4363a0a807a7c088a9d138f6ea4b Mon Sep 17 00:00:00 2001 From: poikilos <7557867+poikilos@users.noreply.github.com> Date: Fri, 12 Feb 2021 09:35:54 -0500 Subject: [PATCH] Fix package manager detection. --- build-minetest-here.sh | 8 ++++++++ mtbuild.rc | 2 +- reset-minetest-install-source.sh | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/build-minetest-here.sh b/build-minetest-here.sh index 72979e5..f075ff8 100755 --- a/build-minetest-here.sh +++ b/build-minetest-here.sh @@ -9,6 +9,7 @@ customExit(){ # echo #fi # cd $mybuild || customExit "$0: cd build failed in '`pwd`'." + printf "* detecting EnlivenMinetest..." if [ -z "$ENLIVEN_REPO" ]; then try_default_enliven_repo="$HOME/git/EnlivenMinetest" @@ -24,11 +25,15 @@ if [ -z "$ENLIVEN_REPO" ]; then fi source mtbuild.rc if [ $? -ne 0 ]; then + printf "* trying \"$ENLIVEN_REPO/mtbuild.rc\"..." source "$ENLIVEN_REPO/mtbuild.rc" if [ $? -ne 0 ]; then + echo "FAILED" echo "Error:" echo "source mtbuild.rc failed. Try adding it to the path or $try_default_enliven_repo (or set ENLIVEN_REPO)" exit 1 + else + echo "OK" fi fi @@ -45,9 +50,12 @@ if [ ! -f "`command -v make`" ]; then fi if [ ! -z "$INSTALL_DEPS" ]; then + echo "* missing $INSTALL_DEPS" + echo " * Running '$DEPS_INSTALL'..." $DEPS_INSTALL if [ $? -ne 0 ]; then echo "Installing dependencies failed." + exit 1 fi fi diff --git a/mtbuild.rc b/mtbuild.rc index 189c92c..d01223f 100644 --- a/mtbuild.rc +++ b/mtbuild.rc @@ -4,7 +4,7 @@ FEDORA_DEPS_INSTALL="sudo dnf install -y $FEDORA_DEPS" UBUNTU_DEPS="libncurses5-dev libgettextpo-dev doxygen libspatialindex-dev libpq-dev postgresql-server-dev-all git build-essential libirrlicht-dev libgettextpo0 libfreetype6-dev cmake libbz2-dev libpng12-dev libjpeg8-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-openssl-dev libluajit-5.1-dev liblua5.1-0-dev libleveldb-dev" UBUNTU_DEPS_INSTALL="sudo apt-get update && sudo apt-get install -y $UBUNTU_DEPS" DEPS_INSTALL_MSG="something like $UBUNTU_DEPS_INSTALL #or $FEDORA_DEPS_INSTALL" -if [ ! -f "`command -v dnf`" ]; then +if [ -f "`command -v dnf`" ]; then DEPS_INSTALL="$FEDORA_DEPS_INSTALL" elif [ -f "`command -v yum`" ]; then FEDORA_DEPS_INSTALL="sudo yum install -y $FEDORA_DEPS" diff --git a/reset-minetest-install-source.sh b/reset-minetest-install-source.sh index 52e6558..ff6f68f 100755 --- a/reset-minetest-install-source.sh +++ b/reset-minetest-install-source.sh @@ -275,13 +275,18 @@ if [ -z "$ENLIVEN_REPO" ]; then fi source mtbuild.rc if [ $? -ne 0 ]; then + printf "* trying \"$ENLIVEN_REPO/mtbuild.rc\"..." source "$ENLIVEN_REPO/mtbuild.rc" if [ $? -ne 0 ]; then + echo "FAILED" echo "Error:" echo "source mtbuild.rc failed. Try adding it to the path or $try_default_enliven_repo (or set ENLIVEN_REPO)" exit 1 + else + echo "OK" fi fi + if [ $mtLibrariesCompileResult -ne 0 ]; then cat "$extracted_path/libraries.log" echo