12 Commits

Author SHA256 Message Date
f077424fcb Accepting request 1307449 from M17N
OBS-URL: https://build.opensuse.org/request/show/1307449
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/librime?expand=0&rev=37
2025-09-29 14:32:04 +00:00
7c09da0de2 - libboost_system was removed upstream (bsc#1249900)
OBS-URL: https://build.opensuse.org/package/show/M17N/librime?expand=0&rev=78
2025-09-27 03:50:55 +00:00
ce4f4825cb Accepting request 1306192 from M17N
OBS-URL: https://build.opensuse.org/request/show/1306192
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/librime?expand=0&rev=36
2025-09-22 14:39:24 +00:00
14716f15e1 - refreshed librime-boost166.patch, fix leap 15.6 build
OBS-URL: https://build.opensuse.org/package/show/M17N/librime?expand=0&rev=76
2025-09-21 05:07:59 +00:00
21eb79332b Accepting request 1297781 from M17N
OBS-URL: https://build.opensuse.org/request/show/1297781
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/librime?expand=0&rev=35
2025-08-06 12:33:44 +00:00
ab8e4c76d3 Update to version 1.14.0: 1,deployer: allow disabling backup_config_files. 2,translator_commons: add dictionary_exclude to exclude words. 3,ascii_composer: set/unset_ascii_mode. 4,ascii_composer: support alt, super key press. 5,script_translator: learn new phrases automatically from segmentations. 6, script_translator: update elements of phrases which are longer than max_word_length. 7,script_translator: concatenate segments with a sliding window.
OBS-URL: https://build.opensuse.org/package/show/M17N/librime?expand=0&rev=74
2025-08-05 15:51:36 +00:00
87f6b99ca4 Accepting request 1267372 from M17N
OBS-URL: https://build.opensuse.org/request/show/1267372
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/librime?expand=0&rev=34
2025-04-07 16:41:23 +00:00
4c69c6adcb - refactor librime-boost166.patch
* leap 15.6's gcc7 has no <filesystem> support, and -lstdc++fs
    does not work, port to <boost/filesystem.hpp>, to avoid runtime
    segfault

OBS-URL: https://build.opensuse.org/package/show/M17N/librime?expand=0&rev=72
2025-04-06 07:28:54 +00:00
37467f9720 Accepting request 1255257 from M17N
- fix Leap 15.6 build
  * add patch librime-boost166.patch

OBS-URL: https://build.opensuse.org/request/show/1255257
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/librime?expand=0&rev=33
2025-03-24 12:30:32 +00:00
2a77d82e7e OBS-URL: https://build.opensuse.org/package/show/M17N/librime?expand=0&rev=70 2025-03-22 13:42:36 +00:00
5b2b201612 OBS-URL: https://build.opensuse.org/package/show/M17N/librime?expand=0&rev=69 2025-03-22 13:18:41 +00:00
70c90c49d6 Accepting request 1255252 from home:MargueriteSu:branches:M17N
- fix Leap 15.6 build
  * add patch librime-boost166.patch

OBS-URL: https://build.opensuse.org/request/show/1255252
OBS-URL: https://build.opensuse.org/package/show/M17N/librime?expand=0&rev=68
2025-03-22 13:11:53 +00:00
5 changed files with 748 additions and 8 deletions

3
1.14.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b2b29c3551eec6b45af1ba8fd3fcffb99e2b7451aa974c1c9ce107e69ce3ea68
size 2642080

Binary file not shown.

671
librime-boost166.patch Normal file
View File

@@ -0,0 +1,671 @@
Index: librime-1.14.0/CMakeLists.txt
===================================================================
--- librime-1.14.0.orig/CMakeLists.txt
+++ librime-1.14.0/CMakeLists.txt
@@ -60,7 +60,7 @@ if(MSVC)
endif()
if(LINUX)
- find_package(Boost 1.74.0 REQUIRED COMPONENTS regex)
+ find_package(Boost 1.66.0 REQUIRED COMPONENTS regex filesystem)
else()
find_package(Boost 1.77.0)
endif()
Index: librime-1.14.0/plugins/plugins_module.cc
===================================================================
--- librime-1.14.0.orig/plugins/plugins_module.cc
+++ librime-1.14.0/plugins/plugins_module.cc
@@ -6,7 +6,7 @@
#include <algorithm>
#include <boost/algorithm/string.hpp>
#include <boost/dll.hpp>
-#include <filesystem>
+#include <boost/filesystem.hpp>
#include <rime/build_config.h>
#include <rime/common.h>
#include <rime/component.h>
@@ -14,7 +14,7 @@
#include <rime/registry.h>
#include <rime_api.h>
-namespace fs = std::filesystem;
+namespace fs = boost::filesystem;
namespace rime {
Index: librime-1.14.0/src/rime/common.h
===================================================================
--- librime-1.14.0.orig/src/rime/common.h
+++ librime-1.14.0/src/rime/common.h
@@ -9,7 +9,7 @@
#include <rime/build_config.h>
-#include <filesystem>
+#include <boost/filesystem.hpp>
#include <functional>
#include <list>
#include <map>
@@ -79,8 +79,9 @@ inline an<T> New(Args&&... args) {
using boost::signals2::connection;
using boost::signals2::signal;
-class path : public std::filesystem::path {
- using fs_path = std::filesystem::path;
+class path : public boost::filesystem::path {
+
+ using fs_path = boost::filesystem::path;
public:
path() : fs_path() {}
@@ -89,9 +90,9 @@ class path : public std::filesystem::pat
#ifdef _WIN32
// convert utf-8 string to native encoding path.
explicit path(const std::string& utf8_path)
- : fs_path(std::filesystem::u8path(utf8_path)) {}
+ : fs_path(boost::filesystem::path(utf8_path)) {}
explicit path(const char* utf8_path)
- : fs_path(std::filesystem::u8path(utf8_path)) {}
+ : fs_path(boost::filesystem::path(utf8_path)) {}
#else
// disable implicit conversion from string to path for development purpose.
explicit path(const std::string& utf8_path) : fs_path(utf8_path) {}
@@ -126,6 +127,9 @@ class path : public std::filesystem::pat
friend path operator/(const fs_path& lhs, const char* rhs) {
return path(lhs) /= path(rhs);
}
+ const std::string & u8string() const {
+ return this->string();
+ }
#ifdef RIME_ENABLE_LOGGING
friend std::ostream& operator<<(std::ostream& os, const path& p) {
return os << p.u8string();
Index: librime-1.14.0/src/rime/config/build_info_plugin.cc
===================================================================
--- librime-1.14.0.orig/src/rime/config/build_info_plugin.cc
+++ librime-1.14.0/src/rime/config/build_info_plugin.cc
@@ -2,7 +2,7 @@
// Copyright RIME Developers
// Distributed under the BSD License
//
-#include <filesystem>
+#include <boost/filesystem.hpp>
#include <rime/service.h>
#include <rime/algo/fs.h>
#include <rime/config/config_compiler.h>
@@ -37,7 +37,7 @@ bool BuildInfoPlugin::ReviewLinkOutput(C
}
// TODO: store as 64-bit number to avoid the year 2038 problem
timestamps[resource->resource_id] =
- (int)filesystem::to_time_t(std::filesystem::last_write_time(file_path));
+ (int)boost::filesystem::last_write_time(file_path);
});
#endif
return true;
Index: librime-1.14.0/src/rime/config/config_data.cc
===================================================================
--- librime-1.14.0.orig/src/rime/config/config_data.cc
+++ librime-1.14.0/src/rime/config/config_data.cc
@@ -7,7 +7,7 @@
#include <fstream>
#include <sstream>
#include <boost/algorithm/string.hpp>
-#include <filesystem>
+#include <boost/filesystem.hpp>
#include <yaml-cpp/yaml.h>
#include <rime/config/config_compiler.h>
#include <rime/config/config_cow_ref.h>
@@ -65,8 +65,8 @@ bool ConfigData::LoadFromFile(const path
file_path_ = file_path;
modified_ = false;
root.reset();
- if (!std::filesystem::exists(file_path)) {
- if (!boost::ends_with(file_path.u8string(), ".custom.yaml"))
+ if (!boost::filesystem::exists(file_path)) {
+ if (!boost::ends_with(file_path.string(), ".custom.yaml"))
LOG(WARNING) << "nonexistent config file '" << file_path << "'.";
return false;
}
Index: librime-1.14.0/src/rime/dict/db.cc
===================================================================
--- librime-1.14.0.orig/src/rime/dict/db.cc
+++ librime-1.14.0/src/rime/dict/db.cc
@@ -5,7 +5,7 @@
// 2011-11-02 GONG Chen <chen.sst@gmail.com>
//
#include <boost/algorithm/string.hpp>
-#include <filesystem>
+#include <boost/filesystem.hpp>
#include <rime/common.h>
#include <rime/resource.h>
#include <rime/service.h>
@@ -40,7 +40,7 @@ Db::Db(const path& file_path, const stri
: name_(name), file_path_(file_path) {}
bool Db::Exists() const {
- return std::filesystem::exists(file_path());
+ return boost::filesystem::exists(file_path());
}
bool Db::Remove() {
@@ -48,7 +48,7 @@ bool Db::Remove() {
LOG(ERROR) << "attempt to remove opened db '" << name_ << "'.";
return false;
}
- return std::filesystem::remove(file_path());
+ return boost::filesystem::remove(file_path());
}
bool Db::CreateMetadata() {
Index: librime-1.14.0/src/rime/dict/dict_compiler.cc
===================================================================
--- librime-1.14.0.orig/src/rime/dict/dict_compiler.cc
+++ librime-1.14.0/src/rime/dict/dict_compiler.cc
@@ -4,7 +4,7 @@
//
// 2011-11-27 GONG Chen <chen.sst@gmail.com>
//
-#include <filesystem>
+#include <boost/filesystem.hpp>
#include <cfloat>
#include <cmath>
#include <fstream>
@@ -51,7 +51,7 @@ static bool get_dict_files_from_settings
for (auto it = tables->begin(); it != tables->end(); ++it) {
string dict_name = As<ConfigValue>(*it)->str();
auto dict_file = source_resolver->ResolvePath(dict_name + ".dict.yaml");
- if (!std::filesystem::exists(dict_file)) {
+ if (!boost::filesystem::exists(dict_file)) {
LOG(ERROR) << "source file '" << dict_file << "' does not exist.";
return false;
}
@@ -82,7 +82,7 @@ bool DictCompiler::Compile(const path& s
bool build_table_from_source = true;
DictSettings settings;
auto dict_file = source_resolver_->ResolvePath(dict_name_ + ".dict.yaml");
- if (!std::filesystem::exists(dict_file)) {
+ if (!boost::filesystem::exists(dict_file)) {
LOG(ERROR) << "source file '" << dict_file << "' does not exist.";
build_table_from_source = false;
} else if (!load_dict_settings_from_file(&settings, dict_file)) {
@@ -165,7 +165,7 @@ bool DictCompiler::Compile(const path& s
EntryCollector collector(std::move(syllabary));
DictSettings settings;
auto dict_file = source_resolver_->ResolvePath(pack_name + ".dict.yaml");
- if (!std::filesystem::exists(dict_file)) {
+ if (!boost::filesystem::exists(dict_file)) {
if (pack_table->Exists())
LOG(INFO) << "pack source file '" << dict_file
<< "' does not exist, using prebuilt table '"
@@ -209,7 +209,7 @@ bool DictCompiler::Compile(const path& s
static path relocate_target(const path& source_path,
ResourceResolver* target_resolver) {
- auto resource_id = source_path.filename().u8string();
+ auto resource_id = source_path.filename().string();
return target_resolver->ResolvePath(resource_id);
}
Index: librime-1.14.0/src/rime/dict/dictionary.cc
===================================================================
--- librime-1.14.0.orig/src/rime/dict/dictionary.cc
+++ librime-1.14.0/src/rime/dict/dictionary.cc
@@ -4,7 +4,7 @@
//
// 2011-07-05 GONG Chen <chen.sst@gmail.com>
//
-#include <filesystem>
+#include <boost/filesystem.hpp>
#include <rime/algo/syllabifier.h>
#include <rime/common.h>
#include <rime/dict/dictionary.h>
@@ -352,8 +352,8 @@ bool Dictionary::Decode(const Code& code
}
bool Dictionary::Exists() const {
- return std::filesystem::exists(prism_->file_path()) && !tables_.empty() &&
- std::filesystem::exists(tables_[0]->file_path());
+ return boost::filesystem::exists(prism_->file_path()) && !tables_.empty() &&
+ boost::filesystem::exists(tables_[0]->file_path());
}
bool Dictionary::Remove() {
Index: librime-1.14.0/src/rime/dict/mapped_file.cc
===================================================================
--- librime-1.14.0.orig/src/rime/dict/mapped_file.cc
+++ librime-1.14.0/src/rime/dict/mapped_file.cc
@@ -7,7 +7,7 @@
// 2011-06-30 GONG Chen <chen.sst@gmail.com>
//
#include <fstream>
-#include <filesystem>
+#include <boost/filesystem.hpp>
#include <boost/interprocess/file_mapping.hpp>
#include <boost/interprocess/mapped_region.hpp>
#include <rime/dict/mapped_file.h>
@@ -101,7 +101,7 @@ void MappedFile::Close() {
}
bool MappedFile::Exists() const {
- return std::filesystem::exists(file_path_);
+ return boost::filesystem::exists(file_path_);
}
bool MappedFile::IsOpen() const {
@@ -130,7 +130,7 @@ bool MappedFile::Resize(size_t capacity)
if (IsOpen())
Close();
try {
- std::filesystem::resize_file(file_path_, capacity);
+ boost::filesystem::resize_file(file_path_, capacity);
} catch (...) {
return false;
}
Index: librime-1.14.0/src/rime/dict/user_db.cc
===================================================================
--- librime-1.14.0.orig/src/rime/dict/user_db.cc
+++ librime-1.14.0/src/rime/dict/user_db.cc
@@ -107,7 +107,7 @@ bool UserDbHelper::UpdateUserInfo() {
}
bool UserDbHelper::IsUniformFormat(const path& file_path) {
- return boost::ends_with(file_path.filename().u8string(),
+ return boost::ends_with(file_path.filename().string(),
plain_userdb_extension);
}
Index: librime-1.14.0/src/rime/dict/user_db_recovery_task.cc
===================================================================
--- librime-1.14.0.orig/src/rime/dict/user_db_recovery_task.cc
+++ librime-1.14.0/src/rime/dict/user_db_recovery_task.cc
@@ -5,7 +5,7 @@
// 2013-04-22 GONG Chen <chen.sst@gmail.com>
//
#include <boost/algorithm/string.hpp>
-#include <filesystem>
+#include <boost/filesystem.hpp>
#include <boost/scope_exit.hpp>
#include <rime/deployer.h>
#include <rime/dict/db.h>
@@ -40,9 +40,9 @@ bool UserDbRecoveryTask::Run(Deployer* d
// repair didn't work on the damaged db file; remove and recreate it
LOG(INFO) << "recreating db file.";
if (db_->Exists()) {
- std::error_code ec;
- std::filesystem::rename(db_->file_path(),
- path(db_->file_path()).concat(".old"), ec);
+ boost::system::error_code ec;
+ boost::filesystem::rename(db_->file_path(),
+ path(db_->file_path()) /= ".old", ec);
if (ec && !db_->Remove()) {
LOG(ERROR) << "Error removing db file '" << db_->file_path() << "'.";
return false;
@@ -67,12 +67,12 @@ void UserDbRecoveryTask::RestoreUserData
const path& dir(deployer->user_data_sync_dir());
// try *.userdb.txt
path snapshot_path = dir / (dict_name + UserDb::snapshot_extension());
- if (!std::filesystem::exists(snapshot_path)) {
+ if (!boost::filesystem::exists(snapshot_path)) {
// try *.userdb.*.snapshot
string legacy_snapshot_file =
dict_name + component->extension() + ".snapshot";
snapshot_path = dir / legacy_snapshot_file;
- if (!std::filesystem::exists(snapshot_path)) {
+ if (!boost::filesystem::exists(snapshot_path)) {
return; // not found
}
}
Index: librime-1.14.0/src/rime/gear/simplifier.cc
===================================================================
--- librime-1.14.0.orig/src/rime/gear/simplifier.cc
+++ librime-1.14.0/src/rime/gear/simplifier.cc
@@ -36,7 +36,7 @@ class Opencc {
opencc::Config config;
try {
// opencc accepts file path encoded in UTF-8.
- converter_ = config.NewFromFile(config_path.u8string());
+ converter_ = config.NewFromFile(config_path.string());
const list<opencc::ConversionPtr> conversions =
converter_->GetConversionChain()->GetConversions();
@@ -305,7 +305,7 @@ Simplifier* SimplifierComponent::Create(
return new Simplifier(ticket, opencc);
}
path opencc_config_path = path(opencc_config);
- if (opencc_config_path.extension().u8string() == ".ini") {
+ if (opencc_config_path.extension().string() == ".ini") {
LOG(ERROR) << "please upgrade opencc_config to an opencc 1.0 config file.";
return nullptr;
}
Index: librime-1.14.0/src/rime/lever/customizer.cc
===================================================================
--- librime-1.14.0.orig/src/rime/lever/customizer.cc
+++ librime-1.14.0/src/rime/lever/customizer.cc
@@ -4,14 +4,14 @@
//
// 2011-12-12 GONG Chen <chen.sst@gmail.com>
//
-#include <filesystem>
+#include <boost/filesystem.hpp>
#include <stdint.h>
#include <rime/common.h>
#include <rime/config.h>
#include <rime/algo/utilities.h>
#include <rime/lever/customizer.h>
-namespace fs = std::filesystem;
+namespace fs = boost::filesystem;
namespace rime {
@@ -88,7 +88,7 @@ bool Customizer::UpdateConfigFile() {
if (redistribute || (is_dirty && !missing_original_copy)) {
try {
fs::copy_file(source_path_, dest_path_,
- fs::copy_options::overwrite_existing);
+ fs::copy_option::overwrite_if_exists);
} catch (...) {
LOG(ERROR) << "Error copying config file '" << source_path_
<< "' to user directory.";
Index: librime-1.14.0/src/rime/lever/deployment_tasks.cc
===================================================================
--- librime-1.14.0.orig/src/rime/lever/deployment_tasks.cc
+++ librime-1.14.0/src/rime/lever/deployment_tasks.cc
@@ -9,7 +9,7 @@
#include <algorithm>
#include <boost/algorithm/string.hpp>
-#include <filesystem>
+#include <boost/filesystem.hpp>
#include <boost/uuid/random_generator.hpp>
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_io.hpp>
@@ -29,7 +29,7 @@
#include <windows.h>
#endif
-namespace fs = std::filesystem;
+namespace fs = boost::filesystem;
namespace rime {
@@ -47,16 +47,16 @@ bool DetectModifications::Run(Deployer*
for (auto dir : data_dirs_) {
path p = fs::canonical(dir);
last_modified = (std::max)(last_modified,
- filesystem::to_time_t(fs::last_write_time(p)));
+ fs::last_write_time(p));
if (fs::is_directory(p)) {
for (fs::directory_iterator iter(p), end; iter != end; ++iter) {
path entry(iter->path());
if (fs::is_regular_file(fs::canonical(entry)) &&
- entry.extension().u8string() == ".yaml" &&
- entry.filename().u8string() != "user.yaml") {
+ entry.extension().string() == ".yaml" &&
+ entry.filename().string() != "user.yaml") {
last_modified =
(std::max)(last_modified,
- filesystem::to_time_t(fs::last_write_time(entry)));
+ fs::last_write_time(entry));
}
}
}
@@ -85,7 +85,7 @@ bool InstallationUpdate::Run(Deployer* d
const path& user_data_path(deployer->user_data_dir);
if (!fs::exists(user_data_path)) {
LOG(INFO) << "creating user data dir: " << user_data_path;
- std::error_code ec;
+ boost::system::error_code ec;
if (!fs::create_directories(user_data_path, ec)) {
LOG(ERROR) << "Error creating user data dir: " << user_data_path;
}
@@ -263,7 +263,7 @@ SchemaUpdate::SchemaUpdate(TaskInitializ
}
static bool MaybeCreateDirectory(path dir) {
- std::error_code ec;
+ boost::system::error_code ec;
if (fs::create_directories(dir, ec)) {
return true;
}
@@ -314,7 +314,7 @@ static bool TrashDeprecatedUserCopy(cons
return false;
}
path backup = trash / user_copy.filename();
- std::error_code ec;
+ boost::system::error_code ec;
fs::rename(user_copy, backup, ec);
if (ec) {
LOG(ERROR) << "error trashing file " << user_copy;
@@ -419,7 +419,7 @@ static bool ConfigNeedsUpdate(Config* co
continue;
}
if (recorded_time !=
- (int)filesystem::to_time_t(fs::last_write_time(source_file))) {
+ (int)fs::last_write_time(source_file)) {
LOG(INFO) << "source file " << (recorded_time ? "changed: " : "added: ")
<< source_file;
return true;
@@ -460,7 +460,7 @@ bool PrebuildAllSchemas::Run(Deployer* d
for (fs::directory_iterator iter(shared_data_path), end; iter != end;
++iter) {
path entry(iter->path());
- if (boost::ends_with(entry.filename().u8string(), ".schema.yaml")) {
+ if (boost::ends_with(entry.filename().string(), ".schema.yaml")) {
the<DeploymentTask> t(new SchemaUpdate(entry));
if (!t->Run(deployer))
success = false;
@@ -483,7 +483,7 @@ bool SymlinkingPrebuiltDictionaries::Run
if (fs::is_symlink(entry)) {
try {
// a symlink becomes dangling if the target file is no longer provided
- std::error_code ec;
+ boost::system::error_code ec;
auto target_path = fs::canonical(entry, ec);
bool bad_link = bool(ec);
bool linked_to_shared_data =
@@ -525,7 +525,7 @@ bool UserDictSync::Run(Deployer* deploye
}
static bool IsCustomizedCopy(const path& file_path) {
- auto file_name = file_path.filename().u8string();
+ auto file_name = file_path.filename().string();
if (boost::ends_with(file_name, ".yaml") &&
!boost::ends_with(file_name, ".custom.yaml")) {
Config config;
@@ -556,7 +556,7 @@ bool BackupConfigFiles::Run(Deployer* de
path entry(iter->path());
if (!fs::is_regular_file(entry))
continue;
- auto file_extension = entry.extension().u8string();
+ auto file_extension = entry.extension().string();
bool is_yaml_file = file_extension == ".yaml";
bool is_text_file = file_extension == ".txt";
if (!is_yaml_file && !is_text_file)
@@ -570,8 +570,8 @@ bool BackupConfigFiles::Run(Deployer* de
++skipped; // customized copy
continue;
}
- std::error_code ec;
- fs::copy_file(entry, backup, fs::copy_options::overwrite_existing, ec);
+ boost::system::error_code ec;
+ fs::copy_file(entry, backup, fs::copy_option::overwrite_if_exists, ec);
if (ec) {
LOG(ERROR) << "error backing up file " << backup;
++failure;
@@ -596,7 +596,7 @@ bool CleanupTrash::Run(Deployer* deploye
path entry(iter->path());
if (!fs::is_regular_file(entry))
continue;
- auto file_name = entry.filename().u8string();
+ auto file_name = entry.filename().string();
if (file_name == "rime.log" || boost::ends_with(file_name, ".bin") ||
boost::ends_with(file_name, ".reverse.kct") ||
boost::ends_with(file_name, ".userdb.kct.old") ||
@@ -605,7 +605,7 @@ bool CleanupTrash::Run(Deployer* deploye
return false;
}
path backup = trash / entry.filename();
- std::error_code ec;
+ boost::system::error_code ec;
fs::rename(entry, backup, ec);
if (ec) {
LOG(ERROR) << "error clean up file " << entry;
@@ -650,15 +650,15 @@ bool CleanOldLogFiles::Run(Deployer* dep
try {
// preparing files
for (const auto& entry : fs::directory_iterator(dir)) {
- const string& file_name(entry.path().filename().u8string());
- if (entry.is_regular_file() && !entry.is_symlink() &&
+ const string& file_name(entry.path().filename().string());
+ if (fs::is_regular_file(entry.path()) && !fs::is_symlink(entry.path()) &&
boost::starts_with(file_name, app_name) &&
boost::ends_with(file_name, ".log") &&
!boost::contains(file_name, today)) {
files_to_remove.push_back(entry.path());
- } else if (entry.is_symlink()) {
+ } else if (fs::is_symlink(entry.path())) {
auto target = fs::read_symlink(entry.path());
- const string& target_file_name(target.filename().u8string());
+ const string& target_file_name(target.filename().string());
if (boost::starts_with(target_file_name, app_name) &&
boost::ends_with(target_file_name, ".log")) {
files_in_use.insert(target);
Index: librime-1.14.0/src/rime/lever/switcher_settings.cc
===================================================================
--- librime-1.14.0.orig/src/rime/lever/switcher_settings.cc
+++ librime-1.14.0/src/rime/lever/switcher_settings.cc
@@ -6,12 +6,12 @@
//
#include <utility>
#include <boost/algorithm/string.hpp>
-#include <filesystem>
+#include <boost/filesystem.hpp>
#include <rime/config.h>
#include <rime/deployer.h>
#include <rime/lever/switcher_settings.h>
-namespace fs = std::filesystem;
+namespace fs = boost::filesystem;
namespace rime {
Index: librime-1.14.0/src/rime/lever/user_dict_manager.cc
===================================================================
--- librime-1.14.0.orig/src/rime/lever/user_dict_manager.cc
+++ librime-1.14.0/src/rime/lever/user_dict_manager.cc
@@ -6,7 +6,7 @@
//
#include <fstream>
#include <boost/algorithm/string.hpp>
-#include <filesystem>
+#include <boost/filesystem.hpp>
#include <boost/scope_exit.hpp>
#include <rime/common.h>
#include <rime/deployer.h>
@@ -16,7 +16,7 @@
#include <rime/dict/user_db.h>
#include <rime/lever/user_dict_manager.h>
-namespace fs = std::filesystem;
+namespace fs = boost::filesystem;
namespace rime {
@@ -40,7 +40,7 @@ void UserDictManager::GetUserDictList(Us
return;
}
for (fs::directory_iterator it(path_), end; it != end; ++it) {
- string name = it->path().filename().u8string();
+ string name = it->path().filename().string();
if (boost::ends_with(name, component->extension())) {
boost::erase_last(name, component->extension());
user_dict_list->push_back(name);
@@ -163,7 +163,7 @@ bool UserDictManager::UpgradeUserDict(co
LOG(INFO) << "upgrading user dict '" << dict_name << "'.";
path trash = deployer_->user_data_dir / "trash";
if (!fs::exists(trash)) {
- std::error_code ec;
+ boost::system::error_code ec;
if (!fs::create_directories(trash, ec)) {
LOG(ERROR) << "error creating directory '" << trash << "'.";
return false;
@@ -180,7 +180,7 @@ bool UserDictManager::Synchronize(const
bool success = true;
path sync_dir(deployer_->sync_dir);
if (!fs::exists(sync_dir)) {
- std::error_code ec;
+ boost::system::error_code ec;
if (!fs::create_directories(sync_dir, ec)) {
LOG(ERROR) << "error creating directory '" << sync_dir << "'.";
return false;
Index: librime-1.14.0/src/rime/resource.cc
===================================================================
--- librime-1.14.0.orig/src/rime/resource.cc
+++ librime-1.14.0/src/rime/resource.cc
@@ -4,13 +4,13 @@
//
#include <boost/algorithm/string.hpp>
-#include <filesystem>
+#include <boost/filesystem.hpp>
#include <rime/resource.h>
namespace rime {
string ResourceResolver::ToResourceId(const string& file_path) const {
- string string_path = path(file_path).generic_u8string();
+ string string_path = path(file_path).generic_string();
bool has_prefix = boost::starts_with(string_path, type_.prefix);
bool has_suffix = boost::ends_with(string_path, type_.suffix);
size_t start = (has_prefix ? type_.prefix.length() : 0);
@@ -27,16 +27,16 @@ string ResourceResolver::ToFilePath(cons
}
path ResourceResolver::ResolvePath(const string& resource_id) {
- return std::filesystem::absolute(root_path_ /
+ return boost::filesystem::absolute(root_path_ /
(type_.prefix + resource_id + type_.suffix));
}
path FallbackResourceResolver::ResolvePath(const string& resource_id) {
auto default_path = ResourceResolver::ResolvePath(resource_id);
- if (!std::filesystem::exists(default_path)) {
- auto fallback_path = std::filesystem::absolute(
+ if (!boost::filesystem::exists(default_path)) {
+ auto fallback_path = boost::filesystem::absolute(
fallback_root_path_ / (type_.prefix + resource_id + type_.suffix));
- if (std::filesystem::exists(fallback_path)) {
+ if (boost::filesystem::exists(fallback_path)) {
return fallback_path;
}
}
Index: librime-1.14.0/test/resource_resolver_test.cc
===================================================================
--- librime-1.14.0.orig/test/resource_resolver_test.cc
+++ librime-1.14.0/test/resource_resolver_test.cc
@@ -1,9 +1,9 @@
#include <fstream>
-#include <filesystem>
+#include <boost/filesystem.hpp>
#include <gtest/gtest.h>
#include <rime/resource.h>
-namespace fs = std::filesystem;
+namespace fs = boost::filesystem;
using namespace rime;
static const ResourceType kMineralsType = ResourceType{
Index: librime-1.14.0/tools/rime_table_decompiler.cc
===================================================================
--- librime-1.14.0.orig/tools/rime_table_decompiler.cc
+++ librime-1.14.0/tools/rime_table_decompiler.cc
@@ -122,7 +122,7 @@ int main(int argc, char* argv[]) {
fout << "# Rime dictionary\n\n";
fout << "---\n"
"name: "
- << file_path.stem().u8string()
+ << file_path.stem().string()
<< "\n"
"version: \"1.0\"\n"
"...\n\n";

View File

@@ -1,3 +1,63 @@
-------------------------------------------------------------------
Tue Sep 23 11:08:54 CEST 2025 - aschnell@suse.com
- libboost_system was removed upstream (bsc#1249900)
-------------------------------------------------------------------
Sun Sep 21 04:03:41 UTC 2025 - Marguerite Su <i@marguerite.su>
- refreshed librime-boost166.patch, fix leap 15.6 build
-------------------------------------------------------------------
Mon Aug 4 12:50:40 UTC 2025 - Cliff Zhao <qzhao@suse.com>
- Update to version 1.14.0:
* Features
deployer: allow disabling backup_config_files.
translator_commons: add dictionary_exclude to exclude words.
ascii_composer: set/unset_ascii_mode.
ascii_composer: support alt, super key press.
script_translator: learn new phrases automatically from
segmentations.
script_translator: update elements of phrases which are longer
than max_word_length.
script_translator: concatenate segments with a sliding window.
* Bug Fixes
test: memory leaks in unit tests
cmake: replace include() with find_package() to avoid calling
find_package_handle_standard_args() twice with different arguments.
crashes caused by creating empty components.
simplifier: return nullptr on error.
ascii_composer: Fix good old caps lock behavior.
script_translator: config max_word_length and core_word_length.
fix non-void function does not return a value.
* Continuous Integration
fix lint, always lint with clang-format 18.1.8.
update runner windows-2019 to windows-latest.
use the macos-15 runner image.
fix wrong filter on push event.
use clang-format from apt llvm.
* Chores
upgrade boost to 1.88.0.
release: 1.14.0.
* Commits
apply clang-format by make clang-format-apply.
add tmux-rime, rl_custom_rime, YuyanIme.
-------------------------------------------------------------------
Sun Apr 6 07:11:40 UTC 2025 - Marguerite Su <i@marguerite.su>
- refactor librime-boost166.patch
* leap 15.6's gcc7 has no <filesystem> support, and -lstdc++fs
does not work, port to <boost/filesystem.hpp>, to avoid runtime
segfault
-------------------------------------------------------------------
Sat Mar 22 13:09:45 UTC 2025 - Marguerite Su <i@marguerite.su>
- fix Leap 15.6 build
* add patch librime-boost166.patch
-------------------------------------------------------------------
Fri Mar 01 15:20:39 UTC 2024 - rrahl0@proton.me

View File

@@ -1,7 +1,7 @@
#
# spec file for package librime
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,13 +17,15 @@
Name: librime
Version: 1.10.0+git20240229.4ee471e
Version: 1.14.0
Release: 0
Summary: Rime Input Method Engine
License: BSD-3-Clause
Group: System/I18n/Chinese
URL: https://github.com/rime/librime
Source: %{name}-%{version}.tar.xz
Source: https://github.com/rime/%{name}/archive/refs/tags/%{version}.tar.gz
#PATCH-FIX-OPENSUSE librime-boost166.patch i@marguerite.su -- leap's gcc7 has no <filesystem>
Patch0: librime-boost166.patch
BuildRequires: capnproto >= 0.7.0
BuildRequires: cmake >= 3.1.0
BuildRequires: gcc-c++
@@ -33,7 +35,9 @@ BuildRequires: leveldb-devel
BuildRequires: libboost_filesystem-devel
BuildRequires: libboost_locale-devel
BuildRequires: libboost_regex-devel
%if 0%{?suse_version} < 1600
BuildRequires: libboost_system-devel
%endif
BuildRequires: libcapnp-devel >= 0.7.0
BuildRequires: libkyotocabinet-devel
BuildRequires: marisa-devel
@@ -93,7 +97,10 @@ Requires: librime-devel = %{version}
This package provides private headers of Rime to build plugins.
%prep
%autosetup -p1
%setup -q
%if 0%{?suse_version} == 1500
%patch -P 0 -p 1
%endif
%build
%cmake -DCMAKE_BUILD_TYPE=Release \
@@ -119,11 +126,13 @@ This package provides private headers of Rime to build plugins.
%files -n librime1
%{_libdir}/%{name}.so.1
%{_libdir}/%{name}.so.1.10.0
%{_libdir}/%{name}.so.%{version}
%files devel
%{_includedir}/rime_api.h
%{_includedir}/rime_levers_api.h
%{_includedir}/rime_api_deprecated.h
%{_includedir}/rime_api_stdbool.h
%{_libdir}/%{name}.so
%{_libdir}/pkgconfig/rime.pc
%{_datadir}/cmake/rime/