Browse Source

change installer to minetest.org rolling release runinplace

master
poikilos 6 years ago
committed by Jacob Gustafson
parent
commit
30e7e15e52
  1. 5
      README.md
  2. 6
      etc/unused/install-minetest.net-all-backends-systemwide.sh
  3. 138
      install-minetest-build-deps.sh
  4. 210
      install-minetest.sh

5
README.md

@ -476,5 +476,10 @@ Qt5Widgets.dll
## Developer Notes ## Developer Notes
### minetest.org build speeds
* Intel i7-4770K
* libraries ~3m
* program ~4m
### Regression Tests ### Regression Tests
* Use of input in python, where should never be used except in poikilos.py and minetestinfo.py for first-time setup or when interactive_enable is True * Use of input in python, where should never be used except in poikilos.py and minetestinfo.py for first-time setup or when interactive_enable is True

6
install-minetestserver-git-all-backends.sh → etc/unused/install-minetest.net-all-backends-systemwide.sh

@ -40,9 +40,9 @@ 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 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 below 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
@ -64,7 +64,7 @@ elif [ -f "`command -v pacman`" ]; then
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 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

138
install-minetest-build-deps.sh

@ -0,0 +1,138 @@
#!/bin/bash
enable_postgres="false"
enable_redis="false"
if [ "$1" = "redis" ]; then enable_redis="true"; fi
if [ "$2" = "redis" ]; then enable_redis="true"; fi
if [ "$3" = "redis" ]; then enable_redis="true"; fi
if [ "$1" = "postgres" ]; then enable_postgres="true"; fi
if [ "$2" = "postgres" ]; then enable_postgres="true"; fi
if [ "$3" = "postgres" ]; then enable_postgres="true"; fi
#if [ -f "`command -v minetest`" ]; then
#echo "* trying to remove any non-git (packaged) version first (Press Ctrl C to cancel)..."
luajit_path="/usr/include/luajit-2.1"
ext_lua=""
#fi
sleep 1
echo "3..."
sleep 1
echo "2..."
sleep 1
echo "1..."
sleep 1
echo
this_dnf=""
if [ -f "`command -v dnf`" ]; then
this_dnf = "dnf"
else
if [ -f "`command -v yum`" ]; then
this_dnf = "yum"
echo "WARNING: dnf not found, reverting to yum."
fi
fi
this_apt=""
if [ -f "`command -v apt`" ]; then
this_apt = "apt"
else
if [ -f "`command -v apt-get`" ]; then
this_apt = "apt-get"
echo "WARNING: apt not found, reverting to apt-get."
fi
fi
if [ ! -z "$this_apt" ]; then
# sudo $this_apt -y remove minetest-server
# sudo $this_apt -y remove minetest
sudo $this_apt update
sudo $this_apt -y install \
autoconf automake autopoint autotools-dev \
bash binutils bison bzip2 \
cmake coreutils e2fsprogs expat \
flex fontconfig g++ gawk \
gcc gettext git g++-multilib \
gperf grep gzip htop \
icu-devtools intltool joe less \
libbz2-dev libc6-dev-i386 libedit-dev libexpat1-dev \
libgmp-dev libjpeg-dev libltdl-dev libncurses5-dev \
libogg-dev libopenal-dev libpng-dev libreadline-dev \
libsqlite3-dev libssl-dev libtool libtool-bin \
libvorbis-dev libx11-dev libxxf86vm-dev lynx \
nano nettle-dev p7zip-full patch \
perl pkg-config python3 python3-dev \
python-dev rake ruby sed \
tar tcl unzip util-linux \
wget xz-utils zip \
\
libcurl4-openssl-dev \
libfreetype6-dev \
libgdk-pixbuf2.0-dev \
libglu1-mesa-dev \
libxml-parser-perl \
xserver-xorg-dev
if [ "$enable_redis" = "true" ]; then
sudo $this_apt -y install libhiredis-dev
fi
if [ "$enable_postgres" = "true" ]; then
sudo $this_apt -y install libpq-dev postgresql-server-dev-all
fi
# Some issues on Fedora ~27:
# sudo apt -y install libncurses5-dev libgettextpo-dev doxygen libspatialindex-dev libpq-dev postgresql-server-dev-all
# if you skip the above, the next step says missing: GetText, Curses, ncurses, Redis, SpatialIndex, Doxygen
elif [ -f "`command -v pacman`" ]; then
# sudo pacman -R --noconfirm minetest-server
# sudo pacman -R --noconfirm minetest
sudo pacman -Syu --noconfirm \
autoconf automake bzip2 cmake \
curl expat flex freetype2 \
gcc git gmp libedit \
libgccjit libjpeg-turbo libogg libpng \
libstdc++5 libtool libvorbis make \
ncurses openal openssl patch \
pkgconf python python2 readline \
ruby tcl which xorg-server \
xz zlib
# The above should work since taken from the build kit instructions
# (When writing my old script, I somehow couldn't find equivalents of:
# libjpeg8-dev libxxf86vm-dev mesa sqlite libogg vorbis -poikilos)
if [ "$enable_redis" = "true" ]; then
sudo pacman -Syu --noconfirm hiredis redis
fi
if [ "$enable_postgres" = "true" ]; then
sudo pacman -Syu --noconfirm postgresql-libs
fi
elif [ ! -z "$this_dnf" ]; then
# sudo $this_dnf -y remove minetest-server
# sudo $this_dnf -y remove minetest
sudo $this_dnf -y install \
autoconf automake bzip2 \
bzip2-devel cmake expat-devel \
flex fontconfig-devel freetype-devel \
gcc gcc-c++ git \
glibc-devel gmp-devel libcurl-devel \
libedit-devel libgcc libjpeg-devel \
libogg-devel libpng-devel libstdc++-devel \
libtool libvorbis-devel libX11-devel \
lzo-devel make ncurses-devel \
openal-soft-devel openssl-devel patch \
pkgconf readline-devel ruby \
tcl which xz \
zlib-devel xorg-x11-server-devel
if [ "$enable_redis" = "true" ]; then
sudo $this_dnf -y install redis hiredis-devel
fi
if [ "$enable_postgres" = "true" ]; then
sudo $this_dnf -y install postgresql-devel
fi
else
# echo "WARNING: cannot remove packaged version, because your package manager is not known by this script."
echo "WARNING: cannot Install dependencies, because your package manager is not known by this script."
exit 1
fi

