mirror of
https://github.com/a-bad-dev/luantiserver-windows.git
synced 2026-06-08 16:42:09 +00:00
nicer debug messages
This commit is contained in:
parent
98a25f5b3f
commit
ece59de51d
1 changed files with 15 additions and 7 deletions
22
build.sh
22
build.sh
|
|
@ -1,17 +1,22 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
|
||||||
# this script is intended to be run in MSYS2 CLANG64
|
# this script is intended to be run in MSYS2 CLANG64
|
||||||
#
|
|
||||||
|
|
||||||
VERSION="5.15.2"
|
VERSION="5.15.2"
|
||||||
|
|
||||||
|
BOLD="\x1b[1m"
|
||||||
|
GREEN="\x1b[32m"
|
||||||
|
RESET="\x1b[0m"
|
||||||
|
|
||||||
# system update (skip this most of the time)
|
# system update (skip this most of the time)
|
||||||
|
echo -e "${BOLD}Updating system...${RESET}"
|
||||||
pacman -Syu
|
pacman -Syu
|
||||||
|
|
||||||
# install deps
|
# install deps
|
||||||
|
echo -e "${BOLD}Installing dependencies...${RESET}"
|
||||||
pacman -S zip git mingw-w64-clang-x86_64-{clang,cmake,ninja,curl-winssl,libpng,libjpeg-turbo,freetype,libogg,libvorbis,sqlite3,openal,zstd,gettext,luajit,SDL2}
|
pacman -S 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
|
# 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
|
curl -Lo luanti.tar.gz https://github.com/luanti-org/luanti/archive/refs/tags/${VERSION}.tar.gz
|
||||||
|
|
||||||
gunzip luanti.tar.gz
|
gunzip luanti.tar.gz
|
||||||
|
|
@ -20,19 +25,21 @@ tar -xf luanti.tar
|
||||||
cd luanti-${VERSION}/
|
cd luanti-${VERSION}/
|
||||||
|
|
||||||
# configure
|
# configure
|
||||||
|
echo -e "${BOLD}Preparing to compile...${RESET}"
|
||||||
cmake . -G Ninja -DRUN_IN_PLACE=TRUE -DBUILD_CLIENT=FALSE -DBUILD_SERVER=TRUE
|
cmake . -G Ninja -DRUN_IN_PLACE=TRUE -DBUILD_CLIENT=FALSE -DBUILD_SERVER=TRUE
|
||||||
|
|
||||||
# compile
|
# compile
|
||||||
|
echo -e "${BOLD}Compiling Luanti...${RESET}"
|
||||||
ninja -j$(nproc)
|
ninja -j$(nproc)
|
||||||
|
|
||||||
# bundle DLLs
|
# bundle DLLs
|
||||||
|
echo -e "${BOLD}Bundling DLLs...${RESET}"
|
||||||
chmod +x ../bundle_dlls.sh
|
chmod +x ../bundle_dlls.sh
|
||||||
|
|
||||||
../bundle_dlls.sh bin/luantiserver.exe bin/
|
../bundle_dlls.sh bin/luantiserver.exe bin/
|
||||||
|
|
||||||
# build the zip archive of luantiserver
|
# build the zip archive of luantiserver
|
||||||
mkdir luantiserver-${VERSION}-msys2-win64/
|
echo -e "${BOLD}Building zip file...${RESET}"
|
||||||
mkdir luantiserver-${VERSION}-msys2-win64/{textures,games}
|
mkdir -p luantiserver-${VERSION}-msys2-win64/{textures,games}
|
||||||
|
|
||||||
cp -r bin/ builtin/ mods/ worlds/ luantiserver-${VERSION}-msys2-win64/
|
cp -r bin/ builtin/ mods/ worlds/ luantiserver-${VERSION}-msys2-win64/
|
||||||
cp textures/texture_packs_here.txt luantiserver-${VERSION}-msys2-win64/textures/
|
cp textures/texture_packs_here.txt luantiserver-${VERSION}-msys2-win64/textures/
|
||||||
|
|
@ -40,8 +47,9 @@ cp textures/texture_packs_here.txt luantiserver-${VERSION}-msys2-win64/textures/
|
||||||
zip -r9 luantiserver-${VERSION}-msys2-win64.zip luantiserver-${VERSION}-msys2-win64/
|
zip -r9 luantiserver-${VERSION}-msys2-win64.zip luantiserver-${VERSION}-msys2-win64/
|
||||||
|
|
||||||
# clean up
|
# clean up
|
||||||
|
echo -e "${BOLD}Cleaning up...${RESET}"
|
||||||
mv luantiserver-${VERSION}-msys2-win64.zip ..
|
mv luantiserver-${VERSION}-msys2-win64.zip ..
|
||||||
cd ..
|
cd ..
|
||||||
rm -rf luanti{.tar,-${VERSION}}
|
rm -rf luanti{.tar,-${VERSION}}
|
||||||
|
|
||||||
echo "done"
|
echo -e "${BOLD}${GREEN}Done!${RESET}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue