Browse Source

working on minetestenv and desktop detection

master
poikilos 6 years ago
committed by Jacob Gustafson
parent
commit
0cf607b66e
  1. 36
      install-minetestserver-git-all-backends.sh
  2. 66
      minetestenv.rc

36
install-minetestserver-git-all-backends.sh

@ -4,12 +4,28 @@
if [ -f "`command -v apt`" ]; then if [ -f "`command -v apt`" ]; then
sudo apt update sudo apt update
fi fi
msg="Installing minetestserver ONLY (no param specified). If you want to install the client on your server (not normal practice) or are on a computer with a graphical desktop, add client or both param when calling this script."
warnings=""
if [ "$1" = "both" ]; then
msg="Installing minetest client AND server (param specified: both)."
elif [ "$1" = "client" ]; then
msg="Installing minetest client ONLY (param specified: client)."
else
if [ ! -z "$XDG_CURRENT_DESKTOP" ]; then
warnings="WARNING: Detected $XDG_CURRENT_DESKTOP...you probably meant to install client or both (use client or both param after this script)"
fi
fi
echo "This script compiles AND installs minetestserver (NOT run-in-place, but rather system-wide) with leveldb, redis, and defaults postgresql, doxygen, sqlite3" echo "This script compiles AND installs minetestserver (NOT run-in-place, but rather system-wide) with leveldb, redis, and defaults postgresql, doxygen, sqlite3"
echo echo
echo echo
echo "If you want to install the client on your server (not normal practice), add client or both param when calling this script." echo $msg
echo $warnings
if [ ! -z "$warnings" ]; then
echo "You may want to cancel and correct warnings above..."
sleep 2
fi
#if [ -f "`command -v minetest`" ]; then #if [ -f "`command -v minetest`" ]; then
echo "Removing the non-git (packaged) version first (Press Ctrl C to cancel)..." echo "* trying to remove any non-git (packaged) version first (Press Ctrl C to cancel)..."
#fi #fi
sleep 1 sleep 1
echo "3..." echo "3..."
@ -19,7 +35,7 @@ sleep 1
echo "1..." echo "1..."
sleep 1 sleep 1
echo echo
if [ -f "`command -v apt`" ]; then if [ `which apt` ]; then
sudo apt -y remove minetest-server sudo apt -y remove minetest-server
sudo apt -y remove minetest sudo apt -y remove minetest
sudo apt -y install libncurses5-dev libgettextpo-dev doxygen libspatialindex-dev libpq-dev postgresql-server-dev-all sudo apt -y install libncurses5-dev libgettextpo-dev doxygen libspatialindex-dev libpq-dev postgresql-server-dev-all
@ -30,14 +46,14 @@ if [ -f "`command -v apt`" ]; then
sudo apt -y install libpng12-dev libjpeg8-dev sudo apt -y install libpng12-dev libjpeg8-dev
# Debian: # Debian:
sudo apt -y install libpng-dev libjpeg-dev sudo apt -y install libpng-dev libjpeg-dev
elif [ -f "`command -v pacman`" ]; then elif [ `which pacman` ]; then
sudo pacman -R --noconfirm minetest-server sudo pacman -R --noconfirm minetest-server
sudo pacman -R --noconfirm minetest sudo pacman -R --noconfirm minetest
echo "detected arch-based distro (tested only on antergos)..." echo "detected arch-based distro (tested only on antergos)..."
# NOTE: the regular packages include headers on arch-based distros: # NOTE: the regular packages include headers on arch-based distros:
sudo pacman -Syyu --noconfirm git spatialindex postgresql-libs doxygen postgresql-libs hiredis redis irrlicht gettext freetype2 bzip2 libpng libjpeg-turbo libxxf86vm mesa glu sqlite libogg libvorbis openal curl luajit leveldb ncurses redis hiredis gmp sudo pacman -Syyu --noconfirm git spatialindex postgresql-libs doxygen postgresql-libs hiredis redis irrlicht gettext freetype2 bzip2 libpng libjpeg-turbo libxxf86vm mesa glu sqlite libogg libvorbis openal curl luajit leveldb ncurses redis hiredis gmp
#can't find equivalent to libjpeg8-dev libxxf86vm-dev mesa sqlite libogg vorbis #can't find equivalent to libjpeg8-dev libxxf86vm-dev mesa sqlite libogg vorbis
elif [ -f "`command -v dnf`" ]; then elif [ `which dnf` ]; then
sudo dnf -y remove minetest-server sudo dnf -y remove minetest-server
sudo dnf -y remove minetest sudo dnf -y remove minetest
#see poikilos post at https://forum.minetest.net/viewtopic.php?f=42&t=3837&start=125 #see poikilos post at https://forum.minetest.net/viewtopic.php?f=42&t=3837&start=125
@ -52,6 +68,16 @@ elif [ -f "`command -v dnf`" ]; then
#sudo make install #sudo make install
#minetest #minetest
# echo -e "\n\n\e[1;33mYou can run Minetest again by typing \"minetest\" in a terminal or selecting it in an applications menu.\nYou can install mods in ~/.minetest/mods, too.\e[0m" # echo -e "\n\n\e[1;33mYou can run Minetest again by typing \"minetest\" in a terminal or selecting it in an applications menu.\nYou can install mods in ~/.minetest/mods, too.\e[0m"
else
echo "WARNING: cannot remove packaged version, because your package manager is not known by this script."
echo "Press Ctrl C to cancel, or wait to continue anyway..."
sleep 1
echo "3..."
sleep 1
echo "2..."
sleep 1
echo "1..."
sleep 1
fi fi
cd cd

