Skip to content

Commit 236b282

Browse files
committed
Newpkg: X-Moto
1 parent ec92583 commit 236b282

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

tur-on-device/xmoto/build.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
TERMUX_PKG_HOMEPAGE=https://xmoto.tuxfamily.org/
2+
TERMUX_PKG_DESCRIPTION="A challenging 2D motocross platform game"
3+
TERMUX_PKG_LICENSE="GPL-2.0"
4+
TERMUX_PKG_MAINTAINER="@termux"
5+
TERMUX_PKG_VERSION="0.6.3"
6+
TERMUX_PKG_SRCURL=https://github.com/xmoto/xmoto/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
7+
TERMUX_PKG_SHA256=64cb29934660456ec82cebdaa0d3d273a862e10760e8ee80443928d317242484
8+
TERMUX_PKG_DEPENDS="libx11, libjpeg-turbo, libpng, lua54, sdl2, sdl2-mixer, sdl2-net, libcurl, bzip2, libxdg-basedir, sdl2-ttf, glu, game-music-emu, libwavpack"
9+
TERMUX_PKG_AUTO_UPDATE=true
10+
11+
termux_step_pre_configure() {
12+
if [ "${TERMUX_ON_DEVICE_BUILD}" = false ]; then
13+
termux_error_exit "This package doesn't support cross-compiling."
14+
fi
15+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
diff -ur orig/bin/CMakeLists.txt mod/bin/CMakeLists.txt
2+
--- orig/bin/CMakeLists.txt 2025-03-31 15:04:05.000000000 +0200
3+
+++ mod/bin/CMakeLists.txt 2025-08-12 17:10:06.387231016 +0200
4+
@@ -55,7 +55,7 @@
5+
)
6+
")
7+
else()
8+
- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/xmoto.bin" DESTINATION share/xmoto)
9+
- install(DIRECTORY Textures/Musics DESTINATION share/xmoto/Textures)
10+
- install(DIRECTORY Textures/Fonts DESTINATION share/xmoto/Textures)
11+
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/xmoto.bin" DESTINATION share/games/xmoto)
12+
+ install(DIRECTORY Textures/Musics DESTINATION share/games/xmoto/Textures)
13+
+ install(DIRECTORY Textures/Fonts DESTINATION share/games/xmoto/Textures)
14+
endif()
15+
diff -ur orig/extra/CMakeLists.txt mod/extra/CMakeLists.txt
16+
--- orig/extra/CMakeLists.txt 2025-03-31 15:04:05.000000000 +0200
17+
+++ mod/extra/CMakeLists.txt 2025-08-12 17:10:06.390564349 +0200
18+
@@ -13,6 +13,6 @@
19+
FILES
20+
xmoto.bmp
21+
xmoto.ico
22+
- DESTINATION share/xmoto
23+
+ DESTINATION share/games/xmoto
24+
)
25+
endif()
26+
diff -ur orig/src/CMakeLists.txt mod/src/CMakeLists.txt
27+
--- orig/src/CMakeLists.txt 2025-03-31 15:04:05.000000000 +0200
28+
+++ mod/src/CMakeLists.txt 2025-08-12 17:10:06.390564349 +0200
29+
@@ -599,7 +599,7 @@
30+
MACOSX_PACKAGE_LOCATION "Resources/locale/${lang}/LC_MESSAGES"
31+
)
32+
else()
33+
- install(FILES "${mo}" DESTINATION share/locale/${lang}/LC_MESSAGES)
34+
+ install(FILES "${mo}" DESTINATION share/games/locale/${lang}/LC_MESSAGES)
35+
endif()
36+
37+
add_custom_command(OUTPUT "${mo}"
38+
diff -ur orig/src/common/VFileIO.cpp mod/src/common/VFileIO.cpp
39+
--- orig/src/common/VFileIO.cpp 2025-03-31 15:04:05.000000000 +0200
40+
+++ mod/src/common/VFileIO.cpp 2025-08-12 17:11:42.413907249 +0200
41+
@@ -1350,7 +1350,7 @@
42+
/* Try some default fallbacks */
43+
if (!m_bGotSystemDataDir) {
44+
const std::vector<std::string> dataDirs = {
45+
- "/usr/share", "/usr/local/share",
46+
+ "@TERMUX_PREFIX@/share/games"
47+
};
48+
49+
for (auto &dir : dataDirs) {
50+
@@ -1364,7 +1364,7 @@
51+
52+
/* Default to /usr/share */
53+
if (!m_bGotSystemDataDir) {
54+
- m_SystemDataDir = "/usr/share";
55+
+ m_SystemDataDir = "@TERMUX_PREFIX@/share/games";
56+
}
57+
58+
m_SystemLocaleDir = m_SystemDataDir + "/locale";

0 commit comments

Comments
 (0)