From cd5d4b938372749fc70b4ce1135cad1cce94cadf Mon Sep 17 00:00:00 2001 From: a-bad-dev <244852891+a-bad-dev@users.noreply.github.com> Date: Mon, 20 Apr 2026 13:25:27 -0300 Subject: [PATCH 01/10] update scripts and mark them as executable (aarch64 script currently untested) --- build-aarch64.sh | 42 +++++++++++++++++++++++++++++++++++++----- build-win64.sh | 0 build-x86_64.sh | 41 +++++++++++++++++++++++++++++++++++++---- bundle_dlls.sh | 0 4 files changed, 74 insertions(+), 9 deletions(-) mode change 100644 => 100755 build-aarch64.sh mode change 100644 => 100755 build-win64.sh mode change 100644 => 100755 build-x86_64.sh mode change 100644 => 100755 bundle_dlls.sh diff --git a/build-aarch64.sh b/build-aarch64.sh old mode 100644 new mode 100755 index 7ae6cf7..c6e649b --- a/build-aarch64.sh +++ b/build-aarch64.sh @@ -4,6 +4,7 @@ VERSION="5.15.2" +SDL_VERSION="2.32.10" BOLD="\x1b[1m" RED="\x1b[31m" @@ -18,6 +19,7 @@ fi # install deps echo -e "${BOLD}Downloading deps...${RESET}" + apt-get install -y --no-install-recommends \ git \ g++ \ @@ -46,12 +48,19 @@ apt-get install -y --no-install-recommends \ ca-certificates \ file -# download luajit and luanti source code -echo -e "${BOLD}Downloading LuaJIT and Luanti source code...${RESET}" +# download luajit, SDL2, and luanti source code +echo -e "${BOLD}Downloading LuaJIT, SDL2, and Luanti source code...${RESET}" git clone --depth=1 https://github.com/LuaJIT/LuaJIT.git luajit curl -Lo luanti.zip https://github.com/luanti-org/luanti/archive/refs/tags/${VERSION}.zip +curl -Lo sdl2.zip https://github.com/libsdl-org/SDL/releases/download/release-${SDL_VERSION}/SDL2-${SDL_VERSION}.zip + unzip luanti.zip mv luanti-${VERSION} luanti/ +rm luanti.zip + +unzip sdl2.zip +mv SDL2-${SDL_VERSION} sdl2 +rm sdl2.zip # create patch files cat > patch-1.patch <<'EOF' @@ -80,6 +89,26 @@ cd luajit make amalg -j$(nproc) cd .. +# compile sdl2 +echo -e "${BOLD}Compiling SDL2...${RESET}" +cd sdl2 + +mkdir build +cd build + +cmake .. -G Ninja \ + -DSDL_INSTALL_CMAKEDIR=usr/lib/cmake/SDL2 \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/ \ + -DCMAKE_C_FLAGS="-DSDL_LEAN_AND_MEAN=1" \ + -DSDL_{AUDIO,RENDER,VULKAN,TEST,STATIC}=OFF + +ninja -j$(nproc) +strip -s *.so +DESTDIR="../../" ninja install -j$(nproc) + +cd ../.. + # prepare to compile luanti cd luanti mkdir -p build @@ -126,7 +155,6 @@ chmod +x AppRun # bundle the libraries INCLUDE_LIBS=( libopenal.so.1 - libSDL2-2.0.so.0 libsndio.so.7.0 libbsd.so.0 libmd.so.0 @@ -146,6 +174,9 @@ for i in "${INCLUDE_LIBS[@]}"; do cp /usr/lib/aarch64-linux-gnu/${i} usr/lib/ done +# copy our SDL2 into place +cp ../../../usr/lib/libSDL2-2.0.so.0 usr/lib/ + # finally make the appimage cd .. ARCH=aarch64 ./appimagetool --appimage-extract-and-run AppDir/ @@ -156,9 +187,10 @@ mv Luanti-aarch64.AppImage ../../luanti-${VERSION}-aarch64.AppImage # clean up cd ../.. -rm -rf luanti{,.zip} +rm -rf luanti/ +rm -rf sdl2/ +rm -rf usr/ rm -rf luajit/ # done :D echo -e "${BOLD}${GREEN}Done!${RESET}" - diff --git a/build-win64.sh b/build-win64.sh old mode 100644 new mode 100755 diff --git a/build-x86_64.sh b/build-x86_64.sh old mode 100644 new mode 100755 index 47188ed..89cf3b9 --- a/build-x86_64.sh +++ b/build-x86_64.sh @@ -4,6 +4,7 @@ VERSION="5.15.2" +SDL_VERSION="2.32.10" BOLD="\x1b[1m" RED="\x1b[31m" @@ -18,6 +19,7 @@ fi # install deps echo -e "${BOLD}Downloading deps...${RESET}" + apt-get install -y --no-install-recommends \ git \ g++ \ @@ -46,12 +48,19 @@ apt-get install -y --no-install-recommends \ ca-certificates \ file -# download luajit and luanti source code -echo -e "${BOLD}Downloading LuaJIT and Luanti source code...${RESET}" +# download luajit, SDL2, and luanti source code +echo -e "${BOLD}Downloading LuaJIT, SDL2, and Luanti source code...${RESET}" git clone --depth=1 https://github.com/LuaJIT/LuaJIT.git luajit curl -Lo luanti.zip https://github.com/luanti-org/luanti/archive/refs/tags/${VERSION}.zip +curl -Lo sdl2.zip https://github.com/libsdl-org/SDL/releases/download/release-${SDL_VERSION}/SDL2-${SDL_VERSION}.zip + unzip luanti.zip mv luanti-${VERSION} luanti/ +rm luanti.zip + +unzip sdl2.zip +mv SDL2-${SDL_VERSION} sdl2 +rm sdl2.zip # create patch files cat > patch-1.patch <<'EOF' @@ -80,6 +89,26 @@ cd luajit make amalg -j$(nproc) cd .. +# compile sdl2 +echo -e "${BOLD}Compiling SDL2...${RESET}" +cd sdl2 + +mkdir build +cd build + +cmake .. -G Ninja \ + -DSDL_INSTALL_CMAKEDIR=usr/lib/cmake/SDL2 \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/ \ + -DCMAKE_C_FLAGS="-DSDL_LEAN_AND_MEAN=1" \ + -DSDL_{AUDIO,RENDER,VULKAN,TEST,STATIC}=OFF + +ninja -j$(nproc) +strip -s *.so +DESTDIR="../../" ninja install -j$(nproc) + +cd ../.. + # prepare to compile luanti cd luanti mkdir -p build @@ -126,7 +155,6 @@ chmod +x AppRun # bundle the libraries INCLUDE_LIBS=( libopenal.so.1 - libSDL2-2.0.so.0 libsndio.so.7.0 libbsd.so.0 libmd.so.0 @@ -146,6 +174,9 @@ for i in "${INCLUDE_LIBS[@]}"; do cp /usr/lib/x86_64-linux-gnu/${i} usr/lib/ done +# copy our SDL2 into place +cp ../../../usr/lib/libSDL2-2.0.so.0 usr/lib/ + # finally make the appimage cd .. ARCH=x86_64 ./appimagetool --appimage-extract-and-run AppDir/ @@ -156,7 +187,9 @@ mv Luanti-x86_64.AppImage ../../luanti-${VERSION}-x86_64.AppImage # clean up cd ../.. -rm -rf luanti{,.zip} +rm -rf luanti/ +rm -rf sdl2/ +rm -rf usr/ rm -rf luajit/ # done :D diff --git a/bundle_dlls.sh b/bundle_dlls.sh old mode 100644 new mode 100755 From 5d753f41973385f58e90aa7b9e3d338cc06548a8 Mon Sep 17 00:00:00 2001 From: a-bad-dev <244852891+a-bad-dev@users.noreply.github.com> Date: Tue, 28 Apr 2026 20:38:34 -0300 Subject: [PATCH 02/10] Update patches for 5.16.0-rc1 --- build-aarch64.sh | 2 +- build-win64.sh | 2 +- build-x86_64.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build-aarch64.sh b/build-aarch64.sh index c6e649b..67547ed 100755 --- a/build-aarch64.sh +++ b/build-aarch64.sh @@ -64,7 +64,7 @@ rm sdl2.zip # create patch files cat > patch-1.patch <<'EOF' -3713c3713 +3753c3753 < m_repeat_place_time = g_settings->getFloat("repeat_place_time", 0.16f, 2.0f); --- > m_repeat_place_time = g_settings->getFloat("repeat_place_time", 0.001f, 2.0f); diff --git a/build-win64.sh b/build-win64.sh index 187970f..b03cb35 100755 --- a/build-win64.sh +++ b/build-win64.sh @@ -26,7 +26,7 @@ cd luanti-${VERSION}/ # create and apply patches cat > patch-1.patch <<'EOF' -3713c3713 +3753c3753 < m_repeat_place_time = g_settings->getFloat("repeat_place_time", 0.16f, 2.0f); --- > m_repeat_place_time = g_settings->getFloat("repeat_place_time", 0.001f, 2.0f); diff --git a/build-x86_64.sh b/build-x86_64.sh index 89cf3b9..cff68b5 100755 --- a/build-x86_64.sh +++ b/build-x86_64.sh @@ -64,7 +64,7 @@ rm sdl2.zip # create patch files cat > patch-1.patch <<'EOF' -3713c3713 +3753c3753 < m_repeat_place_time = g_settings->getFloat("repeat_place_time", 0.16f, 2.0f); --- > m_repeat_place_time = g_settings->getFloat("repeat_place_time", 0.001f, 2.0f); From fa9e0d0aaeecc7d5f7521db138a585aa0a6f52a8 Mon Sep 17 00:00:00 2001 From: a-bad-dev <244852891+a-bad-dev@users.noreply.github.com> Date: Tue, 28 Apr 2026 21:31:50 -0300 Subject: [PATCH 03/10] Update scripts for 5.16.0-rc1 --- build-aarch64.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-aarch64.sh b/build-aarch64.sh index 67547ed..a0333db 100755 --- a/build-aarch64.sh +++ b/build-aarch64.sh @@ -3,7 +3,7 @@ # this script is intended to be run on debian 13 aarch64 -VERSION="5.15.2" +VERSION="5.16.0-rc1" SDL_VERSION="2.32.10" BOLD="\x1b[1m" From 70f4b6547afe9a197383e73d596cde87ad7dc87e Mon Sep 17 00:00:00 2001 From: a-bad-dev <244852891+a-bad-dev@users.noreply.github.com> Date: Tue, 28 Apr 2026 21:32:13 -0300 Subject: [PATCH 04/10] Update scripts for 5.16.0-rc1 --- build-win64.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-win64.sh b/build-win64.sh index b03cb35..a496b5c 100755 --- a/build-win64.sh +++ b/build-win64.sh @@ -1,7 +1,7 @@ #!/bin/bash # this script is intended to be run in MSYS2 CLANG64 -VERSION="5.15.2" +VERSION="5.16.0-rc1" BOLD="\x1b[1m" GREEN="\x1b[32m" From 445e7fdafd4ecaeebf7c7c093755d889ff2fc3c8 Mon Sep 17 00:00:00 2001 From: a-bad-dev <244852891+a-bad-dev@users.noreply.github.com> Date: Tue, 28 Apr 2026 21:32:33 -0300 Subject: [PATCH 05/10] Update scripts for 5.16.0-rc1 --- build-x86_64.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-x86_64.sh b/build-x86_64.sh index cff68b5..c651c18 100755 --- a/build-x86_64.sh +++ b/build-x86_64.sh @@ -3,7 +3,7 @@ # this script is intended to be run on debian 13 x86_64 -VERSION="5.15.2" +VERSION="5.16.0-rc1" SDL_VERSION="2.32.10" BOLD="\x1b[1m" From 6a144dd14799106ced6b0f071677852caf65ce76 Mon Sep 17 00:00:00 2001 From: a-bad-dev <244852891+a-bad-dev@users.noreply.github.com> Date: Sun, 10 May 2026 15:27:35 -0300 Subject: [PATCH 06/10] Update scripts for 5.16.0 --- build-aarch64.sh | 2 +- build-win64.sh | 2 +- build-x86_64.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build-aarch64.sh b/build-aarch64.sh index a0333db..a2a8e0f 100755 --- a/build-aarch64.sh +++ b/build-aarch64.sh @@ -3,7 +3,7 @@ # this script is intended to be run on debian 13 aarch64 -VERSION="5.16.0-rc1" +VERSION="5.16.0" SDL_VERSION="2.32.10" BOLD="\x1b[1m" diff --git a/build-win64.sh b/build-win64.sh index a496b5c..2270799 100755 --- a/build-win64.sh +++ b/build-win64.sh @@ -1,7 +1,7 @@ #!/bin/bash # this script is intended to be run in MSYS2 CLANG64 -VERSION="5.16.0-rc1" +VERSION="5.16.0" BOLD="\x1b[1m" GREEN="\x1b[32m" diff --git a/build-x86_64.sh b/build-x86_64.sh index c651c18..285052d 100755 --- a/build-x86_64.sh +++ b/build-x86_64.sh @@ -3,7 +3,7 @@ # this script is intended to be run on debian 13 x86_64 -VERSION="5.16.0-rc1" +VERSION="5.16.0" SDL_VERSION="2.32.10" BOLD="\x1b[1m" From 5f73e291cde015ca83cde81565ea3891f1dbf091 Mon Sep 17 00:00:00 2001 From: a-bad-dev <244852891+a-bad-dev@users.noreply.github.com> Date: Sun, 10 May 2026 17:53:07 -0300 Subject: [PATCH 07/10] Update scripts for 5.16.1 --- build-aarch64.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-aarch64.sh b/build-aarch64.sh index a2a8e0f..9a1f0d3 100755 --- a/build-aarch64.sh +++ b/build-aarch64.sh @@ -3,7 +3,7 @@ # this script is intended to be run on debian 13 aarch64 -VERSION="5.16.0" +VERSION="5.16.1" SDL_VERSION="2.32.10" BOLD="\x1b[1m" From fcd69b1eec6eed259d999cb4b66503de0e7abc3e Mon Sep 17 00:00:00 2001 From: a-bad-dev <244852891+a-bad-dev@users.noreply.github.com> Date: Sun, 10 May 2026 17:53:26 -0300 Subject: [PATCH 08/10] Update scripts for 5.16.1 --- build-win64.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-win64.sh b/build-win64.sh index 2270799..47bff56 100755 --- a/build-win64.sh +++ b/build-win64.sh @@ -1,7 +1,7 @@ #!/bin/bash # this script is intended to be run in MSYS2 CLANG64 -VERSION="5.16.0" +VERSION="5.16.1" BOLD="\x1b[1m" GREEN="\x1b[32m" From ffe0cc49f23aecd64915b078236be0e65cd2c3e1 Mon Sep 17 00:00:00 2001 From: a-bad-dev <244852891+a-bad-dev@users.noreply.github.com> Date: Sun, 10 May 2026 17:53:39 -0300 Subject: [PATCH 09/10] Update scripts for 5.16.1 --- build-x86_64.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-x86_64.sh b/build-x86_64.sh index 285052d..0b704b6 100755 --- a/build-x86_64.sh +++ b/build-x86_64.sh @@ -3,7 +3,7 @@ # this script is intended to be run on debian 13 x86_64 -VERSION="5.16.0" +VERSION="5.16.1" SDL_VERSION="2.32.10" BOLD="\x1b[1m" From 74a5ce327ebcfbab7516389a743931349cb0fd5d Mon Sep 17 00:00:00 2001 From: a-bad-dev <244852891+a-bad-dev@users.noreply.github.com> Date: Sun, 24 May 2026 00:39:25 -0300 Subject: [PATCH 10/10] seperate patches from scripts and fix a few things --- build-aarch64.sh | 25 +++++-------------------- build-win64.sh | 24 +++++------------------- build-x86_64.sh | 25 +++++-------------------- patches/patch-1.patch | 4 ++++ patches/patch-2.patch | 4 ++++ 5 files changed, 23 insertions(+), 59 deletions(-) create mode 100644 patches/patch-1.patch create mode 100644 patches/patch-2.patch diff --git a/build-aarch64.sh b/build-aarch64.sh index 9a1f0d3..e5aa865 100755 --- a/build-aarch64.sh +++ b/build-aarch64.sh @@ -11,6 +11,8 @@ RED="\x1b[31m" GREEN="\x1b[32m" RESET="\x1b[0m" +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" + # make sure we are root if [ "$(id -u)" != "0" ]; then echo -e "${BOLD}${RED}This script must be run as root!${RESET}" @@ -62,26 +64,9 @@ unzip sdl2.zip mv SDL2-${SDL_VERSION} sdl2 rm sdl2.zip -# create patch files -cat > patch-1.patch <<'EOF' -3753c3753 -< m_repeat_place_time = g_settings->getFloat("repeat_place_time", 0.16f, 2.0f); ---- -> m_repeat_place_time = g_settings->getFloat("repeat_place_time", 0.001f, 2.0f); -EOF - -cat > patch-2.patch <<'EOF' -151c151 -< repeat_place_time (Place repetition interval) float 0.25 0.16 2.0 ---- -> repeat_place_time (Place repetition interval) float 0.25 0.001 2.0 -EOF - -# apply patches -patch luanti/src/client/game.cpp patch-1.patch -patch luanti/builtin/settingtypes.txt patch-2.patch - -rm patch-[1-2].patch +# apply external patch files +patch luanti/src/client/game.cpp "$SCRIPT_DIR"/patches/patch-1.patch +patch luanti/builtin/settingtypes.txt "$SCRIPT_DIR"/patches/patch-2.patch # compile luajit echo -e "${BOLD}Compiling LuaJIT...${RESET}" diff --git a/build-win64.sh b/build-win64.sh index 47bff56..7e80d4f 100755 --- a/build-win64.sh +++ b/build-win64.sh @@ -7,6 +7,8 @@ BOLD="\x1b[1m" GREEN="\x1b[32m" RESET="\x1b[0m" +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" + # system update (skip this most of the time) echo -e "${BOLD}Updating system...${RESET}" pacman -Syu @@ -24,25 +26,9 @@ tar -xf luanti.tar cd luanti-${VERSION}/ -# create and apply patches -cat > patch-1.patch <<'EOF' -3753c3753 -< m_repeat_place_time = g_settings->getFloat("repeat_place_time", 0.16f, 2.0f); ---- -> m_repeat_place_time = g_settings->getFloat("repeat_place_time", 0.001f, 2.0f); -EOF - -cat > patch-2.patch <<'EOF' -151c151 -< repeat_place_time (Place repetition interval) float 0.25 0.16 2.0 ---- -> repeat_place_time (Place repetition interval) float 0.25 0.001 2.0 -EOF - -patch src/client/game.cpp patch-1.patch -patch builtin/settingtypes.txt patch-2.patch - -rm patch-[1-2].patch +# apply external patch files +patch src/client/game.cpp "${SCRIPT_DIR}/patches/patch-1.patch" +patch builtin/settingtypes.txt "${SCRIPT_DIR}/patches/patch-2.patch" # configure echo -e "${BOLD}Preparing to compile...${RESET}" diff --git a/build-x86_64.sh b/build-x86_64.sh index 0b704b6..5111e3f 100755 --- a/build-x86_64.sh +++ b/build-x86_64.sh @@ -11,6 +11,8 @@ RED="\x1b[31m" GREEN="\x1b[32m" RESET="\x1b[0m" +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" + # make sure we are root if [ "$(id -u)" != "0" ]; then echo -e "${BOLD}${RED}This script must be run as root!${RESET}" @@ -62,26 +64,9 @@ unzip sdl2.zip mv SDL2-${SDL_VERSION} sdl2 rm sdl2.zip -# create patch files -cat > patch-1.patch <<'EOF' -3753c3753 -< m_repeat_place_time = g_settings->getFloat("repeat_place_time", 0.16f, 2.0f); ---- -> m_repeat_place_time = g_settings->getFloat("repeat_place_time", 0.001f, 2.0f); -EOF - -cat > patch-2.patch <<'EOF' -151c151 -< repeat_place_time (Place repetition interval) float 0.25 0.16 2.0 ---- -> repeat_place_time (Place repetition interval) float 0.25 0.001 2.0 -EOF - -# apply patches -patch luanti/src/client/game.cpp patch-1.patch -patch luanti/builtin/settingtypes.txt patch-2.patch - -rm patch-[1-2].patch +# apply external patch files +patch luanti/src/client/game.cpp "${SCRIPT_DIR}/patches/patch-1.patch" +patch luanti/builtin/settingtypes.txt "${SCRIPT_DIR}/patches/patch-2.patch" # compile luajit echo -e "${BOLD}Compiling LuaJIT...${RESET}" diff --git a/patches/patch-1.patch b/patches/patch-1.patch new file mode 100644 index 0000000..59ca4db --- /dev/null +++ b/patches/patch-1.patch @@ -0,0 +1,4 @@ +3753c3753 +< m_repeat_place_time = g_settings->getFloat("repeat_place_time", 0.16f, 2.0f); +--- +> m_repeat_place_time = g_settings->getFloat("repeat_place_time", 0.001f, 2.0f); diff --git a/patches/patch-2.patch b/patches/patch-2.patch new file mode 100644 index 0000000..673bc5a --- /dev/null +++ b/patches/patch-2.patch @@ -0,0 +1,4 @@ +151c151 +< repeat_place_time (Place repetition interval) float 0.25 0.16 2.0 +--- +> repeat_place_time (Place repetition interval) float 0.25 0.001 2.0