Scripts To Build Minetest For Mobile Linux
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
1.7 KiB

set -e
# Clone Minetest
rm -rf minetest
git clone
cd minetest
git clone --depth 1 games/minetest_game
# Get Version
DEB_VERSION="$(git describe --tags --dirty)"
# Clone Irrlicht
git clone --depth 1 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_
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_C_COMPILER=aarch64-linux-gnu-gcc \
-DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \
# Build
make -j$(nproc)
# Prepare
rm -rf tmp
mkdir tmp
rm -rf /out/*
mkdir -p /out
# Install Files
make install DESTDIR="$(pwd)/tmp"
# Prepare Debian
cp -r ../../DEBIAN tmp/DEBIAN
sed -i 's/${VERSION}/'"${DEB_VERSION}"'/g' tmp/DEBIAN/control
# Make DEB
dpkg -b tmp /out
# Clean Up
rm -rf tmp