Skip to content

Commit

Permalink
addpkg(x11/luanti{-common,-server}): moved from TUR
Browse files Browse the repository at this point in the history
Copied and pasted from https://github.com/termux-user-repository/tur/tree/master/tur/luanti

Previous documentation here:
- termux-user-repository/tur#1295
- termux-user-repository/tur#1296
- termux-user-repository/tur#1331
- termux-user-repository/tur#1327

Summary of key points:

- for better performance than normal virglrenderer-android, test using [termux-wsi-layer](#22353) or [new virglrenderer](#22385)

- to use touchscreen input, set "Touchscreen input mode: Direct touch" in Termux:X11 settings

- to use keyboard input, set "Prefer scancodes" in Termux:X11 settings

- to use mouse input, set "Capture external pointer devices" in Termux:X11 settings

- 6 patches are unique to TUR/termux, but the patch 0001-enable-egl-without-sdl2.patch is
  a cherry pick of minetest/minetest@4838eb2
  • Loading branch information
robertkirkman committed Nov 29, 2024
1 parent c5ec411 commit 63d9e3b
Show file tree
Hide file tree
Showing 10 changed files with 1,260 additions and 0 deletions.
457 changes: 457 additions & 0 deletions x11-packages/luanti/0001-enable-egl-without-sdl2.patch

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Normally, Luanti does not set the EXECUTABLE_OUTPUT_PATH variable when cross-compiling is detected,
because Luanti does not officially cross-compile for any platforms that require EXECUTABLE_OUTPUT_PATH.

Later on elsewhere in the CMakeLists.txt, there is this logic: "if not ANDROID... then if UNIX...
then create a symlink in the EXECUTABLE_OUTPUT_PATH".

https://github.com/minetest/minetest/blob/6a1d22b2c516abbb9ce9670dedff47451317706f/src/CMakeLists.txt#L1045-L1054

A different patch, 0003-bionic-libc-x11-wsi-opengl-es-2.patch, replaces the ANDROID variable there
to force this codepath, but the reason this patch is not combined into that patch is because this patch
is technically only required for cross-compiling,
while building the package in non-cross-compiling mode does not actually require this
change in order to work, so it seemed appropriate to organize them in separate patches.

This prevents the error "CMake Error: failed to create symbolic link '/minetest': Permission denied",
which is the error that happens if EXECUTABLE_OUTPUT_PATH does not exist when that linked point
in the CMakeLists.txt is reached, and normally happens only when cross-compiling Luanti.
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -569,7 +569,7 @@ endif()

# When cross-compiling assume the user doesn't want to run the executable anyway,
# otherwise place it in <source dir>/bin/ since Luanti can only run from there.
-if(NOT CMAKE_CROSSCOMPILING)
+if(NOT DISABLING_THIS_BECAUSE_IT_IS_FOR_BUILDING_AN_APK)
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin")
endif()

Loading

0 comments on commit 63d9e3b

Please sign in to comment.