forked from libretro/Lakka-LibreELEC
easyrpg: update to 0.8 "Paralyze"
- update core - update liblcf (dep) - rebase CMakeLists.txt patch - add patch to fix build with libfmt10
This commit is contained in:
packages/lakka
lakka_depends/liblcf
libretro_cores/easyrpg
@ -1,5 +1,5 @@
|
||||
PKG_NAME="liblcf"
|
||||
PKG_VERSION="01b73de93cf80185fcdf3ffd4737dfdb9111a85e"
|
||||
PKG_VERSION="9c09529e3de0a4106470082ef48a00d4c3593c33"
|
||||
PKG_ARCH="any"
|
||||
PKG_LICENSE="MIT"
|
||||
PKG_SITE="https://github.com/EasyRPG/liblcf"
|
||||
|
@ -1,5 +1,5 @@
|
||||
PKG_NAME="easyrpg"
|
||||
PKG_VERSION="281be71fee034ea789308919b2a77c92b7446c20"
|
||||
PKG_VERSION="f8e41f43b619413f95847536412b56f85307d378"
|
||||
PKG_LICENSE="GPLv3"
|
||||
PKG_SITE="https://github.com/EasyRPG/Player"
|
||||
PKG_URL="${PKG_SITE}.git"
|
||||
|
@ -1,26 +1,29 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 2647565..5961fb0 100644
|
||||
index b6d498c..86bd78e 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -966,67 +966,14 @@ endif()
|
||||
@@ -1287,72 +1287,14 @@ endif()
|
||||
|
||||
# manpage
|
||||
# Handled as extra target "man"
|
||||
-set(MAN_NAME easyrpg-player.6)
|
||||
-find_program(A2X_EXECUTABLE NAMES a2x a2x.py)
|
||||
-find_program(ASCIIDOCTOR_EXECUTABLE asciidoctor)
|
||||
set(MANUAL_STATUS "Unavailable")
|
||||
-if(A2X_EXECUTABLE)
|
||||
- add_custom_command(OUTPUT resources/${MAN_NAME}
|
||||
- COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/resources
|
||||
- COMMAND ${A2X_EXECUTABLE} -a player_version="${PROJECT_VERSION}" -f manpage -D ${CMAKE_CURRENT_BINARY_DIR}/resources ${CMAKE_CURRENT_SOURCE_DIR}/resources/${MAN_NAME}.adoc
|
||||
- DEPENDS resources/${MAN_NAME}.adoc
|
||||
-if(ASCIIDOCTOR_EXECUTABLE)
|
||||
- add_custom_command(OUTPUT resources/unix/${MAN_NAME}
|
||||
- COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/resources/unix
|
||||
- COMMAND ${ASCIIDOCTOR_EXECUTABLE} -a player_version="${PLAYER_VERSION}"
|
||||
- -b manpage -D ${CMAKE_CURRENT_BINARY_DIR}/resources/unix
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/resources/unix/${MAN_NAME}.adoc
|
||||
- DEPENDS resources/unix/${MAN_NAME}.adoc
|
||||
- COMMENT "(Re-)building manpage ${MAN_NAME}"
|
||||
- VERBATIM)
|
||||
- if(UNIX)
|
||||
- add_custom_target(player_man ALL DEPENDS resources/${MAN_NAME})
|
||||
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/resources/${MAN_NAME} DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
|
||||
- add_custom_target(player_man ALL DEPENDS resources/unix/${MAN_NAME})
|
||||
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/resources/unix/${MAN_NAME}
|
||||
- DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
|
||||
- else()
|
||||
- add_custom_target(player_man DEPENDS resources/${MAN_NAME})
|
||||
- add_custom_target(player_man DEPENDS resources/unix/${MAN_NAME})
|
||||
- endif()
|
||||
- if(NOT TARGET man)
|
||||
- add_custom_target(man)
|
||||
@ -28,9 +31,9 @@ index 2647565..5961fb0 100644
|
||||
- add_dependencies(man player_man)
|
||||
- set(MANUAL_STATUS "Generated")
|
||||
-else()
|
||||
- # no a2x, distribution archive?
|
||||
- if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/resources/${MAN_NAME})
|
||||
- install(FILES resources/${MAN_NAME} DESTINATION share/man/man6)
|
||||
- # no asciidoctor, distribution archive?
|
||||
- if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/resources/unix/${MAN_NAME})
|
||||
- install(FILES resources/unix/${MAN_NAME} DESTINATION share/man/man6)
|
||||
- set(MANUAL_STATUS "Bundled")
|
||||
- endif()
|
||||
-endif()
|
||||
@ -50,9 +53,11 @@ index 2647565..5961fb0 100644
|
||||
-if(DOXYGEN_FOUND)
|
||||
- set(DOXYGEN_STATUS "Available (target \"doc\")")
|
||||
- # fake autotools variables
|
||||
- set(PACKAGE_VERSION ${PLAYER_VERSION})
|
||||
- set(DX_DOCDIR ${CMAKE_CURRENT_BINARY_DIR}/doc)
|
||||
- set(srcdir ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
- configure_file(resources/Doxyfile.in resources/Doxyfile @ONLY)
|
||||
- unset(PACKAGE_VERSION)
|
||||
- unset(DX_DOCDIR)
|
||||
- unset(srcdir)
|
||||
-
|
||||
|
218
packages/lakka/libretro_cores/easyrpg/patches/easyrpg-fix_building_with_fmtlib10.patch
Normal file
218
packages/lakka/libretro_cores/easyrpg/patches/easyrpg-fix_building_with_fmtlib10.patch
Normal file
@ -0,0 +1,218 @@
|
||||
From a4672d2e30db4e4918c8f3580236faed3c9d04c1 Mon Sep 17 00:00:00 2001
|
||||
From: Ghabry <gabriel+github@mastergk.de>
|
||||
Date: Sun, 14 May 2023 14:41:13 +0200
|
||||
Subject: [PATCH] Fix building with fmtlib 10
|
||||
|
||||
to_string_view is a private API since fmt10.
|
||||
|
||||
The new API only works properly since fmt8.
|
||||
|
||||
Added casts to enum formating as they are not converted automatically anymore.
|
||||
|
||||
Fix #3002
|
||||
---
|
||||
CMakeLists.txt | 1 +
|
||||
Makefile.am | 1 +
|
||||
src/game_interpreter.cpp | 6 +++---
|
||||
src/game_interpreter_map.cpp | 2 +-
|
||||
src/output.h | 9 ---------
|
||||
src/player.cpp | 2 +-
|
||||
src/string_view.cpp | 34 ++++++++++++++++++++++++++++++++++
|
||||
src/string_view.h | 27 ++++++++++++++++++++++++---
|
||||
8 files changed, 65 insertions(+), 17 deletions(-)
|
||||
create mode 100644 src/string_view.cpp
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 8507e5d103..28d595a214 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -345,6 +345,7 @@ add_library(${PROJECT_NAME} OBJECT
|
||||
src/state.cpp
|
||||
src/state.h
|
||||
src/std_clock.h
|
||||
+ src/string_view.cpp
|
||||
src/string_view.h
|
||||
src/system.h
|
||||
src/teleport_target.h
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index bed1b21941..4c4774892c 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -327,6 +327,7 @@ libeasyrpg_player_a_SOURCES = \
|
||||
src/state.cpp \
|
||||
src/state.h \
|
||||
src/std_clock.h \
|
||||
+ src/string_view.cpp \
|
||||
src/string_view.h \
|
||||
src/system.h \
|
||||
src/teleport_target.h \
|
||||
diff --git a/src/game_interpreter.cpp b/src/game_interpreter.cpp
|
||||
index 7877d77ff4..7ae056ccfb 100644
|
||||
--- a/src/game_interpreter.cpp
|
||||
+++ b/src/game_interpreter.cpp
|
||||
@@ -2187,7 +2187,7 @@ bool Game_Interpreter::CommandChangeVehicleGraphic(lcf::rpg::EventCommand const&
|
||||
Game_Vehicle* vehicle = Game_Map::GetVehicle(vehicle_id);
|
||||
|
||||
if (!vehicle) {
|
||||
- Output::Warning("ChangeVehicleGraphic: Invalid vehicle ID {}", vehicle_id);
|
||||
+ Output::Warning("ChangeVehicleGraphic: Invalid vehicle ID {}", static_cast<int>(vehicle_id));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2261,7 +2261,7 @@ bool Game_Interpreter::CommandSetVehicleLocation(lcf::rpg::EventCommand const& c
|
||||
// 0 because we adjust all vehicle IDs by +1 to match the lcf values
|
||||
Output::Debug("SetVehicleLocation: Party referenced");
|
||||
} else {
|
||||
- Output::Warning("SetVehicleLocation: Invalid vehicle ID {}", vehicle_id);
|
||||
+ Output::Warning("SetVehicleLocation: Invalid vehicle ID {}", static_cast<int>(vehicle_id));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -3494,7 +3494,7 @@ bool Game_Interpreter::CommandConditionalBranch(lcf::rpg::EventCommand const& co
|
||||
Game_Vehicle* vehicle = Game_Map::GetVehicle(vehicle_id);
|
||||
|
||||
if (!vehicle) {
|
||||
- Output::Warning("ConditionalBranch: Invalid vehicle ID {}", vehicle_id);
|
||||
+ Output::Warning("ConditionalBranch: Invalid vehicle ID {}", static_cast<int>(vehicle_id));
|
||||
return true;
|
||||
}
|
||||
|
||||
diff --git a/src/game_interpreter_map.cpp b/src/game_interpreter_map.cpp
|
||||
index 6c193c2f31..0b47a3db61 100644
|
||||
--- a/src/game_interpreter_map.cpp
|
||||
+++ b/src/game_interpreter_map.cpp
|
||||
@@ -345,7 +345,7 @@ bool Game_Interpreter_Map::CommandEndShop(lcf::rpg::EventCommand const& /* com *
|
||||
|
||||
bool Game_Interpreter_Map::CommandShowInn(lcf::rpg::EventCommand const& com) { // code 10730
|
||||
int inn_type = com.parameters[0];
|
||||
- auto inn_price = com.parameters[1];
|
||||
+ int inn_price = com.parameters[1];
|
||||
// Not used, but left here for documentation purposes
|
||||
// bool has_inn_handlers = com.parameters[2] != 0;
|
||||
|
||||
diff --git a/src/output.h b/src/output.h
|
||||
index 90e1118958..78ff3c0cad 100644
|
||||
--- a/src/output.h
|
||||
+++ b/src/output.h
|
||||
@@ -22,17 +22,8 @@
|
||||
#include <string>
|
||||
#include <iosfwd>
|
||||
#include <fmt/core.h>
|
||||
-#include <lcf/dbstring.h>
|
||||
-
|
||||
#include "filesystem_stream.h"
|
||||
|
||||
-namespace lcf {
|
||||
-// FIXME: liblcf doesn't depend on fmt, so we need to add this here to enable fmtlib support for lcf::DBString
|
||||
-inline fmt::basic_string_view<char> to_string_view(const lcf::DBString& s) {
|
||||
- return to_string_view(StringView(s));
|
||||
-}
|
||||
-}
|
||||
-
|
||||
enum class LogLevel {
|
||||
Error,
|
||||
Warning,
|
||||
diff --git a/src/player.cpp b/src/player.cpp
|
||||
index 0ed6bbb657..654d31e0dc 100644
|
||||
--- a/src/player.cpp
|
||||
+++ b/src/player.cpp
|
||||
@@ -1240,7 +1240,7 @@ void Player::SetupBattleTest() {
|
||||
}
|
||||
|
||||
Output::Debug("BattleTest Mode 2k3 troop=({}) background=({}) formation=({}) condition=({}) terrain=({})",
|
||||
- args.troop_id, args.background.c_str(), args.formation, args.condition, args.terrain_id);
|
||||
+ args.troop_id, args.background, static_cast<int>(args.formation), static_cast<int>(args.condition), args.terrain_id);
|
||||
} else {
|
||||
Output::Debug("BattleTest Mode 2k troop=({}) background=({})", args.troop_id, args.background);
|
||||
}
|
||||
diff --git a/src/string_view.cpp b/src/string_view.cpp
|
||||
new file mode 100644
|
||||
index 0000000000..13a526504d
|
||||
--- /dev/null
|
||||
+++ b/src/string_view.cpp
|
||||
@@ -0,0 +1,34 @@
|
||||
+/*
|
||||
+ * This file is part of EasyRPG Player.
|
||||
+ *
|
||||
+ * EasyRPG Player is free software: you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation, either version 3 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * EasyRPG Player is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with EasyRPG Player. If not, see <http://www.gnu.org/licenses/>.
|
||||
+ */
|
||||
+
|
||||
+#include "string_view.h"
|
||||
+
|
||||
+#if FMT_VERSION >= EP_FMT_MODERN_VERSION
|
||||
+
|
||||
+#include <fmt/format.h>
|
||||
+
|
||||
+auto fmt::formatter<lcf::DBString>::format(const lcf::DBString& s, format_context& ctx) const -> decltype(ctx.out()) {
|
||||
+ string_view sv(s.data(), s.size());
|
||||
+ return formatter<string_view>::format(sv, ctx);
|
||||
+}
|
||||
+
|
||||
+auto fmt::formatter<lcf::StringView>::format(const lcf::StringView& s, format_context& ctx) const -> decltype(ctx.out()) {
|
||||
+ string_view sv(s.data(), s.size());
|
||||
+ return formatter<string_view>::format(sv, ctx);
|
||||
+}
|
||||
+
|
||||
+#endif
|
||||
diff --git a/src/string_view.h b/src/string_view.h
|
||||
index 11e3550d5f..030bb09a10 100644
|
||||
--- a/src/string_view.h
|
||||
+++ b/src/string_view.h
|
||||
@@ -22,9 +22,9 @@
|
||||
#include <lcf/dbstring.h>
|
||||
#include <fmt/core.h>
|
||||
|
||||
-// FIXME: needed to allow building with fmt 5, older versions are untested.
|
||||
+// Needed to allow building with fmt 5, older versions are untested.
|
||||
#if FMT_VERSION < 60000
|
||||
-#include <fmt/ostream.h>
|
||||
+# include <fmt/ostream.h>
|
||||
#endif
|
||||
|
||||
using StringView = lcf::StringView;
|
||||
@@ -33,12 +33,33 @@ using U32StringView = lcf::U32StringView;
|
||||
using lcf::ToString;
|
||||
using lcf::ToStringView;
|
||||
|
||||
+// Version required to use the new formatting API
|
||||
+#define EP_FMT_MODERN_VERSION 80000
|
||||
+
|
||||
// FIXME: liblcf doesn't depend on fmt, so we need to add this here to enable fmtlib support for our StringView.
|
||||
+#if FMT_VERSION >= EP_FMT_MODERN_VERSION
|
||||
+template<>
|
||||
+struct fmt::formatter<lcf::StringView> : fmt::formatter<fmt::string_view> {
|
||||
+ auto format(const lcf::StringView& s, format_context& ctx) const -> decltype(ctx.out());
|
||||
+};
|
||||
+
|
||||
+template<>
|
||||
+struct fmt::formatter<lcf::DBString> : formatter<string_view> {
|
||||
+ auto format(const lcf::DBString& s, format_context& ctx) const -> decltype(ctx.out());
|
||||
+};
|
||||
+#else
|
||||
namespace nonstd { namespace sv_lite {
|
||||
template <typename C, typename T>
|
||||
inline fmt::basic_string_view<C> to_string_view(basic_string_view<C,T> s) {
|
||||
- return fmt::basic_string_view<C>(s.data(), s.size());
|
||||
+ return fmt::basic_string_view<C>(s.data(), s.size());
|
||||
}
|
||||
} }
|
||||
|
||||
+namespace lcf {
|
||||
+inline fmt::basic_string_view<char> to_string_view(const lcf::DBString& s) {
|
||||
+ return to_string_view(StringView(s));
|
||||
+}
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
#endif
|
Reference in New Issue
Block a user