From 236b282e8bbd775e679b6ca96356d22b1fad9d08 Mon Sep 17 00:00:00 2001 From: Fervi Date: Tue, 12 Aug 2025 18:43:42 +0200 Subject: [PATCH] Newpkg: X-Moto --- tur-on-device/xmoto/build.sh | 15 +++++ .../xmoto/installation-directories.patch | 58 +++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 tur-on-device/xmoto/build.sh create mode 100644 tur-on-device/xmoto/installation-directories.patch diff --git a/tur-on-device/xmoto/build.sh b/tur-on-device/xmoto/build.sh new file mode 100644 index 0000000000..0e7db23472 --- /dev/null +++ b/tur-on-device/xmoto/build.sh @@ -0,0 +1,15 @@ +TERMUX_PKG_HOMEPAGE=https://xmoto.tuxfamily.org/ +TERMUX_PKG_DESCRIPTION="A challenging 2D motocross platform game" +TERMUX_PKG_LICENSE="GPL-2.0" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION="0.6.3" +TERMUX_PKG_SRCURL=https://github.com/xmoto/xmoto/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_SHA256=64cb29934660456ec82cebdaa0d3d273a862e10760e8ee80443928d317242484 +TERMUX_PKG_DEPENDS="libx11, libjpeg-turbo, libpng, lua54, sdl2, sdl2-mixer, sdl2-net, libcurl, bzip2, libxdg-basedir, sdl2-ttf, glu, game-music-emu, libwavpack" +TERMUX_PKG_AUTO_UPDATE=true + +termux_step_pre_configure() { + if [ "${TERMUX_ON_DEVICE_BUILD}" = false ]; then + termux_error_exit "This package doesn't support cross-compiling." + fi +} diff --git a/tur-on-device/xmoto/installation-directories.patch b/tur-on-device/xmoto/installation-directories.patch new file mode 100644 index 0000000000..8e2f2874ab --- /dev/null +++ b/tur-on-device/xmoto/installation-directories.patch @@ -0,0 +1,58 @@ +diff -ur orig/bin/CMakeLists.txt mod/bin/CMakeLists.txt +--- orig/bin/CMakeLists.txt 2025-03-31 15:04:05.000000000 +0200 ++++ mod/bin/CMakeLists.txt 2025-08-12 17:10:06.387231016 +0200 +@@ -55,7 +55,7 @@ + ) + ") + else() +- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/xmoto.bin" DESTINATION share/xmoto) +- install(DIRECTORY Textures/Musics DESTINATION share/xmoto/Textures) +- install(DIRECTORY Textures/Fonts DESTINATION share/xmoto/Textures) ++ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/xmoto.bin" DESTINATION share/games/xmoto) ++ install(DIRECTORY Textures/Musics DESTINATION share/games/xmoto/Textures) ++ install(DIRECTORY Textures/Fonts DESTINATION share/games/xmoto/Textures) + endif() +diff -ur orig/extra/CMakeLists.txt mod/extra/CMakeLists.txt +--- orig/extra/CMakeLists.txt 2025-03-31 15:04:05.000000000 +0200 ++++ mod/extra/CMakeLists.txt 2025-08-12 17:10:06.390564349 +0200 +@@ -13,6 +13,6 @@ + FILES + xmoto.bmp + xmoto.ico +- DESTINATION share/xmoto ++ DESTINATION share/games/xmoto + ) + endif() +diff -ur orig/src/CMakeLists.txt mod/src/CMakeLists.txt +--- orig/src/CMakeLists.txt 2025-03-31 15:04:05.000000000 +0200 ++++ mod/src/CMakeLists.txt 2025-08-12 17:10:06.390564349 +0200 +@@ -599,7 +599,7 @@ + MACOSX_PACKAGE_LOCATION "Resources/locale/${lang}/LC_MESSAGES" + ) + else() +- install(FILES "${mo}" DESTINATION share/locale/${lang}/LC_MESSAGES) ++ install(FILES "${mo}" DESTINATION share/games/locale/${lang}/LC_MESSAGES) + endif() + + add_custom_command(OUTPUT "${mo}" +diff -ur orig/src/common/VFileIO.cpp mod/src/common/VFileIO.cpp +--- orig/src/common/VFileIO.cpp 2025-03-31 15:04:05.000000000 +0200 ++++ mod/src/common/VFileIO.cpp 2025-08-12 17:11:42.413907249 +0200 +@@ -1350,7 +1350,7 @@ + /* Try some default fallbacks */ + if (!m_bGotSystemDataDir) { + const std::vector dataDirs = { +- "/usr/share", "/usr/local/share", ++ "@TERMUX_PREFIX@/share/games" + }; + + for (auto &dir : dataDirs) { +@@ -1364,7 +1364,7 @@ + + /* Default to /usr/share */ + if (!m_bGotSystemDataDir) { +- m_SystemDataDir = "/usr/share"; ++ m_SystemDataDir = "@TERMUX_PREFIX@/share/games"; + } + + m_SystemLocaleDir = m_SystemDataDir + "/locale";