Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikel committed Jun 11, 2024
2 parents 73faf18 + ae4cd1e commit 810ea95
Show file tree
Hide file tree
Showing 114 changed files with 26,889 additions and 18,336 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,22 @@ on:
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'android/**'
- '.github/workflows/android.yml'

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gettext openjdk-11-jdk-headless
sudo apt-get install -y --no-install-recommends gettext openjdk-17-jdk-headless
- name: Build AAB with Gradle
# We build an AAB as well for uploading to the the Play Store.
run: cd android; ./gradlew bundlerelease
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/cpp_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ on:
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'util/ci/**'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ on:
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'util/ci/**'
Expand Down
39 changes: 20 additions & 19 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ on:
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'util/ci/**'
Expand Down Expand Up @@ -55,21 +57,21 @@ jobs:
./bin/minetest --run-unittests
# Current gcc version
gcc_12:
runs-on: ubuntu-22.04
gcc_14:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps g++-12 libluajit-5.1-dev
install_linux_deps g++-14 libluajit-5.1-dev
- name: Build
run: |
./util/ci/build.sh
env:
CC: gcc-12
CXX: g++-12
CC: gcc-14
CXX: g++-14

- name: Test
run: |
Expand Down Expand Up @@ -101,21 +103,21 @@ jobs:
./bin/minetest --run-unittests
# Current clang version
clang_14:
runs-on: ubuntu-22.04
clang_18:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps clang-14 lldb
install_linux_deps clang-18 lldb
- name: Build
run: |
./util/ci/build.sh
env:
CC: clang-14
CXX: clang++-14
CC: clang-18
CXX: clang++-18

- name: Test
run: |
Expand All @@ -126,27 +128,26 @@ jobs:
./util/test_multiplayer.sh
# Build with prometheus-cpp (server-only)
clang_9_prometheus:
name: "clang_9 (PROMETHEUS=1)"
runs-on: ubuntu-20.04
clang_11_prometheus:
name: "clang_11 (PROMETHEUS=1)"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps clang-9
install_linux_deps clang-11
- name: Build prometheus-cpp
run: |
./util/ci/build_prometheus_cpp.sh
run: ./util/ci/build_prometheus_cpp.sh

- name: Build
run: |
./util/ci/build.sh
env:
CC: clang-9
CXX: clang++-9
CMAKE_FLAGS: "-DENABLE_PROMETHEUS=1 -DBUILD_CLIENT=0"
CC: clang-11
CXX: clang++-11
CMAKE_FLAGS: "-DENABLE_PROMETHEUS=1 -DBUILD_CLIENT=0 -DENABLE_CURSES=0"

- name: Test
run: |
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/lua.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
# Note that the integration tests are also run in build.yml, but only when C++ code is changed.
integration_tests:
name: "Compile and run multiplayer tests"
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install deps
Expand All @@ -39,7 +39,7 @@ jobs:
luacheck:
name: "Builtin Luacheck and Unit Tests"
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:

Expand All @@ -50,11 +50,7 @@ jobs:
- uses: leafo/[email protected]

- name: Install LuaJIT
run: |
cd $HOME
git clone https://github.com/LuaJIT/LuaJIT/
cd LuaJIT
make -j$(nproc)
run: ./util/ci/build_luajit.sh

- name: Install luarocks tools
run: |
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ on:
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- 'irr/**.mm' # Objective-C(++)
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- '.github/workflows/macos.yml'
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ on:
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'util/buildbot/**'
Expand Down Expand Up @@ -67,8 +69,8 @@ jobs:
name: VS 2019 ${{ matrix.config.arch }}-${{ matrix.type }}
runs-on: windows-2019
env:
VCPKG_VERSION: 8eb57355a4ffb410a2e94c07b4dca2dffbee8e50
# 2023.10.19
VCPKG_VERSION: 01f602195983451bc83e72f4214af2cbc495aa94
# 2024.05.24
vcpkg_packages: zlib zstd curl[winssl] openal-soft libvorbis libogg libjpeg-turbo sqlite3 freetype luajit gmp jsoncpp sdl2
strategy:
fail-fast: false
Expand All @@ -92,12 +94,6 @@ jobs:
steps:
- uses: actions/checkout@v4

