Skip to content

Instantly share code, notes, and snippets.

@TheBrokenRail
Created August 1, 2022 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheBrokenRail/13cc7f66cc53a385b22c04019c19c1ef to your computer and use it in GitHub Desktop.
Save TheBrokenRail/13cc7f66cc53a385b22c04019c19c1ef to your computer and use it in GitHub Desktop.
#!/bin/sh
set -e
# Clone Minetest
rm -rf minetest
git clone --depth 1 https://github.com/minetest/minetest.git
cd minetest
git clone --depth 1 https://github.com/minetest/minetest_game.git games/minetest_game
# Clone Irrlicht
git clone --depth 1 https://github.com/minetest/irrlicht.git lib/irrlichtmt
# Configure Irrlicht
cd lib/irrlichtmt
disable_feature() {
sed -i "s/^#define $1.*\$//g" include/IrrCompileConfig.h
}
enable_feature() {
sed -i "s/^#ifdef NO$1.*\$/#ifndef $1\n#define $1\n#endif\n#if 0/g" include/IrrCompileConfig.h
}
disable_feature _IRR_COMPILE_WITH_OPENGL_
disable_feature _IRR_COMPILE_WITH_OGLES1_
disable_feature _IRR_COMPILE_WITH_WEBGL1_
disable_feature _IRR_COMPILE_WITH_SOFTWARE_
disable_feature _IRR_COMPILE_WITH_BURNINGSVIDEO_
enable_feature _IRR_COMPILE_WITH_OGLES2_
enable_feature _IRR_LINUX_X11_XINPUT2_
cd ../../
# Copy Shaders
rm -rf client/shaders/Irrlicht
cp -r lib/irrlichtmt/media/Shaders client/shaders/Irrlicht
# Configure Minetest
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DENABLE_GLES=TRUE \
-DENABLE_TOUCH=TRUE \
-DRUN_IN_PLACE=FALSE \
-DBUILD_UNITTESTS=FALSE \
-DVERSION_EXTRA=mobile \
..
# Build
make -j$(nproc)
# Install Files
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment