diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2022-05-17 22:12:00 +0200 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2022-05-17 22:12:00 +0200 |
commit | 21df26984da91143c15587f5a03c98d68c3adc4e (patch) | |
tree | aaa707a628ad331f67890023dffe1b4f60dd01d3 /util | |
parent | b09fc5de5cdb021f43ad32b7e3f50dc75c0bc622 (diff) | |
parent | eabf05758e3ba5f6f4bb1b8d1d1f02179b84e410 (diff) | |
download | dragonfireclient-21df26984da91143c15587f5a03c98d68c3adc4e.tar.xz |
Merge branch 'master' of https://github.com/minetest/minetest
Diffstat (limited to 'util')
-rwxr-xr-x | util/buildbot/buildwin32.sh | 76 | ||||
-rwxr-xr-x | util/buildbot/buildwin64.sh | 63 | ||||
-rwxr-xr-x | util/ci/build.sh | 14 | ||||
-rwxr-xr-x | util/ci/build_prometheus_cpp.sh | 2 | ||||
-rwxr-xr-x | util/ci/clang-tidy.sh | 12 | ||||
-rw-r--r-- | util/ci/common.sh | 9 | ||||
-rwxr-xr-x | util/generate-texture-normals.sh | 255 | ||||
-rwxr-xr-x | util/test_multiplayer.sh | 26 | ||||
-rwxr-xr-x | util/updatepo.sh | 3 | ||||
-rw-r--r-- | util/wireshark/minetest.lua | 4 |
10 files changed, 127 insertions, 337 deletions
diff --git a/util/buildbot/buildwin32.sh b/util/buildbot/buildwin32.sh index bfa1e4a09..4484b24a7 100755 --- a/util/buildbot/buildwin32.sh +++ b/util/buildbot/buildwin32.sh @@ -19,28 +19,44 @@ builddir="$( cd "$builddir" && pwd )" libdir=$builddir/libs # Test which win32 compiler is present -which i686-w64-mingw32-gcc &>/dev/null && - toolchain_file=$dir/toolchain_i686-w64-mingw32.cmake -which i686-w64-mingw32-gcc-posix &>/dev/null && - toolchain_file=$dir/toolchain_i686-w64-mingw32-posix.cmake +command -v i686-w64-mingw32-gcc >/dev/null && + compiler=i686-w64-mingw32-gcc +command -v i686-w64-mingw32-gcc-posix >/dev/null && + compiler=i686-w64-mingw32-gcc-posix -if [ -z "$toolchain_file" ]; then - echo "Unable to determine which mingw32 compiler to use" +if [ -z "$compiler" ]; then + echo "Unable to determine which MinGW compiler to use" exit 1 fi +toolchain_file=$dir/toolchain_${compiler/-gcc/}.cmake echo "Using $toolchain_file" -irrlicht_version=1.9.0mt3 -ogg_version=1.3.4 +# Try to find runtime DLLs in various paths (varies by distribution, sigh) +tmp=$(dirname "$(command -v $compiler)")/.. +runtime_dlls= +for name in lib{gcc_,stdc++-,winpthread-}'*'.dll; do + for dir in $tmp/i686-w64-mingw32/{bin,lib} $tmp/lib/gcc/i686-w64-mingw32/*; do + [ -d "$dir" ] || continue + file=$(echo $dir/$name) + [ -f "$file" ] && { runtime_dlls+="$file;"; break; } + done +done +[ -z "$runtime_dlls" ] && + echo "The compiler runtime DLLs could not be found, they might be missing in the final package." + +# Get stuff +irrlicht_version=1.9.0mt5 +ogg_version=1.3.5 +openal_version=1.21.1 vorbis_version=1.3.7 -curl_version=7.76.1 +curl_version=7.81.0 gettext_version=0.20.1 -freetype_version=2.10.4 -sqlite3_version=3.35.5 +freetype_version=2.11.1 +sqlite3_version=3.37.2 luajit_version=2.1.0-beta3 leveldb_version=1.23 zlib_version=1.2.11 -zstd_version=1.4.9 +zstd_version=1.5.2 mkdir -p $libdir @@ -63,29 +79,33 @@ download () { fi } -# Get stuff +# 'dw2' just points to rebuilt versions after a toolchain change +# this distinction should be gotten rid of next time + cd $libdir download "https://github.com/minetest/irrlicht/releases/download/$irrlicht_version/win32.zip" irrlicht-$irrlicht_version.zip -download "http://minetest.kitsunemimi.pw/zlib-$zlib_version-win32.zip" +download "http://minetest.kitsunemimi.pw/dw2/zlib-$zlib_version-win32.zip" download "http://minetest.kitsunemimi.pw/zstd-$zstd_version-win32.zip" download "http://minetest.kitsunemimi.pw/libogg-$ogg_version-win32.zip" -download "http://minetest.kitsunemimi.pw/libvorbis-$vorbis_version-win32.zip" +download "http://minetest.kitsunemimi.pw/dw2/libvorbis-$vorbis_version-win32.zip" download "http://minetest.kitsunemimi.pw/curl-$curl_version-win32.zip" -download "http://minetest.kitsunemimi.pw/gettext-$gettext_version-win32.zip" +download "http://minetest.kitsunemimi.pw/dw2/gettext-$gettext_version-win32.zip" download "http://minetest.kitsunemimi.pw/freetype2-$freetype_version-win32.zip" freetype-$freetype_version.zip download "http://minetest.kitsunemimi.pw/sqlite3-$sqlite3_version-win32.zip" -download "http://minetest.kitsunemimi.pw/luajit-$luajit_version-win32.zip" -download "http://minetest.kitsunemimi.pw/libleveldb-$leveldb_version-win32.zip" leveldb-$leveldb_version.zip -download "http://minetest.kitsunemimi.pw/openal_stripped.zip" '' unzip_nofolder +download "http://minetest.kitsunemimi.pw/dw2/luajit-$luajit_version-win32.zip" +download "http://minetest.kitsunemimi.pw/dw2/libleveldb-$leveldb_version-win32.zip" leveldb-$leveldb_version.zip +download "http://minetest.kitsunemimi.pw/openal-soft-$openal_version-win32.zip" # Set source dir, downloading Minetest as needed if [ -n "$EXISTING_MINETEST_DIR" ]; then sourcedir="$( cd "$EXISTING_MINETEST_DIR" && pwd )" else + cd $builddir sourcedir=$PWD/$CORE_NAME [ -d $CORE_NAME ] && { pushd $CORE_NAME; git pull; popd; } || \ git clone -b $CORE_BRANCH $CORE_GIT $CORE_NAME if [ -z "$NO_MINETEST_GAME" ]; then + cd $sourcedir [ -d games/$GAME_NAME ] && { pushd games/$GAME_NAME; git pull; popd; } || \ git clone -b $GAME_BRANCH $GAME_GIT games/$GAME_NAME fi @@ -96,23 +116,21 @@ git_hash=$(cd $sourcedir && git rev-parse --short HEAD) # Build the thing cd $builddir [ -d build ] && rm -rf build -mkdir build -cd build irr_dlls=$(echo $libdir/irrlicht/lib/*.dll | tr ' ' ';') vorbis_dlls=$(echo $libdir/libvorbis/bin/libvorbis{,file}-*.dll | tr ' ' ';') gettext_dlls=$(echo $libdir/gettext/bin/lib{intl,iconv}-*.dll | tr ' ' ';') -cmake -S $sourcedir -B . \ +cmake -S $sourcedir -B build \ -DCMAKE_TOOLCHAIN_FILE=$toolchain_file \ -DCMAKE_INSTALL_PREFIX=/tmp \ -DVERSION_EXTRA=$git_hash \ -DBUILD_CLIENT=1 -DBUILD_SERVER=0 \ + -DEXTRA_DLL="$runtime_dlls" \ \ -DENABLE_SOUND=1 \ -DENABLE_CURL=1 \ -DENABLE_GETTEXT=1 \ - -DENABLE_FREETYPE=1 \ -DENABLE_LEVELDB=1 \ \ -DCMAKE_PREFIX_PATH=$libdir/irrlicht \ @@ -138,15 +156,15 @@ cmake -S $sourcedir -B . \ -DVORBIS_DLL="$vorbis_dlls" \ -DVORBISFILE_LIBRARY=$libdir/libvorbis/lib/libvorbisfile.dll.a \ \ - -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 \ + -DOPENAL_INCLUDE_DIR=$libdir/openal/include/AL \ + -DOPENAL_LIBRARY=$libdir/openal/lib/libOpenAL32.dll.a \ + -DOPENAL_DLL=$libdir/openal/bin/OpenAL32.dll \ \ -DCURL_DLL=$libdir/curl/bin/libcurl-4.dll \ -DCURL_INCLUDE_DIR=$libdir/curl/include \ -DCURL_LIBRARY=$libdir/curl/lib/libcurl.dll.a \ \ - -DGETTEXT_MSGFMT=`which msgfmt` \ + -DGETTEXT_MSGFMT=`command -v msgfmt` \ -DGETTEXT_DLL="$gettext_dlls" \ -DGETTEXT_INCLUDE_DIR=$libdir/gettext/include \ -DGETTEXT_LIBRARY=$libdir/gettext/lib/libintl.dll.a \ @@ -164,9 +182,9 @@ cmake -S $sourcedir -B . \ -DLEVELDB_LIBRARY=$libdir/leveldb/lib/libleveldb.dll.a \ -DLEVELDB_DLL=$libdir/leveldb/bin/libleveldb.dll -make -j$(nproc) +cmake --build build -j$(nproc) -[ -z "$NO_PACKAGE" ] && make package +[ -z "$NO_PACKAGE" ] && cmake --build build --target package exit 0 # EOF diff --git a/util/buildbot/buildwin64.sh b/util/buildbot/buildwin64.sh index 5acb43b73..f367e68a5 100755 --- a/util/buildbot/buildwin64.sh +++ b/util/buildbot/buildwin64.sh @@ -19,28 +19,44 @@ builddir="$( cd "$builddir" && pwd )" libdir=$builddir/libs # Test which win64 compiler is present -which x86_64-w64-mingw32-gcc &>/dev/null && - toolchain_file=$dir/toolchain_x86_64-w64-mingw32.cmake -which x86_64-w64-mingw32-gcc-posix &>/dev/null && - toolchain_file=$dir/toolchain_x86_64-w64-mingw32-posix.cmake +command -v x86_64-w64-mingw32-gcc >/dev/null && + compiler=x86_64-w64-mingw32-gcc +command -v x86_64-w64-mingw32-gcc-posix >/dev/null && + compiler=x86_64-w64-mingw32-gcc-posix -if [ -z "$toolchain_file" ]; then - echo "Unable to determine which mingw32 compiler to use" +if [ -z "$compiler" ]; then + echo "Unable to determine which MinGW compiler to use" exit 1 fi +toolchain_file=$dir/toolchain_${compiler/-gcc/}.cmake echo "Using $toolchain_file" -irrlicht_version=1.9.0mt3 -ogg_version=1.3.4 +# Try to find runtime DLLs in various paths (varies by distribution, sigh) +tmp=$(dirname "$(command -v $compiler)")/.. +runtime_dlls= +for name in lib{gcc_,stdc++-,winpthread-}'*'.dll; do + for dir in $tmp/x86_64-w64-mingw32/{bin,lib} $tmp/lib/gcc/x86_64-w64-mingw32/*; do + [ -d "$dir" ] || continue + file=$(echo $dir/$name) + [ -f "$file" ] && { runtime_dlls+="$file;"; break; } + done +done +[ -z "$runtime_dlls" ] && + echo "The compiler runtime DLLs could not be found, they might be missing in the final package." + +# Get stuff +irrlicht_version=1.9.0mt5 +ogg_version=1.3.5 +openal_version=1.21.1 vorbis_version=1.3.7 -curl_version=7.76.1 +curl_version=7.81.0 gettext_version=0.20.1 -freetype_version=2.10.4 -sqlite3_version=3.35.5 +freetype_version=2.11.1 +sqlite3_version=3.37.2 luajit_version=2.1.0-beta3 leveldb_version=1.23 zlib_version=1.2.11 -zstd_version=1.4.9 +zstd_version=1.5.2 mkdir -p $libdir @@ -63,7 +79,6 @@ download () { fi } -# Get stuff cd $libdir download "https://github.com/minetest/irrlicht/releases/download/$irrlicht_version/win64.zip" irrlicht-$irrlicht_version.zip download "http://minetest.kitsunemimi.pw/zlib-$zlib_version-win64.zip" @@ -76,16 +91,18 @@ download "http://minetest.kitsunemimi.pw/freetype2-$freetype_version-win64.zip" download "http://minetest.kitsunemimi.pw/sqlite3-$sqlite3_version-win64.zip" download "http://minetest.kitsunemimi.pw/luajit-$luajit_version-win64.zip" download "http://minetest.kitsunemimi.pw/libleveldb-$leveldb_version-win64.zip" leveldb-$leveldb_version.zip -download "http://minetest.kitsunemimi.pw/openal_stripped64.zip" 'openal_stripped.zip' unzip_nofolder +download "http://minetest.kitsunemimi.pw/openal-soft-$openal_version-win64.zip" # Set source dir, downloading Minetest as needed if [ -n "$EXISTING_MINETEST_DIR" ]; then sourcedir="$( cd "$EXISTING_MINETEST_DIR" && pwd )" else + cd $builddir sourcedir=$PWD/$CORE_NAME [ -d $CORE_NAME ] && { pushd $CORE_NAME; git pull; popd; } || \ git clone -b $CORE_BRANCH $CORE_GIT $CORE_NAME if [ -z "$NO_MINETEST_GAME" ]; then + cd $sourcedir [ -d games/$GAME_NAME ] && { pushd games/$GAME_NAME; git pull; popd; } || \ git clone -b $GAME_BRANCH $GAME_GIT games/$GAME_NAME fi @@ -96,23 +113,21 @@ git_hash=$(cd $sourcedir && git rev-parse --short HEAD) # Build the thing cd $builddir [ -d build ] && rm -rf build -mkdir build -cd build irr_dlls=$(echo $libdir/irrlicht/lib/*.dll | tr ' ' ';') vorbis_dlls=$(echo $libdir/libvorbis/bin/libvorbis{,file}-*.dll | tr ' ' ';') gettext_dlls=$(echo $libdir/gettext/bin/lib{intl,iconv}-*.dll | tr ' ' ';') -cmake -S $sourcedir -B . \ +cmake -S $sourcedir -B build \ -DCMAKE_TOOLCHAIN_FILE=$toolchain_file \ -DCMAKE_INSTALL_PREFIX=/tmp \ -DVERSION_EXTRA=$git_hash \ -DBUILD_CLIENT=1 -DBUILD_SERVER=0 \ + -DEXTRA_DLL="$runtime_dlls" \ \ -DENABLE_SOUND=1 \ -DENABLE_CURL=1 \ -DENABLE_GETTEXT=1 \ - -DENABLE_FREETYPE=1 \ -DENABLE_LEVELDB=1 \ \ -DCMAKE_PREFIX_PATH=$libdir/irrlicht \ @@ -138,15 +153,15 @@ cmake -S $sourcedir -B . \ -DVORBIS_DLL="$vorbis_dlls" \ -DVORBISFILE_LIBRARY=$libdir/libvorbis/lib/libvorbisfile.dll.a \ \ - -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 \ + -DOPENAL_INCLUDE_DIR=$libdir/openal/include/AL \ + -DOPENAL_LIBRARY=$libdir/openal/lib/libOpenAL32.dll.a \ + -DOPENAL_DLL=$libdir/openal/bin/OpenAL32.dll \ \ -DCURL_DLL=$libdir/curl/bin/libcurl-4.dll \ -DCURL_INCLUDE_DIR=$libdir/curl/include \ -DCURL_LIBRARY=$libdir/curl/lib/libcurl.dll.a \ \ - -DGETTEXT_MSGFMT=`which msgfmt` \ + -DGETTEXT_MSGFMT=`command -v msgfmt` \ -DGETTEXT_DLL="$gettext_dlls" \ -DGETTEXT_INCLUDE_DIR=$libdir/gettext/include \ -DGETTEXT_LIBRARY=$libdir/gettext/lib/libintl.dll.a \ @@ -164,9 +179,9 @@ cmake -S $sourcedir -B . \ -DLEVELDB_LIBRARY=$libdir/leveldb/lib/libleveldb.dll.a \ -DLEVELDB_DLL=$libdir/leveldb/bin/libleveldb.dll -make -j$(nproc) +cmake --build build -j$(nproc) -[ -z "$NO_PACKAGE" ] && make package +[ -z "$NO_PACKAGE" ] && cmake --build build --target package exit 0 # EOF diff --git a/util/ci/build.sh b/util/ci/build.sh index ba77cd645..88349b852 100755 --- a/util/ci/build.sh +++ b/util/ci/build.sh @@ -1,8 +1,10 @@ #! /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 +cmake -B build \ + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Debug} \ + -DRUN_IN_PLACE=TRUE \ + -DENABLE_GETTEXT=${CMAKE_ENABLE_GETTEXT:-TRUE} \ + -DBUILD_SERVER=${CMAKE_BUILD_SERVER:-TRUE} \ + ${CMAKE_FLAGS} + +cmake --build build --parallel $(($(nproc) + 1)) diff --git a/util/ci/build_prometheus_cpp.sh b/util/ci/build_prometheus_cpp.sh index edfd574cd..f3e4a5559 100755 --- a/util/ci/build_prometheus_cpp.sh +++ b/util/ci/build_prometheus_cpp.sh @@ -8,6 +8,6 @@ cmake .. \ -DCMAKE_INSTALL_PREFIX=/usr/local \ -DCMAKE_BUILD_TYPE=Release \ -DENABLE_TESTING=0 -make -j2 +make -j$(nproc) sudo make install diff --git a/util/ci/clang-tidy.sh b/util/ci/clang-tidy.sh index bb4e99fef..e678cf3b9 100755 --- a/util/ci/clang-tidy.sh +++ b/util/ci/clang-tidy.sh @@ -1,17 +1,13 @@ #! /bin/bash -eu -mkdir -p cmakebuild -cd cmakebuild -cmake -DCMAKE_BUILD_TYPE=Debug \ +cmake -B build -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DRUN_IN_PLACE=TRUE \ -DENABLE_{GETTEXT,SOUND}=FALSE \ - -DBUILD_SERVER=TRUE .. -make GenerateVersion - -cd .. + -DBUILD_SERVER=TRUE +cmake --build build --target GenerateVersion ./util/ci/run-clang-tidy.py \ - -clang-tidy-binary=clang-tidy-9 -p cmakebuild \ + -clang-tidy-binary=clang-tidy-9 -p build \ -quiet -config="$(cat .clang-tidy)" \ 'src/.*' diff --git a/util/ci/common.sh b/util/ci/common.sh index 88bed9ed4..82529c712 100644 --- a/util/ci/common.sh +++ b/util/ci/common.sh @@ -7,19 +7,18 @@ install_linux_deps() { libhiredis-dev libogg-dev libgmp-dev libvorbis-dev libopenal-dev \ gettext libpq-dev libleveldb-dev libcurl4-openssl-dev libzstd-dev) - if [[ "$1" == "--old-irr" ]]; then + if [[ "$1" == "--no-irr" ]]; then + shift + elif [[ "$1" == "--old-irr" ]]; then shift pkgs+=(libirrlicht-dev) else - wget "https://github.com/minetest/irrlicht/releases/download/1.9.0mt3/ubuntu-bionic.tar.gz" + wget "https://github.com/minetest/irrlicht/releases/download/1.9.0mt5/ubuntu-bionic.tar.gz" sudo tar -xaf ubuntu-bionic.tar.gz -C /usr/local fi sudo apt-get update sudo apt-get install -y --no-install-recommends ${pkgs[@]} "$@" - - # workaround for bug with Github Actions' ubuntu-18.04 image - sudo apt-get remove -y libgcc-11-dev gcc-11 || : } # Mac OSX build only diff --git a/util/generate-texture-normals.sh b/util/generate-texture-normals.sh deleted file mode 100755 index 6279dfa69..000000000 --- a/util/generate-texture-normals.sh +++ /dev/null @@ -1,255 +0,0 @@ -#!/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\ \{\}\ \{\}\ \{\}\ \{\}\ \{\}\ \{\}\ \{\}\ \{\} - diff --git a/util/test_multiplayer.sh b/util/test_multiplayer.sh index 9fb894a30..5ffc044e0 100755 --- a/util/test_multiplayer.sh +++ b/util/test_multiplayer.sh @@ -20,7 +20,7 @@ waitfor () { } gdbrun () { - gdb -q -ex 'set confirm off' -ex 'r' -ex 'bt' -ex 'quit' --args "$@" + gdb -q -batch -ex 'set confirm off' -ex 'r' -ex 'bt' --args "$@" } [ -e $minetest ] || { echo "executable $minetest missing"; exit 1; } @@ -33,17 +33,27 @@ printf '%s\n' >$testspath/client1.conf \ enable_{sound,minimap,shaders}=false printf '%s\n' >$testspath/server.conf \ - max_block_send_distance=1 + max_block_send_distance=1 devtest_unittests_autostart=true cat >$worldpath/worldmods/test/init.lua <<"LUA" core.after(0, function() io.close(io.open(core.get_worldpath() .. "/startup", "w")) end) -core.register_on_joinplayer(function(player) - io.close(io.open(core.get_worldpath() .. "/player_joined", "w")) +local function callback(test_ok) + if not test_ok then + io.close(io.open(core.get_worldpath() .. "/test_failure", "w")) + end + io.close(io.open(core.get_worldpath() .. "/done", "w")) core.request_shutdown("", false, 2) -end) +end +if core.settings:get_bool("devtest_unittests_autostart") then + unittests.on_finished = callback +else + core.register_on_joinplayer(function() callback(true) end) +end LUA +printf '%s\n' >$worldpath/worldmods/test/mod.conf \ + name=test optional_depends=unittests echo "Starting server" gdbrun $minetest --server --config $conf_server --world $worldpath --gameid $gameid 2>&1 | sed -u 's/^/(server) /' & @@ -51,10 +61,14 @@ waitfor $worldpath/startup echo "Starting client" gdbrun $minetest --config $conf_client1 --go --address 127.0.0.1 2>&1 | sed -u 's/^/(client) /' & -waitfor $worldpath/player_joined +waitfor $worldpath/done echo "Waiting for client and server to exit" wait +if [ -f $worldpath/test_failure ]; then + echo "There were test failures." + exit 1 +fi echo "Success" exit 0 diff --git a/util/updatepo.sh b/util/updatepo.sh index dbcb16fde..23e2c61e9 100755 --- a/util/updatepo.sh +++ b/util/updatepo.sh @@ -13,7 +13,7 @@ abort() { # 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")")" +scriptisin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # The script is executed from the parent of po/, which is also the # parent of the script directory and of the src/ directory. @@ -61,6 +61,7 @@ xgettext --package-name=minetest \ --keyword=wstrgettext \ --keyword=core.gettext \ --keyword=showTranslatedStatusText \ + --keyword=fmtgettext \ --output $potfile \ --from-code=utf-8 \ `find src/ -name '*.cpp' -o -name '*.h'` \ diff --git a/util/wireshark/minetest.lua b/util/wireshark/minetest.lua index d954c7597..40e1956f3 100644 --- a/util/wireshark/minetest.lua +++ b/util/wireshark/minetest.lua @@ -422,8 +422,8 @@ do t:add(f_pointed_under_y, buffer(13,2)) t:add(f_pointed_under_z, buffer(15,2)) t:add(f_pointed_above_x, buffer(17,2)) - t:add(f_pointed_above_x, buffer(19,2)) - t:add(f_pointed_above_x, buffer(21,2)) + t:add(f_pointed_above_y, buffer(19,2)) + t:add(f_pointed_above_z, buffer(21,2)) elseif ptype == 2 then -- Object t:add(f_pointed_object_id, buffer(11,2)) end |