mirror of
https://github.com/a-bad-dev/luanti-no-place-rep-limit.git
synced 2026-06-08 16:32:10 +00:00
60 lines
1.7 KiB
Bash
Executable file
60 lines
1.7 KiB
Bash
Executable file
#!/bin/bash
|
|
# this script is intended to be run in MSYS2 CLANG64
|
|
|
|
VERSION="5.16.1"
|
|
|
|
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
|
|
|
|
# install deps
|
|
echo -e "${BOLD}Installing dependencies...${RESET}"
|
|
pacman -S patch zip git mingw-w64-clang-x86_64-{clang,cmake,ninja,curl-winssl,libpng,libjpeg-turbo,freetype,libogg,libvorbis,sqlite3,openal,zstd,gettext,luajit,SDL2}
|
|
|
|
# download and extract sources - TODO: download, compile, and use luajit
|
|
echo -e "${BOLD}Downloading Luanti source code...${RESET}"
|
|
curl -Lo luanti.tar.gz https://github.com/luanti-org/luanti/archive/refs/tags/${VERSION}.tar.gz
|
|
|
|
gunzip luanti.tar.gz
|
|
tar -xf luanti.tar
|
|
|
|
cd luanti-${VERSION}/
|
|
|
|
# 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}"
|
|
cmake . -G Ninja -DRUN_IN_PLACE=TRUE
|
|
|
|
# compile
|
|
echo -e "${BOLD}Compiling Luanti...${RESET}"
|
|
ninja -j$(nproc)
|
|
|
|
# bundle DLLs
|
|
echo -e "${BOLD}Bundling DLLs...${RESET}"
|
|
chmod +x ../bundle_dlls.sh
|
|
../bundle_dlls.sh bin/luanti.exe bin/
|
|
|
|
# build the zip archive of luanti
|
|
echo -e "${BOLD}Building zip file...${RESET}"
|
|
mkdir -p luanti-${VERSION}-msys2-win64/games/
|
|
|
|
cp -r bin/ builtin/ client/ clientmods/ textures/ doc/ fonts/ locale/ mods/ worlds/ minetest.conf.example luanti-${VERSION}-msys2-win64/
|
|
|
|
zip -r9 luanti-${VERSION}-msys2-win64.zip luanti-${VERSION}-msys2-win64/
|
|
|
|
# clean up
|
|
echo -e "${BOLD}Cleaning up...${RESET}"
|
|
mv luanti-${VERSION}-msys2-win64.zip ..
|
|
cd ..
|
|
rm -rf luanti{.tar,-${VERSION}}
|
|
|
|
echo -e "${BOLD}${GREEN}Done!${RESET}"
|