librime: update to 1.11.2.

This commit is contained in:
Vinfall 2024-07-15 19:19:56 +08:00 committed by Đoàn Trần Công Danh
parent 560296f3f4
commit 923d362da9
2 changed files with 5 additions and 117 deletions

View File

@ -1,111 +0,0 @@
From 57cffcd02ac70148e21ce982be834876b3df87db Mon Sep 17 00:00:00 2001
From: HanatoK <summersnow9403@gmail.com>
Date: Sat, 1 May 2021 01:04:38 -0500
Subject: [PATCH] Fix FTBFS.
Previous boost library (1.75) may implicitly include cmath, but the
latest version (1.76) does not, so the calls to exp are undefined. This
commit include cmath in script_translator.cc and table_translator.cc to
fix the issue (#462).
---
src/rime/gear/script_translator.cc | 1 +
src/rime/gear/table_translator.cc | 1 +
2 files changed, 2 insertions(+)
diff --git a/src/rime/gear/script_translator.cc b/src/rime/gear/script_translator.cc
index 4a45f05e6..250616593 100644
--- a/src/rime/gear/script_translator.cc
+++ b/src/rime/gear/script_translator.cc
@@ -8,6 +8,7 @@
//
#include <algorithm>
#include <stack>
+#include <cmath>
#include <boost/algorithm/string/join.hpp>
#include <boost/range/adaptor/reversed.hpp>
#include <rime/composition.h>
diff --git a/src/rime/gear/table_translator.cc b/src/rime/gear/table_translator.cc
index 162ac0244..c95e5e24b 100644
--- a/src/rime/gear/table_translator.cc
+++ b/src/rime/gear/table_translator.cc
@@ -6,6 +6,7 @@
//
#include <boost/algorithm/string.hpp>
#include <boost/range/adaptor/reversed.hpp>
+#include <cmath>
#include <utf8.h>
#include <rime/candidate.h>
#include <rime/common.h>
From bc589fd45eca349b7ca408f9b85a85474745abb0 Mon Sep 17 00:00:00 2001
From: Chen Gong <chen.sst@gmail.com>
Date: Sun, 16 Jan 2022 01:06:29 +0800
Subject: [PATCH] fix: qualify std::exp after including <cmath>
As noted in #462, including <cmath> only guarantees that std::exp is
declared, so calling exp(double) unqualified is not portable.
Squashed commit with a style change to the original PR:
commit 8b9d48c0340f3fb82de59a6f7ec71ddfd86a602f
Author: Chen Gong <chen.sst@gmail.com>
Date: Sun Jan 16 00:49:47 2022 +0800
commit df4fe3ea11e0222426b98e489db36d32856b3361
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Tue Aug 10 10:18:38 2021 +0100
Closes #476
---
src/rime/gear/script_translator.cc | 12 ++++++------
src/rime/gear/table_translator.cc | 8 ++++----
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/rime/gear/script_translator.cc b/src/rime/gear/script_translator.cc
index 250616593..e220aed9c 100644
--- a/src/rime/gear/script_translator.cc
+++ b/src/rime/gear/script_translator.cc
@@ -488,9 +488,9 @@ void ScriptTranslation::PrepareCandidate() {
start_,
start_ + user_phrase_code_length,
entry);
- cand->set_quality(exp(entry->weight) +
- translator_->initial_quality() +
- (IsNormalSpelling() ? 0.5 : -0.5));
+ cand->set_quality(std::exp(entry->weight) +
+ translator_->initial_quality() +
+ (IsNormalSpelling() ? 0.5 : -0.5));
}
else if (phrase_code_length > 0) {
DictEntryIterator& iter = phrase_iter_->second;
@@ -502,9 +502,9 @@ void ScriptTranslation::PrepareCandidate() {
start_,
start_ + phrase_code_length,
entry);
- cand->set_quality(exp(entry->weight) +
- translator_->initial_quality() +
- (IsNormalSpelling() ? 0 : -1));
+ cand->set_quality(std::exp(entry->weight) +
+ translator_->initial_quality() +
+ (IsNormalSpelling() ? 0 : -1));
}
candidate_ = cand;
}
diff --git a/src/rime/gear/table_translator.cc b/src/rime/gear/table_translator.cc
index c95e5e24b..97cfc96e5 100644
--- a/src/rime/gear/table_translator.cc
+++ b/src/rime/gear/table_translator.cc
@@ -81,10 +81,10 @@ an<Candidate> TableTranslation::Peek() {
if (phrase) {
phrase->set_comment(comment);
phrase->set_preedit(preedit_);
- phrase->set_quality(exp(e->weight) +
- options_->initial_quality() +
- (incomplete ? -1 : 0) +
- (is_user_phrase ? 0.5 : 0));
+ phrase->set_quality(std::exp(e->weight) +
+ options_->initial_quality() +
+ (incomplete ? -1 : 0) +
+ (is_user_phrase ? 0.5 : 0));
}
return phrase;
}

View File

@ -1,19 +1,18 @@
# Template file for 'librime'
pkgname=librime
version=1.7.3
revision=8
version=1.11.2
revision=1
build_style=cmake
configure_args="-DCMAKE_BUILD_TYPE=None -DENABLE_LOGGING=OFF -DBUILD_TEST=ON
-DCAPNP_EXECUTABLE=/usr/bin/capnp -DCAPNPC_CXX_EXECUTABLE=/usr/bin/capnpc-c++"
configure_args="-DCMAKE_BUILD_TYPE=None -DENABLE_LOGGING=OFF -DBUILD_TEST=ON"
hostmakedepends="pkg-config capnproto"
makedepends="boost-devel leveldb-devel marisa-devel opencc-devel
yaml-cpp-devel gtest-devel capnproto-devel xorgproto"
yaml-cpp-devel gtest-devel capnproto-devel xorgproto lua54-devel"
short_desc="Rime Input Method Engine"
maintainer="Yuxuan Shui <yshuiv7@gmail.com>"
license="BSD-3-Clause"
homepage="https://github.com/rime/librime"
distfiles="https://github.com/rime/librime/archive/${version}.tar.gz"
checksum=c76b937a27d7b9352c3eea9eb3adaebf70c93457104c7d47d40c006009092c20
checksum=0a3f507d11aeb137de08e90fd319714533caf210b97223d8a12994db215684b5
post_install() {
vlicense LICENSE