commit:     a0c1b7e6cc4513c5e04b8ee17d0bf2c8f6838986
Author:     Yongxiang Liang <tanekliang <AT> gmail <DOT> com>
AuthorDate: Fri Sep 12 17:14:55 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Sep 12 20:43:40 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a0c1b7e6

app-i18n/libime: fix build with -Werror=odr

Fixes already accepted in upstream repo

Closes: https://bugs.gentoo.org/962546
Signed-off-by: Yongxiang Liang <tanekliang <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/43758
Closes: https://github.com/gentoo/gentoo/pull/43758
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../libime/files/libime-1.1.11-fix-kenlm-odr.patch | 22 ++++++++++++++++++++++
 app-i18n/libime/libime-1.1.11-r1.ebuild            |  2 ++
 2 files changed, 24 insertions(+)

diff --git a/app-i18n/libime/files/libime-1.1.11-fix-kenlm-odr.patch 
b/app-i18n/libime/files/libime-1.1.11-fix-kenlm-odr.patch
new file mode 100644
index 000000000000..c4484f50e052
--- /dev/null
+++ b/app-i18n/libime/files/libime-1.1.11-fix-kenlm-odr.patch
@@ -0,0 +1,22 @@
+https://github.com/fcitx/libime/commit/39ced92b4450f49b03e38bdd6a58d1f1b9430824
+
+fix odr: build kenlm with C++20
+
+--- a/src/libime/core/CMakeLists.txt
++++ b/src/libime/core/CMakeLists.txt
+@@ -14,9 +14,14 @@ target_include_directories(kenlm PUBLIC 
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE
+ target_compile_definitions(kenlm PUBLIC -DKENLM_MAX_ORDER=3 PRIVATE -DNDEBUG)
+ target_link_libraries(kenlm PUBLIC Boost::boost PkgConfig::ZSTD)
+ set_target_properties(kenlm PROPERTIES
+-  CXX_STANDARD 11
+   POSITION_INDEPENDENT_CODE ON)
+ 
++include(CheckCXXSymbolExists)
++check_cxx_symbol_exists(_LIBCPP_VERSION version LIBCPP)
++if(LIBCPP)
++  target_compile_definitions(kenlm PUBLIC 
-D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
++endif()
++
+ if(UNIX)
+   check_library_exists(rt clock_gettime "clock_gettime from librt" 
HAVE_CLOCKGETTIME_RT)
+   if (HAVE_CLOCKGETTIME_RT)

diff --git a/app-i18n/libime/libime-1.1.11-r1.ebuild 
b/app-i18n/libime/libime-1.1.11-r1.ebuild
index f00861629812..739e57478f12 100644
--- a/app-i18n/libime/libime-1.1.11-r1.ebuild
+++ b/app-i18n/libime/libime-1.1.11-r1.ebuild
@@ -30,6 +30,8 @@ BDEPEND="
        )
 "
 
+PATCHES=( "${FILESDIR}"/${P}-fix-kenlm-odr.patch )
+
 src_configure() {
        # 957570 : remove unused kenlm CMakeLists.txt
        rm src/libime/core/kenlm/CMakeLists.txt || die

Reply via email to