From 4fa2e352247450906ef7e69fcd506e3cd04e6de1 Mon Sep 17 00:00:00 2001 From: a-bad-dev <244852891+a-bad-dev@users.noreply.github.com> Date: Mon, 26 Jan 2026 00:11:40 -0400 Subject: [PATCH] update build script --- build.sh | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/build.sh b/build.sh index 2e591a7..f12a70c 100644 --- a/build.sh +++ b/build.sh @@ -1,19 +1,27 @@ #!/bin/bash -e # Builds an AppImage using appimagetool. -# You need to run this inside of a build directory in the source tree, -# it will generate the build files and compile Minetest for you. +# Run this script on an aarch64 computer, running modern debian or +# something similar, otherwise it's not going to work... -# This script should be run on Debian 11 Bullseye. +VERSION="5.15.0" -apt-get install -y git g++ make ninja-build libc6-dev cmake libpng-dev libjpeg-dev libxi-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-openssl-dev libfreetype6-dev zlib1g-dev libgmp-dev libzstd-dev libleveldb-dev gettext desktop-file-utils ca-certificates wget file --no-install-recommends +BOLD="\033[1m" +GREEN="\033[32m" +RESET="\033[0m" +echo -e "${BOLD}Downloading deps...${RESET}" +apt-get install -y git g++ make ninja-build libc6-dev cmake libpng-dev libjpeg-dev libxi-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-openssl-dev libfreetype6-dev zlib1g-dev libgmp-dev libsdl2-dev libzstd-dev libleveldb-dev gettext desktop-file-utils ca-certificates wget file --no-install-recommends + +echo -e "${BOLD}Downloading LuaJIT and Luanti source code...${RESET}" git clone --depth 1 https://github.com/LuaJIT/LuaJIT.git luajit -git clone --depth 1 --branch stable-5 https://github.com/luanti-org/luanti.git +wget -O luanti.zip https://github.com/luanti-org/luanti/archive/refs/tags/${VERSION}.zip +unzip luanti.zip +mv luanti-${VERSION} luanti/ -# COMPILE LUAJIT +echo -e "${BOLD}Compiling LuaJIT...${RESET}" pushd luajit -make amalg -j4 +make amalg -j$(nproc) popd pushd luanti @@ -23,27 +31,30 @@ mkdir -p build; cd build if [ ! -f appimagetool ]; then # Old version of appimagetool: #wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-aarch64.AppImage -O appimagetool + echo -e "${BOLD}Downloading AppImageTool${RESET}" wget https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-aarch64.AppImage -O appimagetool chmod +x appimagetool fi # Compile and install into AppDir +echo -e "${BOLD}Compiling Luanti...${RESET}" cmake .. -G Ninja \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=AppDir/usr \ -DBUILD_UNITTESTS=OFF \ -DENABLE_SYSTEM_JSONCPP=OFF \ -DLUA_INCLUDE_DIR=../../luajit/src/ \ -DLUA_LIBRARY=../../luajit/src/libluajit.a -ninja +ninja -j$(nproc) objcopy --only-keep-debug ../bin/luanti luanti.debug objcopy --strip-debug --add-gnu-debuglink=luanti.debug ../bin/luanti -ninja install +ninja install -j$(nproc) cd AppDir +echo -e "${BOLD}Building AppImage...${RESET}" # Put desktop and icon at root ln -sf usr/share/applications/org.luanti.luanti.desktop luanti.desktop ln -sf usr/share/icons/hicolor/128x128/apps/luanti.png luanti.png @@ -87,13 +98,13 @@ done cd .. ARCH=aarch64 ./appimagetool --appimage-extract-and-run AppDir/ -# Move the appimage to ~ +# Move the appimage to this script's folder mv Luanti-aarch64.AppImage ../../luanti-5.15.0-aarch64.AppImage # Clean up cd ../.. -rm -rf luanti/ +rm -rf luanti{,.zip} rm -rf luajit/ -echo "Done!" +echo -e "${BOLD}${GREEN}Done!${RESET}"