commit:     28bf25873e91002685303b7bb7a164879c57f64a
Author:     Alexey Sokolov <alexey+gentoo <AT> asokolov <DOT> org>
AuthorDate: Mon Aug 18 07:14:45 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Sep  4 20:48:37 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=28bf2587

games-roguelike/tome: switch upstream, add 2.4.0_p20250227

Closes: https://bugs.gentoo.org/944440
Signed-off-by: Alexey Sokolov <alexey+gentoo <AT> asokolov.org>
Part-of: https://github.com/gentoo/gentoo/pull/43482
Closes: https://github.com/gentoo/gentoo/pull/43482
Signed-off-by: Sam James <sam <AT> gentoo.org>

 games-roguelike/tome/Manifest                      |   1 +
 games-roguelike/tome/files/tome-2.4.0-boost.patch  |  13 +
 games-roguelike/tome/files/tome-2.4.0-cmake4.patch |  37 ++
 .../tome/files/tome-2.4.0-datadir.patch            |  13 +
 games-roguelike/tome/files/tome-2.4.0-fmt.patch    | 400 +++++++++++++++++++++
 games-roguelike/tome/files/tome-2.4.0-header.patch |  12 +
 games-roguelike/tome/files/tome-2.4.0-json.patch   | 103 ++++++
 games-roguelike/tome/files/tome-2.4.0-order.patch  |  12 +
 games-roguelike/tome/tome-2.4.0_p20250227.ebuild   |  60 ++++
 licenses/ToME2-theme                               |   3 +
 10 files changed, 654 insertions(+)

diff --git a/games-roguelike/tome/Manifest b/games-roguelike/tome/Manifest
index 84ab85623f4f..3ba0e1ce507a 100644
--- a/games-roguelike/tome/Manifest
+++ b/games-roguelike/tome/Manifest
@@ -1 +1,2 @@
+DIST tome-2.4.0_p20250227.tar.gz 2554393 BLAKE2B 
c919ad0b1d63a600b19bd2df02c826a9245b210817aae43b34ef8317d1ab67fecdfe9ede489b20f567329f03e121c5f8067ef251367b02888c5b20855f203fb8
 SHA512 
5a55bba7d5c8f200625c73851bd09b0d3cc253b963d20e86776d3f24c8374be779fc66918c3f81f88d035985c13fd9c8658abba444b888d987c8e3417cc16e6d
 DIST tome-235-src.tar.bz2 2951227 BLAKE2B 
7a9a6c608873062f9d6deae38c7e39244ca25d2bbb553d338014078c86b9decc36869c2f39f875425f9c3bb26784d3e460a225c5dabd197437781488f3e15d74
 SHA512 
f456aa91d18397297c213fa67dd14a4d29e024525be99f83b22cbe42f4d426b57fe6115a7124e3ec34de8f351117de525eab996ba7a2a230119e43639c4c9205

diff --git a/games-roguelike/tome/files/tome-2.4.0-boost.patch 
b/games-roguelike/tome/files/tome-2.4.0-boost.patch
new file mode 100644
index 000000000000..49faaf046ef1
--- /dev/null
+++ b/games-roguelike/tome/files/tome-2.4.0-boost.patch
@@ -0,0 +1,13 @@
+https://github.com/tome2/tome2/pull/74
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -63,7 +63,7 @@ SET(LIBS ${LIBS} m)
+ #
+ # BOOST
+ #
+-FIND_PACKAGE(Boost 1.54.0 COMPONENTS system filesystem)
++FIND_PACKAGE(Boost 1.54.0 COMPONENTS system filesystem CONFIG)
+ SET_PACKAGE_PROPERTIES(Boost PROPERTIES TYPE REQUIRED)
+ 
+ IF(Boost_FOUND)

