Browse Source

use preset dir for build-MultiCraft.sh and improve dependency script output

master
poikilos 5 years ago
committed by Jacob Gustafson
parent
commit
ccbe0f3a75
  1. 16
      build-MultiCraft.sh
  2. 191
      install-minetest-build-deps.sh

16
build-MultiCraft.sh

@ -13,14 +13,19 @@ customDie() {
echo
exit 1
}
if [ ! -d "$HOME/Downloads/git/MultiCraft" ]; then
mkdir -p "$HOME/Downloads/git/MultiCraft"
fi
cd $HOME/Downloads/git/MultiCraft || customDie "cd $HOME/Downloads/git/MultiCraft FAILED"
goodFlagFile=MultiCraft/CMakeLists.txt
if [ -f "`which git`" ]; then
echo "In `pwd`..."
if [ ! -d MultiCraft ]; then
git clone https://github.com/MultiCraft/MultiCraft.git || customDie "Cannot clone MultiCraft from `pwd`"
cd MultiCraft || customDie "Cannot cd MultiCraft from `pwd`"
else
cd MultiCraft || customDie "Cannot cd MultiCraft from `pwd`"
git pull || customDie "Cannot pull MultiCraft from `pwd`"
git pull || echo "WARNING: Cannot pull MultiCraft from `pwd`"
fi
else
if [ ! -f "$goodFlagFile" ]; then
@ -33,8 +38,13 @@ srcPath=.
flag1="-DOpenGL_GL_PREFERENCE=GLVND"
echo
echo "Running cmake srcPath..."
cmake $srcPath $flag1 || customDie "cmake failed. See any messages above for more information."
cmake $srcPath $flag1 -DRUN_IN_PLACE=1 -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=1 -DENABLE_LEVELDB=1 || customDie "cmake failed. See any messages above for more information. Run ./install-minetest-build-deps.sh if you did not."
echo
echo "Running make..."
make
make -j$(nproc) || customDie "make failed. See any messages above for more information. Run ./install-minetest-build-deps.sh if you did not."
if [ -f "`pwd`/bin/MultiCraft" ]; then
echo "`pwd`/bin/MultiCraft"
else
echo "`pwd`"
fi
echo "Done."

191
install-minetest-build-deps.sh

@ -22,119 +22,122 @@ sleep 1
echo
this_dnf=""
if [ -f "`command -v dnf`" ]; then
this_dnf="dnf"
this_dnf="dnf"
else
if [ -f "`command -v yum`" ]; then
this_dnf="yum"
echo "WARNING: dnf not found, reverting to yum."
fi
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"
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
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
echo "Using $this_apt..."
# 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
#libcurl4-openssl-dev: for announce to work
#libcurl4-openssl-dev: for announce to work
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
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
# 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
echo "Using pacman..."
# 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
echo "Using $this_dnf..."
# 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
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
# 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

Loading…
Cancel
Save