Browse Source

Try to get dependencies before cmake.

master
poikilos 4 years ago
parent
commit
d6eb7f81de
  1. 38
      build-minetest-here.sh
  2. 20
      mtbuild.rc
  3. 32
      reset-minetest-install-source.sh

38
build-minetest-here.sh

@ -9,9 +9,42 @@ customExit(){
# echo # echo
#fi #fi
# cd $mybuild || customExit "$0: cd build failed in '`pwd`'." # cd $mybuild || customExit "$0: cd build failed in '`pwd`'."
if [ -z "$ENLIVEN_REPO" ]; then
try_default_enliven_repo="$HOME/git/EnlivenMinetest"
for try_enliven_repo in "$HOME/Downloads/poikilos/EnlivenMinetest" "$HOME/Downloads/EnlivenMinetest" "$try_default_enliven_repo"
do
if [ -d "$try_enliven_repo" ]; then
ENLIVEN_REPO="$try_enliven_repo"
fi
done
fi
source mtbuild.rc
if [ $? -ne 0 ]; then
echo "Error:"
echo "source mtbuild.rc failed. Try adding it to the path or $try_default_enliven_repo (or set ENLIVEN_REPO)"
exit 1
fi
if [ -z "$KEEP_MAKE" ]; then if [ -z "$KEEP_MAKE" ]; then
KEEP_MAKE=0 KEEP_MAKE=0
fi fi
INSTALL_DEPS=
if [ ! -f "`command -v cmake`" ]; then
INSTALL_DEPS="$INSTALL_DEPS cmake"
fi
if [ ! -f "`command -v make`" ]; then
INSTALL_DEPS="$INSTALL_DEPS make"
fi
if [ ! -z "$INSTALL_DEPS" ]; then
$DEPS_INSTALL
if [ $? -ne 0 ]; then
echo "Installing dependencies failed."
fi
fi
if [ -f bin/minetest ]; then if [ -f bin/minetest ]; then
if [ "$KEEP_MAKE" != "1" ]; then if [ "$KEEP_MAKE" != "1" ]; then
echo "* [build-minetest-here.sh] running 'make clean' in `pwd`..." echo "* [build-minetest-here.sh] running 'make clean' in `pwd`..."
@ -66,6 +99,11 @@ if [ ! -z "$BUILD_SERVER" ]; then
fi fi
echo "* [build-minetest-here.sh] running cmake in `pwd`..." echo "* [build-minetest-here.sh] running cmake in `pwd`..."
cmake . $server_line $client_line -DOpenGL_GL_PREFERENCE=GLVND -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=1 -DENABLE_LEVELDB=1 -DENABLE_REDIS=1 -DRUN_IN_PLACE=$RUN_IN_PLACE && make -j$(grep -c processor /proc/cpuinfo) || customExit "$0: Build failed in '`pwd`'." cmake . $server_line $client_line -DOpenGL_GL_PREFERENCE=GLVND -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=1 -DENABLE_LEVELDB=1 -DENABLE_REDIS=1 -DRUN_IN_PLACE=$RUN_IN_PLACE && make -j$(grep -c processor /proc/cpuinfo) || customExit "$0: Build failed in '`pwd`'."
if [ $? -ne 0 ]; then
echo
echo "cmake failed. Try:"
echo "$DEPS_INSTALL"
fi
echo echo
if [ "@$RUN_IN_PLACE" = "@1" ]; then if [ "@$RUN_IN_PLACE" = "@1" ]; then
echo "[build-minetest-here.sh] WARNING: do not do make install with -DRUN_IN_PLACE=$RUN_IN_PLACE!" echo "[build-minetest-here.sh] WARNING: do not do make install with -DRUN_IN_PLACE=$RUN_IN_PLACE!"

20
mtbuild.rc

@ -0,0 +1,20 @@
#!/bin/sh
FEDORA_DEPS="gcc-c++ 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 libtool"
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
DEPS_INSTALL="$FEDORA_DEPS_INSTALL"
elif [ -f "`command -v yum`" ]; then
FEDORA_DEPS_INSTALL="sudo yum install -y $FEDORA_DEPS"
DEPS_INSTALL="$FEDORA_DEPS_INSTALL"
elif [ -f "`command -v apt`" ]; then
UBUNTU_DEPS_INSTALL="sudo apt update && sudo apt install -y $UBUNTU_DEPS"
DEPS_INSTALL="$UBUNTU_DEPS_INSTALL"
elif [ -f "`command -v apt-get`" ]; then
DEPS_INSTALL="$UBUNTU_DEPS_INSTALL"
fi
if [ ! -z "$DEPS_INSTALL" ]; then
DEPS_INSTALL_MSG="$DEPS_INSTALL"
fi

32
reset-minetest-install-source.sh

@ -259,24 +259,20 @@ fi
if [ -z "$DEPS_INSTALL" ]; then if [ -z "$DEPS_INSTALL" ]; then
DEPS_INSTALL= DEPS_INSTALL=
fi fi
FEDORA_DEPS="gcc-c++ 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 libtool" if [ -z "$ENLIVEN_REPO" ]; then
FEDORA_DEPS_INSTALL="sudo dnf install -y $FEDORA_DEPS" try_default_enliven_repo="$HOME/git/EnlivenMinetest"
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" for try_enliven_repo in "$HOME/Downloads/poikilos/EnlivenMinetest" "$HOME/Downloads/EnlivenMinetest" "$try_default_enliven_repo"
UBUNTU_DEPS_INSTALL="sudo apt-get update && sudo apt-get install -y $UBUNTU_DEPS" do
DEPS_INSTALL_MSG="something like $UBUNTU_DEPS_INSTALL #or $FEDORA_DEPS_INSTALL" if [ -d "$try_enliven_repo" ]; then
if [ ! -f "`command -v dnf`" ]; then ENLIVEN_REPO="$try_enliven_repo"
DEPS_INSTALL="$FEDORA_DEPS_INSTALL" fi
elif [ -f "`command -v yum`" ]; then done
FEDORA_DEPS_INSTALL="sudo yum install -y $FEDORA_DEPS" fi
DEPS_INSTALL="$FEDORA_DEPS_INSTALL" source mtbuild.rc
elif [ -f "`command -v apt`" ]; then if [ $? -ne 0 ]; then
UBUNTU_DEPS_INSTALL="sudo apt update && sudo apt install -y $UBUNTU_DEPS" echo "Error:"
DEPS_INSTALL="$UBUNTU_DEPS_INSTALL" echo "source mtbuild.rc failed. Try adding it to the path or $try_default_enliven_repo (or set ENLIVEN_REPO)"
elif [ -f "`command -v apt-get`" ]; then exit 1
DEPS_INSTALL="$UBUNTU_DEPS_INSTALL"
fi
if [ ! -z "$DEPS_INSTALL" ]; then
DEPS_INSTALL_MSG="$DEPS_INSTALL"
fi fi
if [ $mtLibrariesCompileResult -ne 0 ]; then if [ $mtLibrariesCompileResult -ne 0 ]; then
cat "$extracted_path/libraries.log" cat "$extracted_path/libraries.log"

Loading…
Cancel
Save