commit: a8b8f8350140379dd1e6b6377b8d476c33c41355 Author: jinqiang zhang <peeweep <AT> 0x0 <DOT> ee> AuthorDate: Tue Oct 28 09:03:43 2025 +0000 Commit: Yixun Lan <dlan <AT> gentoo <DOT> org> CommitDate: Wed Oct 29 12:16:13 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a8b8f835
app-i18n/fcitx-m17n: fix build failures Closes: https://bugs.gentoo.org/959670 Signed-off-by: jinqiang zhang <peeweep <AT> 0x0.ee> Signed-off-by: Yixun Lan <dlan <AT> gentoo.org> app-i18n/fcitx-m17n/fcitx-m17n-5.1.3.ebuild | 3 +- .../fcitx-m17n-5.1.3-fix-i18n-string-format.patch | 103 +++++++++++++++++++++ 2 files changed, 105 insertions(+), 1 deletion(-) diff --git a/app-i18n/fcitx-m17n/fcitx-m17n-5.1.3.ebuild b/app-i18n/fcitx-m17n/fcitx-m17n-5.1.3.ebuild index e16ff8143d11..06ec7be2c2bc 100644 --- a/app-i18n/fcitx-m17n/fcitx-m17n-5.1.3.ebuild +++ b/app-i18n/fcitx-m17n/fcitx-m17n-5.1.3.ebuild @@ -11,6 +11,7 @@ DESCRIPTION="m17n-provided input methods for Fcitx5" HOMEPAGE="https://github.com/fcitx/fcitx5-m17n" SRC_URI="https://download.fcitx-im.org/fcitx5/${MY_PN}/${MY_PN}-${PV}.tar.zst -> ${P}.tar.zst" +S="${WORKDIR}/${MY_PN}-${PV}" LICENSE="LGPL-2.1+" SLOT="5" KEYWORDS="amd64 ~arm64 ~loong ~riscv x86" @@ -30,7 +31,7 @@ BDEPEND=" kde-frameworks/extra-cmake-modules:0 " -S="${WORKDIR}/${MY_PN}-${PV}" +PATCHES=( "${FILESDIR}/${P}-fix-i18n-string-format.patch") # bugs #959670 src_configure() { local mycmakeargs=( diff --git a/app-i18n/fcitx-m17n/files/fcitx-m17n-5.1.3-fix-i18n-string-format.patch b/app-i18n/fcitx-m17n/files/fcitx-m17n-5.1.3-fix-i18n-string-format.patch new file mode 100644 index 000000000000..21e1ad2f6d64 --- /dev/null +++ b/app-i18n/fcitx-m17n/files/fcitx-m17n-5.1.3-fix-i18n-string-format.patch @@ -0,0 +1,103 @@ +port away from fmt to std::format + +Bugs: https://bugs.gentoo.org/959670 +Link: https://github.com/fcitx/fcitx5-m17n/commit/105bee2b3b9bc8a17f0546f879daa31e88a9613b +Link: https://github.com/fcitx/fcitx5-m17n/commit/fbbfdcafaa5299e80c16d8bc4ed9cf8c6bd86395 + +From 105bee2b3b9bc8a17f0546f879daa31e88a9613b Mon Sep 17 00:00:00 2001 +From: Weng Xuetian <[email protected]> +Date: Wed, 19 Feb 2025 18:59:31 +0000 +Subject: [PATCH] Port away from fmt to std::format + +--- + CMakeLists.txt | 7 ------- + im/CMakeLists.txt | 2 +- + im/engine.cpp | 9 +++++---- + 3 files changed, 6 insertions(+), 12 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a6ee6bb..ab5f3f3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -16,18 +16,11 @@ set(GCOV_TOOL "gcov" CACHE STRING "Path to gcov tool used by coverage.") + find_package(Fcitx5Core ${REQUIRED_FCITX_VERSION} REQUIRED) + find_package(Fcitx5Module REQUIRED COMPONENTS TestFrontend) + find_package(Gettext REQUIRED) +-find_package(fmt REQUIRED) + find_package(PkgConfig REQUIRED) + pkg_check_modules(M17NGui IMPORTED_TARGET "m17n-gui>=1.6.3" REQUIRED) + # Required for data and testing + pkg_check_modules(M17NDB "m17n-db" REQUIRED) + +-if (TARGET fmt::fmt-header-only) +- set(FMT_TARGET fmt::fmt-header-only) +-else() +- set(FMT_TARGET fmt::fmt) +-endif () +- + include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake") + add_definitions(-DFCITX_GETTEXT_DOMAIN=\"fcitx5-m17n\" -D_GNU_SOURCE) + fcitx5_add_i18n_definition() +diff --git a/im/CMakeLists.txt b/im/CMakeLists.txt +index 900437f..ba50bd3 100644 +--- a/im/CMakeLists.txt ++++ b/im/CMakeLists.txt +@@ -5,7 +5,7 @@ set(fcitx_m17n_sources + ) + + add_fcitx5_addon(m17n ${fcitx_m17n_sources}) +-target_link_libraries(m17n Fcitx5::Core Fcitx5::Config ${FMT_TARGET} PkgConfig::M17NGui) ++target_link_libraries(m17n Fcitx5::Core Fcitx5::Config PkgConfig::M17NGui) + target_include_directories(m17n PRIVATE ${PROJECT_BINARY_DIR}) + set_target_properties(m17n PROPERTIES PREFIX "") + install(TARGETS m17n DESTINATION "${CMAKE_INSTALL_LIBDIR}/fcitx5") +diff --git a/im/engine.cpp b/im/engine.cpp +index 9b9ee4f..0f6da54 100644 +--- a/im/engine.cpp ++++ b/im/engine.cpp +@@ -32,7 +32,7 @@ + #include <fcitx/text.h> + #include <fcitx/userinterface.h> + #include <fcntl.h> +-#include <fmt/format.h> ++#include <format> + #include <m17n-core.h> + #include <m17n.h> + #include <memory> +@@ -348,9 +348,10 @@ std::vector<InputMethodEntry> M17NEngine::listInputMethods() { + + std::string iconName; + auto uniqueName = stringutils::concat("m17n_", lang, "_", name); +- auto fxName = fmt::format( +- _("{0} (M17N)"), +- (item && item->i18nName.size()) ? _(item->i18nName) : name); ++ const std::string i18nname = ++ (item && item->i18nName.size()) ? _(item->i18nName) : name; ++ auto fxName = ++ std::vformat(_("{0} (M17N)"), std::make_format_args(i18nname)); + + info = minput_get_title_icon(mlang, mname); + // head of info is a MText +From fbbfdcafaa5299e80c16d8bc4ed9cf8c6bd86395 Mon Sep 17 00:00:00 2001 +From: Weng Xuetian <[email protected]> +Date: Wed, 19 Feb 2025 23:33:05 -0800 +Subject: [PATCH] Use new macro for i18n string format + +--- + im/engine.cpp | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/im/engine.cpp b/im/engine.cpp +index 0f6da54..1a22657 100644 +--- a/im/engine.cpp ++++ b/im/engine.cpp +@@ -350,8 +350,7 @@ std::vector<InputMethodEntry> M17NEngine::listInputMethods() { + auto uniqueName = stringutils::concat("m17n_", lang, "_", name); + const std::string i18nname = + (item && item->i18nName.size()) ? _(item->i18nName) : name; +- auto fxName = +- std::vformat(_("{0} (M17N)"), std::make_format_args(i18nname)); ++ auto fxName = _("{0} (M17N)", i18nname); + + info = minput_get_title_icon(mlang, mname); + // head of info is a MText
