diff --git a/x11-packages/luanti/0001-bionic-libc-x11-wsi-opengl-es-2.patch b/x11-packages/luanti/0001-bionic-libc-x11-wsi-opengl-es-2.patch index 2bbdc0374c..129da54e9b 100644 --- a/x11-packages/luanti/0001-bionic-libc-x11-wsi-opengl-es-2.patch +++ b/x11-packages/luanti/0001-bionic-libc-x11-wsi-opengl-es-2.patch @@ -78,40 +78,22 @@ For maintainers - how to bump this patch checklist, for avoiding bitrot: --- a/irr/src/CMakeLists.txt +++ b/irr/src/CMakeLists.txt @@ -66,7 +66,7 @@ if(WIN32) + add_compile_definitions(_IRR_WINDOWS_ _IRR_WINDOWS_API_) elseif(APPLE) add_compile_definitions(_IRR_OSX_PLATFORM_) - set(DEVICE "OSX") -elseif(ANDROID) +elseif(DISABLING_THIS_BECAUSE_IT_IS_FOR_BUILDING_AN_APK) add_compile_definitions(_IRR_ANDROID_PLATFORM_) - if(NOT USE_SDL2) - message(FATAL_ERROR "The Android build requires SDL2") -@@ -231,7 +231,7 @@ if(USE_SDL2) - if(NOT USE_SDL2_STATIC) - set(USE_SDL2_SHARED TRUE) - endif() -- if(NOT ANDROID) -+ if(NOT DISABLING_THIS_BECAUSE_IT_IS_FOR_BUILDING_AN_APK) - find_package(SDL2 REQUIRED) - else() - # provided by AndroidLibs.cmake -@@ -278,7 +278,7 @@ endif() - - # Platform-specific libs - --if(ANDROID) -+if(DISABLING_THIS_BECAUSE_IT_IS_FOR_BUILDING_AN_APK) - enable_language(C) - elseif(APPLE) - find_library(COCOA_LIB Cocoa REQUIRED) -@@ -513,7 +513,6 @@ target_link_libraries(IrrlichtMt PRIVATE + elseif(EMSCRIPTEN) + add_compile_definitions(_IRR_EMSCRIPTEN_PLATFORM_ _IRR_COMPILE_WITH_EGL_MANAGER_) +@@ -519,7 +519,6 @@ target_link_libraries(IrrlichtMt PRIVATE ${EGL_LIBRARY} # incl. transitive SDL2 dependencies for static linking - "$<$:-landroid -llog -lGLESv2 -lGLESv1_CM -lOpenSLES>" - ${COCOA_LIB} - ${IOKIT_LIB} - "$<$:gdi32>" + ) + + if(WIN32) @@ -528,6 +527,6 @@ endif() if(CMAKE_BUILD_TYPE STREQUAL "Debug") target_compile_definitions(IrrlichtMt INTERFACE _DEBUG) @@ -188,24 +170,6 @@ For maintainers - how to bump this patch checklist, for avoiding bitrot: elseif (USE_GETTEXT) --- a/src/client/game.cpp +++ b/src/client/game.cpp -@@ -703,7 +703,7 @@ class Game { - return input->wasKeyReleased(k); - } - --#ifdef __ANDROID__ -+#ifdef DISABLING_THIS_BECAUSE_IT_IS_FOR_BUILDING_AN_APK - void handleAndroidChatInput(); - #endif - -@@ -850,7 +850,7 @@ class Game { - return g_touchcontrols && g_touchcontrols->isShootlineAvailable() && - camera->getCameraMode() == CAMERA_MODE_FIRST; - } --#ifdef __ANDROID__ -+#ifdef DISABLING_THIS_BECAUSE_IT_IS_FOR_BUILDING_AN_APK - bool m_android_chat_open; - #endif - @@ -1018,7 +1018,7 @@ void Game::run() const bool initial_window_maximized = !g_settings->getBool("fullscreen") && g_settings->getBool("window_maximized"); @@ -379,15 +343,15 @@ For maintainers - how to bump this patch checklist, for avoiding bitrot: float x_inches = (float) porting::getDisplaySize().X / --- a/src/filesys.cpp +++ b/src/filesys.cpp -@@ -436,7 +436,7 @@ std::string TempPath() - configuration hardcodes mkstemp("/tmp/lua_XXXXXX"). - */ +@@ -421,7 +421,7 @@ bool DeleteSingleFileOrEmptyDirectory(const std::string &path, bool log_error) + std::string TempPath() + { -#ifdef __ANDROID__ +#ifdef DISABLING_THIS_BECAUSE_IT_IS_FOR_BUILDING_AN_APK return porting::path_cache; #else - return DIR_DELIM "tmp"; + const char *env_tmpdir = getenv("TMPDIR"); --- a/src/gui/guiEngine.cpp +++ b/src/gui/guiEngine.cpp @@ -381,7 +381,7 @@ void GUIEngine::run() @@ -494,10 +458,10 @@ For maintainers - how to bump this patch checklist, for avoiding bitrot: // No dialog is shown --- a/src/gui/modalMenu.h +++ b/src/gui/modalMenu.h -@@ -9,7 +9,7 @@ +@@ -8,7 +8,7 @@ + #include "irrlichttypes_bloated.h" #include "irr_ptr.h" - #include "util/string.h" -#ifdef __ANDROID__ +#ifdef DISABLING_THIS_BECAUSE_IT_IS_FOR_BUILDING_AN_APK #include diff --git a/x11-packages/luanti/0003-fix-incompatible-type-ekey-code.patch b/x11-packages/luanti/0003-fix-incompatible-type-ekey-code.patch deleted file mode 100644 index a5053015d6..0000000000 --- a/x11-packages/luanti/0003-fix-incompatible-type-ekey-code.patch +++ /dev/null @@ -1,13 +0,0 @@ -This prevents an error during compiling with recent C++ compilers while SDL2 is disabled, -which was: CIrrDeviceLinux.cpp:682:13: error: assigning to 'EKEY_CODE' from incompatible type 'int' ---- a/irr/src/CIrrDeviceLinux.cpp -+++ b/irr/src/CIrrDeviceLinux.cpp -@@ -693,7 +693,7 @@ EKEY_CODE CIrrDeviceLinux::getKeyCode(XEvent &event) - keyCode = (EKEY_CODE)KeyMap[idx].Win32Key; - } - if (keyCode == 0) { -- keyCode = KEY_UNKNOWN; -+ keyCode = (EKEY_CODE)KEY_UNKNOWN; - if (!mp.X11Key) { - os::Printer::log("No such X11Key, event keycode", core::stringc(event.xkey.keycode).c_str(), ELL_INFORMATION); - } else if (idx == -1) { diff --git a/x11-packages/luanti/0004-replace-xdg-open.patch b/x11-packages/luanti/0003-replace-xdg-open.patch similarity index 100% rename from x11-packages/luanti/0004-replace-xdg-open.patch rename to x11-packages/luanti/0003-replace-xdg-open.patch diff --git a/x11-packages/luanti/0005-scrambled-keycodes-workaround.patch b/x11-packages/luanti/0004-scrambled-keycodes-workaround.patch similarity index 100% rename from x11-packages/luanti/0005-scrambled-keycodes-workaround.patch rename to x11-packages/luanti/0004-scrambled-keycodes-workaround.patch diff --git a/x11-packages/luanti/0005-sdl-force-egl.patch b/x11-packages/luanti/0005-sdl-force-egl.patch new file mode 100644 index 0000000000..fab1d22667 --- /dev/null +++ b/x11-packages/luanti/0005-sdl-force-egl.patch @@ -0,0 +1,19 @@ +Without this, SDL mode of Luanti would: +- have significantly reduced performance and driver compatibility +- have strangely washed-out colors +https://github.com/luanti-org/luanti/issues/16859 + +--- a/irr/src/CIrrDeviceSDL.cpp ++++ b/irr/src/CIrrDeviceSDL.cpp +@@ -442,6 +442,11 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters ¶m) : + #if defined(SDL_HINT_IME_SHOW_UI) + SDL_SetHint(SDL_HINT_IME_SHOW_UI, "1"); + #endif ++#ifdef _IRR_USE_SDL3_ ++ SDL_SetHint(SDL_HINT_VIDEO_FORCE_EGL, "1"); ++#else ++ SDL_SetHint(SDL_HINT_VIDEO_X11_FORCE_EGL, "1"); ++#endif + + // Initialize SDL + diff --git a/x11-packages/luanti/build.sh b/x11-packages/luanti/build.sh index 92a24ed131..3e79bd44ed 100644 --- a/x11-packages/luanti/build.sh +++ b/x11-packages/luanti/build.sh @@ -2,19 +2,11 @@ TERMUX_PKG_HOMEPAGE=https://www.luanti.org TERMUX_PKG_DESCRIPTION="An open source voxel game engine." TERMUX_PKG_LICENSE="LGPL-2.1" TERMUX_PKG_MAINTAINER="@termux" -TERMUX_PKG_VERSION="1:5.14.0" -TERMUX_PKG_REVISION=1 +TERMUX_PKG_VERSION="1:5.15.0" TERMUX_PKG_SRCURL=https://github.com/luanti-org/luanti/archive/refs/tags/${TERMUX_PKG_VERSION:2}.tar.gz -TERMUX_PKG_SHA256=b9f561fa37db3c7ea1b8ba15cfede8282b7a79b9e939b0357269c8b037cf5aea +TERMUX_PKG_SHA256=07e044df0b87c83f78d8fe143f01693203b0ccc9dad6ed9c99b7f7b886c35313 TERMUX_PKG_AUTO_UPDATE=true -TERMUX_PKG_DEPENDS="freetype, jsoncpp, libandroid-spawn, libc++, libcurl, libgmp, libjpeg-turbo, libiconv, luajit, libpng, libsqlite, libvorbis, libx11, libxi, luanti-common, openal-soft, opengl, xdg-utils, zlib, zstd" -# In 5.12.0, luanti upstream officially migrated to SDL2, -# but for now, enabling SDL2 in Termux would: -# - disable EGL support, which would significantly reduce performance and driver compatibility -# - make the colors of everything strangely washed out -# so it makes more sense to keep SDL2 disabled in this luanti for now, -# since the non-SDL2 mode seems to continue to work without problems. -# Enable SDL2 in the future when possible, after the above problems are gone. +TERMUX_PKG_DEPENDS="freetype, jsoncpp, libandroid-spawn, libc++, libcurl, libgmp, libjpeg-turbo, libiconv, luajit, libpng, libsqlite, libvorbis, luanti-common, openal-soft, opengl, sdl3, xdg-utils, zlib, zstd" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DBUILD_SERVER=TRUE -DBUILD_BENCHMARKS=TRUE @@ -32,7 +24,7 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DENABLE_LTO=FALSE -DENABLE_REDIS=FALSE -DENABLE_PROMETHEUS=FALSE --DUSE_SDL2=FALSE +-DUSE_SDL3=TRUE " termux_step_pre_configure() {