Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions tur/lugaru/Fix-mismatched-usage-length-build-fail-on-g.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
From dd685fe9080c2853422d8272792691358ea07dfc Mon Sep 17 00:00:00 2001
From: Martin Erik Werner <[email protected]>
Date: Wed, 8 Mar 2017 22:51:16 +0100
Subject: [PATCH] Fix mismatched usage length, build fail on g++
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The length of const option::Descriptor usage[] is intended to be
inferred based on the initialisation in Source/main.cpp, however, the
extern declaration in Source/Game.hpp hard-codes it to 13.

Remove the hard-coded 13 in the extern declaration, in favour of the
inferred length.

This also fixes the following build failure with g++ (Debian 4.9.2-10)
4.9.2:
(...)/Source/main.cpp:602:5: error: uninitialized const member ‘option::Descriptor::index’
};
^
(...)/Source/main.cpp:602:5: warning: missing initializer for member ‘option::Descriptor::index’ [-Wmissing-field-initializers]
(...)/Source/main.cpp:602:5: error: uninitialized const member ‘option::Descriptor::type’
(...)/Source/main.cpp:602:5: warning: missing initializer for member ‘option::Descriptor::type’ [-Wmissing-field-initializers]
(...)/Source/main.cpp:602:5: error: uninitialized const member ‘option::Descriptor::shortopt’
(...)/Source/main.cpp:602:5: warning: missing initializer for member ‘option::Descriptor::shortopt’ [-Wmissing-field-initializers]
(...)/Source/main.cpp:602:5: error: uninitialized const member ‘option::Descriptor::longopt’
(...)/Source/main.cpp:602:5: warning: missing initializer for member ‘option::Descriptor::longopt’ [-Wmissing-field-initializers]
(...)/Source/main.cpp:602:5: error: uninitialized const member ‘option::Descriptor::check_arg’
(...)/Source/main.cpp:602:5: warning: missing initializer for member ‘option::Descriptor::check_arg’ [-Wmissing-field-initializers]
(...)/Source/main.cpp:602:5: warning: missing initializer for member ‘option::Descriptor::help’ [-Wmissing-field-initializers]
CMakeFiles/lugaru.dir/build.make:54: recipe for target 'CMakeFiles/lugaru.dir/Source/main.cpp.o' failed

Signed-off-by: Martin Erik Werner <[email protected]>
---
Source/Game.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Source/Game.hpp b/Source/Game.hpp
index 51232cc..9bb6adb 100644
--- a/Source/Game.hpp
+++ b/Source/Game.hpp
@@ -234,7 +234,7 @@ enum optionIndex
/* Number of options + 1 */
const int commandLineOptionsNumber = 10;

-extern const option::Descriptor usage[13];
+extern const option::Descriptor usage[];

extern option::Option commandLineOptions[commandLineOptionsNumber];
extern option::Option* commandLineOptionsBuffer;
--
2.1.4

19 changes: 19 additions & 0 deletions tur/lugaru/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
TERMUX_PKG_HOMEPAGE=https://osslugaru.gitlab.io
TERMUX_PKG_DESCRIPTION="Lugaru HD, free and open source ninja rabbit fighting game"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@IntinteDAO"
TERMUX_PKG_VERSION="1.2"
TERMUX_PKG_SRCURL=https://github.com/osslugaru/lugaru/releases/download/${TERMUX_PKG_VERSION}/lugaru-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=f3ea477caf78911c69939fbdc163f9f6517c7ef2267e716a0e050be1a166ef97
TERMUX_PKG_DEPENDS="sdl2, glu, openal-soft, lugaru-data"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-DCMAKE_INSTALL_PREFIX=$TERMUX_PREFIX
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is automatically applied by termux_step_configure_cmake() and is not necessary to specify explicitly here.

-DSYSTEM_INSTALL=ON
-DCMAKE_INSTALL_BINDIR=bin
-DCMAKE_INSTALL_DATADIR=share/games
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This additional patch is also necessary in order to fix the second error that occurs with CMake 4:

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,6 @@
 project(lugaru)
 
 cmake_minimum_required(VERSION 3.0)
-cmake_policy(SET CMP0004 OLD)
 
 include(FindPkgConfig)
 include(GNUInstallDirs)

"

termux_step_pre_configure() {
export LDFLAGS+=" -Wl,--no-as-needed,-lOpenSLES,--as-needed"
}
12 changes: 12 additions & 0 deletions tur/lugaru/fix-sound-loading-on-android.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff -ur orig/Source/Audio/openal_wrapper.cpp mod/Source/Audio/openal_wrapper.cpp
--- orig/Source/Audio/openal_wrapper.cpp 2017-02-11 20:09:37.000000000 +0100
+++ mod/Source/Audio/openal_wrapper.cpp 2025-07-06 10:30:30.359535461 +0200
@@ -316,7 +316,7 @@
// !!! FIXME: if it's not Ogg, we don't have a decoder. I'm lazy. :/
char* fname = (char*)alloca(strlen(_fname) + 16);
strcpy(fname, _fname);
- char* ptr = strchr(fname, '.');
+ char* ptr = strrchr(fname, '.');
if (ptr) {
*ptr = '\0';
}
14 changes: 14 additions & 0 deletions tur/lugaru/install_appdata_in_metainfo.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Author: Vincent Prat <[email protected]>
Description: Change the destination of AppData files from /usr/share/metadata to /usr/share/metainfo
Forwarded: not-needed
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -306,7 +306,7 @@
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/lugaru DESTINATION ${CMAKE_INSTALL_BINDIR})
# Trailing '/' is significant, it installs and _renames_ Data/ as the destination folder
install(DIRECTORY ${CMAKE_SOURCE_DIR}/Data/ DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME})
- install(FILES ${CMAKE_SOURCE_DIR}/Dist/Linux/lugaru.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/appdata)
+ install(FILES ${CMAKE_SOURCE_DIR}/Dist/Linux/lugaru.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
install(FILES ${CMAKE_SOURCE_DIR}/Dist/Linux/lugaru.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
install(FILES ${CMAKE_SOURCE_DIR}/Dist/Linux/lugaru.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps)
install(FILES ${CMAKE_SOURCE_DIR}/Dist/Linux/lugaru.6 DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
6 changes: 6 additions & 0 deletions tur/lugaru/lugaru-data.subpackage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
TERMUX_SUBPKG_DESCRIPTION="Data files for Lugaru"
TERMUX_SUBPKG_PLATFORM_INDEPENDENT=true
TERMUX_SUBPKG_DEPEND_ON_PARENT=no
TERMUX_SUBPKG_INCLUDE="
share/games/lugaru
"
Loading