From 6a26d6d15a9a122681772c29a7f3b0c36ac9c62e Mon Sep 17 00:00:00 2001 From: sfan5 Date: Thu, 25 Mar 2021 15:09:49 +0100 Subject: Adjust build config for Irrlicht changes (again) --- util/buildbot/buildwin32.sh | 6 +++--- util/buildbot/buildwin64.sh | 6 +++--- util/ci/common.sh | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'util') diff --git a/util/buildbot/buildwin32.sh b/util/buildbot/buildwin32.sh index db3a23375..1a66a9764 100755 --- a/util/buildbot/buildwin32.sh +++ b/util/buildbot/buildwin32.sh @@ -31,7 +31,7 @@ if [ -z "$toolchain_file" ]; then fi echo "Using $toolchain_file" -irrlicht_version=1.9.0mt0 +irrlicht_version=1.9.0mt1 ogg_version=1.3.2 vorbis_version=1.3.5 curl_version=7.65.3 @@ -122,8 +122,8 @@ cmake .. \ -DENABLE_FREETYPE=1 \ -DENABLE_LEVELDB=1 \ \ - -DIRRLICHT_INCLUDE_DIR=$libdir/irrlicht/include/irrlicht \ - -DIRRLICHT_LIBRARY=$libdir/irrlicht/lib/libIrrlicht.dll.a \ + -DIRRLICHT_INCLUDE_DIR=$libdir/irrlicht/include/irrlichtmt \ + -DIRRLICHT_LIBRARY=$libdir/irrlicht/lib/libIrrlichtMt.dll.a \ -DIRRLICHT_DLL="$irr_dlls" \ \ -DZLIB_INCLUDE_DIR=$libdir/zlib/include \ diff --git a/util/buildbot/buildwin64.sh b/util/buildbot/buildwin64.sh index 53c6d1ea9..54bfbef69 100755 --- a/util/buildbot/buildwin64.sh +++ b/util/buildbot/buildwin64.sh @@ -20,7 +20,7 @@ packagedir=$builddir/packages libdir=$builddir/libs toolchain_file=$dir/toolchain_x86_64-w64-mingw32.cmake -irrlicht_version=1.9.0mt0 +irrlicht_version=1.9.0mt1 ogg_version=1.3.2 vorbis_version=1.3.5 curl_version=7.65.3 @@ -112,8 +112,8 @@ cmake .. \ -DENABLE_FREETYPE=1 \ -DENABLE_LEVELDB=1 \ \ - -DIRRLICHT_INCLUDE_DIR=$libdir/irrlicht/include/irrlicht \ - -DIRRLICHT_LIBRARY=$libdir/irrlicht/lib/libIrrlicht.dll.a \ + -DIRRLICHT_INCLUDE_DIR=$libdir/irrlicht/include/irrlichtmt \ + -DIRRLICHT_LIBRARY=$libdir/irrlicht/lib/libIrrlichtMt.dll.a \ -DIRRLICHT_DLL="$irr_dlls" \ \ -DZLIB_INCLUDE_DIR=$libdir/zlib/include \ diff --git a/util/ci/common.sh b/util/ci/common.sh index d73c31b2f..ca2ecbc29 100644 --- a/util/ci/common.sh +++ b/util/ci/common.sh @@ -12,7 +12,7 @@ install_linux_deps() { shift pkgs+=(libirrlicht-dev) else - wget "https://github.com/minetest/irrlicht/releases/download/1.9.0mt0/ubuntu-bionic.tar.gz" + wget "https://github.com/minetest/irrlicht/releases/download/1.9.0mt1/ubuntu-bionic.tar.gz" sudo tar -xaf ubuntu-bionic.tar.gz -C /usr/local fi -- cgit v1.2.3 From 4d0fef8ae87aa7b940d43485e7f6466eaa3d111e Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sun, 11 Apr 2021 17:10:06 +0200 Subject: Buildbot changes to allow out-of-tree builds (#11180) * Do proper out-of-tree builds with buildbot * Don't write to bin/ for cross builds * This allows safely building multiple builds from the same source dir, e.g. with the buildbot. * Disable Gettext (by default) and Freetype (entirely) for server builds --- src/CMakeLists.txt | 13 ++++++++----- util/buildbot/buildwin32.sh | 40 ++++++++++++++++++++-------------------- util/buildbot/buildwin64.sh | 39 +++++++++++++++++++-------------------- 3 files changed, 47 insertions(+), 45 deletions(-) (limited to 'util') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4bb6877d9..26441063f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -55,7 +55,7 @@ if(NOT USE_CURL) endif() -option(ENABLE_GETTEXT "Use GetText for internationalization" TRUE) +option(ENABLE_GETTEXT "Use GetText for internationalization" ${BUILD_CLIENT}) set(USE_GETTEXT FALSE) if(ENABLE_GETTEXT) @@ -120,13 +120,13 @@ endif() option(ENABLE_FREETYPE "Enable FreeType2 (TrueType fonts and basic unicode support)" TRUE) set(USE_FREETYPE FALSE) -if(ENABLE_FREETYPE) +if(BUILD_CLIENT AND ENABLE_FREETYPE) find_package(Freetype) if(FREETYPE_FOUND) message(STATUS "Freetype enabled.") set(USE_FREETYPE TRUE) endif() -endif(ENABLE_FREETYPE) +endif() option(ENABLE_CURSES "Enable ncurses console" TRUE) set(USE_CURSES FALSE) @@ -526,8 +526,11 @@ if(USE_CURL) endif() -set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin") - +# When cross-compiling assume the user doesn't want to run the executable anyway, +# otherwise place it in /bin/ since Minetest can only run from there. +if(NOT CMAKE_CROSSCOMPILING) + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin") +endif() if(BUILD_CLIENT) add_executable(${PROJECT_NAME} ${client_SRCS} ${extra_windows_SRCS}) diff --git a/util/buildbot/buildwin32.sh b/util/buildbot/buildwin32.sh index 1a66a9764..df62062c9 100755 --- a/util/buildbot/buildwin32.sh +++ b/util/buildbot/buildwin32.sh @@ -85,36 +85,36 @@ cd $libdir [ -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 +# Set source dir, downloading Minetest as needed +if [ -n "$EXISTING_MINETEST_DIR" ]; then + sourcedir="$( cd "$EXISTING_MINETEST_DIR" && pwd )" else - [ -d $CORE_NAME ] && (cd $CORE_NAME && git pull) || (git clone -b $CORE_BRANCH $CORE_GIT) - cd $CORE_NAME + 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 + [ -d games/$GAME_NAME ] && { pushd games/$GAME_NAME; git pull; popd; } || \ + git clone -b $GAME_BRANCH $GAME_GIT games/$GAME_NAME + fi 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 +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/bin/*.dll | tr ' ' ';') vorbis_dlls=$(echo $libdir/libvorbis/bin/libvorbis{,file}-*.dll | tr ' ' ';') gettext_dlls=$(echo $libdir/gettext/bin/lib{intl,iconv}-*.dll | tr ' ' ';') -# Build the thing -[ -d _build ] && rm -Rf _build/ -mkdir _build -cd _build -cmake .. \ +cmake -S $sourcedir -B . \ + -DCMAKE_TOOLCHAIN_FILE=$toolchain_file \ -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 \ @@ -170,7 +170,7 @@ cmake .. \ make -j$(nproc) -[ "x$NO_PACKAGE" = "x" ] && make package +[ -z "$NO_PACKAGE" ] && make package exit 0 # EOF diff --git a/util/buildbot/buildwin64.sh b/util/buildbot/buildwin64.sh index 54bfbef69..c35ece35b 100755 --- a/util/buildbot/buildwin64.sh +++ b/util/buildbot/buildwin64.sh @@ -60,7 +60,6 @@ cd $builddir [ -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 @@ -75,32 +74,32 @@ cd $libdir [ -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 +# Set source dir, downloading Minetest as needed +if [ -n "$EXISTING_MINETEST_DIR" ]; then + sourcedir="$( cd "$EXISTING_MINETEST_DIR" && pwd )" else - [ -d $CORE_NAME ] && (cd $CORE_NAME && git pull) || (git clone -b $CORE_BRANCH $CORE_GIT) - cd $CORE_NAME + 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 + [ -d games/$GAME_NAME ] && { pushd games/$GAME_NAME; git pull; popd; } || \ + git clone -b $GAME_BRANCH $GAME_GIT games/$GAME_NAME + fi 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 +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/bin/*.dll | tr ' ' ';') vorbis_dlls=$(echo $libdir/libvorbis/bin/libvorbis{,file}-*.dll | tr ' ' ';') gettext_dlls=$(echo $libdir/gettext/bin/lib{intl,iconv}-*.dll | tr ' ' ';') -# Build the thing -[ -d _build ] && rm -Rf _build/ -mkdir _build -cd _build -cmake .. \ +cmake -S $sourcedir -B . \ -DCMAKE_TOOLCHAIN_FILE=$toolchain_file \ -DCMAKE_INSTALL_PREFIX=/tmp \ -DVERSION_EXTRA=$git_hash \ @@ -160,7 +159,7 @@ cmake .. \ make -j$(nproc) -[ "x$NO_PACKAGE" = "x" ] && make package +[ -z "$NO_PACKAGE" ] && make package exit 0 # EOF -- cgit v1.2.3 From a24899bf2dcd58916922d671ee8761448b6876e5 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Tue, 20 Apr 2021 19:50:34 +0200 Subject: Look for PostgreSQL library properly and fix CI --- README.md | 2 +- src/CMakeLists.txt | 11 ++++++++++- util/ci/common.sh | 3 +-- 3 files changed, 12 insertions(+), 4 deletions(-) (limited to 'util') diff --git a/README.md b/README.md index 662b5c4ca..0b9907992 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ Compiling | Dependency | Version | Commentary | |------------|---------|------------| | GCC | 4.9+ | Can be replaced with Clang 3.4+ | -| CMake | 2.6+ | | +| CMake | 3.5+ | | | Irrlicht | - | Custom version required, see https://github.com/minetest/irrlicht | | SQLite3 | 3.0+ | | | LuaJIT | 2.0+ | Bundled Lua 5.1 is used if not present | diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 16b5bf991..f70e77dcc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -146,7 +146,16 @@ option(ENABLE_POSTGRESQL "Enable PostgreSQL backend" TRUE) set(USE_POSTGRESQL FALSE) if(ENABLE_POSTGRESQL) - find_package("PostgreSQL") + if(CMAKE_VERSION VERSION_LESS "3.20") + find_package(PostgreSQL QUIET) + # Before CMake 3.20 FindPostgreSQL.cmake always looked for server includes + # but we don't need them, so continue anyway if only those are missing. + if(PostgreSQL_INCLUDE_DIR AND PostgreSQL_LIBRARY) + set(PostgreSQL_FOUND TRUE) + endif() + else() + find_package(PostgreSQL) + endif() if(PostgreSQL_FOUND) set(USE_POSTGRESQL TRUE) diff --git a/util/ci/common.sh b/util/ci/common.sh index ca2ecbc29..1083581b5 100644 --- a/util/ci/common.sh +++ b/util/ci/common.sh @@ -5,8 +5,7 @@ install_linux_deps() { local pkgs=(cmake 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) + gettext libpq-dev libleveldb-dev libcurl4-openssl-dev) if [[ "$1" == "--old-irr" ]]; then shift -- cgit v1.2.3 From 9660ae288a4e520907a29f34ea7ed20acdcbc212 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Tue, 27 Apr 2021 11:50:40 +0200 Subject: Update library versions in buildbot (#11229) --- util/buildbot/buildwin32.sh | 85 ++++++++++++++++++++------------------------- util/buildbot/buildwin64.sh | 85 ++++++++++++++++++++------------------------- 2 files changed, 76 insertions(+), 94 deletions(-) (limited to 'util') diff --git a/util/buildbot/buildwin32.sh b/util/buildbot/buildwin32.sh index df62062c9..468df05a9 100755 --- a/util/buildbot/buildwin32.sh +++ b/util/buildbot/buildwin32.sh @@ -16,7 +16,6 @@ fi builddir=$1 mkdir -p $builddir builddir="$( cd "$builddir" && pwd )" -packagedir=$builddir/packages libdir=$builddir/libs # Test which win32 compiler is present @@ -32,58 +31,50 @@ fi echo "Using $toolchain_file" irrlicht_version=1.9.0mt1 -ogg_version=1.3.2 -vorbis_version=1.3.5 -curl_version=7.65.3 +ogg_version=1.3.4 +vorbis_version=1.3.7 +curl_version=7.76.1 gettext_version=0.20.1 -freetype_version=2.10.1 -sqlite3_version=3.27.2 +freetype_version=2.10.4 +sqlite3_version=3.35.5 luajit_version=2.1.0-beta3 -leveldb_version=1.22 +leveldb_version=1.23 zlib_version=1.2.11 -mkdir -p $packagedir mkdir -p $libdir -cd $builddir +download () { + local url=$1 + local filename=$2 + [ -z "$filename" ] && filename=${url##*/} + local foldername=${filename%%[.-]*} + local extract=$3 + [ -z "$extract" ] && extract=unzip + + [ -d "./$foldername" ] && return 0 + wget "$url" -c -O "./$filename" + if [ "$extract" = "unzip" ]; then + unzip -o "$filename" -d "$foldername" + elif [ "$extract" = "unzip_nofolder" ]; then + unzip -o "$filename" + else + return 1 + fi +} # Get stuff -[ -e $packagedir/irrlicht-$irrlicht_version.zip ] || wget https://github.com/minetest/irrlicht/releases/download/$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 +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/libogg-$ogg_version-win32.zip" +download "http://minetest.kitsunemimi.pw/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/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 # Set source dir, downloading Minetest as needed if [ -n "$EXISTING_MINETEST_DIR" ]; then @@ -146,9 +137,9 @@ cmake -S $sourcedir -B . \ -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 \ + -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_DLL="$gettext_dlls" \ diff --git a/util/buildbot/buildwin64.sh b/util/buildbot/buildwin64.sh index c35ece35b..b9b23a133 100755 --- a/util/buildbot/buildwin64.sh +++ b/util/buildbot/buildwin64.sh @@ -16,63 +16,54 @@ 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.9.0mt1 -ogg_version=1.3.2 -vorbis_version=1.3.5 -curl_version=7.65.3 +ogg_version=1.3.4 +vorbis_version=1.3.7 +curl_version=7.76.1 gettext_version=0.20.1 -freetype_version=2.10.1 -sqlite3_version=3.27.2 +freetype_version=2.10.4 +sqlite3_version=3.35.5 luajit_version=2.1.0-beta3 -leveldb_version=1.22 +leveldb_version=1.23 zlib_version=1.2.11 -mkdir -p $packagedir mkdir -p $libdir -cd $builddir +download () { + local url=$1 + local filename=$2 + [ -z "$filename" ] && filename=${url##*/} + local foldername=${filename%%[.-]*} + local extract=$3 + [ -z "$extract" ] && extract=unzip -# Get stuff -[ -e $packagedir/irrlicht-$irrlicht_version.zip ] || wget https://github.com/minetest/irrlicht/releases/download/$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 + [ -d "./$foldername" ] && return 0 + wget "$url" -c -O "./$filename" + if [ "$extract" = "unzip" ]; then + unzip -o "$filename" -d "$foldername" + elif [ "$extract" = "unzip_nofolder" ]; then + unzip -o "$filename" + else + return 1 + fi +} -# Extract stuff +# Get 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 +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" +download "http://minetest.kitsunemimi.pw/libogg-$ogg_version-win64.zip" +download "http://minetest.kitsunemimi.pw/libvorbis-$vorbis_version-win64.zip" +download "http://minetest.kitsunemimi.pw/curl-$curl_version-win64.zip" +download "http://minetest.kitsunemimi.pw/gettext-$gettext_version-win64.zip" +download "http://minetest.kitsunemimi.pw/freetype2-$freetype_version-win64.zip" freetype-$freetype_version.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 # Set source dir, downloading Minetest as needed if [ -n "$EXISTING_MINETEST_DIR" ]; then @@ -135,9 +126,9 @@ cmake -S $sourcedir -B . \ -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 \ + -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_DLL="$gettext_dlls" \ -- cgit v1.2.3 From ba40b3950057c54609f8e4a56139563d30f8b84f Mon Sep 17 00:00:00 2001 From: sfan5 Date: Wed, 21 Apr 2021 18:21:12 +0200 Subject: Add basic client-server test to CI --- .github/workflows/build.yml | 8 +++- util/ci/common.sh | 4 +- util/test_multiplayer.sh | 91 +++++++++++++++++++++++++++------------------ 3 files changed, 63 insertions(+), 40 deletions(-) (limited to 'util') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0cf18d228..d268aa0cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,7 +80,7 @@ jobs: - name: Install deps run: | source ./util/ci/common.sh - install_linux_deps clang-3.9 + install_linux_deps clang-3.9 gdb - name: Build run: | @@ -89,10 +89,14 @@ jobs: CC: clang-3.9 CXX: clang++-3.9 - - name: Test + - name: Unittest run: | ./bin/minetest --run-unittests + - name: Integration test + run: | + ./util/test_multiplayer.sh + # This is the current clang version clang_9: runs-on: ubuntu-18.04 diff --git a/util/ci/common.sh b/util/ci/common.sh index 1083581b5..eb282c823 100644 --- a/util/ci/common.sh +++ b/util/ci/common.sh @@ -11,7 +11,9 @@ install_linux_deps() { shift pkgs+=(libirrlicht-dev) else - wget "https://github.com/minetest/irrlicht/releases/download/1.9.0mt1/ubuntu-bionic.tar.gz" + # TODO: return old URL when IrrlichtMt 1.9.0mt2 is tagged + #wget "https://github.com/minetest/irrlicht/releases/download/1.9.0mt1/ubuntu-bionic.tar.gz" + wget "http://minetest.kitsunemimi.pw/irrlichtmt-patched-temporary.tgz" -O ubuntu-bionic.tar.gz sudo tar -xaf ubuntu-bionic.tar.gz -C /usr/local fi diff --git a/util/test_multiplayer.sh b/util/test_multiplayer.sh index 176cf11d9..9fb894a30 100755 --- a/util/test_multiplayer.sh +++ b/util/test_multiplayer.sh @@ -3,41 +3,58 @@ 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 +conf_client1=$testspath/client1.conf +conf_server=$testspath/server.conf +worldpath=$testspath/world +waitfor () { + n=30 + while [ $n -gt 0 ]; do + [ -f "$1" ] && return 0 + sleep 0.5 + ((n-=1)) + done + echo "Waiting for ${1##*/} timed out" + pkill -P $$ + exit 1 +} + +gdbrun () { + gdb -q -ex 'set confirm off' -ex 'r' -ex 'bt' -ex 'quit' --args "$@" +} + +[ -e $minetest ] || { echo "executable $minetest missing"; exit 1; } + +rm -rf $worldpath +mkdir -p $worldpath/worldmods/test + +printf '%s\n' >$testspath/client1.conf \ + video_driver=null name=client1 viewing_range=10 \ + enable_{sound,minimap,shaders}=false + +printf '%s\n' >$testspath/server.conf \ + max_block_send_distance=1 + +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")) + core.request_shutdown("", false, 2) +end) +LUA + +echo "Starting server" +gdbrun $minetest --server --config $conf_server --world $worldpath --gameid $gameid 2>&1 | sed -u 's/^/(server) /' & +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 + +echo "Waiting for client and server to exit" +wait + +echo "Success" +exit 0 -- cgit v1.2.3