210
install-minetest.sh

@ -0,0 +1,210 @@
#!/bin/bash
# The git repo ONLY includes the core engine: http://localhost:3000/minetest/minetest.git
# The build kit should be used, & has "patched Irrlicht, the new LuaJit, built-in LevelDB and Snappy support, Bucket Game, Bucket City, Wonder World, the schems collection, and other pieces"
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=""
enable_postgres=false
enable_redis=false
MAKEDEBUG=false
TIDYUP=true
postgresql_line="-DENABLE_POSTGRESQL=0"
redis_line="-DENABLE_REDIS=0"
server_line="-DBUILD_SERVER=1"
client_line="-DBUILD_CLIENT=1"
#build_what="-DBUILD_SERVER=1 -DBUILD_CLIENT=1"
for var in "$@"
do
if [ "$var" == "--remove-release" ]; then
if [ ! -f git_flag ]; then
if [ -d minetest ]; then
rm -fr minetest
fi
fi
fi
done
force_enable_server=false
force_enable_client=false
for var in "$@"
do
if [ "$var" == "--postgres" ]; then
enable_postgres=true
postgresql_line="-DENABLE_POSTGRESQL=1"
elif [ "$var" == "--redis" ]; then
enable_redis=true
redis_line="-DENABLE_REDIS=1"
elif [ "$var" == "--server" ]; then
server_line="-DBUILD_SERVER=1"
if [ "$force_enable_client" = "false" ]; then
client_line="-DBUILD_CLIENT=0"
fi
force_enable_server=true
#build_what="-DBUILD_SERVER=on -DBUILD_CLIENT=off"
elif [ "$var" == "--client" ]; then
if [ "$force_enable_server" = "false" ]; then
server_line="-DBUILD_SERVER=0"
fi
client_line="-DBUILD_CLIENT=1"
force_enable_client=true
#build_what="-DBUILD_SERVER=off -DBUILD_CLIENT=on"
elif [ "$var" == "--no-tidyup" ]; then
TIDYUP=false
elif [ "$var" == "--git" ]; then
touch git_flag
if [ ! -d minetest ]; then
git clone http://localhost:3000/minetest/minetest.git
else
cd minetest
git pull
cd ..
fi
elif [ "$var" == "--debug" ]; then
MAKEDEBUG=true
fi
done
echo "Backends:"
echo "* leveldb (by default)"
echo "* sqlite3 (by default)"
if [ "$enable_redis" = "true" ]; then
echo "* redis"
else
echo " (skipping redis--not used by default in this version)"
fi
if [ "$enable_postgres" = "true" ]; then
echo "* postgres"
else
echo " (skipping postgresql--not used by default in this version)"
fi
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 $msg
echo $warnings
echo
echo
if [ ! -z "$warnings" ]; then
echo "You may want to cancel and correct warnings above..."
echo "(If you do not press Ctrl C, install will continue anyway)"
echo "3..."
sleep 1
echo "2..."
sleep 1
echo "1..."
sleep 1
fi
cd
if [ ! -d "Downloads" ]; then
mkdir Downloads
fi
cd Downloads
#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 "Ctrl C or this window will exit..."
#echo "3..."
#sleep 1
#echo "2..."
#sleep 1
#echo "1..."
#sleep 1
#cd minetest
#else
zip_name="linux-minetest-kit.zip"
extracted_name="linux-minetest-kit"
wget -O $zip_name https://downloads.minetest.org/$zip_name
if [ ! -f "$zip_name" ]; then
echo "ERROR: Nothing done since $zip_name could not be downloaded."
exit 1
fi
unzip -u "$zip_name"
# -o overwrite non-interactively
# -u update files, create if necessary
if [ ! -d "$extracted_name" ]; then
echo "ERROR: Nothing done since after extracting $zip_name, there is"
echo " still no directory: $extracted_name"
exit 2
fi
cd "$extracted_name"
bash -e mtcompile-libraries.sh build >& libraries.log
bash -e mtcompile-program.sh build >& program.log
exit 0
if [ ! -d minetest ]; then
git clone https://github.com/minetest/minetest.git
cd minetest
else
cd minetest
echo "updating: `pwd`"
git pull # --all # see https://forum.minetest.net/viewtopic.php?f=42&t=3837&start=125#p306449
fi
cd games
if [ ! -d minetest_game ]; then
git clone https://github.com/minetest/minetest_game.git
else
cd minetest_game
echo "updating: `pwd`"
git pull # --all
cd ..
fi
#(does nothing since currently in games folder) git pull --all
#echo "in: `pwd`"
cd ..
#echo "in: `pwd`"
#echo "..."
#sleep 10
# heavily modified from forum url above due to hints from AUR files obtained via git clone https://aur.archlinux.org/minetest-git-leveldb.git
echo "ENABLE_CURSES enables server-side terminal via --terminal option"
build_what="-DBUILD_SERVER=on -DBUILD_CLIENT=off"
if [ "$1" = "both" ]; then
build_what="-DBUILD_SERVER=on -DBUILD_CLIENT=on"
echo "Building minetest and minetestserver (only)..."
elif [ "$1" = "client" ]; then
build_what="-DBUILD_SERVER=off -DBUILD_CLIENT=on"
echo "Building minetest CLIENT (only)..."
else
echo "Building minetestserver..."
fi
echo "3..."
sleep 1
echo "2..."
sleep 1
echo "1..."
sleep 1
cmake .$ext_lua -DENABLE_GETTEXT=on -DENABLE_CURSES=on -DENABLE_FREETYPE=on -DENABLE_LEVELDB=on -DENABLE_CURL=on -DENABLE_GETTEXT=on -DENABLE_REDIS=on -DENABLE_POSTGRESQL=on -DRUN_IN_PLACE=off -DCMAKE_BUILD_TYPE=Release $build_what
# NOTE: as long as -DRUN_IN_PLACE=off, above installs correctly without -DCMAKE_INSTALL_PREFIX=/usr which for some reason is used by https://aur.archlinux.org/minetest-git.git
# -DCMAKE_BUILD_TYPE=Release as per https://aur.archlinux.org/minetest-git.git
make -j$(nproc)
sudo make install
if [ -f "`command -v update-desktop-database`" ]; then
echo "updating desktop database as per https://aur.archlinux.org/minetest-git.git"
update-desktop-database &>/dev/null && update-desktop-database -q
fi
if [ -f "`command -v gtk-update-icon-cache`" ]; then
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
fi
# 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 "The only known uninstall method is:"
echo " cd $HOME/Downloads/minetest"
echo " sudo xargs rm < install_manifest.txt"
echo " # as per http://irc.minetest.net/minetest/2015-08-06"
# based on https://forum.minetest.net/viewtopic.php?f=42&t=3837 (below)
# sudo apt-get install -y 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; cd; git clone https://github.com/minetest/minetest.git; cd minetest/games; git clone https://github.com/minetest/minetest_game.git; cd ..; cmake . -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=1 -DENABLE_LEVELDB=1; make -j$(nproc); sudo make install; 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"
Loading…
Cancel
Save