diff --git a/games-roguelike/tome/files/tome-2.4.0-cmake4.patch 
b/games-roguelike/tome/files/tome-2.4.0-cmake4.patch
new file mode 100644
index 000000000000..f909a15d445e
--- /dev/null
+++ b/games-roguelike/tome/files/tome-2.4.0-cmake4.patch
@@ -0,0 +1,37 @@
+https://github.com/tome2/tome2/pull/75
+
+--- a/vendor/CppQuickCheck-2018-03-28/CMakeLists.txt
++++ b/vendor/CppQuickCheck-2018-03-28/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-cmake_minimum_required(VERSION 2.6)
++cmake_minimum_required(VERSION 2.6...3.15)
+ project(CppQuickCheck)
+ set(CMAKE_CXX_FLAGS "-O3 -g -Wall -std=c++11")
+ 
+--- a/vendor/bandit/CMakeLists.txt
++++ b/vendor/bandit/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-cmake_minimum_required(VERSION 2.8)
++cmake_minimum_required(VERSION 2.8...3.15)
+ project(bandit)
+ 
+ option(BANDIT_BUILD_SPECS   "Build the Bandit specs"                ON)
+--- a/vendor/bandit/bandit/assertion_frameworks/snowhouse/CMakeLists.txt
++++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-cmake_minimum_required(VERSION 2.8)
++cmake_minimum_required(VERSION 2.8...3.15)
+ 
+ project(snowhouse)
+ 
+--- a/vendor/bandit/cmake/cotire.cmake
++++ b/vendor/bandit/cmake/cotire.cmake
+@@ -39,7 +39,7 @@ if (NOT CMAKE_SCRIPT_MODE_FILE)
+ endif()
+ # we need the CMake variables CMAKE_SCRIPT_MODE_FILE and CMAKE_ARGV available 
since 2.8.5
+ # we need APPEND_STRING option for set_property available since 2.8.6
+-cmake_minimum_required(VERSION 2.8.6)
++cmake_minimum_required(VERSION 2.8.6...3.15)
+ if (NOT CMAKE_SCRIPT_MODE_FILE)
+       cmake_policy(POP)
+ endif()

diff --git a/games-roguelike/tome/files/tome-2.4.0-datadir.patch 
b/games-roguelike/tome/files/tome-2.4.0-datadir.patch
new file mode 100644
index 000000000000..3c50cf8890ea
--- /dev/null
+++ b/games-roguelike/tome/files/tome-2.4.0-datadir.patch
@@ -0,0 +1,13 @@
+https://github.com/tome2/tome2/pull/76
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -100,7 +100,7 @@ endif(WIN32)
+ # Set the path for loading the library bits.
+ #
+ IF(SYSTEM_INSTALL)
+-  SET(DEFAULT_PATH "${CMAKE_INSTALL_PREFIX}/lib/tome")
++  SET(DEFAULT_PATH "${CMAKE_INSTALL_PREFIX}/share/tome")
+ ELSE()
+   SET(DEFAULT_PATH "./lib")
+ ENDIF()

