Browse Source

add marked icon for GitHub minetest

master
poikilos 5 years ago
committed by Jacob Gustafson
parent
commit
f034e6ff16
  1. 184
      utilities/extra/install-minetest.net-all-backends-systemwide.sh

184
utilities/extra/install-minetest.net-all-backends-systemwide.sh

@ -2,18 +2,18 @@
# this is the recommended script for servers # this is the recommended script for servers
# remove non-git version first: # remove non-git version first:
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." 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="" warnings=""
if [ "$1" = "both" ]; then if [ "$1" = "both" ]; then
msg="Installing minetest client AND server (param specified: both)." msg="Installing minetest client AND server (param specified: both)."
elif [ "$1" = "client" ]; then elif [ "$1" = "client" ]; then
msg="Installing minetest client ONLY (param specified: client)." msg="Installing minetest client ONLY (param specified: client)."
else else
if [ ! -z "$XDG_CURRENT_DESKTOP" ]; then 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)" warnings="WARNING: Detected $XDG_CURRENT_DESKTOP...you probably meant to install client or both (use client or both param after this script)"
fi fi
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
@ -21,8 +21,8 @@ echo
echo $msg echo $msg
echo $warnings echo $warnings
if [ ! -z "$warnings" ]; then if [ ! -z "$warnings" ]; then
echo "You may want to cancel and correct warnings above..." echo "You may want to cancel and correct warnings above..."
sleep 2 sleep 2
fi fi
#if [ -f "`command -v minetest`" ]; then #if [ -f "`command -v minetest`" ]; then
echo "* trying to remove any 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)..."
@ -38,93 +38,93 @@ echo "1..."
sleep 1 sleep 1
echo echo
if [ -f "`command -v apt`" ]; then if [ -f "`command -v 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 libhiredis-dev sudo apt -y install libncurses5-dev libgettextpo-dev doxygen libspatialindex-dev libpq-dev postgresql-server-dev-all libhiredis-dev
# added libpq-dev postgresql-server-dev-all (or specific version) are BOTH needed for PostgreSQL development as per https://stackoverflow.com/questions/13920383/findpostgresql-cmake-wont-work-on-ubuntu # added libpq-dev postgresql-server-dev-all (or specific version) are BOTH needed for PostgreSQL development as per https://stackoverflow.com/questions/13920383/findpostgresql-cmake-wont-work-on-ubuntu
# if you skip the above, the next step says missing: GetText, Curses, ncurses, Redis, SpatialIndex, Doxygen # if you skip the above, the next step says missing: GetText, Curses, ncurses, Redis, SpatialIndex, Doxygen
sudo apt -y install git build-essential libirrlicht-dev libgettextpo0 libfreetype6-dev cmake libbz2-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 sudo apt -y install git build-essential libirrlicht-dev libgettextpo0 libfreetype6-dev cmake libbz2-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 Xenial: # Ubuntu Xenial:
sudo apt -y install libpng12-dev libjpeg8-dev sudo apt -y install libpng12-dev libjpeg8-dev
# Nov 2018 or later Minetestserver: # Nov 2018 or later Minetestserver:
# sudo apt -y install liblua5.3-dev # still missing lua.h after this # sudo apt -y install liblua5.3-dev # still missing lua.h after this
# so see "-DLUA_INCLUDE_DIR" below instead # so see "-DLUA_INCLUDE_DIR" below instead
#luajit_path="/usr/include/lua5.1" #luajit_path="/usr/include/lua5.1"
if [ -d "$luajit_path" ]; then if [ -d "$luajit_path" ]; then
ext_lua=" -DLUA_INCLUDE_DIR=$luajit_path" ext_lua=" -DLUA_INCLUDE_DIR=$luajit_path"
else else
echo "WARNING: may not be able to find lua.h on Debian-based system on 2018+ versions of minetest if you do not have the packaged version of luajit installed in the '$luajit_path' directory..." echo "WARNING: may not be able to find lua.h on Debian-based system on 2018+ versions of minetest if you do not have the packaged version of luajit installed in the '$luajit_path' directory..."
sleep 2 sleep 2
fi fi
# 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 [ -f "`command -v 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 doxygen postgresql-libs 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 doxygen postgresql-libs 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 [ -f "`command -v 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
sudo dnf -y install -y gcc-c++ freetype-devel spatialindex-devel postgresql-devel doxygen irrlicht-devel gettext freetype cmake bzip2-devel libpng libjpeg-turbo libXxf86vm mesa-libGLU libsqlite3x-devel libogg-devel libvorbis-devel openal-devel curl-devel luajit-devel lua-devel leveldb-devel ncurses-devel redis hiredis-devel gmp-devel sudo dnf -y install -y gcc-c++ freetype-devel spatialindex-devel postgresql-devel doxygen irrlicht-devel gettext freetype cmake bzip2-devel libpng libjpeg-turbo libXxf86vm mesa-libGLU libsqlite3x-devel libogg-devel libvorbis-devel openal-devel curl-devel luajit-devel lua-devel leveldb-devel ncurses-devel redis hiredis-devel gmp-devel
cd cd
#git clone https://github.com/minetest/minetest.git #git clone https://github.com/minetest/minetest.git
#cd minetest/games #cd minetest/games
#git clone https://github.com/minetest/minetest_game.git #git clone https://github.com/minetest/minetest_game.git
#cd .. #cd ..
#cmake . -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=1 -DENABLE_LEVELDB=1 -DENABLE_REDIS=1 -DENABLE_POSTGRESQL=1 #cmake . -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=1 -DENABLE_LEVELDB=1 -DENABLE_REDIS=1 -DENABLE_POSTGRESQL=1
#make -j$(nproc) #make -j$(nproc)
#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 else
echo "WARNING: cannot remove packaged version, because your package manager is not known by this script." 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..." echo "Press Ctrl C to cancel, or wait to continue anyway..."
sleep 1 sleep 1
echo "3..." echo "3..."
sleep 1 sleep 1
echo "2..." echo "2..."
sleep 1 sleep 1
echo "1..." echo "1..."
sleep 1 sleep 1
fi fi
cd cd
if [ ! -d "Downloads" ]; then if [ ! -d "Downloads" ]; then
mkdir Downloads mkdir Downloads
fi fi
cd Downloads cd Downloads
#if [ -d minetest ]; then #if [ -d minetest ]; then
#echo "ERROR: Nothing done since 'minetest' already exists in `pwd`--delete it before cloning, or run the included update script to update." #echo "ERROR: Nothing done since 'minetest' already exists in `pwd`--delete it before cloning, or run the included update script to update."
#echo "Ctrl C or this window will exit..." #echo "Ctrl C or this window will exit..."
#echo "3..." #echo "3..."
#sleep 1 #sleep 1
#echo "2..." #echo "2..."
#sleep 1 #sleep 1
#echo "1..." #echo "1..."
#sleep 1 #sleep 1
#cd minetest #cd minetest
#else #else
if [ ! -d minetest ]; then if [ ! -d minetest ]; then
git clone https://github.com/minetest/minetest.git git clone https://github.com/minetest/minetest.git
cd minetest cd minetest
else else
cd minetest cd minetest
echo "updating: `pwd`" echo "updating: `pwd`"
git pull # --all # see https://forum.minetest.net/viewtopic.php?f=42&t=3837&start=125#p306449 git pull # --all # see https://forum.minetest.net/viewtopic.php?f=42&t=3837&start=125#p306449
fi fi
cd games cd games
if [ ! -d minetest_game ]; then if [ ! -d minetest_game ]; then
git clone https://github.com/minetest/minetest_game.git git clone https://github.com/minetest/minetest_game.git
else else
cd minetest_game cd minetest_game
echo "updating: `pwd`" echo "updating: `pwd`"
git pull # --all git pull # --all
cd .. cd ..
fi fi
#(does nothing since currently in games folder) git pull --all #(does nothing since currently in games folder) git pull --all
#echo "in: `pwd`" #echo "in: `pwd`"
@ -136,13 +136,13 @@ cd ..
echo "ENABLE_CURSES enables server-side terminal via --terminal option" echo "ENABLE_CURSES enables server-side terminal via --terminal option"
build_what="-DBUILD_SERVER=on -DBUILD_CLIENT=off" build_what="-DBUILD_SERVER=on -DBUILD_CLIENT=off"
if [ "$1" = "both" ]; then if [ "$1" = "both" ]; then
build_what="-DBUILD_SERVER=on -DBUILD_CLIENT=on" build_what="-DBUILD_SERVER=on -DBUILD_CLIENT=on"
echo "Building minetest and minetestserver (only)..." echo "Building minetest and minetestserver (only)..."
elif [ "$1" = "client" ]; then elif [ "$1" = "client" ]; then
build_what="-DBUILD_SERVER=off -DBUILD_CLIENT=on" build_what="-DBUILD_SERVER=off -DBUILD_CLIENT=on"
echo "Building minetest CLIENT (only)..." echo "Building minetest CLIENT (only)..."
else else
echo "Building minetestserver..." echo "Building minetestserver..."
fi fi
echo "3..." echo "3..."
@ -156,13 +156,25 @@ cmake .$ext_lua -DENABLE_GETTEXT=on -DENABLE_CURSES=on -DENABLE_FREETYPE=on -DEN
# -DCMAKE_BUILD_TYPE=Release as per https://aur.archlinux.org/minetest-git.git # -DCMAKE_BUILD_TYPE=Release as per https://aur.archlinux.org/minetest-git.git
make -j$(nproc) make -j$(nproc)
sudo make install sudo make install
target_shortcut=/usr/local/share/applications/net.minetest.minetest.desktop
tmp_shortcut=$target_shortcut.tmp
if [ -f "$target_shortcut" ]; then
sudo mv $target_shortcut $tmp_shortcut
# sudo bash -c "cat $tmp_shortcut | grep -v \"^Name=\" > $target_shortcut"
# sudo bash -c "echo 'Name=Minetest (GitHub)' >> $target_shortcut"
# see https://stackoverflow.com/questions/82256/how-do-i-use-sudo-to-redirect-output-to-a-location-i-dont-have-permission-to-wr
cat $tmp_shortcut | grep -v \"^Name=\" | sudo tee $target_shortcut > /dev/null
echo 'Name=Minetest (git)' | grep -v \"^Name=\" | sudo tee $target_shortcut >> /dev/null
fi
if [ -f "`command -v update-desktop-database`" ]; then if [ -f "`command -v update-desktop-database`" ]; then
echo "updating desktop database as per https://aur.archlinux.org/minetest-git.git" echo "updating desktop database as per https://aur.archlinux.org/minetest-git.git"
update-desktop-database &>/dev/null && update-desktop-database -q update-desktop-database &>/dev/null && update-desktop-database -q
fi fi
if [ -f "`command -v gtk-update-icon-cache`" ]; then if [ -f "`command -v gtk-update-icon-cache`" ]; then
echo "updating gtk icon cache as per https://aur.archlinux.org/minetest-git.git" echo "updating gtk icon cache as per https://aur.archlinux.org/minetest-git.git"
gtk-update-icon-cache &>/dev/null && gtk-update-icon-cache -q -t -f usr/share/icons/hicolor gtk-update-icon-cache &>/dev/null && gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
fi fi
# minetest; # minetest;
echo -e "\n\n\e[1;33mYou can run Minetest Server by typing \"minetestserver\" in a terminal, but using mtsenliven.py is recommended instead and keeps a config file for what world and subgame you want via minetestinfo.py.\e[0m" echo -e "\n\n\e[1;33mYou can run Minetest Server by typing \"minetestserver\" in a terminal, but using mtsenliven.py is recommended instead and keeps a config file for what world and subgame you want via minetestinfo.py.\e[0m"

Loading…
Cancel
Save