summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rwxr-xr-xutil/buildbot/buildwin32.sh26
-rwxr-xr-xutil/buildbot/buildwin64.sh20
-rw-r--r--util/buildbot/toolchain_i686-w64-mingw32-posix.cmake (renamed from util/buildbot/toolchain_i586-mingw32msvc.cmake)10
-rw-r--r--util/buildbot/toolchain_i686-w64-mingw32.cmake (renamed from util/buildbot/toolchain_i646-w64-mingw32.cmake)0
-rwxr-xr-xutil/ci/clang-format.sh (renamed from util/ci/lint.sh)25
-rw-r--r--util/ci/common.sh10
-rwxr-xr-xutil/fix_format.sh5
-rwxr-xr-xutil/gather_git_credits.py67
-rwxr-xr-xutil/updatepo.sh1
9 files changed, 137 insertions, 27 deletions
diff --git a/util/buildbot/buildwin32.sh b/util/buildbot/buildwin32.sh
index e62d32969..db3a23375 100755
--- a/util/buildbot/buildwin32.sh
+++ b/util/buildbot/buildwin32.sh
@@ -20,8 +20,10 @@ 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
+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
if [ -z "$toolchain_file" ]; then
echo "Unable to determine which mingw32 compiler to use"
@@ -29,7 +31,7 @@ if [ -z "$toolchain_file" ]; then
fi
echo "Using $toolchain_file"
-irrlicht_version=1.8.4
+irrlicht_version=1.9.0mt0
ogg_version=1.3.2
vorbis_version=1.3.5
curl_version=7.65.3
@@ -46,7 +48,7 @@ mkdir -p $libdir
cd $builddir
# Get stuff
-[ -e $packagedir/irrlicht-$irrlicht_version.zip ] || wget http://minetest.kitsunemimi.pw/irrlicht-$irrlicht_version-win32.zip \
+[ -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
@@ -100,6 +102,10 @@ if [ "x$NO_MINETEST_GAME" = "x" ]; then
cd ..
fi
+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
@@ -116,9 +122,9 @@ cmake .. \
-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 \
+ -DIRRLICHT_INCLUDE_DIR=$libdir/irrlicht/include/irrlicht \
+ -DIRRLICHT_LIBRARY=$libdir/irrlicht/lib/libIrrlicht.dll.a \
+ -DIRRLICHT_DLL="$irr_dlls" \
\
-DZLIB_INCLUDE_DIR=$libdir/zlib/include \
-DZLIB_LIBRARIES=$libdir/zlib/lib/libz.dll.a \
@@ -133,9 +139,8 @@ cmake .. \
\
-DVORBIS_INCLUDE_DIR=$libdir/libvorbis/include \
-DVORBIS_LIBRARY=$libdir/libvorbis/lib/libvorbis.dll.a \
- -DVORBIS_DLL=$libdir/libvorbis/bin/libvorbis-0.dll \
+ -DVORBIS_DLL="$vorbis_dlls" \
-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 \
@@ -146,8 +151,7 @@ cmake .. \
-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_DLL="$gettext_dlls" \
-DGETTEXT_INCLUDE_DIR=$libdir/gettext/include \
-DGETTEXT_LIBRARY=$libdir/gettext/lib/libintl.dll.a \
\
diff --git a/util/buildbot/buildwin64.sh b/util/buildbot/buildwin64.sh
index 94e009c29..53c6d1ea9 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.8.4
+irrlicht_version=1.9.0mt0
ogg_version=1.3.2
vorbis_version=1.3.5
curl_version=7.65.3
@@ -37,7 +37,7 @@ mkdir -p $libdir
cd $builddir
# Get stuff
-[ -e $packagedir/irrlicht-$irrlicht_version.zip ] || wget http://minetest.kitsunemimi.pw/irrlicht-$irrlicht_version-win64.zip \
+[ -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
@@ -92,6 +92,10 @@ if [ "x$NO_MINETEST_GAME" = "x" ]; then
cd ..
fi
+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
@@ -108,9 +112,9 @@ cmake .. \
-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 \
+ -DIRRLICHT_INCLUDE_DIR=$libdir/irrlicht/include/irrlicht \
+ -DIRRLICHT_LIBRARY=$libdir/irrlicht/lib/libIrrlicht.dll.a \
+ -DIRRLICHT_DLL="$irr_dlls" \
\
-DZLIB_INCLUDE_DIR=$libdir/zlib/include \
-DZLIB_LIBRARIES=$libdir/zlib/lib/libz.dll.a \
@@ -125,9 +129,8 @@ cmake .. \
\
-DVORBIS_INCLUDE_DIR=$libdir/libvorbis/include \
-DVORBIS_LIBRARY=$libdir/libvorbis/lib/libvorbis.dll.a \
- -DVORBIS_DLL=$libdir/libvorbis/bin/libvorbis-0.dll \
+ -DVORBIS_DLL="$vorbis_dlls" \
-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 \
@@ -138,8 +141,7 @@ cmake .. \
-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_DLL="$gettext_dlls" \
-DGETTEXT_INCLUDE_DIR=$libdir/gettext/include \
-DGETTEXT_LIBRARY=$libdir/gettext/lib/libintl.dll.a \
\
diff --git a/util/buildbot/toolchain_i586-mingw32msvc.cmake b/util/buildbot/toolchain_i686-w64-mingw32-posix.cmake
index 0eeefb84d..b5d9ba5c4 100644
--- a/util/buildbot/toolchain_i586-mingw32msvc.cmake
+++ b/util/buildbot/toolchain_i686-w64-mingw32-posix.cmake
@@ -2,12 +2,14 @@
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)
+# *-posix is Ubuntu's naming for the MinGW variant that comes with support
+# for pthreads / std::thread (required by MT)
+SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc-posix)
+SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++-posix)
+SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
# here is the target environment located
-SET(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc)
+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
diff --git a/util/buildbot/toolchain_i646-w64-mingw32.cmake b/util/buildbot/toolchain_i686-w64-mingw32.cmake
index 015baa210..015baa210 100644
--- a/util/buildbot/toolchain_i646-w64-mingw32.cmake
+++ b/util/buildbot/toolchain_i686-w64-mingw32.cmake
diff --git a/util/ci/lint.sh b/util/ci/clang-format.sh
index 395445ca7..89576c656 100755
--- a/util/ci/lint.sh
+++ b/util/ci/clang-format.sh
@@ -1,6 +1,6 @@
#! /bin/bash
-function perform_lint() {
- echo "Performing LINT..."
+
+function setup_for_format() {
if [ -z "${CLANG_FORMAT}" ]; then
CLANG_FORMAT=clang-format
fi
@@ -8,6 +8,12 @@ function perform_lint() {
CLANG_FORMAT_WHITELIST="util/ci/clang-format-whitelist.txt"
files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')"
+}
+
+function check_format() {
+ echo "Checking format..."
+
+ setup_for_format
local errorcount=0
local fail=0
@@ -41,3 +47,18 @@ function perform_lint() {
echo "LINT OK"
}
+
+
+function fix_format() {
+ echo "Fixing format..."
+
+ setup_for_format
+
+ for f in ${files_to_lint}; do
+ whitelisted=$(awk '$1 == "'$f'" { print 1 }' "$CLANG_FORMAT_WHITELIST")
+ if [ -z "${whitelisted}" ]; then
+ echo "$f"
+ $CLANG_FORMAT -i "$f"
+ fi
+ done
+}
diff --git a/util/ci/common.sh b/util/ci/common.sh
index 7523fa7ff..d73c31b2f 100644
--- a/util/ci/common.sh
+++ b/util/ci/common.sh
@@ -2,12 +2,20 @@
# Linux build only
install_linux_deps() {
- local pkgs=(libirrlicht-dev cmake libbz2-dev libpng-dev \
+ 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)
+ if [[ "$1" == "--old-irr" ]]; then
+ shift
+ pkgs+=(libirrlicht-dev)
+ else
+ wget "https://github.com/minetest/irrlicht/releases/download/1.9.0mt0/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[@]} "$@"
}
diff --git a/util/fix_format.sh b/util/fix_format.sh
new file mode 100755
index 000000000..3cef6f58d
--- /dev/null
+++ b/util/fix_format.sh
@@ -0,0 +1,5 @@
+#!/bin/bash -e
+
+. ./util/ci/clang-format.sh
+
+fix_format
diff --git a/util/gather_git_credits.py b/util/gather_git_credits.py
new file mode 100755
index 000000000..1b2865182
--- /dev/null
+++ b/util/gather_git_credits.py
@@ -0,0 +1,67 @@
+#!/usr/bin/env python3
+import subprocess
+import re
+from collections import defaultdict
+
+codefiles = r"(\.[ch](pp)?|\.lua|\.md|\.cmake|\.java|\.gradle|Makefile|CMakeLists\.txt)$"
+
+# two minor versions back, for "Active Contributors"
+REVS_ACTIVE = "5.2.0..HEAD"
+# all time, for "Previous Contributors"
+REVS_PREVIOUS = "HEAD"
+
+CUTOFF_ACTIVE = 3
+CUTOFF_PREVIOUS = 21
+
+# For a description of the points system see:
+# https://github.com/minetest/minetest/pull/9593#issue-398677198
+
+def load(revs):
+ points = defaultdict(int)
+ p = subprocess.Popen(["git", "log", "--mailmap", "--pretty=format:%h %aN <%aE>", revs],
+ stdout=subprocess.PIPE, universal_newlines=True)
+ for line in p.stdout:
+ hash, author = line.strip().split(" ", 1)
+ n = 0
+
+ p2 = subprocess.Popen(["git", "show", "--numstat", "--pretty=format:", hash],
+ stdout=subprocess.PIPE, universal_newlines=True)
+ for line in p2.stdout:
+ added, deleted, filename = re.split(r"\s+", line.strip(), 2)
+ if re.search(codefiles, filename) and added != "-":
+ n += int(added)
+ p2.wait()
+
+ if n == 0:
+ continue
+ if n > 1200:
+ n = 8
+ elif n > 700:
+ n = 4
+ elif n > 100:
+ n = 2
+ else:
+ n = 1
+ points[author] += n
+ p.wait()
+
+ # Some authors duplicate? Don't add manual workarounds here, edit the .mailmap!
+ for author in ("updatepo.sh <script@mt>", "Weblate <42@minetest.ru>"):
+ points.pop(author, None)
+ return points
+
+points_active = load(REVS_ACTIVE)
+points_prev = load(REVS_PREVIOUS)
+
+with open("results.txt", "w") as f:
+ for author, points in sorted(points_active.items(), key=(lambda e: e[1]), reverse=True):
+ if points < CUTOFF_ACTIVE: break
+ points_prev.pop(author, None) # active authors don't appear in previous
+ f.write("%d\t%s\n" % (points, author))
+ f.write('\n---------\n\n')
+ once = True
+ for author, points in sorted(points_prev.items(), key=(lambda e: e[1]), reverse=True):
+ if points < CUTOFF_PREVIOUS and once:
+ f.write('\n---------\n\n')
+ once = False
+ f.write("%d\t%s\n" % (points, author))
diff --git a/util/updatepo.sh b/util/updatepo.sh
index 168483bd4..95acb01ea 100755
--- a/util/updatepo.sh
+++ b/util/updatepo.sh
@@ -58,6 +58,7 @@ xgettext --package-name=minetest \
--keyword=fgettext_ne \
--keyword=strgettext \
--keyword=wstrgettext \
+ --keyword=core.gettext \
--keyword=showTranslatedStatusText \
--output $potfile \
--from-code=utf-8 \