mirror of
https://github.com/a-bad-dev/luantiserver-windows.git
synced 2026-06-09 00:51:32 +00:00
Create build.sh
This commit is contained in:
parent
a96731d44d
commit
5fda5ab9d4
1 changed files with 42 additions and 0 deletions
42
build.sh
Normal file
42
build.sh
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# this script is intended to be run in MSYS2 CLANG64
|
||||||
|
#
|
||||||
|
|
||||||
|
VERSION="5.15.2"
|
||||||
|
|
||||||
|
# system update
|
||||||
|
pacman -Syu
|
||||||
|
|
||||||
|
# install deps
|
||||||
|
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}
|
||||||
|
|
||||||
|
# prepare to compile
|
||||||
|
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}/
|
||||||
|
|
||||||
|
# configure
|
||||||
|
cmake . -G Ninja -DRUN_IN_PLACE=TRUE -DBUILD_CLIENT=FALSE -DBUILD_SERVER=TRUE
|
||||||
|
|
||||||
|
# compile
|
||||||
|
ninja -j$(nproc)
|
||||||
|
|
||||||
|
# bundle DLLs
|
||||||
|
cp ../bundle_dlls.sh util/
|
||||||
|
chmod +x util/bundle_dlls.sh
|
||||||
|
|
||||||
|
./util/bundle_dlls.sh bin/luantiserver.exe bin/
|
||||||
|
|
||||||
|
# build the zip archive of luantiserver
|
||||||
|
mkdir luantiserver-${VERSION}-msys2-win64
|
||||||
|
cp -r bin/ builtin/ games/ mods/ textures/ worlds/ luantiserver-${VERSION}-msys2-win64/
|
||||||
|
zip -r9 luantiserver-${VERSION}-msys2-win64.zip luantiserver-${VERSION}-msys2-win64/
|
||||||
|
|
||||||
|
# clean up
|
||||||
|
mv luantiserver-${VERSION}-msys2-win64.zip ..
|
||||||
|
cd ..
|
||||||
|
rm -rf luanti{.tar,-${VERSION}}
|
||||||
|
|
||||||
|
echo "done"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue