Compare commits

..

12 commits

Author SHA1 Message Date
a-bad-dev
59fd8e4532
Update scripts for 5.16.1 2026-05-10 14:33:22 -03:00
a-bad-dev
b445356066
Update scripts for 5.16.1 2026-05-10 14:32:52 -03:00
a-bad-dev
d9a3b03291
Update scripts for 5.16.0
5.16.0 is broken, do not use it.
This is only for completeness.
2026-05-10 14:10:31 -03:00
a-bad-dev
b43be1cba0
Update scripts for 5.16.0
5.16.0 is broken, do not use it.
This is only for completeness.
2026-05-10 14:09:58 -03:00
a-bad-dev
38781a65fe
Update scripts for 5.16.0-rc1 2026-04-28 21:58:18 -03:00
a-bad-dev
2df8b64e79
Update scripts for 5.16.0-rc1 2026-04-28 21:57:50 -03:00
a-bad-dev
935c614f07
compile our own SDL2 2026-04-20 13:29:17 -03:00
a-bad-dev
cfbd156583
Update build.sh 2026-04-18 17:14:32 -03:00
a-bad-dev
57518baae5
Update scripts for 5.15.2 2026-04-14 18:45:31 -03:00
a-bad-dev
360644feaf
Update scripts for 5.15.2 2026-04-14 18:45:12 -03:00
a-bad-dev
45605a703a
small fixes 2026-04-14 18:25:40 -03:00
a-bad-dev
4f071a2cba
small fixes 2026-04-14 18:23:04 -03:00
2 changed files with 67 additions and 31 deletions

View file

@ -3,21 +3,23 @@
# run this script on an aarch64 computer, running modern debian or # run this script on an aarch64 computer, running modern debian or
# something similar, otherwise it's not going to work... # something similar, otherwise it's not going to work...
VERSION="5.15.1" VERSION="5.16.1"
SDL_VERSION="2.32.10"
BOLD="\033[1m" BOLD="\x1b[1m"
RED="\033[31m" RED="\x1b[31m"
GREEN="\033[32m" GREEN="\x1b[32m"
RESET="\033[0m" RESET="\x1b[0m"
# make sure we are root # make sure we are root
if [ "$(id -u)" != 0 ]; then if [ "$(id -u)" != "0" ]; then
echo -e "${BOLD}${RED}This script must be run as root!${RESET}" echo -e "${BOLD}${RED}This script must be run as root!${RESET}"
exit 1 exit 1
fi fi
# install deps # install deps
echo -e "${BOLD}Downloading deps...${RESET}" echo -e "${BOLD}Downloading deps...${RESET}"
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
git \ git \
g++ \ g++ \
@ -46,12 +48,19 @@ apt-get install -y --no-install-recommends \
ca-certificates \ ca-certificates \
file file
# download source code # download luajit, SDL2, and luanti source code
echo -e "${BOLD}Downloading LuaJIT and Luanti source code...${RESET}" echo -e "${BOLD}Downloading LuaJIT, SDL2, and Luanti source code...${RESET}"
git clone --depth 1 https://github.com/LuaJIT/LuaJIT.git luajit 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 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 unzip luanti.zip
mv luanti-${VERSION} luanti/ mv luanti-${VERSION} luanti/
rm luanti.zip
unzip sdl2.zip
mv SDL2-${SDL_VERSION} sdl2
rm sdl2.zip
# compile luajit # compile luajit
echo -e "${BOLD}Compiling LuaJIT...${RESET}" echo -e "${BOLD}Compiling LuaJIT...${RESET}"
@ -59,6 +68,26 @@ cd luajit
make amalg -j$(nproc) make amalg -j$(nproc)
cd .. 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 # prepare to compile luanti
cd luanti cd luanti
mkdir -p build mkdir -p build
@ -68,7 +97,7 @@ echo -e "${BOLD}Downloading AppImageTool${RESET}"
curl -Lo appimagetool https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-aarch64.AppImage curl -Lo appimagetool https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-aarch64.AppImage
chmod +x appimagetool chmod +x appimagetool
# compile and install into AppDir # compile luanti
echo -e "${BOLD}Compiling Luanti...${RESET}" echo -e "${BOLD}Compiling Luanti...${RESET}"
cmake .. -G Ninja \ cmake .. -G Ninja \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
@ -78,13 +107,14 @@ cmake .. -G Ninja \
-DLUA_INCLUDE_DIR=../../luajit/src/ \ -DLUA_INCLUDE_DIR=../../luajit/src/ \
-DLUA_LIBRARY=../../luajit/src/libluajit.a -DLUA_LIBRARY=../../luajit/src/libluajit.a
# install into the AppDir folder
ninja install -j$(nproc) ninja install -j$(nproc)
# build the appimage itself # build the appimage itself
cd AppDir cd AppDir
echo -e "${BOLD}Building AppImage...${RESET}" echo -e "${BOLD}Building AppImage...${RESET}"
# put desktop and icon at root # put desktop and icon at root of AppDir
ln -sf usr/share/applications/org.luanti.luanti.desktop luanti.desktop ln -sf usr/share/applications/org.luanti.luanti.desktop luanti.desktop
ln -sf usr/share/icons/hicolor/128x128/apps/luanti.png luanti.png ln -sf usr/share/icons/hicolor/128x128/apps/luanti.png luanti.png
ln -sf luanti.png .DirIcon ln -sf luanti.png .DirIcon
@ -92,18 +122,18 @@ ln -sf luanti.png .DirIcon
# fix locales # fix locales
mv usr/share/locale usr/share/luanti mv usr/share/locale usr/share/luanti
cat > AppRun <<'APPRUN' cat > AppRun <<'EOF'
#!/bin/sh #!/bin/bash
APP_PATH="$(dirname "$(readlink -f "${0}")")" APP_PATH="$(dirname "$(readlink -f "${0}")")"
export LD_LIBRARY_PATH="${APP_PATH}"/usr/lib/:"${LD_LIBRARY_PATH}" export LD_LIBRARY_PATH="${APP_PATH}"/usr/lib/:"${LD_LIBRARY_PATH}"
exec "${APP_PATH}/usr/bin/luanti" "$@" exec "${APP_PATH}/usr/bin/luanti" "$@"
APPRUN EOF
chmod +x AppRun chmod +x AppRun
# bundle the libraries # bundle the libraries
INCLUDE_LIBS=( INCLUDE_LIBS=(
libopenal.so.1 libopenal.so.1
libSDL2-2.0.so.0
libsndio.so.7.0 libsndio.so.7.0
libbsd.so.0 libbsd.so.0
libmd.so.0 libmd.so.0
@ -120,9 +150,12 @@ INCLUDE_LIBS=(
mkdir -p usr/lib/ mkdir -p usr/lib/
for i in "${INCLUDE_LIBS[@]}"; do for i in "${INCLUDE_LIBS[@]}"; do
cp /usr/lib/aarch64-linux-gnu/$i usr/lib/ cp /usr/lib/aarch64-linux-gnu/${i} usr/lib/
done done
# copy our SDL2 into place
cp ../../../usr/lib/libSDL2-2.0.so.0 usr/lib/
# finally make the appimage # finally make the appimage
cd .. cd ..
ARCH=aarch64 ./appimagetool --appimage-extract-and-run AppDir/ ARCH=aarch64 ./appimagetool --appimage-extract-and-run AppDir/
@ -133,7 +166,9 @@ mv Luanti-aarch64.AppImage ../../luanti-${VERSION}-aarch64.AppImage
# clean up # clean up
cd ../.. cd ../..
rm -rf luanti{,.zip} rm -rf luanti/
rm -rf sdl2/
rm -rf usr/
rm -rf luajit/ rm -rf luajit/
# done :D # done :D

15
test.sh
View file

@ -3,12 +3,12 @@
# test the AppImage built with build.sh # test the AppImage built with build.sh
# again, this only works on aarch64 # again, this only works on aarch64
VERSION="5.15.1" VERSION="5.16.1"
BOLD="\033[1m" BOLD="\x1b[1m"
RED="\033[31m" RED="\x1b[31m"
GREEN="\033[32m" GREEN="\x1b[32m"
RESET="\033[0m" RESET="\x1b[0m"
# make sure we are root # make sure we are root
if [ "$(id -u)" != 0 ]; then if [ "$(id -u)" != 0 ]; then
@ -21,6 +21,7 @@ if [ "$(ps aux | grep luanti | wc -l)" != 1 ]; then
echo -e "${BOLD}${RED}No Luanti processes may be running while this script is run.${RESET}" echo -e "${BOLD}${RED}No Luanti processes may be running while this script is run.${RESET}"
exit 1 exit 1
fi fi
# check if the AppImage even exists # check if the AppImage even exists
echo -e "${BOLD}Checking if AppImage exists...${RESET}" echo -e "${BOLD}Checking if AppImage exists...${RESET}"
@ -63,7 +64,7 @@ DEPS=(
echo -e "${BOLD}Removing dependencies...${RESET}" echo -e "${BOLD}Removing dependencies...${RESET}"
for d in "${DEPS[@]}"; do for d in "${DEPS[@]}"; do
apt remove $d -y apt remove ${d} -y
done done
# test the AppImage # test the AppImage
@ -87,7 +88,7 @@ echo -e "${BOLD}Reinstalling dependencies...${RESET}"
# reinstall the dependencies # reinstall the dependencies
for d in "${DEPS[@]}"; do for d in "${DEPS[@]}"; do
apt-get install -y $d apt-get install -y ${d}
done done
exit 0 exit 0