librime: rebuild with opencc 1.1.1
While we're at it: - Move license back to main package. - Build without -O3 - Also build test
This commit is contained in:
parent
7f9719f4b9
commit
6fbdc55334
4 changed files with 98 additions and 5 deletions
7
srcpkgs/librime/INSTALL
Executable file
7
srcpkgs/librime/INSTALL
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
case "$ACTION" in
|
||||||
|
post)
|
||||||
|
[ -x usr/bin/rime_deployer ] || exit 1
|
||||||
|
[ -d usr/share/rime-data ] || exit 0
|
||||||
|
usr/bin/rime_deployer --build usr/share/rime-data
|
||||||
|
;;
|
||||||
|
esac
|
86
srcpkgs/librime/patches/opencc-1.1.0.patch
Normal file
86
srcpkgs/librime/patches/opencc-1.1.0.patch
Normal file
|
@ -0,0 +1,86 @@
|
||||||
|
From beae5b1d4e990aeb05eb86db5eefec50fa03750b Mon Sep 17 00:00:00 2001
|
||||||
|
From: Chen Gong <chen.sst@gmail.com>
|
||||||
|
Date: Fri, 15 May 2020 01:42:52 +0800
|
||||||
|
Subject: [PATCH] fix(simplifier): opencc::DictEntry::Values() type change in
|
||||||
|
opencc 1.1.0
|
||||||
|
|
||||||
|
Closes #367
|
||||||
|
---
|
||||||
|
src/rime/gear/simplifier.cc | 14 ++++++--------
|
||||||
|
src/rime/gear/simplifier.h | 5 +++--
|
||||||
|
2 files changed, 9 insertions(+), 10 deletions(-)
|
||||||
|
|
||||||
|
diff --git src/rime/gear/simplifier.cc src/rime/gear/simplifier.cc
|
||||||
|
index 98a1c5a9..feb7f50b 100644
|
||||||
|
--- src/rime/gear/simplifier.cc
|
||||||
|
+++ src/rime/gear/simplifier.cc
|
||||||
|
@@ -8,6 +8,7 @@
|
||||||
|
#include <boost/filesystem.hpp>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <utf8.h>
|
||||||
|
+#include <utility>
|
||||||
|
#include <rime/candidate.h>
|
||||||
|
#include <rime/common.h>
|
||||||
|
#include <rime/config.h>
|
||||||
|
@@ -45,8 +46,7 @@ class Opencc {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- bool ConvertWord(const string& text,
|
||||||
|
- vector<string>* forms) {
|
||||||
|
+ bool ConvertWord(const string& text, vector<string>* forms) {
|
||||||
|
if (dict_ == nullptr) return false;
|
||||||
|
opencc::Optional<const opencc::DictEntry*> item = dict_->Match(text);
|
||||||
|
if (item.IsNull()) {
|
||||||
|
@@ -54,15 +54,14 @@ class Opencc {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
const opencc::DictEntry* entry = item.Get();
|
||||||
|
- for (const char* value : entry->Values()) {
|
||||||
|
- forms->push_back(value);
|
||||||
|
+ for (auto&& value : entry->Values()) {
|
||||||
|
+ forms->push_back(std::move(value));
|
||||||
|
}
|
||||||
|
return forms->size() > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- bool RandomConvertText(const string& text,
|
||||||
|
- string* simplified) {
|
||||||
|
+ bool RandomConvertText(const string& text, string* simplified) {
|
||||||
|
if (dict_ == nullptr) return false;
|
||||||
|
const char *phrase = text.c_str();
|
||||||
|
std::ostringstream buffer;
|
||||||
|
@@ -83,8 +82,7 @@ class Opencc {
|
||||||
|
return *simplified != text;
|
||||||
|
}
|
||||||
|
|
||||||
|
- bool ConvertText(const string& text,
|
||||||
|
- string* simplified) {
|
||||||
|
+ bool ConvertText(const string& text, string* simplified) {
|
||||||
|
if (converter_ == nullptr) return false;
|
||||||
|
*simplified = converter_->Convert(text);
|
||||||
|
return *simplified != text;
|
||||||
|
diff --git src/rime/gear/simplifier.h src/rime/gear/simplifier.h
|
||||||
|
index c68e4c7d..f70344e7 100644
|
||||||
|
--- src/rime/gear/simplifier.h
|
||||||
|
+++ src/rime/gear/simplifier.h
|
||||||
|
@@ -20,7 +20,7 @@ class Simplifier : public Filter, TagMatching {
|
||||||
|
explicit Simplifier(const Ticket& ticket);
|
||||||
|
|
||||||
|
virtual an<Translation> Apply(an<Translation> translation,
|
||||||
|
- CandidateList* candidates);
|
||||||
|
+ CandidateList* candidates);
|
||||||
|
|
||||||
|
|
||||||
|
virtual bool AppliesToSegment(Segment* segment) {
|
||||||
|
@@ -35,7 +35,8 @@ class Simplifier : public Filter, TagMatching {
|
||||||
|
|
||||||
|
void Initialize();
|
||||||
|
void PushBack(const an<Candidate>& original,
|
||||||
|
- CandidateQueue* result, const string& simplified);
|
||||||
|
+ CandidateQueue* result,
|
||||||
|
+ const string& simplified);
|
||||||
|
|
||||||
|
bool initialized_ = false;
|
||||||
|
the<Opencc> opencc_;
|
|
@ -1,10 +1,11 @@
|
||||||
# Template file for 'librime'
|
# Template file for 'librime'
|
||||||
pkgname=librime
|
pkgname=librime
|
||||||
version=1.5.3
|
version=1.5.3
|
||||||
revision=3
|
revision=4
|
||||||
build_style=cmake
|
build_style=cmake
|
||||||
configure_args="-DENABLE_LOGGING=OFF -DBUILD_TEST=OFF"
|
configure_args="-DCMAKE_BUILD_TYPE=None -DENABLE_LOGGING=OFF -DBUILD_TEST=ON"
|
||||||
makedepends="boost-devel leveldb-devel marisa-devel opencc-devel yaml-cpp-devel"
|
makedepends="boost-devel leveldb-devel marisa-devel opencc-devel
|
||||||
|
yaml-cpp-devel gtest-devel"
|
||||||
short_desc="Rime Input Method Engine"
|
short_desc="Rime Input Method Engine"
|
||||||
maintainer="Yuxuan Shui <yshuiv7@gmail.com>"
|
maintainer="Yuxuan Shui <yshuiv7@gmail.com>"
|
||||||
license="BSD-3-Clause"
|
license="BSD-3-Clause"
|
||||||
|
@ -23,6 +24,6 @@ librime-devel_package() {
|
||||||
vmove usr/include
|
vmove usr/include
|
||||||
vmove usr/lib/pkgconfig
|
vmove usr/lib/pkgconfig
|
||||||
vmove "usr/lib/*.so"
|
vmove "usr/lib/*.so"
|
||||||
vmove usr/share
|
vmove usr/share/cmake
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
pkgname=rime
|
|
Loading…
Reference in a new issue