66
minetestenv.rc

@ -1,4 +1,4 @@
CONFIGS_PATH="$HOME/.config/EnlivenMinetest" CONFIGS_PATH="$HOME/.config/EnlivenMinetest"
if [ ! -d "$CONFIGS_PATH" ]; then if [ ! -d "$CONFIGS_PATH" ]; then
mkdir -p "$CONFIGS_PATH" mkdir -p "$CONFIGS_PATH"
@ -15,35 +15,26 @@ if [ "$1" = "--help" ]; then
echo echo
exit 0 exit 0
fi fi
if [ "$1" = "version_0_5_enable=true" ]; then
version_0_5_enable="true" #NOTE: version_0_5_enable is now detected further down instead of being specified
elif [ "$2" = "version_0_5_enable=true" ]; then #if [ "$1" = "version_0_5_enable=true" ]; then
version_0_5_enable="true" # version_0_5_enable="true"
elif [ "$1" = "version_0_5_enable=false" ]; then #elif [ "$2" = "version_0_5_enable=true" ]; then
version_0_5_enable="false" # version_0_5_enable="true"
elif [ "$2" = "version_0_5_enable=false" ]; then #elif [ "$1" = "version_0_5_enable=false" ]; then
version_0_5_enable="false" # version_0_5_enable="false"
fi #elif [ "$2" = "version_0_5_enable=false" ]; then
# version_0_5_enable="false"
#fi
if [ "$1" = "local_enable=true" ]; then if [ "$1" = "local_enable=true" ]; then
local_enable="true" local_enable="true"
elif [ "$2" = "local_enable=true" ]; then #elif [ "$2" = "local_enable=true" ]; then
local_enable="true" # local_enable="true"
elif [ "$1" = "local_enable=false" ]; then elif [ "$1" = "local_enable=false" ]; then
# local_enable="false"
#elif [ "$2" = "local_enable=false" ]; then
local_enable="false" local_enable="false"
elif [ "$2" = "local_enable=false" ]; then
local_enable="false"
fi
if [ -f "$CONFIGS_PATH/local_enable" ]; then
local_enable=$(head -n 1 $CONFIGS_PATH/local_enable)
fi
if [ -f "$CONFIGS_PATH/version_0_5_enable" ]; then
version_0_5_enable=$(head -n 1 $CONFIGS_PATH/version_0_5_enable)
fi
if [ -z "$local_enable" ]; then
echo "$local_enable" > "$CONFIGS_PATH/local_enable"
fi
if [ -z "$version_0_5_enable" ]; then
echo "$version_0_5_enable" > "$CONFIGS_PATH/version_0_5_enable"
fi fi
#echo "3..." #echo "3..."
#sleep 1 #sleep 1
@ -108,12 +99,29 @@ if [ "$local_enable" != "false" ]; then
# IF git version is installed # IF git version is installed
try_path="/usr/local/share/minetest" try_path="/usr/local/share/minetest"
if [ -d "$try_path" ]; then if [ -d "$try_path" ]; then
if [ -z "$version_0_5_enable" ]; then #if [ -z "$version_0_5_enable" ]; then
version_0_5_enable="true" # version_0_5_enable="true"
fi #fi
USR_SHARE_MINETEST="$try_path" USR_SHARE_MINETEST="$try_path"
fi fi
fi fi
version_0_5_enable="false"
if [ -d "$USR_SHARE_MINETEST/games/minetest_game/mods/player_api" ]; then
version_0_5_enable="true"
fi
if [ -f "$CONFIGS_PATH/local_enable" ]; then
local_enable=$(head -n 1 $CONFIGS_PATH/local_enable)
fi
if [ -f "$CONFIGS_PATH/version_0_5_enable" ]; then
version_0_5_enable=$(head -n 1 $CONFIGS_PATH/version_0_5_enable)
fi
if [ -z "$local_enable" ]; then
echo "$local_enable" > "$CONFIGS_PATH/local_enable"
fi
if [ -z "$version_0_5_enable" ]; then
echo "$version_0_5_enable" > "$CONFIGS_PATH/version_0_5_enable"
fi
mtgame_name="minetest_game" mtgame_name="minetest_game"
MT_MINETEST_GAME_PATH=$USR_SHARE_MINETEST/games/$mtgame_name MT_MINETEST_GAME_PATH=$USR_SHARE_MINETEST/games/$mtgame_name
#echo "3..." #echo "3..."

Loading…
Cancel
Save