# Workaround for regression, see https://github.com/minetest/minetest/pull/14536
- name: Pin CMake to 3.28
uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.28.0"

- name: Restore from cache and run vcpkg
uses: lukka/run-vcpkg@v7
with:
Expand Down
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Editors and development environments
*~
.cmake
CMakeUserPresets.json
Testing/*
*.swp
*.bak*
*.orig
Expand All @@ -26,7 +29,8 @@ gtags.files
# Codelite
*.project
# Visual Studio Code & plugins
.vscode/
.vscode/*
!.vscode/extensions.json
build/.cmake/
# Fleet
.fleet
Expand Down Expand Up @@ -107,7 +111,10 @@ src/cmake_config_githash.h
*.iml
test_config.h
cmake-build-debug/
cmake-build-minsizerel/
cmake-build-release/
cmake-build-relwithdebinfo/
cmake-build-default/
cmake_config.h
cmake_config_githash.h
CMakeDoxy*
Expand Down
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"ms-vscode.cpptools-extension-pack"
]
}
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ find_package(Lua REQUIRED)
if(NOT USE_LUAJIT)
add_subdirectory(lib/bitop)
endif()
add_subdirectory(lib/sha256)

if(BUILD_UNITTESTS OR BUILD_BENCHMARKS)
add_subdirectory(lib/catch2)
Expand Down
41 changes: 41 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 12
},
"configurePresets": [
{
"name": "Debug",
"displayName": "Debug",
"description": "Debug preset with debug symbols and no optimizations",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "Release",
"displayName": "Release",
"description": "Release preset with optimizations and no debug symbols",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "RelWithDebInfo",
"displayName": "RelWithDebInfo",
"description": "Release with debug symbols",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "MinSizeRel",
"displayName": "MinSizeRel",
"description": "Release with minimal code size",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "MinSizeRel"
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.libsdl.app.SDLActivity;

import android.content.Intent;
import android.content.ActivityNotFoundException;
import android.net.Uri;
import android.os.Bundle;
import android.text.InputType;
Expand All @@ -33,6 +34,7 @@
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.Toast;
import android.content.res.Configuration;

import androidx.annotation.Keep;
Expand Down Expand Up @@ -201,7 +203,11 @@ public int getDisplayWidth() {

public void openURI(String uri) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
startActivity(browserIntent);
try {
startActivity(browserIntent);
} catch (ActivityNotFoundException e) {
runOnUiThread(() -> Toast.makeText(this, R.string.no_web_browser, Toast.LENGTH_SHORT).show());
}
}

public String getUserDataPath() {
Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
<string name="unzip_notification_title">Loading Minetest</string>
<string name="unzip_notification_description">Less than 1 minute&#8230;</string>
<string name="ime_dialog_done">Done</string>
<string name="no_web_browser">No web browser found</string>
</resources>
9 changes: 3 additions & 6 deletions builtin/fstk/dialog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,12 @@ function dialog_create(name,get_formspec,buttonhandler,eventhandler)
return self
end

-- "message" must already be formspec-escaped, e.g. via fgettext or
-- core.formspec_escape.
function messagebox(name, message)
return dialog_create(name,
function()
return ([[
formspec_version[3]
size[8,3]
textarea[0.375,0.375;7.25,1.2;;;%s]
button[3,1.825;2,0.8;ok;%s]
]]):format(message, fgettext("OK"))
return ui.get_message_formspec("", message, "ok")
end,
function(this, fields)
if fields.ok then
Expand Down
Loading

0 comments on commit 810ea95

Please sign in to comment.