Add files via upload
51
AppImageBuilder.yml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
version: 1
|
||||||
|
|
||||||
|
AppDir:
|
||||||
|
path: ./AppDir
|
||||||
|
|
||||||
|
app_info:
|
||||||
|
id: minetest
|
||||||
|
name: Minetest
|
||||||
|
icon: minetest
|
||||||
|
version: !ENV ${VERSION}
|
||||||
|
exec: usr/bin/minetest
|
||||||
|
exec_args: $@
|
||||||
|
runtime:
|
||||||
|
env:
|
||||||
|
APPDIR_LIBRARY_PATH: $APPDIR/usr/lib/x86_64-linux-gnu
|
||||||
|
|
||||||
|
apt:
|
||||||
|
arch: amd64
|
||||||
|
sources:
|
||||||
|
- sourceline: deb http://archive.ubuntu.com/ubuntu/ bionic main universe
|
||||||
|
key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3b4fe6acc0b21f32'
|
||||||
|
- sourceline: deb http://archive.ubuntu.com/ubuntu/ bionic-updates main universe
|
||||||
|
- sourceline: deb http://archive.ubuntu.com/ubuntu/ bionic-backports main universe
|
||||||
|
- sourceline: deb http://archive.ubuntu.com/ubuntu/ bionic-security main universe
|
||||||
|
|
||||||
|
include:
|
||||||
|
- libirrlicht1.8
|
||||||
|
- libxxf86vm1
|
||||||
|
- libgl1-mesa-glx
|
||||||
|
- libsqlite3-0
|
||||||
|
- libogg0
|
||||||
|
- libvorbis0a
|
||||||
|
- libopenal1
|
||||||
|
- libcurl3-gnutls
|
||||||
|
- libfreetype6
|
||||||
|
- zlib1g
|
||||||
|
- libgmp10
|
||||||
|
- libjsoncpp1
|
||||||
|
|
||||||
|
files:
|
||||||
|
exclude:
|
||||||
|
- usr/share/man
|
||||||
|
- usr/share/doc/*/README.*
|
||||||
|
- usr/share/doc/*/changelog.*
|
||||||
|
- usr/share/doc/*/NEWS.*
|
||||||
|
- usr/share/doc/*/TODO.*
|
||||||
|
|
||||||
|
AppImage:
|
||||||
|
update-information: None
|
||||||
|
sign-key: None
|
||||||
|
arch: x86_64
|
7
clammt
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
pwf=$HOME/.mtpw
|
||||||
|
if [ -z $1 ]; then echo "usage: clammt altname - (common) password must be in $pwf"; exit 1; fi
|
||||||
|
mt=$(dirname $0)/automt
|
||||||
|
pw=$(cat $pwf)
|
||||||
|
$mt clam-ity.minecity.online $1 $pw
|
||||||
|
|
BIN
textures/base/pack/air.png
Normal file
After Width: | Height: | Size: 225 B |
BIN
textures/base/pack/aux_btn.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
textures/base/pack/blank.png
Normal file
After Width: | Height: | Size: 95 B |
BIN
textures/base/pack/bubble.png
Normal file
After Width: | Height: | Size: 142 B |
BIN
textures/base/pack/bubble_gone.png
Normal file
After Width: | Height: | Size: 68 B |
BIN
textures/base/pack/camera_btn.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
textures/base/pack/chat_btn.png
Normal file
After Width: | Height: | Size: 873 B |
BIN
textures/base/pack/chat_hide_btn.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
textures/base/pack/chat_show_btn.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
textures/base/pack/checkbox_16.png
Normal file
After Width: | Height: | Size: 288 B |
BIN
textures/base/pack/checkbox_32.png
Normal file
After Width: | Height: | Size: 436 B |
BIN
textures/base/pack/checkbox_64.png
Normal file
After Width: | Height: | Size: 766 B |
BIN
textures/base/pack/crack_anylength.png
Normal file
After Width: | Height: | Size: 255 B |
BIN
textures/base/pack/debug_btn.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
textures/base/pack/down.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
textures/base/pack/drop_btn.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
textures/base/pack/end_icon.png
Normal file
After Width: | Height: | Size: 908 B |
BIN
textures/base/pack/error_screenshot.png
Normal file
After Width: | Height: | Size: 971 B |
BIN
textures/base/pack/fast_btn.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
textures/base/pack/fly_btn.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
textures/base/pack/gear_icon.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
textures/base/pack/halo.png
Normal file
After Width: | Height: | Size: 144 B |
BIN
textures/base/pack/heart.png
Normal file
After Width: | Height: | Size: 255 B |
BIN
textures/base/pack/heart_gone.png
Normal file
After Width: | Height: | Size: 68 B |
BIN
textures/base/pack/ignore.png
Normal file
After Width: | Height: | Size: 234 B |
BIN
textures/base/pack/inventory_btn.png
Normal file
After Width: | Height: | Size: 331 B |
BIN
textures/base/pack/joystick_bg.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
textures/base/pack/joystick_center.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
textures/base/pack/joystick_off.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
textures/base/pack/jump_btn.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
textures/base/pack/loading_screenshot.png
Normal file
After Width: | Height: | Size: 580 B |
BIN
textures/base/pack/logo.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
textures/base/pack/menu_bg.png
Normal file
After Width: | Height: | Size: 305 KiB |
BIN
textures/base/pack/menu_header.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
textures/base/pack/minimap_btn.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
textures/base/pack/minimap_mask_round.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
textures/base/pack/minimap_mask_square.png
Normal file
After Width: | Height: | Size: 420 B |
BIN
textures/base/pack/minimap_overlay_round.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
textures/base/pack/minimap_overlay_square.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
textures/base/pack/next_icon.png
Normal file
After Width: | Height: | Size: 714 B |
BIN
textures/base/pack/no_screenshot.png
Normal file
After Width: | Height: | Size: 586 B |
BIN
textures/base/pack/no_texture_airlike.png
Normal file
After Width: | Height: | Size: 178 B |
BIN
textures/base/pack/noclip_btn.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
textures/base/pack/object_marker_red.png
Normal file
After Width: | Height: | Size: 449 B |
BIN
textures/base/pack/player.png
Normal file
After Width: | Height: | Size: 142 B |
BIN
textures/base/pack/player_back.png
Normal file
After Width: | Height: | Size: 140 B |
BIN
textures/base/pack/player_marker.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
textures/base/pack/plus.png
Normal file
After Width: | Height: | Size: 763 B |
BIN
textures/base/pack/prev_icon.png
Normal file
After Width: | Height: | Size: 714 B |
BIN
textures/base/pack/progress_bar.png
Normal file
After Width: | Height: | Size: 413 B |
BIN
textures/base/pack/progress_bar_bg.png
Normal file
After Width: | Height: | Size: 354 B |
BIN
textures/base/pack/rangeview_btn.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
textures/base/pack/rare_controls.png
Normal file
After Width: | Height: | Size: 227 B |
BIN
textures/base/pack/refresh.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
textures/base/pack/server_flags_creative.png
Normal file
After Width: | Height: | Size: 273 B |
BIN
textures/base/pack/server_flags_damage.png
Normal file
After Width: | Height: | Size: 713 B |
BIN
textures/base/pack/server_flags_favorite.png
Normal file
After Width: | Height: | Size: 916 B |
BIN
textures/base/pack/server_flags_pvp.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
textures/base/pack/server_ping_1.png
Normal file
After Width: | Height: | Size: 251 B |
BIN
textures/base/pack/server_ping_2.png
Normal file
After Width: | Height: | Size: 244 B |
BIN
textures/base/pack/server_ping_3.png
Normal file
After Width: | Height: | Size: 245 B |
BIN
textures/base/pack/server_ping_4.png
Normal file
After Width: | Height: | Size: 213 B |
BIN
textures/base/pack/smoke_puff.png
Normal file
After Width: | Height: | Size: 202 B |
BIN
textures/base/pack/start_icon.png
Normal file
After Width: | Height: | Size: 912 B |
BIN
textures/base/pack/sunrisebg.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
textures/base/pack/unknown_item.png
Normal file
After Width: | Height: | Size: 292 B |
BIN
textures/base/pack/unknown_node.png
Normal file
After Width: | Height: | Size: 193 B |
BIN
textures/base/pack/unknown_object.png
Normal file
After Width: | Height: | Size: 254 B |
BIN
textures/base/pack/wieldhand.png
Normal file
After Width: | Height: | Size: 126 B |
BIN
textures/base/pack/zoom.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
1
textures/texture_packs_here.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Put your texture pack folders in this folder. Textures in the "server" pack will be used by the server.
|
172
util/buildbot/buildwin32.sh
Normal file
@ -0,0 +1,172 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
CORE_GIT=https://github.com/EliasFleckenstein03/dragonfireclient
|
||||||
|
CORE_BRANCH=master
|
||||||
|
CORE_NAME=dragonfireclient
|
||||||
|
GAME_GIT=https://git.minetest.land/Wuzzy/MineClone2
|
||||||
|
GAME_BRANCH=master
|
||||||
|
GAME_NAME=mineclone2
|
||||||
|
|
||||||
|
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
echo "Usage: $0 <build directory>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
builddir=$1
|
||||||
|
mkdir -p $builddir
|
||||||
|
builddir="$( cd "$builddir" && pwd )"
|
||||||
|
packagedir=$builddir/packages
|
||||||
|
libdir=$builddir/libs
|
||||||
|
|
||||||
|
# Test which win32 compiler is present
|
||||||
|
which i586-mingw32msvc-windres &>/dev/null && toolchain_file=$dir/toolchain_i586-mingw32msvc.cmake
|
||||||
|
which i686-w64-mingw32-windres &>/dev/null && toolchain_file=$dir/toolchain_i646-w64-mingw32.cmake
|
||||||
|
|
||||||
|
if [ -z "$toolchain_file" ]; then
|
||||||
|
echo "Unable to determine which mingw32 compiler to use"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Using $toolchain_file"
|
||||||
|
|
||||||
|
irrlicht_version=1.8.4
|
||||||
|
ogg_version=1.3.2
|
||||||
|
vorbis_version=1.3.5
|
||||||
|
curl_version=7.65.3
|
||||||
|
gettext_version=0.20.1
|
||||||
|
freetype_version=2.10.1
|
||||||
|
sqlite3_version=3.27.2
|
||||||
|
luajit_version=2.1.0-beta3
|
||||||
|
leveldb_version=1.22
|
||||||
|
zlib_version=1.2.11
|
||||||
|
|
||||||
|
mkdir -p $packagedir
|
||||||
|
mkdir -p $libdir
|
||||||
|
|
||||||
|
cd $builddir
|
||||||
|
|
||||||
|
# Get stuff
|
||||||
|
[ -e $packagedir/irrlicht-$irrlicht_version.zip ] || wget http://minetest.kitsunemimi.pw/irrlicht-$irrlicht_version-win32.zip \
|
||||||
|
-c -O $packagedir/irrlicht-$irrlicht_version.zip
|
||||||
|
[ -e $packagedir/zlib-$zlib_version.zip ] || wget http://minetest.kitsunemimi.pw/zlib-$zlib_version-win32.zip \
|
||||||
|
-c -O $packagedir/zlib-$zlib_version.zip
|
||||||
|
[ -e $packagedir/libogg-$ogg_version.zip ] || wget http://minetest.kitsunemimi.pw/libogg-$ogg_version-win32.zip \
|
||||||
|
-c -O $packagedir/libogg-$ogg_version.zip
|
||||||
|
[ -e $packagedir/libvorbis-$vorbis_version.zip ] || wget http://minetest.kitsunemimi.pw/libvorbis-$vorbis_version-win32.zip \
|
||||||
|
-c -O $packagedir/libvorbis-$vorbis_version.zip
|
||||||
|
[ -e $packagedir/curl-$curl_version.zip ] || wget http://minetest.kitsunemimi.pw/curl-$curl_version-win32.zip \
|
||||||
|
-c -O $packagedir/curl-$curl_version.zip
|
||||||
|
[ -e $packagedir/gettext-$gettext_version.zip ] || wget http://minetest.kitsunemimi.pw/gettext-$gettext_version-win32.zip \
|
||||||
|
-c -O $packagedir/gettext-$gettext_version.zip
|
||||||
|
[ -e $packagedir/freetype2-$freetype_version.zip ] || wget http://minetest.kitsunemimi.pw/freetype2-$freetype_version-win32.zip \
|
||||||
|
-c -O $packagedir/freetype2-$freetype_version.zip
|
||||||
|
[ -e $packagedir/sqlite3-$sqlite3_version.zip ] || wget http://minetest.kitsunemimi.pw/sqlite3-$sqlite3_version-win32.zip \
|
||||||
|
-c -O $packagedir/sqlite3-$sqlite3_version.zip
|
||||||
|
[ -e $packagedir/luajit-$luajit_version.zip ] || wget http://minetest.kitsunemimi.pw/luajit-$luajit_version-win32.zip \
|
||||||
|
-c -O $packagedir/luajit-$luajit_version.zip
|
||||||
|
[ -e $packagedir/libleveldb-$leveldb_version.zip ] || wget http://minetest.kitsunemimi.pw/libleveldb-$leveldb_version-win32.zip \
|
||||||
|
-c -O $packagedir/libleveldb-$leveldb_version.zip
|
||||||
|
[ -e $packagedir/openal_stripped.zip ] || wget http://minetest.kitsunemimi.pw/openal_stripped.zip \
|
||||||
|
-c -O $packagedir/openal_stripped.zip
|
||||||
|
|
||||||
|
# Extract stuff
|
||||||
|
cd $libdir
|
||||||
|
[ -d irrlicht ] || unzip -o $packagedir/irrlicht-$irrlicht_version.zip -d irrlicht
|
||||||
|
[ -d zlib ] || unzip -o $packagedir/zlib-$zlib_version.zip -d zlib
|
||||||
|
[ -d libogg ] || unzip -o $packagedir/libogg-$ogg_version.zip -d libogg
|
||||||
|
[ -d libvorbis ] || unzip -o $packagedir/libvorbis-$vorbis_version.zip -d libvorbis
|
||||||
|
[ -d libcurl ] || unzip -o $packagedir/curl-$curl_version.zip -d libcurl
|
||||||
|
[ -d gettext ] || unzip -o $packagedir/gettext-$gettext_version.zip -d gettext
|
||||||
|
[ -d freetype ] || unzip -o $packagedir/freetype2-$freetype_version.zip -d freetype
|
||||||
|
[ -d sqlite3 ] || unzip -o $packagedir/sqlite3-$sqlite3_version.zip -d sqlite3
|
||||||
|
[ -d openal_stripped ] || unzip -o $packagedir/openal_stripped.zip
|
||||||
|
[ -d luajit ] || unzip -o $packagedir/luajit-$luajit_version.zip -d luajit
|
||||||
|
[ -d leveldb ] || unzip -o $packagedir/libleveldb-$leveldb_version.zip -d leveldb
|
||||||
|
|
||||||
|
# Get minetest
|
||||||
|
cd $builddir
|
||||||
|
if [ ! "x$EXISTING_MINETEST_DIR" = "x" ]; then
|
||||||
|
cd /$EXISTING_MINETEST_DIR # must be absolute path
|
||||||
|
else
|
||||||
|
[ -d $CORE_NAME ] && (cd $CORE_NAME && git pull) || (git clone -b $CORE_BRANCH $CORE_GIT)
|
||||||
|
cd $CORE_NAME
|
||||||
|
fi
|
||||||
|
git_hash=$(git rev-parse --short HEAD)
|
||||||
|
|
||||||
|
# Get minetest_game
|
||||||
|
if [ "x$NO_MINETEST_GAME" = "x" ]; then
|
||||||
|
cd games
|
||||||
|
[ -d $GAME_NAME ] && (cd $GAME_NAME && git pull) || (git clone -b $GAME_BRANCH $GAME_GIT)
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Build the thing
|
||||||
|
[ -d _build ] && rm -Rf _build/
|
||||||
|
mkdir _build
|
||||||
|
cd _build
|
||||||
|
cmake .. \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=/tmp \
|
||||||
|
-DVERSION_EXTRA=$git_hash \
|
||||||
|
-DBUILD_CLIENT=1 -DBUILD_SERVER=0 \
|
||||||
|
-DCMAKE_TOOLCHAIN_FILE=$toolchain_file \
|
||||||
|
\
|
||||||
|
-DENABLE_SOUND=1 \
|
||||||
|
-DENABLE_CURL=1 \
|
||||||
|
-DENABLE_GETTEXT=1 \
|
||||||
|
-DENABLE_FREETYPE=1 \
|
||||||
|
-DENABLE_LEVELDB=1 \
|
||||||
|
\
|
||||||
|
-DIRRLICHT_INCLUDE_DIR=$libdir/irrlicht/include \
|
||||||
|
-DIRRLICHT_LIBRARY=$libdir/irrlicht/lib/Win32-gcc/libIrrlicht.dll.a \
|
||||||
|
-DIRRLICHT_DLL=$libdir/irrlicht/bin/Win32-gcc/Irrlicht.dll \
|
||||||
|
\
|
||||||
|
-DZLIB_INCLUDE_DIR=$libdir/zlib/include \
|
||||||
|
-DZLIB_LIBRARIES=$libdir/zlib/lib/libz.dll.a \
|
||||||
|
-DZLIB_DLL=$libdir/zlib/bin/zlib1.dll \
|
||||||
|
\
|
||||||
|
-DLUA_INCLUDE_DIR=$libdir/luajit/include \
|
||||||
|
-DLUA_LIBRARY=$libdir/luajit/libluajit.a \
|
||||||
|
\
|
||||||
|
-DOGG_INCLUDE_DIR=$libdir/libogg/include \
|
||||||
|
-DOGG_LIBRARY=$libdir/libogg/lib/libogg.dll.a \
|
||||||
|
-DOGG_DLL=$libdir/libogg/bin/libogg-0.dll \
|
||||||
|
\
|
||||||
|
-DVORBIS_INCLUDE_DIR=$libdir/libvorbis/include \
|
||||||
|
-DVORBIS_LIBRARY=$libdir/libvorbis/lib/libvorbis.dll.a \
|
||||||
|
-DVORBIS_DLL=$libdir/libvorbis/bin/libvorbis-0.dll \
|
||||||
|
-DVORBISFILE_LIBRARY=$libdir/libvorbis/lib/libvorbisfile.dll.a \
|
||||||
|
-DVORBISFILE_DLL=$libdir/libvorbis/bin/libvorbisfile-3.dll \
|
||||||
|
\
|
||||||
|
-DOPENAL_INCLUDE_DIR=$libdir/openal_stripped/include/AL \
|
||||||
|
-DOPENAL_LIBRARY=$libdir/openal_stripped/lib/libOpenAL32.dll.a \
|
||||||
|
-DOPENAL_DLL=$libdir/openal_stripped/bin/OpenAL32.dll \
|
||||||
|
\
|
||||||
|
-DCURL_DLL=$libdir/libcurl/bin/libcurl-4.dll \
|
||||||
|
-DCURL_INCLUDE_DIR=$libdir/libcurl/include \
|
||||||
|
-DCURL_LIBRARY=$libdir/libcurl/lib/libcurl.dll.a \
|
||||||
|
\
|
||||||
|
-DGETTEXT_MSGFMT=`which msgfmt` \
|
||||||
|
-DGETTEXT_DLL=$libdir/gettext/bin/libintl-8.dll \
|
||||||
|
-DGETTEXT_ICONV_DLL=$libdir/gettext/bin/libiconv-2.dll \
|
||||||
|
-DGETTEXT_INCLUDE_DIR=$libdir/gettext/include \
|
||||||
|
-DGETTEXT_LIBRARY=$libdir/gettext/lib/libintl.dll.a \
|
||||||
|
\
|
||||||
|
-DFREETYPE_INCLUDE_DIR_freetype2=$libdir/freetype/include/freetype2 \
|
||||||
|
-DFREETYPE_INCLUDE_DIR_ft2build=$libdir/freetype/include/freetype2 \
|
||||||
|
-DFREETYPE_LIBRARY=$libdir/freetype/lib/libfreetype.dll.a \
|
||||||
|
-DFREETYPE_DLL=$libdir/freetype/bin/libfreetype-6.dll \
|
||||||
|
\
|
||||||
|
-DSQLITE3_INCLUDE_DIR=$libdir/sqlite3/include \
|
||||||
|
-DSQLITE3_LIBRARY=$libdir/sqlite3/lib/libsqlite3.dll.a \
|
||||||
|
-DSQLITE3_DLL=$libdir/sqlite3/bin/libsqlite3-0.dll \
|
||||||
|
\
|
||||||
|
-DLEVELDB_INCLUDE_DIR=$libdir/leveldb/include \
|
||||||
|
-DLEVELDB_LIBRARY=$libdir/leveldb/lib/libleveldb.dll.a \
|
||||||
|
-DLEVELDB_DLL=$libdir/leveldb/bin/libleveldb.dll
|
||||||
|
|
||||||
|
make -j$(nproc)
|
||||||
|
|
||||||
|
[ "x$NO_PACKAGE" = "x" ] && make package
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
# EOF
|
164
util/buildbot/buildwin64.sh
Normal file
@ -0,0 +1,164 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
CORE_GIT=https://github.com/EliasFleckenstein03/dragonfireclient
|
||||||
|
CORE_BRANCH=master
|
||||||
|
CORE_NAME=dragonfireclient
|
||||||
|
GAME_GIT=https://git.minetest.land/Wuzzy/MineClone2
|
||||||
|
GAME_BRANCH=master
|
||||||
|
GAME_NAME=mineclone2
|
||||||
|
|
||||||
|
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
echo "Usage: $0 <build directory>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
builddir=$1
|
||||||
|
mkdir -p $builddir
|
||||||
|
builddir="$( cd "$builddir" && pwd )"
|
||||||
|
packagedir=$builddir/packages
|
||||||
|
libdir=$builddir/libs
|
||||||
|
|
||||||
|
toolchain_file=$dir/toolchain_x86_64-w64-mingw32.cmake
|
||||||
|
irrlicht_version=1.8.4
|
||||||
|
ogg_version=1.3.2
|
||||||
|
vorbis_version=1.3.5
|
||||||
|
curl_version=7.65.3
|
||||||
|
gettext_version=0.20.1
|
||||||
|
freetype_version=2.10.1
|
||||||
|
sqlite3_version=3.27.2
|
||||||
|
luajit_version=2.1.0-beta3
|
||||||
|
leveldb_version=1.22
|
||||||
|
zlib_version=1.2.11
|
||||||
|
|
||||||
|
mkdir -p $packagedir
|
||||||
|
mkdir -p $libdir
|
||||||
|
|
||||||
|
cd $builddir
|
||||||
|
|
||||||
|
# Get stuff
|
||||||
|
[ -e $packagedir/irrlicht-$irrlicht_version.zip ] || wget http://minetest.kitsunemimi.pw/irrlicht-$irrlicht_version-win64.zip \
|
||||||
|
-c -O $packagedir/irrlicht-$irrlicht_version.zip
|
||||||
|
[ -e $packagedir/zlib-$zlib_version.zip ] || wget http://minetest.kitsunemimi.pw/zlib-$zlib_version-win64.zip \
|
||||||
|
-c -O $packagedir/zlib-$zlib_version.zip
|
||||||
|
[ -e $packagedir/libogg-$ogg_version.zip ] || wget http://minetest.kitsunemimi.pw/libogg-$ogg_version-win64.zip \
|
||||||
|
-c -O $packagedir/libogg-$ogg_version.zip
|
||||||
|
[ -e $packagedir/libvorbis-$vorbis_version.zip ] || wget http://minetest.kitsunemimi.pw/libvorbis-$vorbis_version-win64.zip \
|
||||||
|
-c -O $packagedir/libvorbis-$vorbis_version.zip
|
||||||
|
[ -e $packagedir/curl-$curl_version.zip ] || wget http://minetest.kitsunemimi.pw/curl-$curl_version-win64.zip \
|
||||||
|
-c -O $packagedir/curl-$curl_version.zip
|
||||||
|
[ -e $packagedir/gettext-$gettext_version.zip ] || wget http://minetest.kitsunemimi.pw/gettext-$gettext_version-win64.zip \
|
||||||
|
-c -O $packagedir/gettext-$gettext_version.zip
|
||||||
|
[ -e $packagedir/freetype2-$freetype_version.zip ] || wget http://minetest.kitsunemimi.pw/freetype2-$freetype_version-win64.zip \
|
||||||
|
-c -O $packagedir/freetype2-$freetype_version.zip
|
||||||
|
[ -e $packagedir/sqlite3-$sqlite3_version.zip ] || wget http://minetest.kitsunemimi.pw/sqlite3-$sqlite3_version-win64.zip \
|
||||||
|
-c -O $packagedir/sqlite3-$sqlite3_version.zip
|
||||||
|
[ -e $packagedir/luajit-$luajit_version.zip ] || wget http://minetest.kitsunemimi.pw/luajit-$luajit_version-win64.zip \
|
||||||
|
-c -O $packagedir/luajit-$luajit_version.zip
|
||||||
|
[ -e $packagedir/libleveldb-$leveldb_version.zip ] || wget http://minetest.kitsunemimi.pw/libleveldb-$leveldb_version-win64.zip \
|
||||||
|
-c -O $packagedir/libleveldb-$leveldb_version.zip
|
||||||
|
[ -e $packagedir/openal_stripped.zip ] || wget http://minetest.kitsunemimi.pw/openal_stripped64.zip \
|
||||||
|
-c -O $packagedir/openal_stripped.zip
|
||||||
|
|
||||||
|
|
||||||
|
# Extract stuff
|
||||||
|
cd $libdir
|
||||||
|
[ -d irrlicht ] || unzip -o $packagedir/irrlicht-$irrlicht_version.zip -d irrlicht
|
||||||
|
[ -d zlib ] || unzip -o $packagedir/zlib-$zlib_version.zip -d zlib
|
||||||
|
[ -d libogg ] || unzip -o $packagedir/libogg-$ogg_version.zip -d libogg
|
||||||
|
[ -d libvorbis ] || unzip -o $packagedir/libvorbis-$vorbis_version.zip -d libvorbis
|
||||||
|
[ -d libcurl ] || unzip -o $packagedir/curl-$curl_version.zip -d libcurl
|
||||||
|
[ -d gettext ] || unzip -o $packagedir/gettext-$gettext_version.zip -d gettext
|
||||||
|
[ -d freetype ] || unzip -o $packagedir/freetype2-$freetype_version.zip -d freetype
|
||||||
|
[ -d sqlite3 ] || unzip -o $packagedir/sqlite3-$sqlite3_version.zip -d sqlite3
|
||||||
|
[ -d openal_stripped ] || unzip -o $packagedir/openal_stripped.zip
|
||||||
|
[ -d luajit ] || unzip -o $packagedir/luajit-$luajit_version.zip -d luajit
|
||||||
|
[ -d leveldb ] || unzip -o $packagedir/libleveldb-$leveldb_version.zip -d leveldb
|
||||||
|
|
||||||
|
# Get minetest
|
||||||
|
cd $builddir
|
||||||
|
if [ ! "x$EXISTING_MINETEST_DIR" = "x" ]; then
|
||||||
|
cd /$EXISTING_MINETEST_DIR # must be absolute path
|
||||||
|
else
|
||||||
|
[ -d $CORE_NAME ] && (cd $CORE_NAME && git pull) || (git clone -b $CORE_BRANCH $CORE_GIT)
|
||||||
|
cd $CORE_NAME
|
||||||
|
fi
|
||||||
|
git_hash=$(git rev-parse --short HEAD)
|
||||||
|
|
||||||
|
# Get minetest_game
|
||||||
|
if [ "x$NO_MINETEST_GAME" = "x" ]; then
|
||||||
|
cd games
|
||||||
|
[ -d $GAME_NAME ] && (cd $GAME_NAME && git pull) || (git clone -b $GAME_BRANCH $GAME_GIT)
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Build the thing
|
||||||
|
[ -d _build ] && rm -Rf _build/
|
||||||
|
mkdir _build
|
||||||
|
cd _build
|
||||||
|
cmake .. \
|
||||||
|
-DCMAKE_TOOLCHAIN_FILE=$toolchain_file \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=/tmp \
|
||||||
|
-DVERSION_EXTRA=$git_hash \
|
||||||
|
-DBUILD_CLIENT=1 -DBUILD_SERVER=0 \
|
||||||
|
\
|
||||||
|
-DENABLE_SOUND=1 \
|
||||||
|
-DENABLE_CURL=1 \
|
||||||
|
-DENABLE_GETTEXT=1 \
|
||||||
|
-DENABLE_FREETYPE=1 \
|
||||||
|
-DENABLE_LEVELDB=1 \
|
||||||
|
\
|
||||||
|
-DIRRLICHT_INCLUDE_DIR=$libdir/irrlicht/include \
|
||||||
|
-DIRRLICHT_LIBRARY=$libdir/irrlicht/lib/Win64-gcc/libIrrlicht.dll.a \
|
||||||
|
-DIRRLICHT_DLL=$libdir/irrlicht/bin/Win64-gcc/Irrlicht.dll \
|
||||||
|
\
|
||||||
|
-DZLIB_INCLUDE_DIR=$libdir/zlib/include \
|
||||||
|
-DZLIB_LIBRARIES=$libdir/zlib/lib/libz.dll.a \
|
||||||
|
-DZLIB_DLL=$libdir/zlib/bin/zlib1.dll \
|
||||||
|
\
|
||||||
|
-DLUA_INCLUDE_DIR=$libdir/luajit/include \
|
||||||
|
-DLUA_LIBRARY=$libdir/luajit/libluajit.a \
|
||||||
|
\
|
||||||
|
-DOGG_INCLUDE_DIR=$libdir/libogg/include \
|
||||||
|
-DOGG_LIBRARY=$libdir/libogg/lib/libogg.dll.a \
|
||||||
|
-DOGG_DLL=$libdir/libogg/bin/libogg-0.dll \
|
||||||
|
\
|
||||||
|
-DVORBIS_INCLUDE_DIR=$libdir/libvorbis/include \
|
||||||
|
-DVORBIS_LIBRARY=$libdir/libvorbis/lib/libvorbis.dll.a \
|
||||||
|
-DVORBIS_DLL=$libdir/libvorbis/bin/libvorbis-0.dll \
|
||||||
|
-DVORBISFILE_LIBRARY=$libdir/libvorbis/lib/libvorbisfile.dll.a \
|
||||||
|
-DVORBISFILE_DLL=$libdir/libvorbis/bin/libvorbisfile-3.dll \
|
||||||
|
\
|
||||||
|
-DOPENAL_INCLUDE_DIR=$libdir/openal_stripped/include/AL \
|
||||||
|
-DOPENAL_LIBRARY=$libdir/openal_stripped/lib/libOpenAL32.dll.a \
|
||||||
|
-DOPENAL_DLL=$libdir/openal_stripped/bin/OpenAL32.dll \
|
||||||
|
\
|
||||||
|
-DCURL_DLL=$libdir/libcurl/bin/libcurl-4.dll \
|
||||||
|
-DCURL_INCLUDE_DIR=$libdir/libcurl/include \
|
||||||
|
-DCURL_LIBRARY=$libdir/libcurl/lib/libcurl.dll.a \
|
||||||
|
\
|
||||||
|
-DGETTEXT_MSGFMT=`which msgfmt` \
|
||||||
|
-DGETTEXT_DLL=$libdir/gettext/bin/libintl-8.dll \
|
||||||
|
-DGETTEXT_ICONV_DLL=$libdir/gettext/bin/libiconv-2.dll \
|
||||||
|
-DGETTEXT_INCLUDE_DIR=$libdir/gettext/include \
|
||||||
|
-DGETTEXT_LIBRARY=$libdir/gettext/lib/libintl.dll.a \
|
||||||
|
\
|
||||||
|
-DFREETYPE_INCLUDE_DIR_freetype2=$libdir/freetype/include/freetype2 \
|
||||||
|
-DFREETYPE_INCLUDE_DIR_ft2build=$libdir/freetype/include/freetype2 \
|
||||||
|
-DFREETYPE_LIBRARY=$libdir/freetype/lib/libfreetype.dll.a \
|
||||||
|
-DFREETYPE_DLL=$libdir/freetype/bin/libfreetype-6.dll \
|
||||||
|
\
|
||||||
|
-DSQLITE3_INCLUDE_DIR=$libdir/sqlite3/include \
|
||||||
|
-DSQLITE3_LIBRARY=$libdir/sqlite3/lib/libsqlite3.dll.a \
|
||||||
|
-DSQLITE3_DLL=$libdir/sqlite3/bin/libsqlite3-0.dll \
|
||||||
|
\
|
||||||
|
-DLEVELDB_INCLUDE_DIR=$libdir/leveldb/include \
|
||||||
|
-DLEVELDB_LIBRARY=$libdir/leveldb/lib/libleveldb.dll.a \
|
||||||
|
-DLEVELDB_DLL=$libdir/leveldb/bin/libleveldb.dll
|
||||||
|
|
||||||
|
make -j$(nproc)
|
||||||
|
|
||||||
|
[ "x$NO_PACKAGE" = "x" ] && make package
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
# EOF
|
17
util/buildbot/toolchain_i586-mingw32msvc.cmake
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# name of the target operating system
|
||||||
|
SET(CMAKE_SYSTEM_NAME Windows)
|
||||||
|
|
||||||
|
# which compilers to use for C and C++
|
||||||
|
SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
|
||||||
|
SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
|
||||||
|
SET(CMAKE_RC_COMPILER i586-mingw32msvc-windres)
|
||||||
|
|
||||||
|
# here is the target environment located
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc)
|
||||||
|
|
||||||
|
# adjust the default behaviour of the FIND_XXX() commands:
|
||||||
|
# search headers and libraries in the target environment, search
|
||||||
|
# programs in the host environment
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
17
util/buildbot/toolchain_i646-w64-mingw32.cmake
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# name of the target operating system
|
||||||
|
SET(CMAKE_SYSTEM_NAME Windows)
|
||||||
|
|
||||||
|
# which compilers to use for C and C++
|
||||||
|
SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
|
||||||
|
SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
|
||||||
|
SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
|
||||||
|
|
||||||
|
# here is the target environment located
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)
|
||||||
|
|
||||||
|
# adjust the default behaviour of the FIND_XXX() commands:
|
||||||
|
# search headers and libraries in the target environment, search
|
||||||
|
# programs in the host environment
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
17
util/buildbot/toolchain_x86_64-w64-mingw32.cmake
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# name of the target operating system
|
||||||
|
SET(CMAKE_SYSTEM_NAME Windows)
|
||||||
|
|
||||||
|
# which compilers to use for C and C++
|
||||||
|
SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
|
||||||
|
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
|
||||||
|
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
|
||||||
|
|
||||||
|
# here is the target environment located
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
|
||||||
|
|
||||||
|
# adjust the default behaviour of the FIND_XXX() commands:
|
||||||
|
# search headers and libraries in the target environment, search
|
||||||
|
# programs in the host environment
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
138
util/bump_version.sh
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
prompt_for_number() {
|
||||||
|
local prompt_text=$1
|
||||||
|
local default_value=$2
|
||||||
|
local tmp=""
|
||||||
|
while true; do
|
||||||
|
read -p "$prompt_text [$default_value]: " tmp
|
||||||
|
if [ "$tmp" = "" ]; then
|
||||||
|
echo "$default_value"; return
|
||||||
|
elif echo "$tmp" | grep -q -E '^[0-9]+$'; then
|
||||||
|
echo "$tmp"; return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# On a release the following actions are performed
|
||||||
|
# * DEVELOPMENT_BUILD is set to false
|
||||||
|
# * android versionCode is bumped
|
||||||
|
# * appdata release version and date are updated
|
||||||
|
# * Commit the changes
|
||||||
|
# * Tag with current version
|
||||||
|
perform_release() {
|
||||||
|
sed -i -re "s/^set\(DEVELOPMENT_BUILD TRUE\)$/set(DEVELOPMENT_BUILD FALSE)/" CMakeLists.txt
|
||||||
|
|
||||||
|
sed -i -re "s/\"versionCode\", [0-9]+/\"versionCode\", $NEW_ANDROID_VERSION_CODE/" build/android/build.gradle
|
||||||
|
|
||||||
|
sed -i '/\<release/s/\(version\)="[^"]*"/\1="'"$RELEASE_VERSION"'"/' misc/net.minetest.minetest.appdata.xml
|
||||||
|
|
||||||
|
RELEASE_DATE=`date +%Y-%m-%d`
|
||||||
|
|
||||||
|
sed -i 's/\(<release date\)="[^"]*"/\1="'"$RELEASE_DATE"'"/' misc/net.minetest.minetest.appdata.xml
|
||||||
|
|
||||||
|
git add -f CMakeLists.txt build/android/build.gradle misc/net.minetest.minetest.appdata.xml
|
||||||
|
|
||||||
|
git commit -m "Bump version to $RELEASE_VERSION"
|
||||||
|
|
||||||
|
echo "Tagging $RELEASE_VERSION"
|
||||||
|
|
||||||
|
git tag -a "$RELEASE_VERSION" -m "$RELEASE_VERSION"
|
||||||
|
}
|
||||||
|
|
||||||
|
# After release
|
||||||
|
# * Set DEVELOPMENT_BUILD to true
|
||||||
|
# * Bump version in CMakeLists and docs
|
||||||
|
# * Commit the changes
|
||||||
|
back_to_devel() {
|
||||||
|
echo 'Creating "return back to development" commit'
|
||||||
|
|
||||||
|
sed -i -re 's/^set\(DEVELOPMENT_BUILD FALSE\)$/set(DEVELOPMENT_BUILD TRUE)/' CMakeLists.txt
|
||||||
|
|
||||||
|
sed -i -re "s/^set\(VERSION_MAJOR [0-9]+\)$/set(VERSION_MAJOR $NEXT_VERSION_MAJOR)/" CMakeLists.txt
|
||||||
|
|
||||||
|
sed -i -re "s/^set\(VERSION_MINOR [0-9]+\)$/set(VERSION_MINOR $NEXT_VERSION_MINOR)/" CMakeLists.txt
|
||||||
|
|
||||||
|
sed -i -re "s/^set\(VERSION_PATCH [0-9]+\)$/set(VERSION_PATCH $NEXT_VERSION_PATCH)/" CMakeLists.txt
|
||||||
|
|
||||||
|
sed -i -re "1s/[0-9]+\.[0-9]+\.[0-9]+/$NEXT_VERSION/g" doc/menu_lua_api.txt
|
||||||
|
|
||||||
|
sed -i -re "1s/[0-9]+\.[0-9]+\.[0-9]+/$NEXT_VERSION/g" doc/client_lua_api.txt
|
||||||
|
|
||||||
|
git add -f CMakeLists.txt doc/menu_lua_api.txt doc/client_lua_api.txt
|
||||||
|
|
||||||
|
git commit -m "Continue with $NEXT_VERSION-dev"
|
||||||
|
}
|
||||||
|
##################################
|
||||||
|
# Switch to top minetest directory
|
||||||
|
##################################
|
||||||
|
|
||||||
|
cd ${0%/*}/..
|
||||||
|
|
||||||
|
|
||||||
|
#######################
|
||||||
|
# Determine old version
|
||||||
|
#######################
|
||||||
|
|
||||||
|
# Make sure all the files we need exist
|
||||||
|
grep -q -E '^set\(VERSION_MAJOR [0-9]+\)$' CMakeLists.txt
|
||||||
|
grep -q -E '^set\(VERSION_MINOR [0-9]+\)$' CMakeLists.txt
|
||||||
|
grep -q -E '^set\(VERSION_PATCH [0-9]+\)$' CMakeLists.txt
|
||||||
|
grep -q -E '\("versionCode", [0-9]+\)' build/android/build.gradle
|
||||||
|
|
||||||
|
VERSION_MAJOR=$(grep -E '^set\(VERSION_MAJOR [0-9]+\)$' CMakeLists.txt | tr -dC 0-9)
|
||||||
|
VERSION_MINOR=$(grep -E '^set\(VERSION_MINOR [0-9]+\)$' CMakeLists.txt | tr -dC 0-9)
|
||||||
|
VERSION_PATCH=$(grep -E '^set\(VERSION_PATCH [0-9]+\)$' CMakeLists.txt | tr -dC 0-9)
|
||||||
|
ANDROID_VERSION_CODE=$(grep -E '"versionCode", [0-9]+' build/android/build.gradle | tr -dC 0-9)
|
||||||
|
|
||||||
|
RELEASE_VERSION="$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH"
|
||||||
|
|
||||||
|
echo "Current Minetest version: $RELEASE_VERSION"
|
||||||
|
echo "Current Android version code: $ANDROID_VERSION_CODE"
|
||||||
|
|
||||||
|
# +1 for ARM and +1 for ARM64 APKs
|
||||||
|
NEW_ANDROID_VERSION_CODE=$(expr $ANDROID_VERSION_CODE + 2)
|
||||||
|
NEW_ANDROID_VERSION_CODE=$(prompt_for_number "Set android version code" $NEW_ANDROID_VERSION_CODE)
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "New android version code: $NEW_ANDROID_VERSION_CODE"
|
||||||
|
|
||||||
|
########################
|
||||||
|
# Perform release
|
||||||
|
########################
|
||||||
|
|
||||||
|
perform_release
|
||||||
|
|
||||||
|
########################
|
||||||
|
# Prompt for next version
|
||||||
|
########################
|
||||||
|
|
||||||
|
NEXT_VERSION_MAJOR=$VERSION_MAJOR
|
||||||
|
NEXT_VERSION_MINOR=$VERSION_MINOR
|
||||||
|
NEXT_VERSION_PATCH=$(expr $VERSION_PATCH + 1)
|
||||||
|
|
||||||
|
NEXT_VERSION_MAJOR=$(prompt_for_number "Set next major" $NEXT_VERSION_MAJOR)
|
||||||
|
|
||||||
|
if [ "$NEXT_VERSION_MAJOR" != "$VERSION_MAJOR" ]; then
|
||||||
|
NEXT_VERSION_MINOR=0
|
||||||
|
NEXT_VERSION_PATCH=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
NEXT_VERSION_MINOR=$(prompt_for_number "Set next minor" $NEXT_VERSION_MINOR)
|
||||||
|
|
||||||
|
if [ "$NEXT_VERSION_MINOR" != "$VERSION_MINOR" ]; then
|
||||||
|
NEXT_VERSION_PATCH=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
NEXT_VERSION_PATCH=$(prompt_for_number "Set next patch" $NEXT_VERSION_PATCH)
|
||||||
|
|
||||||
|
NEXT_VERSION="$NEXT_VERSION_MAJOR.$NEXT_VERSION_MINOR.$NEXT_VERSION_PATCH"
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "New version: $NEXT_VERSION"
|
||||||
|
|
||||||
|
########################
|
||||||
|
# Return back to devel
|
||||||
|
########################
|
||||||
|
|
||||||
|
back_to_devel
|
8
util/ci/build.sh
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#! /bin/bash -e
|
||||||
|
|
||||||
|
mkdir cmakebuild
|
||||||
|
cd cmakebuild
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Debug \
|
||||||
|
-DRUN_IN_PLACE=TRUE -DENABLE_GETTEXT=TRUE \
|
||||||
|
-DBUILD_SERVER=TRUE ${CMAKE_FLAGS} ..
|
||||||
|
make -j2
|
13
util/ci/build_prometheus_cpp.sh
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#! /bin/bash -eu
|
||||||
|
|
||||||
|
cd /tmp
|
||||||
|
git clone --recursive https://github.com/jupp0r/prometheus-cpp
|
||||||
|
mkdir prometheus-cpp/build
|
||||||
|
cd prometheus-cpp/build
|
||||||
|
cmake .. \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DENABLE_TESTING=0
|
||||||
|
make -j2
|
||||||
|
sudo make install
|
||||||
|
|
502
util/ci/clang-format-whitelist.txt
Normal file
@ -0,0 +1,502 @@
|
|||||||
|
src/activeobject.h
|
||||||
|
src/ban.cpp
|
||||||
|
src/camera.cpp
|
||||||
|
src/camera.h
|
||||||
|
src/chat.cpp
|
||||||
|
src/chat.h
|
||||||
|
src/chat_interface.h
|
||||||
|
src/client/clientlauncher.cpp
|
||||||
|
src/client/clientlauncher.h
|
||||||
|
src/client/sound_openal.cpp
|
||||||
|
src/client.cpp
|
||||||
|
src/clientenvironment.cpp
|
||||||
|
src/clientenvironment.h
|
||||||
|
src/client/gameui.cpp
|
||||||
|
src/client.h
|
||||||
|
src/client/hud.cpp
|
||||||
|
src/client/hud.h
|
||||||
|
src/clientiface.cpp
|
||||||
|
src/clientiface.h
|
||||||
|
src/client/joystick_controller.cpp
|
||||||
|
src/client/joystick_controller.h
|
||||||
|
src/clientmap.cpp
|
||||||
|
src/clientmap.h
|
||||||
|
src/clientmedia.cpp
|
||||||
|
src/clientmedia.h
|
||||||
|
src/clientobject.cpp
|
||||||
|
src/clientobject.h
|
||||||
|
src/client/render/core.cpp
|
||||||
|
src/client/renderingengine.cpp
|
||||||
|
src/client/render/interlaced.cpp
|
||||||
|
src/client/render/plain.cpp
|
||||||
|
src/client/render/sidebyside.cpp
|
||||||
|
src/client/render/stereo.cpp
|
||||||
|
src/client/tile.cpp
|
||||||
|
src/client/tile.h
|
||||||
|
src/client/fontengine.h
|
||||||
|
src/client/clientenvironment.cpp
|
||||||
|
src/client/mapblock_mesh.cpp
|
||||||
|
src/client/sound_openal.h
|
||||||
|
src/client/clouds.cpp
|
||||||
|
src/client/fontengine.cpp
|
||||||
|
src/client/camera.h
|
||||||
|
src/client/hud.cpp
|
||||||
|
src/client/clientmap.cpp
|
||||||
|
src/client/sound_openal.cpp
|
||||||
|
src/client/minimap.h
|
||||||
|
src/client/content_cao.cpp
|
||||||
|
src/client/localplayer.h
|
||||||
|
src/client/mapblock_mesh.h
|
||||||
|
src/client/mesh.cpp
|
||||||
|
src/client/sound.cpp
|
||||||
|
src/client/guiscalingfilter.cpp
|
||||||
|
src/client/content_cso.cpp
|
||||||
|
src/client/gameui.cpp
|
||||||
|
src/client/wieldmesh.cpp
|
||||||
|
src/client/clientmedia.h
|
||||||
|
src/client/game.cpp
|
||||||
|
src/client/keys.h
|
||||||
|
src/client/client.h
|
||||||
|
src/client/shader.cpp
|
||||||
|
src/client/clientmap.h
|
||||||
|
src/client/inputhandler.h
|
||||||
|
src/client/content_mapblock.h
|
||||||
|
src/client/game.h
|
||||||
|
src/client/mesh.h
|
||||||
|
src/client/camera.cpp
|
||||||
|
src/client/sky.h
|
||||||
|
src/client/mesh_generator_thread.cpp
|
||||||
|
src/client/guiscalingfilter.h
|
||||||
|
src/client/clientobject.cpp
|
||||||
|
src/client/tile.cpp
|
||||||
|
src/client/hud.h
|
||||||
|
src/client/inputhandler.cpp
|
||||||
|
src/client/clientevent.h
|
||||||
|
src/client/gameui.h
|
||||||
|
src/client/content_cso.h
|
||||||
|
src/client/sky.cpp
|
||||||
|
src/client/localplayer.cpp
|
||||||
|
src/client/content_mapblock.cpp
|
||||||
|
src/client/clientobject.h
|
||||||
|
src/client/filecache.cpp
|
||||||
|
src/client/particles.h
|
||||||
|
src/client/clientenvironment.h
|
||||||
|
src/client/imagefilters.h
|
||||||
|
src/client/renderingengine.cpp
|
||||||
|
src/client/tile.h
|
||||||
|
src/client/clientmedia.cpp
|
||||||
|
src/client/event_manager.h
|
||||||
|
src/client/joystick_controller.h
|
||||||
|
src/client/clouds.h
|
||||||
|
src/client/clientlauncher.h
|
||||||
|
src/client/content_cao.h
|
||||||
|
src/client/minimap.cpp
|
||||||
|
src/client/sound.h
|
||||||
|
src/client/keycode.cpp
|
||||||
|
src/client/particles.cpp
|
||||||
|
src/client/joystick_controller.cpp
|
||||||
|
src/client/keycode.h
|
||||||
|
src/client/wieldmesh.h
|
||||||
|
src/client/filecache.h
|
||||||
|
src/client/shader.h
|
||||||
|
src/client/mesh_generator_thread.h
|
||||||
|
src/client/renderingengine.h
|
||||||
|
src/client/client.cpp
|
||||||
|
src/client/imagefilters.cpp
|
||||||
|
src/client/clientlauncher.cpp
|
||||||
|
src/clouds.cpp
|
||||||
|
src/clouds.h
|
||||||
|
src/collision.cpp
|
||||||
|
src/collision.h
|
||||||
|
src/config.h
|
||||||
|
src/content_cao.cpp
|
||||||
|
src/content_cao.h
|
||||||
|
src/content_cso.cpp
|
||||||
|
src/content_cso.h
|
||||||
|
src/content_mapblock.cpp
|
||||||
|
src/content_mapblock.h
|
||||||
|
src/content_mapnode.cpp
|
||||||
|
src/content_nodemeta.cpp
|
||||||
|
src/content_nodemeta.h
|
||||||
|
src/convert_json.cpp
|
||||||
|
src/convert_json.h
|
||||||
|
src/craftdef.cpp
|
||||||
|
src/craftdef.h
|
||||||
|
src/database/database.cpp
|
||||||
|
src/database/database-dummy.cpp
|
||||||
|
src/database/database-files.cpp
|
||||||
|
src/database/database-leveldb.cpp
|
||||||
|
src/database/database-postgresql.cpp
|
||||||
|
src/database/database-postgresql.h
|
||||||
|
src/database/database-redis.cpp
|
||||||
|
src/database/database-sqlite3.cpp
|
||||||
|
src/database/database-sqlite3.h
|
||||||
|
src/daynightratio.h
|
||||||
|
src/debug.cpp
|
||||||
|
src/debug.h
|
||||||
|
src/defaultsettings.cpp
|
||||||
|
src/emerge.cpp
|
||||||
|
src/emerge.h
|
||||||
|
src/environment.cpp
|
||||||
|
src/exceptions.h
|
||||||
|
src/face_position_cache.cpp
|
||||||
|
src/face_position_cache.h
|
||||||
|
src/filecache.cpp
|
||||||
|
src/filesys.cpp
|
||||||
|
src/filesys.h
|
||||||
|
src/fontengine.cpp
|
||||||
|
src/fontengine.h
|
||||||
|
src/game.cpp
|
||||||
|
src/gamedef.h
|
||||||
|
src/game.h
|
||||||
|
src/gettext.cpp
|
||||||
|
src/gettext.h
|
||||||
|
src/gui/guiAnimatedImage.cpp
|
||||||
|
src/gui/guiAnimatedImage.h
|
||||||
|
src/gui/guiBackgroundImage.cpp
|
||||||
|
src/gui/guiBackgroundImage.h
|
||||||
|
src/gui/guiBox.cpp
|
||||||
|
src/gui/guiBox.h
|
||||||
|
src/gui/guiButton.cpp
|
||||||
|
src/gui/guiButton.h
|
||||||
|
src/gui/guiButtonImage.cpp
|
||||||
|
src/gui/guiButtonImage.h
|
||||||
|
src/gui/guiButtonItemImage.cpp
|
||||||
|
src/gui/guiButtonItemImage.h
|
||||||
|
src/gui/guiChatConsole.cpp
|
||||||
|
src/gui/guiChatConsole.h
|
||||||
|
src/gui/guiConfirmRegistration.cpp
|
||||||
|
src/gui/guiEditBoxWithScrollbar.cpp
|
||||||
|
src/gui/guiEditBoxWithScrollbar.h
|
||||||
|
src/gui/guiEngine.cpp
|
||||||
|
src/gui/guiEngine.h
|
||||||
|
src/gui/guiFormSpecMenu.cpp
|
||||||
|
src/gui/guiFormSpecMenu.h
|
||||||
|
src/gui/guiKeyChangeMenu.cpp
|
||||||
|
src/gui/guiHyperText.cpp
|
||||||
|
src/gui/guiHyperText.h
|
||||||
|
src/gui/guiInventoryList.cpp
|
||||||
|
src/gui/guiInventoryList.h
|
||||||
|
src/gui/guiItemImage.cpp
|
||||||
|
src/gui/guiItemImage.h
|
||||||
|
src/gui/guiMainMenu.h
|
||||||
|
src/gui/guiPasswordChange.cpp
|
||||||
|
src/gui/guiPathSelectMenu.cpp
|
||||||
|
src/gui/guiPathSelectMenu.h
|
||||||
|
src/gui/guiScene.cpp
|
||||||
|
src/gui/guiScene.h
|
||||||
|
src/gui/guiScrollBar.cpp
|
||||||
|
src/gui/guiSkin.cpp
|
||||||
|
src/gui/guiSkin.h
|
||||||
|
src/gui/guiTable.cpp
|
||||||
|
src/gui/guiTable.h
|
||||||
|
src/gui/guiVolumeChange.cpp
|
||||||
|
src/gui/guiVolumeChange.h
|
||||||
|
src/gui/intlGUIEditBox.cpp
|
||||||
|
src/gui/intlGUIEditBox.h
|
||||||
|
src/gui/mainmenumanager.h
|
||||||
|
src/gui/modalMenu.h
|
||||||
|
src/guiscalingfilter.cpp
|
||||||
|
src/guiscalingfilter.h
|
||||||
|
src/gui/StyleSpec.h
|
||||||
|
src/gui/touchscreengui.cpp
|
||||||
|
src/httpfetch.cpp
|
||||||
|
src/hud.cpp
|
||||||
|
src/hud.h
|
||||||
|
src/imagefilters.cpp
|
||||||
|
src/imagefilters.h
|
||||||
|
src/inventory.cpp
|
||||||
|
src/inventory.h
|
||||||
|
src/inventorymanager.cpp
|
||||||
|
src/inventorymanager.h
|
||||||
|
src/irrlicht_changes/CGUITTFont.cpp
|
||||||
|
src/irrlicht_changes/CGUITTFont.h
|
||||||
|
src/irrlicht_changes/irrUString.h
|
||||||
|
src/irrlicht_changes/static_text.cpp
|
||||||
|
src/irrlicht_changes/static_text.h
|
||||||
|
src/irrlichttypes.h
|
||||||
|
src/itemdef.cpp
|
||||||
|
src/itemdef.h
|
||||||
|
src/itemstackmetadata.cpp
|
||||||
|
src/keycode.cpp
|
||||||
|
src/light.cpp
|
||||||
|
src/localplayer.cpp
|
||||||
|
src/log.cpp
|
||||||
|
src/log.h
|
||||||
|
src/main.cpp
|
||||||
|
src/mapblock.cpp
|
||||||
|
src/mapblock.h
|
||||||
|
src/mapblock_mesh.cpp
|
||||||
|
src/mapblock_mesh.h
|
||||||
|
src/map.cpp
|
||||||
|
src/mapgen/cavegen.cpp
|
||||||
|
src/mapgen/cavegen.h
|
||||||
|
src/mapgen/dungeongen.cpp
|
||||||
|
src/mapgen/dungeongen.h
|
||||||
|
src/mapgen/mapgen.cpp
|
||||||
|
src/mapgen/mapgen.h
|
||||||
|
src/mapgen/mapgen_carpathian.cpp
|
||||||
|
src/mapgen/mapgen_carpathian.h
|
||||||
|
src/mapgen/mapgen_flat.cpp
|
||||||
|
src/mapgen/mapgen_flat.h
|
||||||
|
src/mapgen/mapgen_fractal.cpp
|
||||||
|
src/mapgen/mapgen_fractal.h
|
||||||
|
src/mapgen/mapgen_singlenode.cpp
|
||||||
|
src/mapgen/mapgen_singlenode.h
|
||||||
|
src/mapgen/mapgen_v5.cpp
|
||||||
|
src/mapgen/mapgen_v5.h
|
||||||
|
src/mapgen/mapgen_v6.cpp
|
||||||
|
src/mapgen/mapgen_v6.h
|
||||||
|
src/mapgen/mapgen_v7.cpp
|
||||||
|
src/mapgen/mapgen_v7.h
|
||||||
|
src/mapgen/mapgen_valleys.cpp
|
||||||
|
src/mapgen/mapgen_valleys.h
|
||||||
|
src/mapgen/mg_biome.cpp
|
||||||
|
src/mapgen/mg_biome.h
|
||||||
|
src/mapgen/mg_decoration.cpp
|
||||||
|
src/mapgen/mg_decoration.h
|
||||||
|
src/mapgen/mg_ore.cpp
|
||||||
|
src/mapgen/mg_ore.h
|
||||||
|
src/mapgen/mg_schematic.cpp
|
||||||
|
src/mapgen/mg_schematic.h
|
||||||
|
src/mapgen/treegen.cpp
|
||||||
|
src/mapgen/treegen.h
|
||||||
|
src/map.h
|
||||||
|
src/mapnode.cpp
|
||||||
|
src/mapnode.h
|
||||||
|
src/mapsector.cpp
|
||||||
|
src/mapsector.h
|
||||||
|
src/map_settings_manager.cpp
|
||||||
|
src/map_settings_manager.h
|
||||||
|
src/mesh.cpp
|
||||||
|
src/mesh_generator_thread.cpp
|
||||||
|
src/mesh.h
|
||||||
|
src/metadata.h
|
||||||
|
src/minimap.cpp
|
||||||
|
src/minimap.h
|
||||||
|
src/mods.cpp
|
||||||
|
src/mods.h
|
||||||
|
src/network/address.cpp
|
||||||
|
src/network/clientopcodes.cpp
|
||||||
|
src/network/clientopcodes.h
|
||||||
|
src/network/clientpackethandler.cpp
|
||||||
|
src/network/connection.cpp
|
||||||
|
src/network/connection.h
|
||||||
|
src/network/connectionthreads.cpp
|
||||||
|
src/network/networkpacket.cpp
|
||||||
|
src/network/networkprotocol.h
|
||||||
|
src/network/serveropcodes.cpp
|
||||||
|
src/network/serveropcodes.h
|
||||||
|
src/network/serverpackethandler.cpp
|
||||||
|
src/nodedef.cpp
|
||||||
|
src/nodedef.h
|
||||||
|
src/nodemetadata.cpp
|
||||||
|
src/nodemetadata.h
|
||||||
|
src/nodetimer.cpp
|
||||||
|
src/nodetimer.h
|
||||||
|
src/noise.cpp
|
||||||
|
src/noise.h
|
||||||
|
src/objdef.cpp
|
||||||
|
src/objdef.h
|
||||||
|
src/object_properties.cpp
|
||||||
|
src/object_properties.h
|
||||||
|
src/particles.cpp
|
||||||
|
src/particles.h
|
||||||
|
src/pathfinder.cpp
|
||||||
|
src/pathfinder.h
|
||||||
|
src/player.cpp
|
||||||
|
src/player.h
|
||||||
|
src/porting_android.cpp
|
||||||
|
src/porting_android.h
|
||||||
|
src/porting.cpp
|
||||||
|
src/porting.h
|
||||||
|
src/profiler.h
|
||||||
|
src/raycast.cpp
|
||||||
|
src/raycast.h
|
||||||
|
src/reflowscan.cpp
|
||||||
|
src/reflowscan.h
|
||||||
|
src/remoteplayer.cpp
|
||||||
|
src/rollback.cpp
|
||||||
|
src/rollback.h
|
||||||
|
src/rollback_interface.cpp
|
||||||
|
src/rollback_interface.h
|
||||||
|
src/script/common/c_content.cpp
|
||||||
|
src/script/common/c_content.h
|
||||||
|
src/script/common/c_converter.cpp
|
||||||
|
src/script/common/c_converter.h
|
||||||
|
src/script/common/c_internal.cpp
|
||||||
|
src/script/common/c_internal.h
|
||||||
|
src/script/common/c_types.cpp
|
||||||
|
src/script/common/c_types.h
|
||||||
|
src/script/cpp_api/s_async.cpp
|
||||||
|
src/script/cpp_api/s_async.h
|
||||||
|
src/script/cpp_api/s_base.cpp
|
||||||
|
src/script/cpp_api/s_base.h
|
||||||
|
src/script/cpp_api/s_client.cpp
|
||||||
|
src/script/cpp_api/s_entity.cpp
|
||||||
|
src/script/cpp_api/s_entity.h
|
||||||
|
src/script/cpp_api/s_env.cpp
|
||||||
|
src/script/cpp_api/s_env.h
|
||||||
|
src/script/cpp_api/s_internal.h
|
||||||
|
src/script/cpp_api/s_inventory.cpp
|
||||||
|
src/script/cpp_api/s_inventory.h
|
||||||
|
src/script/cpp_api/s_item.cpp
|
||||||
|
src/script/cpp_api/s_item.h
|
||||||
|
src/script/cpp_api/s_mainmenu.h
|
||||||
|
src/script/cpp_api/s_node.cpp
|
||||||
|
src/script/cpp_api/s_node.h
|
||||||
|
src/script/cpp_api/s_nodemeta.cpp
|
||||||
|
src/script/cpp_api/s_nodemeta.h
|
||||||
|
src/script/cpp_api/s_player.cpp
|
||||||
|
src/script/cpp_api/s_player.h
|
||||||
|
src/script/cpp_api/s_security.cpp
|
||||||
|
src/script/cpp_api/s_security.h
|
||||||
|
src/script/cpp_api/s_server.cpp
|
||||||
|
src/script/cpp_api/s_server.h
|
||||||
|
src/script/lua_api/l_areastore.cpp
|
||||||
|
src/script/lua_api/l_base.cpp
|
||||||
|
src/script/lua_api/l_base.h
|
||||||
|
src/script/lua_api/l_client.cpp
|
||||||
|
src/script/lua_api/l_craft.cpp
|
||||||
|
src/script/lua_api/l_craft.h
|
||||||
|
src/script/lua_api/l_env.cpp
|
||||||
|
src/script/lua_api/l_env.h
|
||||||
|
src/script/lua_api/l_http.cpp
|
||||||
|
src/script/lua_api/l_http.h
|
||||||
|
src/script/lua_api/l_internal.h
|
||||||
|
src/script/lua_api/l_inventory.cpp
|
||||||
|
src/script/lua_api/l_inventory.h
|
||||||
|
src/script/lua_api/l_item.cpp
|
||||||
|
src/script/lua_api/l_item.h
|
||||||
|
src/script/lua_api/l_itemstackmeta.cpp
|
||||||
|
src/script/lua_api/l_itemstackmeta.h
|
||||||
|
src/script/lua_api/l_localplayer.cpp
|
||||||
|
src/script/lua_api/l_mainmenu.cpp
|
||||||
|
src/script/lua_api/l_mainmenu.h
|
||||||
|
src/script/lua_api/l_mapgen.cpp
|
||||||
|
src/script/lua_api/l_mapgen.h
|
||||||
|
src/script/lua_api/l_metadata.cpp
|
||||||
|
src/script/lua_api/l_minimap.cpp
|
||||||
|
src/script/lua_api/l_nodemeta.cpp
|
||||||
|
src/script/lua_api/l_nodemeta.h
|
||||||
|
src/script/lua_api/l_nodetimer.cpp
|
||||||
|
src/script/lua_api/l_noise.cpp
|
||||||
|
src/script/lua_api/l_object.cpp
|
||||||
|
src/script/lua_api/l_object.h
|
||||||
|
src/script/lua_api/l_particles.cpp
|
||||||
|
src/script/lua_api/l_particles.h
|
||||||
|
src/script/lua_api/l_particles_local.cpp
|
||||||
|
src/script/lua_api/l_rollback.cpp
|
||||||
|
src/script/lua_api/l_rollback.h
|
||||||
|
src/script/lua_api/l_server.cpp
|
||||||
|
src/script/lua_api/l_settings.cpp
|
||||||
|
src/script/lua_api/l_sound.cpp
|
||||||
|
src/script/lua_api/l_storage.cpp
|
||||||
|
src/script/lua_api/l_util.cpp
|
||||||
|
src/script/lua_api/l_vmanip.cpp
|
||||||
|
src/script/scripting_client.cpp
|
||||||
|
src/script/scripting_client.h
|
||||||
|
src/script/scripting_mainmenu.cpp
|
||||||
|
src/script/scripting_mainmenu.h
|
||||||
|
src/script/scripting_server.cpp
|
||||||
|
src/script/scripting_server.h
|
||||||
|
src/serialization.cpp
|
||||||
|
src/serialization.h
|
||||||
|
src/server.cpp
|
||||||
|
src/serverenvironment.cpp
|
||||||
|
src/serverenvironment.h
|
||||||
|
src/server.h
|
||||||
|
src/serverlist.cpp
|
||||||
|
src/serverlist.h
|
||||||
|
src/server/luaentity_sao.cpp
|
||||||
|
src/server/player_sao.cpp
|
||||||
|
src/server/serveractiveobject.cpp
|
||||||
|
src/server/serveractiveobject.h
|
||||||
|
src/settings.cpp
|
||||||
|
src/settings.h
|
||||||
|
src/settings_translation_file.cpp
|
||||||
|
src/shader.cpp
|
||||||
|
src/shader.h
|
||||||
|
src/sky.cpp
|
||||||
|
src/sound.cpp
|
||||||
|
src/staticobject.cpp
|
||||||
|
src/staticobject.h
|
||||||
|
src/subgame.cpp
|
||||||
|
src/subgame.h
|
||||||
|
src/terminal_chat_console.cpp
|
||||||
|
src/terminal_chat_console.h
|
||||||
|
src/texture_override.cpp
|
||||||
|
src/threading/atomic.h
|
||||||
|
src/threading/event.cpp
|
||||||
|
src/threading/mutex_auto_lock.h
|
||||||
|
src/threading/mutex.cpp
|
||||||
|
src/threading/mutex.h
|
||||||
|
src/threading/semaphore.cpp
|
||||||
|
src/threading/thread.cpp
|
||||||
|
src/threading/thread.h
|
||||||
|
src/threads.h
|
||||||
|
src/tileanimation.cpp
|
||||||
|
src/tileanimation.h
|
||||||
|
src/tool.cpp
|
||||||
|
src/tool.h
|
||||||
|
src/translation.cpp
|
||||||
|
src/unittest/test_areastore.cpp
|
||||||
|
src/unittest/test_collision.cpp
|
||||||
|
src/unittest/test_compression.cpp
|
||||||
|
src/unittest/test_connection.cpp
|
||||||
|
src/unittest/test.cpp
|
||||||
|
src/unittest/test_filepath.cpp
|
||||||
|
src/unittest/test.h
|
||||||
|
src/unittest/test_inventory.cpp
|
||||||
|
src/unittest/test_keycode.cpp
|
||||||
|
src/unittest/test_map_settings_manager.cpp
|
||||||
|
src/unittest/test_noderesolver.cpp
|
||||||
|
src/unittest/test_noise.cpp
|
||||||
|
src/unittest/test_random.cpp
|
||||||
|
src/unittest/test_schematic.cpp
|
||||||
|
src/unittest/test_serialization.cpp
|
||||||
|
src/unittest/test_settings.cpp
|
||||||
|
src/unittest/test_socket.cpp
|
||||||
|
src/unittest/test_threading.cpp
|
||||||
|
src/unittest/test_utilities.cpp
|
||||||
|
src/unittest/test_voxelalgorithms.cpp
|
||||||
|
src/unittest/test_voxelmanipulator.cpp
|
||||||
|
src/util/areastore.cpp
|
||||||
|
src/util/areastore.h
|
||||||
|
src/util/auth.cpp
|
||||||
|
src/util/auth.h
|
||||||
|
src/util/base64.cpp
|
||||||
|
src/util/base64.h
|
||||||
|
src/util/basic_macros.h
|
||||||
|
src/util/container.h
|
||||||
|
src/util/directiontables.cpp
|
||||||
|
src/util/directiontables.h
|
||||||
|
src/util/enriched_string.cpp
|
||||||
|
src/util/enriched_string.h
|
||||||
|
src/util/md32_common.h
|
||||||
|
src/util/numeric.cpp
|
||||||
|
src/util/numeric.h
|
||||||
|
src/util/pointedthing.cpp
|
||||||
|
src/util/pointedthing.h
|
||||||
|
src/util/pointer.h
|
||||||
|
src/util/quicktune.h
|
||||||
|
src/util/quicktune_shortcutter.h
|
||||||
|
src/util/quicktune.cpp
|
||||||
|
src/util/serialize.cpp
|
||||||
|
src/util/serialize.h
|
||||||
|
src/util/sha1.cpp
|
||||||
|
src/util/srp.cpp
|
||||||
|
src/util/srp.h
|
||||||
|
src/util/strfnd.h
|
||||||
|
src/util/string.cpp
|
||||||
|
src/util/string.h
|
||||||
|
src/util/thread.h
|
||||||
|
src/util/timetaker.cpp
|
||||||
|
src/util/timetaker.h
|
||||||
|
src/version.cpp
|
||||||
|
src/version.h
|
||||||
|
src/voxelalgorithms.cpp
|
||||||
|
src/voxelalgorithms.h
|
||||||
|
src/voxel.cpp
|
||||||
|
src/voxel.h
|
||||||
|
src/wieldmesh.cpp
|
17
util/ci/clang-tidy.sh
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#! /bin/bash -eu
|
||||||
|
|
||||||
|
mkdir -p cmakebuild
|
||||||
|
cd cmakebuild
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Debug \
|
||||||
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
||||||
|
-DRUN_IN_PLACE=TRUE \
|
||||||
|
-DENABLE_{GETTEXT,SOUND}=FALSE \
|
||||||
|
-DBUILD_SERVER=TRUE ..
|
||||||
|
make GenerateVersion
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
./util/ci/run-clang-tidy.py \
|
||||||
|
-clang-tidy-binary=clang-tidy-9 -p cmakebuild \
|
||||||
|
-quiet -config="$(cat .clang-tidy)" \
|
||||||
|
'src/.*'
|
29
util/ci/common.sh
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
# Linux build only
|
||||||
|
install_linux_deps() {
|
||||||
|
local pkgs=(libirrlicht-dev cmake libbz2-dev libpng-dev \
|
||||||
|
libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev \
|
||||||
|
libhiredis-dev libogg-dev libgmp-dev libvorbis-dev libopenal-dev \
|
||||||
|
gettext libpq-dev postgresql-server-dev-all libleveldb-dev \
|
||||||
|
libcurl4-openssl-dev)
|
||||||
|
# for better coverage, build some jobs with luajit
|
||||||
|
if [ -n "$WITH_LUAJIT" ]; then
|
||||||
|
pkgs+=(libluajit-5.1-dev)
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y --no-install-recommends ${pkgs[@]}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Mac OSX build only
|
||||||
|
install_macosx_deps() {
|
||||||
|
brew update
|
||||||
|
brew install freetype gettext hiredis irrlicht leveldb libogg libvorbis luajit
|
||||||
|
if brew ls | grep -q jpeg; then
|
||||||
|
brew upgrade jpeg
|
||||||
|
else
|
||||||
|
brew install jpeg
|
||||||
|
fi
|
||||||
|
#brew upgrade postgresql
|
||||||
|
}
|
43
util/ci/lint.sh
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
function perform_lint() {
|
||||||
|
echo "Performing LINT..."
|
||||||
|
if [ -z "${CLANG_FORMAT}" ]; then
|
||||||
|
CLANG_FORMAT=clang-format
|
||||||
|
fi
|
||||||
|
echo "LINT: Using binary $CLANG_FORMAT"
|
||||||
|
CLANG_FORMAT_WHITELIST="util/ci/clang-format-whitelist.txt"
|
||||||
|
|
||||||
|
files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')"
|
||||||
|
|
||||||
|
local errorcount=0
|
||||||
|
local fail=0
|
||||||
|
for f in ${files_to_lint}; do
|
||||||
|
d=$(diff -u "$f" <(${CLANG_FORMAT} "$f") || true)
|
||||||
|
|
||||||
|
if ! [ -z "$d" ]; then
|
||||||
|
whitelisted=$(awk '$1 == "'$f'" { print 1 }' "$CLANG_FORMAT_WHITELIST")
|
||||||
|
|
||||||
|
# If file is not whitelisted, mark a failure
|
||||||
|
if [ -z "${whitelisted}" ]; then
|
||||||
|
errorcount=$((errorcount+1))
|
||||||
|
|
||||||
|
printf "The file %s is not compliant with the coding style" "$f"
|
||||||
|
if [ ${errorcount} -gt 50 ]; then
|
||||||
|
printf "\nToo many errors encountered previously, this diff is hidden.\n"
|
||||||
|
else
|
||||||
|
printf ":\n%s\n" "$d"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fail=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$fail" = 1 ]; then
|
||||||
|
echo "LINT reports failure."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "LINT OK"
|
||||||
|
}
|
||||||
|
|
45
util/ci/lint_autocorrect.sh
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
function perform_lint() {
|
||||||
|
echo "Performing LINT..."
|
||||||
|
if [ -z "${CLANG_FORMAT}" ]; then
|
||||||
|
CLANG_FORMAT=clang-format
|
||||||
|
fi
|
||||||
|
echo "LINT: Using binary $CLANG_FORMAT"
|
||||||
|
CLANG_FORMAT_WHITELIST="util/ci/clang-format-whitelist.txt"
|
||||||
|
|
||||||
|
files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')"
|
||||||
|
|
||||||
|
local errorcount=0
|
||||||
|
local fail=0
|
||||||
|
for f in ${files_to_lint}; do
|
||||||
|
d=$(diff -u "$f" <(${CLANG_FORMAT} "$f") || true)
|
||||||
|
|
||||||
|
if ! [ -z "$d" ]; then
|
||||||
|
whitelisted=$(awk '$1 == "'$f'" { print 1 }' "$CLANG_FORMAT_WHITELIST")
|
||||||
|
|
||||||
|
# If file is not whitelisted, mark a failure
|
||||||
|
if [ -z "${whitelisted}" ]; then
|
||||||
|
errorcount=$((errorcount+1))
|
||||||
|
|
||||||
|
printf "The file %s is not compliant with the coding style" "$f"
|
||||||
|
if [ ${errorcount} -gt 50 ]; then
|
||||||
|
printf "\nToo many errors encountered previously, this diff is hidden.\n"
|
||||||
|
else
|
||||||
|
printf ":\n%s\n" "$d"
|
||||||
|
fi
|
||||||
|
|
||||||
|
${CLANG_FORMAT} -i "$f"
|
||||||
|
|
||||||
|
fail=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$fail" = 1 ]; then
|
||||||
|
echo "LINT reports failure."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "LINT OK"
|
||||||
|
}
|
||||||
|
|
321
util/ci/run-clang-tidy.py
Normal file
@ -0,0 +1,321 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
#
|
||||||
|
#===- run-clang-tidy.py - Parallel clang-tidy runner ---------*- python -*--===#
|
||||||
|
#
|
||||||
|
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||||
|
# See https://llvm.org/LICENSE.txt for license information.
|
||||||
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||||
|
#
|
||||||
|
#===------------------------------------------------------------------------===#
|
||||||
|
# FIXME: Integrate with clang-tidy-diff.py
|
||||||
|
|
||||||
|
"""
|
||||||
|
Parallel clang-tidy runner
|
||||||
|
==========================
|
||||||
|
|
||||||
|
Runs clang-tidy over all files in a compilation database. Requires clang-tidy
|
||||||
|
and clang-apply-replacements in $PATH.
|
||||||
|
|
||||||
|
Example invocations.
|
||||||
|
- Run clang-tidy on all files in the current working directory with a default
|
||||||
|
set of checks and show warnings in the cpp files and all project headers.
|
||||||
|
run-clang-tidy.py $PWD
|
||||||
|
|
||||||
|
- Fix all header guards.
|
||||||
|
run-clang-tidy.py -fix -checks=-*,llvm-header-guard
|
||||||
|
|
||||||
|
- Fix all header guards included from clang-tidy and header guards
|
||||||
|
for clang-tidy headers.
|
||||||
|
run-clang-tidy.py -fix -checks=-*,llvm-header-guard extra/clang-tidy \
|
||||||
|
-header-filter=extra/clang-tidy
|
||||||
|
|
||||||
|
Compilation database setup:
|
||||||
|
http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import glob
|
||||||
|
import json
|
||||||
|
import multiprocessing
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import shutil
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
import tempfile
|
||||||
|
import threading
|
||||||
|
import traceback
|
||||||
|
|
||||||
|
try:
|
||||||
|
import yaml
|
||||||
|
except ImportError:
|
||||||
|
yaml = None
|
||||||
|
|
||||||
|
is_py2 = sys.version[0] == '2'
|
||||||
|
|
||||||
|
if is_py2:
|
||||||
|
import Queue as queue
|
||||||
|
else:
|
||||||
|
import queue as queue
|
||||||
|
|
||||||
|
def find_compilation_database(path):
|
||||||
|
"""Adjusts the directory until a compilation database is found."""
|
||||||
|
result = './'
|
||||||
|
while not os.path.isfile(os.path.join(result, path)):
|
||||||
|
if os.path.realpath(result) == '/':
|
||||||
|
print('Error: could not find compilation database.')
|
||||||
|
sys.exit(1)
|
||||||
|
result += '../'
|
||||||
|
return os.path.realpath(result)
|
||||||
|
|
||||||
|
|
||||||
|
def make_absolute(f, directory):
|
||||||
|
if os.path.isabs(f):
|
||||||
|
return f
|
||||||
|
return os.path.normpath(os.path.join(directory, f))
|
||||||
|
|
||||||
|
|
||||||
|
def get_tidy_invocation(f, clang_tidy_binary, checks, tmpdir, build_path,
|
||||||
|
header_filter, extra_arg, extra_arg_before, quiet,
|
||||||
|
config):
|
||||||
|
"""Gets a command line for clang-tidy."""
|
||||||
|
start = [clang_tidy_binary]
|
||||||
|
if header_filter is not None:
|
||||||
|
start.append('-header-filter=' + header_filter)
|
||||||
|
if checks:
|
||||||
|
start.append('-checks=' + checks)
|
||||||
|
if tmpdir is not None:
|
||||||
|
start.append('-export-fixes')
|
||||||
|
# Get a temporary file. We immediately close the handle so clang-tidy can
|
||||||
|
# overwrite it.
|
||||||
|
(handle, name) = tempfile.mkstemp(suffix='.yaml', dir=tmpdir)
|
||||||
|
os.close(handle)
|
||||||
|
start.append(name)
|
||||||
|
for arg in extra_arg:
|
||||||
|
start.append('-extra-arg=%s' % arg)
|
||||||
|
for arg in extra_arg_before:
|
||||||
|
start.append('-extra-arg-before=%s' % arg)
|
||||||
|
start.append('-p=' + build_path)
|
||||||
|
if quiet:
|
||||||
|
start.append('-quiet')
|
||||||
|
if config:
|
||||||
|
start.append('-config=' + config)
|
||||||
|
start.append(f)
|
||||||
|
return start
|
||||||
|
|
||||||
|
|
||||||
|
def merge_replacement_files(tmpdir, mergefile):
|
||||||
|
"""Merge all replacement files in a directory into a single file"""
|
||||||
|
# The fixes suggested by clang-tidy >= 4.0.0 are given under
|
||||||
|
# the top level key 'Diagnostics' in the output yaml files
|
||||||
|
mergekey="Diagnostics"
|
||||||
|
merged=[]
|
||||||
|
for replacefile in glob.iglob(os.path.join(tmpdir, '*.yaml')):
|
||||||
|
content = yaml.safe_load(open(replacefile, 'r'))
|
||||||
|
if not content:
|
||||||
|
continue # Skip empty files.
|
||||||
|
merged.extend(content.get(mergekey, []))
|
||||||
|
|
||||||
|
if merged:
|
||||||
|
# MainSourceFile: The key is required by the definition inside
|
||||||
|
# include/clang/Tooling/ReplacementsYaml.h, but the value
|
||||||
|
# is actually never used inside clang-apply-replacements,
|
||||||
|
# so we set it to '' here.
|
||||||
|
output = { 'MainSourceFile': '', mergekey: merged }
|
||||||
|
with open(mergefile, 'w') as out:
|
||||||
|
yaml.safe_dump(output, out)
|
||||||
|
else:
|
||||||
|
# Empty the file:
|
||||||
|
open(mergefile, 'w').close()
|
||||||
|
|
||||||
|
|
||||||
|
def check_clang_apply_replacements_binary(args):
|
||||||
|
"""Checks if invoking supplied clang-apply-replacements binary works."""
|
||||||
|
try:
|
||||||
|
subprocess.check_call([args.clang_apply_replacements_binary, '--version'])
|
||||||
|
except:
|
||||||
|
print('Unable to run clang-apply-replacements. Is clang-apply-replacements '
|
||||||
|
'binary correctly specified?', file=sys.stderr)
|
||||||
|
traceback.print_exc()
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
def apply_fixes(args, tmpdir):
|
||||||
|
"""Calls clang-apply-fixes on a given directory."""
|
||||||
|
invocation = [args.clang_apply_replacements_binary]
|
||||||
|
if args.format:
|
||||||
|
invocation.append('-format')
|
||||||
|
if args.style:
|
||||||
|
invocation.append('-style=' + args.style)
|
||||||
|
invocation.append(tmpdir)
|
||||||
|
subprocess.call(invocation)
|
||||||
|
|
||||||
|
|
||||||
|
def run_tidy(args, tmpdir, build_path, queue, lock, failed_files):
|
||||||
|
"""Takes filenames out of queue and runs clang-tidy on them."""
|
||||||
|
while True:
|
||||||
|
name = queue.get()
|
||||||
|
invocation = get_tidy_invocation(name, args.clang_tidy_binary, args.checks,
|
||||||
|
tmpdir, build_path, args.header_filter,
|
||||||
|
args.extra_arg, args.extra_arg_before,
|
||||||
|
args.quiet, args.config)
|
||||||
|
|
||||||
|
proc = subprocess.Popen(invocation)
|
||||||
|
proc.wait()
|
||||||
|
if proc.returncode != 0:
|
||||||
|
failed_files.append(name)
|
||||||
|
queue.task_done()
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = argparse.ArgumentParser(description='Runs clang-tidy over all files '
|
||||||
|
'in a compilation database. Requires '
|
||||||
|
'clang-tidy and clang-apply-replacements in '
|
||||||
|
'$PATH.')
|
||||||
|
parser.add_argument('-clang-tidy-binary', metavar='PATH',
|
||||||
|
default='clang-tidy',
|
||||||
|
help='path to clang-tidy binary')
|
||||||
|
parser.add_argument('-clang-apply-replacements-binary', metavar='PATH',
|
||||||
|
default='clang-apply-replacements',
|
||||||
|
help='path to clang-apply-replacements binary')
|
||||||
|
parser.add_argument('-checks', default=None,
|
||||||
|
help='checks filter, when not specified, use clang-tidy '
|
||||||
|
'default')
|
||||||
|
parser.add_argument('-config', default=None,
|
||||||
|
help='Specifies a configuration in YAML/JSON format: '
|
||||||
|
' -config="{Checks: \'*\', '
|
||||||
|
' CheckOptions: [{key: x, '
|
||||||
|
' value: y}]}" '
|
||||||
|
'When the value is empty, clang-tidy will '
|
||||||
|
'attempt to find a file named .clang-tidy for '
|
||||||
|
'each source file in its parent directories.')
|
||||||
|
parser.add_argument('-header-filter', default=None,
|
||||||
|
help='regular expression matching the names of the '
|
||||||
|
'headers to output diagnostics from. Diagnostics from '
|
||||||
|
'the main file of each translation unit are always '
|
||||||
|
'displayed.')
|
||||||
|
if yaml:
|
||||||
|
parser.add_argument('-export-fixes', metavar='filename', dest='export_fixes',
|
||||||
|
help='Create a yaml file to store suggested fixes in, '
|
||||||
|
'which can be applied with clang-apply-replacements.')
|
||||||
|
parser.add_argument('-j', type=int, default=0,
|
||||||
|
help='number of tidy instances to be run in parallel.')
|
||||||
|
parser.add_argument('files', nargs='*', default=['.*'],
|
||||||
|
help='files to be processed (regex on path)')
|
||||||
|
parser.add_argument('-fix', action='store_true', help='apply fix-its')
|
||||||
|
parser.add_argument('-format', action='store_true', help='Reformat code '
|
||||||
|
'after applying fixes')
|
||||||
|
parser.add_argument('-style', default='file', help='The style of reformat '
|
||||||
|
'code after applying fixes')
|
||||||
|
parser.add_argument('-p', dest='build_path',
|
||||||
|
help='Path used to read a compile command database.')
|
||||||
|
parser.add_argument('-extra-arg', dest='extra_arg',
|
||||||
|
action='append', default=[],
|
||||||
|
help='Additional argument to append to the compiler '
|
||||||
|
'command line.')
|
||||||
|
parser.add_argument('-extra-arg-before', dest='extra_arg_before',
|
||||||
|
action='append', default=[],
|
||||||
|
help='Additional argument to prepend to the compiler '
|
||||||
|
'command line.')
|
||||||
|
parser.add_argument('-quiet', action='store_true',
|
||||||
|
help='Run clang-tidy in quiet mode')
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
db_path = 'compile_commands.json'
|
||||||
|
|
||||||
|
if args.build_path is not None:
|
||||||
|
build_path = args.build_path
|
||||||
|
else:
|
||||||
|
# Find our database
|
||||||
|
build_path = find_compilation_database(db_path)
|
||||||
|
|
||||||
|
try:
|
||||||
|
invocation = [args.clang_tidy_binary, '-list-checks']
|
||||||
|
invocation.append('-p=' + build_path)
|
||||||
|
if args.checks:
|
||||||
|
invocation.append('-checks=' + args.checks)
|
||||||
|
invocation.append('-')
|
||||||
|
if args.quiet:
|
||||||
|
# Even with -quiet we still want to check if we can call clang-tidy.
|
||||||
|
with open(os.devnull, 'w') as dev_null:
|
||||||
|
subprocess.check_call(invocation, stdout=dev_null)
|
||||||
|
else:
|
||||||
|
subprocess.check_call(invocation)
|
||||||
|
except:
|
||||||
|
print("Unable to run clang-tidy.", file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
# Load the database and extract all files.
|
||||||
|
database = json.load(open(os.path.join(build_path, db_path)))
|
||||||
|
files = [make_absolute(entry['file'], entry['directory'])
|
||||||
|
for entry in database]
|
||||||
|
|
||||||
|
max_task = args.j
|
||||||
|
if max_task == 0:
|
||||||
|
max_task = multiprocessing.cpu_count()
|
||||||
|
|
||||||
|
tmpdir = None
|
||||||
|
if args.fix or (yaml and args.export_fixes):
|
||||||
|
check_clang_apply_replacements_binary(args)
|
||||||
|
tmpdir = tempfile.mkdtemp()
|
||||||
|
|
||||||
|
# Build up a big regexy filter from all command line arguments.
|
||||||
|
file_name_re = re.compile('|'.join(args.files))
|
||||||
|
|
||||||
|
return_code = 0
|
||||||
|
try:
|
||||||
|
# Spin up a bunch of tidy-launching threads.
|
||||||
|
task_queue = queue.Queue(max_task)
|
||||||
|
# List of files with a non-zero return code.
|
||||||
|
failed_files = []
|
||||||
|
lock = threading.Lock()
|
||||||
|
for _ in range(max_task):
|
||||||
|
t = threading.Thread(target=run_tidy,
|
||||||
|
args=(args, tmpdir, build_path, task_queue, lock, failed_files))
|
||||||
|
t.daemon = True
|
||||||
|
t.start()
|
||||||
|
|
||||||
|
# Fill the queue with files.
|
||||||
|
for name in files:
|
||||||
|
if file_name_re.search(name):
|
||||||
|
task_queue.put(name)
|
||||||
|
|
||||||
|
# Wait for all threads to be done.
|
||||||
|
task_queue.join()
|
||||||
|
if len(failed_files):
|
||||||
|
return_code = 1
|
||||||
|
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
# This is a sad hack. Unfortunately subprocess goes
|
||||||
|
# bonkers with ctrl-c and we start forking merrily.
|
||||||
|
print('\nCtrl-C detected, goodbye.')
|
||||||
|
if tmpdir:
|
||||||
|
shutil.rmtree(tmpdir)
|
||||||
|
os.kill(0, 9)
|
||||||
|
|
||||||
|
if yaml and args.export_fixes:
|
||||||
|
print('Writing fixes to ' + args.export_fixes + ' ...')
|
||||||
|
try:
|
||||||
|
merge_replacement_files(tmpdir, args.export_fixes)
|
||||||
|
except:
|
||||||
|
print('Error exporting fixes.\n', file=sys.stderr)
|
||||||
|
traceback.print_exc()
|
||||||
|
return_code=1
|
||||||
|
|
||||||
|
if args.fix:
|
||||||
|
print('Applying fixes ...')
|
||||||
|
try:
|
||||||
|
apply_fixes(args, tmpdir)
|
||||||
|
except:
|
||||||
|
print('Error applying fixes.\n', file=sys.stderr)
|
||||||
|
traceback.print_exc()
|
||||||
|
return_code=1
|
||||||
|
|
||||||
|
if tmpdir:
|
||||||
|
shutil.rmtree(tmpdir)
|
||||||
|
sys.exit(return_code)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
255
util/generate-texture-normals.sh
Normal file
@ -0,0 +1,255 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This script generates normalmaps using The GIMP to do the heavy lifting.
|
||||||
|
# give any unrecognized switch (say, -h) for usage info.
|
||||||
|
|
||||||
|
rm /tmp/normals_filelist.txt
|
||||||
|
|
||||||
|
numprocs=6
|
||||||
|
|
||||||
|
skiptools=false
|
||||||
|
skipinventory=false
|
||||||
|
invresolution=64
|
||||||
|
dryrun=false
|
||||||
|
pattern="*.png *.jpg"
|
||||||
|
|
||||||
|
filter=0
|
||||||
|
scale=8
|
||||||
|
wrap=0
|
||||||
|
heightsource=0
|
||||||
|
conversion=0
|
||||||
|
invertx=0
|
||||||
|
inverty=0
|
||||||
|
|
||||||
|
while test -n "$1"; do
|
||||||
|
case "$1" in
|
||||||
|
--scale|-s)
|
||||||
|
if [ -z "$2" ] ; then echo "Missing scale parameter"; exit 1; fi
|
||||||
|
scale=$2
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--pattern|-p)
|
||||||
|
if [ -z "$2" ] ; then echo "Missing pattern parameter"; exit 1; fi
|
||||||
|
pattern=$2
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--skiptools|-t)
|
||||||
|
skiptools=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--skipinventory|-i)
|
||||||
|
if [[ $2 =~ ^[0-9]+$ ]]; then
|
||||||
|
invresolution=$2
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
skipinventory=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--filter|-f)
|
||||||
|
if [ -z "$2" ] ; then echo "Missing filter parameter"; exit 1; fi
|
||||||
|
|
||||||
|
case "$2" in
|
||||||
|
sobel3|1)
|
||||||
|
filter=1
|
||||||
|
;;
|
||||||
|
sobel5|2)
|
||||||
|
filter=2
|
||||||
|
;;
|
||||||
|
prewitt3|3)
|
||||||
|
filter=3
|
||||||
|
;;
|
||||||
|
prewitt5|4)
|
||||||
|
filter=4
|
||||||
|
;;
|
||||||
|
3x3|5)
|
||||||
|
filter=5
|
||||||
|
;;
|
||||||
|
5x5|6)
|
||||||
|
filter=6
|
||||||
|
;;
|
||||||
|
7x7|7)
|
||||||
|
filter=7
|
||||||
|
;;
|
||||||
|
9x9|8)
|
||||||
|
filter=8
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
filter=0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--heightalpha|-a)
|
||||||
|
heightsource=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--conversion|-c)
|
||||||
|
if [ -z "$2" ] ; then echo "Missing conversion parameter"; exit 1; fi
|
||||||
|
|
||||||
|
case "$2" in
|
||||||
|
biased|1)
|
||||||
|
conversion=1
|
||||||
|
;;
|
||||||
|
red|2)
|
||||||
|
conversion=2
|
||||||
|
;;
|
||||||
|
green|3)
|
||||||
|
conversion=3
|
||||||
|
;;
|
||||||
|
blue|4)
|
||||||
|
conversion=4
|
||||||
|
;;
|
||||||
|
maxrgb|5)
|
||||||
|
conversion=5
|
||||||
|
;;
|
||||||
|
minrgb|6)
|
||||||
|
conversion=6
|
||||||
|
;;
|
||||||
|
colorspace|7)
|
||||||
|
conversion=7
|
||||||
|
;;
|
||||||
|
normalize-only|8)
|
||||||
|
conversion=8
|
||||||
|
;;
|
||||||
|
heightmap|9)
|
||||||
|
conversion=9
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
conversion=0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--wrap|-w)
|
||||||
|
wrap=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--invertx|-x)
|
||||||
|
invertx=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--inverty|-y)
|
||||||
|
inverty=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--dryrun|-d)
|
||||||
|
dryrun=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo -e "\nUsage:\n"
|
||||||
|
echo "`basename $0` [--scale|-s <value>] [--filter|-f <string>]"
|
||||||
|
echo " [--wrap|-w] [--heightalpha|-a] [--invertx|-x] [--inverty|-y]"
|
||||||
|
echo " [--conversion|-c <string>] [--skiptools|-t] [--skipinventory|-i [<value>]]"
|
||||||
|
echo " [--dryrun|-d] [--pattern|-p <pattern>]"
|
||||||
|
echo -e "\nDefaults to a scale of 8, checking all files in the current directory, and not"
|
||||||
|
echo "skipping apparent tools or inventory images. Filter, if specified, may be one"
|
||||||
|
echo "of: sobel3, sobel5, prewitt3, prewitt5, 3x3, 5x5, 7x7, or 9x9, or a value 1"
|
||||||
|
echo "through 8 (1=sobel3, 2=sobel5, etc.). Defaults to 0 (four-sample). The height"
|
||||||
|
echo "source is taken from the image's alpha channel if heightalpha is specified.\n"
|
||||||
|
echo ""
|
||||||
|
echo "If inventory skip is specified, an optional resolution may also be included"
|
||||||
|
echo "(default is 64). Conversion can be one of: biased, red, green, blue, maxrgb,"
|
||||||
|
echo "minrgb, colorspace, normalize-only, heightmap or a value from 1 to 9"
|
||||||
|
echo "corresponding respectively to those keywords. Defaults to 0 (simple"
|
||||||
|
echo "normalize) if not specified. Wrap, if specified, enables wrapping of the"
|
||||||
|
echo "normalmap around the edges of the texture (defaults to no). Invert X/Y"
|
||||||
|
echo "reverses the calculated gradients for the X and/or Y dimensions represented"
|
||||||
|
echo "by the normalmap (both default to non-inverted)."
|
||||||
|
echo ""
|
||||||
|
echo "The pattern, can be an escaped pattern string such as \*apple\* or"
|
||||||
|
echo "default_\*.png or similar (defaults to all PNG and JPG images in the current"
|
||||||
|
echo "directory that do not contain \"_normal\" or \"_specular\" in their filenames)."
|
||||||
|
echo ""
|
||||||
|
echo "If set for dry-run, the actions this script will take will be printed, but no"
|
||||||
|
echo "images will be generated. Passing an invalid value to a switch will generally"
|
||||||
|
echo "cause that switch to revert to its default value."
|
||||||
|
echo ""
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
echo -e "\nProcessing files based on pattern \"$pattern\" ..."
|
||||||
|
|
||||||
|
normalMap()
|
||||||
|
{
|
||||||
|
out=`echo "$1" | sed 's/.png/_normal.png/' | sed 's/.jpg/_normal.png/'`
|
||||||
|
|
||||||
|
echo "Launched process to generate normalmap: \"$1\" --> \"$out\"" >&2
|
||||||
|
|
||||||
|
gimp -i -b "
|
||||||
|
(define
|
||||||
|
(normalMap-fbx-conversion fileName newFileName filter nscale wrap heightsource conversion invertx inverty)
|
||||||
|
(let*
|
||||||
|
(
|
||||||
|
(image (car (gimp-file-load RUN-NONINTERACTIVE fileName fileName)))
|
||||||
|
(drawable (car (gimp-image-get-active-layer image)))
|
||||||
|
(drawable (car (gimp-image-flatten image)))
|
||||||
|
)
|
||||||
|
(if (> (car (gimp-drawable-type drawable)) 1)
|
||||||
|
(gimp-convert-rgb image) ()
|
||||||
|
)
|
||||||
|
|
||||||
|
(plug-in-normalmap
|
||||||
|
RUN-NONINTERACTIVE
|
||||||
|
image
|
||||||
|
drawable
|
||||||
|
filter
|
||||||
|
0.0
|
||||||
|
nscale
|
||||||
|
wrap
|
||||||
|
heightsource
|
||||||
|
0
|
||||||
|
conversion
|
||||||
|
0
|
||||||
|
invertx
|
||||||
|
inverty
|
||||||
|
0
|
||||||
|
0.0
|
||||||
|
drawable)
|
||||||
|
(gimp-file-save RUN-NONINTERACTIVE image drawable newFileName newFileName)
|
||||||
|
(gimp-image-delete image)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(normalMap-fbx-conversion \"$1\" \"$out\" $2 $3 $4 $5 $6 $7 $8)" -b '(gimp-quit 0)'
|
||||||
|
}
|
||||||
|
|
||||||
|
export -f normalMap
|
||||||
|
|
||||||
|
for file in `ls $pattern |grep -v "_normal.png"|grep -v "_specular"` ; do
|
||||||
|
|
||||||
|
invtest=`file "$file" |grep "$invresolution x $invresolution"`
|
||||||
|
if $skipinventory && [ -n "$invtest" ] ; then
|
||||||
|
echo "Skipped presumed "$invresolution"px inventory image: $file" >&2
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
tooltest=`echo "$file" \
|
||||||
|
| grep -v "_tool" \
|
||||||
|
| grep -v "_shovel" \
|
||||||
|
| grep -v "_pick" \
|
||||||
|
| grep -v "_axe" \
|
||||||
|
| grep -v "_sword" \
|
||||||
|
| grep -v "_hoe" \
|
||||||
|
| grep -v "bucket_"`
|
||||||
|
|
||||||
|
if $skiptools && [ -z "$tooltest" ] ; then
|
||||||
|
echo "Skipped presumed tool image: $file" >&2
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
if $dryrun ; then
|
||||||
|
echo "Would have generated a normalmap for $file" >&2
|
||||||
|
continue
|
||||||
|
else
|
||||||
|
echo \"$file\" $filter $scale $wrap $heightsource $conversion $invertx $inverty
|
||||||
|
fi
|
||||||
|
done | xargs -P $numprocs -n 8 -I{} bash -c normalMap\ \{\}\ \{\}\ \{\}\ \{\}\ \{\}\ \{\}\ \{\}\ \{\}
|
||||||
|
|
33
util/reorder_translation_commits.py
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
import sys
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
ret = subprocess.run(["git", "config", "rebase.instructionFormat"], capture_output=True)
|
||||||
|
if ret.returncode != 0 or ret.stdout.decode('ascii').strip() != "(%an <%ae>) %s":
|
||||||
|
print("Git is using the wrong rebase instruction format, reconfigure it.")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
try:
|
||||||
|
f = open(".git/rebase-merge/git-rebase-todo", "r")
|
||||||
|
except:
|
||||||
|
print("Initiate the rebase first!")
|
||||||
|
exit(1)
|
||||||
|
lines = list(s.strip("\r\n") for s in f.readlines())
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
for i in range(len(lines)):
|
||||||
|
line = lines[i]
|
||||||
|
if line.startswith("#") or " Translated using Weblate " not in line: continue
|
||||||
|
pos = line.rfind("(")
|
||||||
|
lang = line[pos:]
|
||||||
|
author = line[line.find("("):line.rfind(")", 0, pos)+1]
|
||||||
|
# try to grab the next commit by the same author for the same language
|
||||||
|
for j in range(i+1, len(lines)):
|
||||||
|
if lines[j].startswith("#") or not lines[j].endswith(lang): continue
|
||||||
|
if author in lines[j]:
|
||||||
|
lines.insert(i+1, "f " + lines.pop(j)[5:])
|
||||||
|
break
|
||||||
|
|
||||||
|
with open(".git/rebase-merge/git-rebase-todo", "w") as f:
|
||||||
|
f.write("\n".join(lines) + "\n")
|
||||||
|
print("You can now continue with the rebase.")
|
43
util/test_multiplayer.sh
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
gameid=devtest
|
||||||
|
minetest=$dir/../bin/minetest
|
||||||
|
testspath=$dir/../tests
|
||||||
|
worldpath=$testspath/testworld_$gameid
|
||||||
|
configpath=$testspath/configs
|
||||||
|
logpath=$testspath/log
|
||||||
|
conf_server=$configpath/minetest.conf.multi.server
|
||||||
|
conf_client1=$configpath/minetest.conf.multi.client1
|
||||||
|
conf_client2=$configpath/minetest.conf.multi.client2
|
||||||
|
log_server=$logpath/server.log
|
||||||
|
log_client1=$logpath/client1.log
|
||||||
|
log_client2=$logpath/client2.log
|
||||||
|
|
||||||
|
mkdir -p $worldpath
|
||||||
|
mkdir -p $configpath
|
||||||
|
mkdir -p $logpath
|
||||||
|
|
||||||
|
echo -ne 'client1::shout,interact,settime,teleport,give
|
||||||
|
client2::shout,interact,settime,teleport,give
|
||||||
|
' > $worldpath/auth.txt
|
||||||
|
|
||||||
|
echo -ne '' > $conf_server
|
||||||
|
|
||||||
|
echo -ne '# client 1 config
|
||||||
|
screenW=500
|
||||||
|
screenH=380
|
||||||
|
name=client1
|
||||||
|
viewing_range_nodes_min=10
|
||||||
|
' > $conf_client1
|
||||||
|
|
||||||
|
echo -ne '# client 2 config
|
||||||
|
screenW=500
|
||||||
|
screenH=380
|
||||||
|
name=client2
|
||||||
|
viewing_range_nodes_min=10
|
||||||
|
' > $conf_client2
|
||||||
|
|
||||||
|
echo $(sleep 1; $minetest --disable-unittests --logfile $log_client1 --config $conf_client1 --go --address localhost) &
|
||||||
|
echo $(sleep 2; $minetest --disable-unittests --logfile $log_client2 --config $conf_client2 --go --address localhost) &
|
||||||
|
$minetest --disable-unittests --server --logfile $log_server --config $conf_server --world $worldpath --gameid $gameid
|
||||||
|
|
79
util/updatepo.sh
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Update/create minetest po files
|
||||||
|
|
||||||
|
# an auxiliary function to abort processing with an optional error
|
||||||
|
# message
|
||||||
|
abort() {
|
||||||
|
test -n "$1" && echo >&2 "$1"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# The po/ directory is assumed to be parallel to the directory where
|
||||||
|
# this script is. Relative paths are fine for us so we can just
|
||||||
|
# use the following trick (works both for manual invocations and for
|
||||||
|
# script found from PATH)
|
||||||
|
scriptisin="$(dirname "$(which "$0")")"
|
||||||
|
|
||||||
|
# The script is executed from the parent of po/, which is also the
|
||||||
|
# parent of the script directory and of the src/ directory.
|
||||||
|
# We go through $scriptisin so that it can be executed from whatever
|
||||||
|
# directory and still work correctly
|
||||||
|
cd "$scriptisin/.."
|
||||||
|
|
||||||
|
test -e po || abort "po/ directory not found"
|
||||||
|
test -d po || abort "po/ is not a directory!"
|
||||||
|
|
||||||
|
# Get a list of the languages we have to update/create
|
||||||
|
|
||||||
|
cd po || abort "couldn't change directory to po!"
|
||||||
|
|
||||||
|
# This assumes that we won't have dirnames with space, which is
|
||||||
|
# the case for language codes, which are the only subdirs we expect to
|
||||||
|
# find in po/ anyway. If you put anything else there, you need to suffer
|
||||||
|
# the consequences of your actions, so we don't do sanity checks
|
||||||
|
langs=""
|
||||||
|
|
||||||
|
for lang in * ; do
|
||||||
|
if test ! -d $lang; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
langs="$langs $lang"
|
||||||
|
done
|
||||||
|
|
||||||
|
# go back
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# First thing first, update the .pot template. We place it in the po/
|
||||||
|
# directory at the top level. You a recent enough xgettext that supports
|
||||||
|
# --package-name
|
||||||
|
potfile=po/minetest.pot
|
||||||
|
xgettext --package-name=minetest \
|
||||||
|
--add-comments='~' \
|
||||||
|
--sort-by-file \
|
||||||
|
--add-location=file \
|
||||||
|
--keyword=N_ \
|
||||||
|
--keyword=wgettext \
|
||||||
|
--keyword=fgettext \
|
||||||
|
--keyword=fgettext_ne \
|
||||||
|
--keyword=strgettext \
|
||||||
|
--keyword=wstrgettext \
|
||||||
|
--keyword=showTranslatedStatusText \
|
||||||
|
--output $potfile \
|
||||||
|
--from-code=utf-8 \
|
||||||
|
`find src/ -name '*.cpp' -o -name '*.h'` \
|
||||||
|
`find builtin/ -name '*.lua'`
|
||||||
|
|
||||||
|
# Now iterate on all languages and create the po file if missing, or update it
|
||||||
|
# if it exists already
|
||||||
|
for lang in $langs ; do # note the missing quotes around $langs
|
||||||
|
pofile=po/$lang/minetest.po
|
||||||
|
if test -e $pofile; then
|
||||||
|
echo "[$lang]: updating strings"
|
||||||
|
msgmerge --update --sort-by-file $pofile $potfile
|
||||||
|
else
|
||||||
|
# This will ask for the translator identity
|
||||||
|
echo "[$lang]: NEW strings"
|
||||||
|
msginit --locale=$lang --output-file=$pofile --input=$potfile
|
||||||
|
fi
|
||||||
|
done
|