diff --git a/games-roguelike/tome/files/tome-2.4.0-fmt.patch 
b/games-roguelike/tome/files/tome-2.4.0-fmt.patch
new file mode 100644
index 000000000000..a04f089f90bd
--- /dev/null
+++ b/games-roguelike/tome/files/tome-2.4.0-fmt.patch
@@ -0,0 +1,400 @@
+https://github.com/tome2/tome2/pull/78
+Compatibility with the packaged version of dev-libs/libfmt
+
+--- a/src/cmd2.cc
++++ b/src/cmd2.cc
+@@ -18,6 +18,7 @@
+ #include "feature_flag.hpp"
+ #include "feature_type.hpp"
+ #include "files.hpp"
++#include "format_ext.hpp"
+ #include "game.hpp"
+ #include "gods.hpp"
+ #include "hook_chat_in.hpp"
+--- a/src/cmd3.cc
++++ b/src/cmd3.cc
+@@ -12,6 +12,7 @@
+ #include "cave_type.hpp"
+ #include "cli_comm.hpp"
+ #include "files.hpp"
++#include "format_ext.hpp"
+ #include "game.hpp"
+ #include "gods.hpp"
+ #include "hook_drop_in.hpp"
+@@ -1744,12 +1745,12 @@ void do_cmd_cli()
+  */
+ void do_cmd_cli_help()
+ {
+-      fmt::MemoryWriter w;
++      fmtMemoryWriter w;
+       for (int i = 0, j = -1; i < cli_total; i++)
+       {
+               if (j < i - 1)
+               {
+-                      w << "/";
++                      w.write("/");
+               }
+ 
+               w.write("[[[[[G{}]", cli_info[i].comm);
+--- a/src/cmd4.cc
++++ b/src/cmd4.cc
+@@ -14,6 +14,7 @@
+ #include "dungeon_info_type.hpp"
+ #include "feature_type.hpp"
+ #include "files.hpp"
++#include "format_ext.hpp"
+ #include "game.hpp"
+ #include "hooks.hpp"
+ #include "init1.hpp"
+@@ -3068,7 +3069,7 @@ void do_cmd_knowledge_artifacts()
+       }
+ 
+       /* Output buffer */
+-      fmt::MemoryWriter w;
++      fmtMemoryWriter w;
+ 
+       /* Scan the artifacts */
+       for (std::size_t k = 0; k < a_info.size(); k++)
+@@ -3201,7 +3202,7 @@ static void do_cmd_knowledge_uniques()
+                 });
+ 
+       // Scan the monster races
+-      fmt::MemoryWriter w;
++      fmtMemoryWriter w;
+       for (std::size_t r_idx : unique_r_idxs)
+       {
+               auto r_ptr = &r_info[r_idx];
+@@ -3332,7 +3333,7 @@ static void do_cmd_knowledge_pets()
+       int t_levels = 0;
+ 
+       // Buffer
+-      fmt::MemoryWriter w;
++      fmtMemoryWriter w;
+ 
+       /* Process the monsters (backwards) */
+       for (int i = m_max - 1; i >= 1; i--)
+@@ -3394,7 +3395,7 @@ static void do_cmd_knowledge_kill_count()
+       s32b Total = 0;
+ 
+       // Buffer
+-      fmt::MemoryWriter w;
++      fmtMemoryWriter w;
+ 
+       // Summary of monsters slain
+       {
+@@ -3493,7 +3494,7 @@ static void do_cmd_knowledge_dungeons()
+ {
+       auto const &d_info = game->edit_data.d_info;
+ 
+-      fmt::MemoryWriter w;
++      fmtMemoryWriter w;
+ 
+       /* Scan all dungeons */
+       for (std::size_t y = 1; y < d_info.size(); y++)
+@@ -3521,7 +3522,7 @@ void do_cmd_knowledge_towns()
+ {
+       auto const &d_info = game->edit_data.d_info;
+ 
+-      fmt::MemoryWriter w;
++      fmtMemoryWriter w;
+ 
+       /* Scan all dungeons */
+       for (auto const &d_ref: d_info)
+@@ -3573,7 +3574,7 @@ static void do_cmd_knowledge_quests()
+       });
+ 
+       /* Write */
+-      fmt::MemoryWriter w;
++      fmtMemoryWriter w;
+       for (int z = 0; z < MAX_Q_IDX; z++)
+       {
+               int const i = order[z];
+--- a/src/cmd5.cc
++++ b/src/cmd5.cc
+@@ -13,6 +13,7 @@
+ #include "cave_type.hpp"
+ #include "corrupt.hpp"
+ #include "dungeon_flag.hpp"
++#include "format_ext.hpp"
+ #include "game.hpp"
+ #include "lua_bind.hpp"
+ #include "monster2.hpp"
+--- a/src/cmd6.cc
++++ b/src/cmd6.cc
+@@ -18,6 +18,7 @@
+ #include "dungeon_info_type.hpp"
+ #include "ego_item_type.hpp"
+ #include "files.hpp"
++#include "format_ext.hpp"
+ #include "game.hpp"
+ #include "hook_eat_in.hpp"
+ #include "hooks.hpp"
+--- a/src/cmd7.cc
++++ b/src/cmd7.cc
+@@ -16,6 +16,7 @@
+ #include "dungeon_flag.hpp"
+ #include "ego_item_type.hpp"
+ #include "files.hpp"
++#include "format_ext.hpp"
+ #include "game.hpp"
+ #include "hooks.hpp"
+ #include "mimic.hpp"
+--- a/src/corrupt.cc
++++ b/src/corrupt.cc
+@@ -1,5 +1,6 @@
+ #include "corrupt.hpp"
+ 
++#include "format_ext.hpp"
+ #include "game.hpp"
+ #include "init1.hpp"
+ #include "object_flag.hpp"
+@@ -925,7 +926,7 @@ void lose_corruption()
+  */
+ std::string dump_corruptions(bool color, bool header)
+ {
+-      fmt::MemoryWriter w;
++      fmtMemoryWriter w;
+ 
+       for (int i = 0; i < CORRUPTIONS_MAX; i++)
+       {
+--- a/src/files.cc
++++ b/src/files.cc
+@@ -3453,7 +3453,7 @@ static bool show_file_aux(const char *name, const char 
*what, int line)
+       return true;
+ }
+ 
+-void show_string(const char *lines, const char *title, int line)
++void show_string(const std::string &lines, const char *title, int line)
+ {
+       // Temporary file
+       auto const file_name = fs::unique_path().string();
+--- a/src/files.hpp
++++ b/src/files.hpp
+@@ -26,7 +26,7 @@ std::string describe_player_location();
+ errr file_character(const char *name);
+ errr process_pref_file_aux(char *buf);
+ errr process_pref_file(std::string const &name);
+-void show_string(const char *lines, const char *title, int line = 0);
++void show_string(const std::string &lines, const char *title, int line = 0);
+ void show_file(const char *name, const char *what, int line = 0);
+ void do_cmd_help();
+ void get_name();
+--- a/src/format_ext.cc
++++ b/src/format_ext.cc
+@@ -1,24 +1,18 @@
++#include <cassert>
+ #include "format_ext.hpp"
+ 
+ #include "util.hpp"
+ 
+-void singular_prefix::write(fmt::Writer &w) const
++std::string format_as(const singular_prefix &sp)
+ {
+-      assert(!m_s.empty());
++      assert(!sp.m_s.empty());
+ 
+-      if (is_a_vowel(m_s[0]))
++      if (is_a_vowel(sp.m_s[0]))
+       {
+-              w.write("an ");
++              return "an " + sp.m_s;
+       }
+       else
+       {
+-              w.write("a ");
++              return "a " + sp.m_s;
+       }
+-
+-      w.write(m_s);
+-}
+-
+-void format_arg(fmt::BasicFormatter<char> &formatter, const char 
*&format_str, const singular_prefix &sp)
+-{
+-      sp.write(formatter.writer());
+ }
+--- a/src/format_ext.hpp
++++ b/src/format_ext.hpp
+@@ -10,11 +10,11 @@ struct singular_prefix {
+ private:
+       std::string m_s;
+ 
+-      friend void format_arg(fmt::BasicFormatter<char> &formatter, const char 
*&format_str, const singular_prefix &sp);
++      friend std::string format_as(const singular_prefix &sp);
+ 
+ public:
+-      explicit singular_prefix(std::string s)
+-              : m_s(std::move(s))
++      explicit singular_prefix(const std::string& s)
++              : m_s(s)
+       {
+       }
+ 
+@@ -23,11 +23,30 @@ public:
+       {
+       }
+ 
+-      void write(fmt::Writer &w) const;
+-
+ };
+ 
+ //
+ // Formatting support for fmtlib
+ //
+-void format_arg(fmt::BasicFormatter<char> &formatter, const char 
*&format_str, const singular_prefix &sp);
++std::string format_as(const singular_prefix &sp);
++
++// Class to simplify migration off deprecated fmt::MemoryWriter.
++// My goal here was to minimize the diff necessary.
++// This class should probably be removed and fmt:: (or std::format) used 
directly.
++class fmtMemoryWriter {
++private:
++      fmt::memory_buffer m_buf;
++
++public:
++      template <typename... Ts> void write(Ts &&...ts) {
++              fmt::format_to(std::back_inserter(m_buf), 
std::forward<Ts>(ts)...);
++      }
++
++      std::string str() {
++              return fmt::to_string(m_buf);
++      }
++
++      std::string c_str() {
++              return str();
++      }
++};
+--- a/src/q_bounty.cc
++++ b/src/q_bounty.cc
+@@ -1,5 +1,6 @@
+ #include "q_bounty.hpp"
+ 
++#include "format_ext.hpp"
+ #include "game.hpp"
+ #include "monster2.hpp"
+ #include "monster_race.hpp"
+@@ -159,7 +160,7 @@ void quest_bounty_get_item()
+ std::string quest_bounty_describe()
+ {
+       char mdesc[512];
+-      fmt::MemoryWriter w;
++      fmtMemoryWriter w;
+ 
+       if (cquest.status == QUEST_STATUS_TAKEN)
+       {
+--- a/src/q_fireprof.cc
++++ b/src/q_fireprof.cc
+@@ -4,6 +4,7 @@
+ #include "dungeon_flag.hpp"
+ #include "feature_flag.hpp"
+ #include "feature_type.hpp"
++#include "format_ext.hpp"
+ #include "hook_get_in.hpp"
+ #include "hook_quest_gen_in.hpp"
+ #include "hooks.hpp"
+@@ -430,7 +431,7 @@ std::string quest_fireproof_describe()
+       num_staff = get_item_points_remaining() / FIREPROOF_STAFF_POINTS;
+       num_scroll = get_item_points_remaining() / FIREPROOF_SCROLL_POINTS;
+ 
+-      fmt::MemoryWriter w;
++      fmtMemoryWriter w;
+ 
+       if (status == QUEST_STATUS_TAKEN)
+       {
+--- a/src/q_god.cc
++++ b/src/q_god.cc
+@@ -5,6 +5,7 @@
+ #include "dungeon_info_type.hpp"
+ #include "feature_flag.hpp"
+ #include "feature_type.hpp"
++#include "format_ext.hpp"
+ #include "game.hpp"
+ #include "hook_chardump_in.hpp"
+ #include "hook_get_in.hpp"
+@@ -282,7 +283,7 @@ static std::string make_directions(bool feel_it)
+ 
+ std::string quest_god_describe()
+ {
+-      fmt::MemoryWriter w;
++      fmtMemoryWriter w;
+ 
+       if (cquest.status == QUEST_STATUS_TAKEN)
+       {
+--- a/src/q_library.cc
++++ b/src/q_library.cc
+@@ -2,6 +2,7 @@
+ 
+ #include "cave_type.hpp"
+ #include "dungeon_flag.hpp"
++#include "format_ext.hpp"
+ #include "game.hpp"
+ #include "hooks.hpp"
+ #include "hook_quest_gen_in.hpp"
+@@ -476,7 +477,7 @@ void quest_library_building(bool *paid, bool *recreate)
+ 
+ std::string quest_library_describe()
+ {
+-      fmt::MemoryWriter w;
++      fmtMemoryWriter w;
+ 
+       if (cquest.status == QUEST_STATUS_TAKEN)
+       {
+--- a/src/q_rand.cc
++++ b/src/q_rand.cc
+@@ -5,6 +5,7 @@
+ #include "cave_type.hpp"
+ #include "dungeon_flag.hpp"
+ #include "dungeon_info_type.hpp"
++#include "format_ext.hpp"
+ #include "game.hpp"
+ #include "generate.hpp"
+ #include "hook_build_room1_in.hpp"
+@@ -655,7 +656,7 @@ std::string quest_random_describe()
+               return "";
+       }
+ 
+-      fmt::MemoryWriter w;
++      fmtMemoryWriter w;
+ 
+       if (!is_randhero(dun_level))
+       {
+--- a/src/xtra1.cc
++++ b/src/xtra1.cc
+@@ -16,6 +16,7 @@
+ #include "dungeon_flag.hpp"
+ #include "dungeon_info_type.hpp"
+ #include "files.hpp"
++#include "format_ext.hpp"
+ #include "game.hpp"
+ #include "gods.hpp"
+ #include "hook_calculate_hp_in.hpp"
+@@ -4410,7 +4411,7 @@ std::string fate_desc(int fate)
+ {
+       auto const &a_info = game->edit_data.a_info;
+ 
+-      fmt::MemoryWriter w;
++      fmtMemoryWriter w;
+ 
+       if (fates[fate].serious)
+       {
+@@ -4517,7 +4518,7 @@ std::string dump_fates()
+ {
+       bool pending = false;
+ 
+-      fmt::MemoryWriter w;
++      fmtMemoryWriter w;
+ 
+       for (int i = 0; i < MAX_FATES; i++)
+       {
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -56,8 +56,8 @@ ENDIF()
+ # fmt
+ #
+-ADD_DEFINITIONS(-DFMT_HEADER_ONLY)
+ find_package(jsoncons REQUIRED)
+-SET(LIBS ${LIBS} jsoncons::jsoncons)
++find_package(fmt REQUIRED)
++SET(LIBS ${LIBS} jsoncons::jsoncons fmt::fmt)
+ 
+ # Add standard math library
+ SET(LIBS ${LIBS} m)

diff --git a/games-roguelike/tome/files/tome-2.4.0-header.patch 
b/games-roguelike/tome/files/tome-2.4.0-header.patch
new file mode 100644
index 000000000000..ff6a462fcad4
--- /dev/null
+++ b/games-roguelike/tome/files/tome-2.4.0-header.patch
@@ -0,0 +1,12 @@
+https://github.com/tome2/tome2/pull/73
+
+--- a/src/squeltch.cc
++++ b/src/squeltch.cc
+@@ -34,6 +34,7 @@
+ #include <deque>
+ #include <fmt/format.h>
+ #include <list>
++#include <fstream>
+ #include <memory>
+ #include <string>
+ #include <vector>

diff --git a/games-roguelike/tome/files/tome-2.4.0-json.patch 
b/games-roguelike/tome/files/tome-2.4.0-json.patch
new file mode 100644
index 000000000000..32451d079b2d
--- /dev/null
+++ b/games-roguelike/tome/files/tome-2.4.0-json.patch
@@ -0,0 +1,103 @@
+https://github.com/tome2/tome2/pull/77
+Compatibility with the packaged version of dev-cpp/jsoncons
+
+--- a/src/squelch/automatizer.cc
++++ b/src/squelch/automatizer.cc
+@@ -22,9 +22,7 @@ static std::vector< std::shared_ptr < Rule > > 
parse_rules(jsoncons::json const
+               return rules;
+       }
+ 
+-      auto rules_array = rules_json.array_value();
+-
+-      for (auto const &rule_value : rules_array)
++      for (auto const &rule_value : rules_json.array_range())
+       {
+               auto rule = Rule::parse_rule(rule_value);
+               if (rule)
+--- a/src/squelch/condition.cc
++++ b/src/squelch/condition.cc
+@@ -376,7 +376,7 @@ std::shared_ptr<Condition> 
GroupingCondition::next_child(Condition *current)
+ 
+ std::vector< std::shared_ptr<Condition> > 
GroupingCondition::parse_conditions(jsoncons::json const &j)
+ {
+-      auto conditions_j = j.get_with_default<jsoncons::json>("conditions", 
jsoncons::null_type());
++      auto conditions_j = j.get_value_or<jsoncons::json>("conditions", 
jsoncons::null_type());
+ 
+       if (conditions_j.is_null())
+       {
+@@ -390,7 +390,7 @@ std::vector< std::shared_ptr<Condition> > 
GroupingCondition::parse_conditions(js
+       else
+       {
+               std::vector< std::shared_ptr<Condition> > subconditions;
+-              for (auto const &subcondition_j: conditions_j.array_value())
++              for (auto const &subcondition_j: conditions_j.array_range())
+               {
+                       std::shared_ptr<Condition> subcondition =
+                               parse_condition(subcondition_j);
+@@ -931,7 +931,7 @@ void SingleSubconditionCondition::to_json(jsoncons::json 
&j) const
+ 
+ std::shared_ptr<Condition> 
SingleSubconditionCondition::parse_single_subcondition(jsoncons::json const 
&in_json)
+ {
+-      auto condition_j = 
in_json.get_with_default<jsoncons::json>("condition", jsoncons::null_type());
++      auto condition_j = in_json.get_value_or<jsoncons::json>("condition", 
jsoncons::null_type());
+ 
+       if (condition_j.is_null())
+       {
+--- a/src/squelch/jsoncons_helpers.hpp
++++ b/src/squelch/jsoncons_helpers.hpp
+@@ -9,7 +9,7 @@ namespace squelch {
+ template <class T>
+ boost::optional<T> get_optional(jsoncons::json const &json, std::string const 
&key)
+ {
+-      if (!json.has_key(key))
++      if (!json.contains(key))
+       {
+               return boost::none;
+       }
+--- a/src/squelch/rule.cc
++++ b/src/squelch/rule.cc
+@@ -171,14 +171,14 @@ std::shared_ptr<Rule> Rule::parse_rule(jsoncons::json 
const &rule_json)
+ 
+       // Parse condition
+       std::shared_ptr<Condition> condition =
+-              
Condition::parse_condition(rule_json.get_with_default<jsoncons::json>("condition",
 jsoncons::null_type()));
++              
Condition::parse_condition(rule_json.get_value_or<jsoncons::json>("condition", 
jsoncons::null_type()));
+ 
+       // Parse rule
+       switch (action)
+       {
+       case action_type::AUTO_INSCRIBE:
+       {
+-              auto rule_inscription_j = 
rule_json.get_with_default<jsoncons::json>("inscription", 
jsoncons::null_type());
++              auto rule_inscription_j = 
rule_json.get_value_or<jsoncons::json>("inscription", jsoncons::null_type());
+ 
+               if (rule_inscription_j.is_null())
+               {
+--- a/src/squeltch.cc
++++ b/src/squeltch.cc
+@@ -218,8 +219,8 @@ static void automatizer_save_rules()
+       }
+ 
+       // Write JSON to output
+-      jsoncons::serialization_options serialization_options;
+-      serialization_options.indent(2);
++      jsoncons::json_options serialization_options;
++      serialization_options.indent_size(2);
+       of << jsoncons::pretty_print(rules_document, serialization_options);
+       if (of.fail())
+       {
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -55,10 +55,12 @@ ENDIF()
+ #
+ # fmt
+ #
+ ADD_DEFINITIONS(-DFMT_HEADER_ONLY)
++find_package(jsoncons REQUIRED)
++SET(LIBS ${LIBS} jsoncons::jsoncons)
+ 
+ # Add standard math library
+ SET(LIBS ${LIBS} m)
+ 
+ #
+ # BOOST

diff --git a/games-roguelike/tome/files/tome-2.4.0-order.patch 
b/games-roguelike/tome/files/tome-2.4.0-order.patch
new file mode 100644
index 000000000000..8e944c6b35f7
--- /dev/null
+++ b/games-roguelike/tome/files/tome-2.4.0-order.patch
@@ -0,0 +1,12 @@
+https://github.com/tome2/tome2/pull/75
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ # Project definition.
++CMAKE_MINIMUM_REQUIRED (VERSION 3.5...4.0)
+ PROJECT (tome2)
+-CMAKE_MINIMUM_REQUIRED (VERSION 3.5)
+ 
+ # We want a readable feature summary.
+ INCLUDE(FeatureSummary)

diff --git a/games-roguelike/tome/tome-2.4.0_p20250227.ebuild 
b/games-roguelike/tome/tome-2.4.0_p20250227.ebuild
new file mode 100644
index 000000000000..2d7b35f5f2af
--- /dev/null
+++ b/games-roguelike/tome/tome-2.4.0_p20250227.ebuild
@@ -0,0 +1,60 @@
+# Copyright 2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="Fantasy adventure game, based on the works of J.R.R. Tolkien"
+HOMEPAGE="https://github.com/tome2/tome2";
+MY_COMMIT="3892fbcb1c2446afcb0c34f59e2a24f78ae672c4"
+SRC_URI="https://github.com/tome2/tome2/archive/${MY_COMMIT}.tar.gz -> 
${P}.tar.gz"
+S="${WORKDIR}/tome2-${MY_COMMIT}"
+
+LICENSE="Moria ToME2-theme"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="X"
+
+RDEPEND="
+       dev-libs/boost:=
+       dev-libs/libfmt:=
+       sys-libs/ncurses:=
+       X? ( x11-libs/libX11 )
+"
+DEPEND="
+       ${RDEPEND}
+       dev-cpp/jsoncons
+       dev-cpp/pcg-cpp
+"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+       "${FILESDIR}/tome-2.4.0-json.patch"
+       "${FILESDIR}/tome-2.4.0-datadir.patch"
+       "${FILESDIR}/tome-2.4.0-order.patch"
+       "${FILESDIR}/tome-2.4.0-boost.patch"
+       "${FILESDIR}/tome-2.4.0-cmake4.patch"
+       "${FILESDIR}/tome-2.4.0-header.patch"
+       "${FILESDIR}/tome-2.4.0-fmt2.patch"
+)
+
+src_prepare() {
+       # The rest of bundled deps are test-only and very old
+       rm -r vendor/fmt* vendor/jsoncons* vendor/pcg-cpp* || die
+       cmake_src_prepare
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DSYSTEM_INSTALL=yes
+               -DBUILD_SHARED_LIBS=no
+               -DCMAKE_DISABLE_FIND_PACKAGE_X11=$(usex !X)
+               -DCMAKE_DISABLE_FIND_PACKAGE_GTK2=yes
+       )
+       cmake_src_configure
+}
+
+src_test() {
+       "${BUILD_DIR}"/src/harness || die
+}

diff --git a/licenses/ToME2-theme b/licenses/ToME2-theme
new file mode 100644
index 000000000000..e2a59869af6f
--- /dev/null
+++ b/licenses/ToME2-theme
@@ -0,0 +1,3 @@
+Permission hereby granted to use any and all parts of the Theme module in 
other modules, games, fan fiction, whatever, as long as it's nonprofit. Please 
give credit where credit is due and don't simply take my work and use it as 
though it was always yours. Adding something of mine to an *_info file? Include 
a comment that credits Theme.
+
+furiosity

Reply via email to