Skip to content

Commit 3ad4247

Browse files
committed
update marisa-trie and librime
1 parent e83e45f commit 3ad4247

File tree

9 files changed

+65
-56
lines changed

9 files changed

+65
-56
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
fetchRecurseSubmodules = false
2828
[submodule "marisa-trie"]
2929
path = marisa-trie
30-
url = https://github.com/rime/marisa-trie
30+
url = https://github.com/s-yata/marisa-trie
3131
[submodule "librime"]
3232
path = librime
3333
url = https://github.com/rime/librime

librime

Submodule librime updated 88 files

marisa-trie

Submodule marisa-trie updated 173 files

patches/librime.patch

Lines changed: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
1-
From 15a8b479e66ac597a0fca4bede8012f5bb9df151 Mon Sep 17 00:00:00 2001
2-
From: Rocka <i@rocka.me>
3-
Date: Tue, 12 Nov 2024 22:16:16 +0800
4-
Subject: [PATCH 1/2] set file-prefix-map to relative path
5-
6-
---
7-
src/CMakeLists.txt | 2 ++
8-
1 file changed, 2 insertions(+)
9-
101
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
11-
index 16082869..c4a5b5ca 100644
2+
index 8faa61f8..671622ce 100644
123
--- a/src/CMakeLists.txt
134
+++ b/src/CMakeLists.txt
145
@@ -166,6 +166,8 @@ if(BUILD_SHARED_LIBS)
@@ -20,24 +11,8 @@ index 16082869..c4a5b5ca 100644
2011
set_target_properties(rime-static PROPERTIES
2112
OUTPUT_NAME "rime" PREFIX "lib"
2213
ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
23-
--
24-
2.47.0
25-
26-
27-
From 25608d1ea7a246b3ac4e7ccc02b1b6dfbb468869 Mon Sep 17 00:00:00 2001
28-
From: Rocka <i@rocka.me>
29-
Date: Tue, 12 Nov 2024 22:20:33 +0800
30-
Subject: [PATCH 2/2] Persist options to user.yaml in RimeSetOption
31-
32-
---
33-
src/rime/engine.cc | 1 -
34-
src/rime/engine.h | 2 ++
35-
src/rime/service.h | 8 ++++----
36-
src/rime_api_impl.h | 9 +++++++++
37-
4 files changed, 15 insertions(+), 5 deletions(-)
38-
3914
diff --git a/src/rime/engine.cc b/src/rime/engine.cc
40-
index 07aa6b7d..7360e0b5 100644
15+
index 4a54f64c..2efe0c93 100644
4116
--- a/src/rime/engine.cc
4217
+++ b/src/rime/engine.cc
4318
@@ -52,7 +52,6 @@ class ConcreteEngine : public Engine {
@@ -49,7 +24,7 @@ index 07aa6b7d..7360e0b5 100644
4924

5025
// implementations
5126
diff --git a/src/rime/engine.h b/src/rime/engine.h
52-
index 2e1c8b81..94a6b500 100644
27+
index 6b51a68e..c5b8f7e4 100644
5328
--- a/src/rime/engine.h
5429
+++ b/src/rime/engine.h
5530
@@ -16,6 +16,7 @@ namespace rime {
@@ -68,8 +43,30 @@ index 2e1c8b81..94a6b500 100644
6843

6944
protected:
7045
Engine();
46+
diff --git a/src/rime/lever/deployment_tasks.cc b/src/rime/lever/deployment_tasks.cc
47+
index 6e6ff895..fe111d55 100644
48+
--- a/src/rime/lever/deployment_tasks.cc
49+
+++ b/src/rime/lever/deployment_tasks.cc
50+
@@ -429,17 +429,6 @@ static bool ConfigNeedsUpdate(Config* config) {
51+
}
52+
53+
bool ConfigFileUpdate::Run(Deployer* deployer) {
54+
- const path shared_data_path(deployer->shared_data_dir);
55+
- const path user_data_path(deployer->user_data_dir);
56+
- // trash deprecated user copy created by an older version of Rime
57+
- path source_config_path(shared_data_path / file_name_);
58+
- path dest_config_path(user_data_path / file_name_);
59+
- path trash = user_data_path / "trash";
60+
- if (TrashDeprecatedUserCopy(source_config_path, dest_config_path,
61+
- version_key_, trash)) {
62+
- LOG(WARNING) << "deprecated user copy of '" << file_name_
63+
- << "' is moved to " << trash;
64+
- }
65+
// build the config file if needs update
66+
the<Config> config(Config::Require("config")->Create(file_name_));
67+
if (ConfigNeedsUpdate(config.get())) {
7168
diff --git a/src/rime/service.h b/src/rime/service.h
72-
index 2b3111af..95ca87dc 100644
69+
index a69ae741..9b3d4b16 100644
7370
--- a/src/rime/service.h
7471
+++ b/src/rime/service.h
7572
@@ -44,11 +44,11 @@ class Session {
@@ -89,7 +86,7 @@ index 2b3111af..95ca87dc 100644
8986
string commit_text_;
9087
};
9188
diff --git a/src/rime_api_impl.h b/src/rime_api_impl.h
92-
index 7749ce98..b0200a67 100644
89+
index 30f4514f..c17d4794 100644
9390
--- a/src/rime_api_impl.h
9491
+++ b/src/rime_api_impl.h
9592
@@ -17,6 +17,8 @@
@@ -101,7 +98,7 @@ index 7749ce98..b0200a67 100644
10198

10299
using namespace rime;
103100

104-
@@ -426,6 +428,13 @@ RIME_DEPRECATED void RimeSetOption(RimeSessionId session_id,
101+
@@ -430,6 +432,13 @@ RIME_DEPRECATED void RimeSetOption(RimeSessionId session_id,
105102
if (!ctx)
106103
return;
107104
ctx->set_option(option, !!value);
@@ -115,6 +112,3 @@ index 7749ce98..b0200a67 100644
115112
}
116113

117114
RIME_DEPRECATED Bool RimeGetOption(RimeSessionId session_id,
118-
--
119-
2.47.0
120-

patches/marisa-tire.patch

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
diff --git a/CMakeLists.txt b/CMakeLists.txt
2-
index d89d928..6ba6a32 100644
2+
index b96374e..4f040d5 100644
33
--- a/CMakeLists.txt
44
+++ b/CMakeLists.txt
5-
@@ -49,6 +49,7 @@ add_library(marisa
6-
${MARISA_SRC}
5+
@@ -195,6 +195,7 @@ target_include_directories(marisa
6+
PRIVATE
7+
lib
78
)
8-
99
+target_compile_options(marisa PRIVATE "-ffile-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=.")
10-
install(TARGETS marisa
11-
EXPORT marisa-targets
12-
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
10+
set_target_properties(marisa PROPERTIES
11+
VERSION "${Marisa_VERSION}"
12+
SOVERSION "${Marisa_VERSION_MAJOR}"

patches/opencc.patch

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/CMakeLists.txt b/CMakeLists.txt
2-
index c2e9dc70..70085eac 100644
2+
index c2e9dc70..fb9077d0 100644
33
--- a/CMakeLists.txt
44
+++ b/CMakeLists.txt
55
@@ -79,10 +79,6 @@ endif()
@@ -13,17 +13,20 @@ index c2e9dc70..70085eac 100644
1313

1414
set (DIR_PREFIX ${CMAKE_INSTALL_PREFIX})
1515
set (DIR_INCLUDE ${DIR_PREFIX}/include)
16-
@@ -215,7 +211,8 @@ if(NOT USE_SYSTEM_MARISA)
16+
@@ -215,19 +211,13 @@ if(NOT USE_SYSTEM_MARISA)
1717
message(STATUS "Use bundled marisa library.")
1818
add_subdirectory(deps/marisa-0.2.6)
1919
else()
2020
- find_library(LIBMARISA NAMES marisa)
21-
+ find_package(marisa)
22-
+ set(LIBMARISA marisa)
23-
if (LIBMARISA)
24-
message(STATUS "libmarisa found: ${LIBMARISA}")
25-
else()
26-
@@ -227,7 +224,6 @@ endif()
21+
- if (LIBMARISA)
22+
- message(STATUS "libmarisa found: ${LIBMARISA}")
23+
- else()
24+
- message(FATAL_ERROR "libmarisa not found.")
25+
- endif()
26+
+ find_package(Marisa REQUIRED)
27+
endif()
28+
29+
######## Subdirectories
2730

2831
add_subdirectory(src)
2932
add_subdirectory(doc)
@@ -32,9 +35,18 @@ index c2e9dc70..70085eac 100644
3235

3336
######## Testing
3437
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
35-
index 227e6c65..223553c1 100644
38+
index 227e6c65..9aed48d1 100644
3639
--- a/src/CMakeLists.txt
3740
+++ b/src/CMakeLists.txt
41+
@@ -116,7 +116,7 @@ add_library(libopencc ${LIBOPENCC_SOURCES} ${LIBOPENCC_HEADERS})
42+
add_library(OpenCC::OpenCC ALIAS libopencc)
43+
set_target_properties(libopencc PROPERTIES POSITION_INDEPENDENT_CODE ON)
44+
source_group(libopencc FILES ${LIBOPENCC_SOURCES} ${LIBOPENCC_HEADERS})
45+
-target_link_libraries(libopencc marisa)
46+
+target_link_libraries(libopencc Marisa::marisa)
47+
target_include_directories(libopencc PUBLIC
48+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
49+
$<INSTALL_INTERFACE:${DIR_INCLUDE}/opencc>
3850
@@ -206,4 +206,3 @@ endif()
3951

4052
# Subdir

src/Rules/Boost.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ boostRule = do
7474
],
7575
-- symlink headers for each abi to reduce size
7676
postBuildEachABI = BuildActionABI $ \_ env ->
77-
liftIO $ createDirectoryLink (".." </> "include") (buildEnvOutPrefix env </> "include")
77+
liftIO $ do
78+
let includePath = buildEnvOutPrefix env </> "include"
79+
whenM (doesPathExist includePath) $ removePathForcibly includePath
80+
createDirectoryLink (".." </> "include") includePath
7881
}
7982
"boost" ~> do
8083
buildWithAndroidEnv buildBoost Boost

src/Rules/OpenCC.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ openccRule = do
6363
"-DENABLE_BENCHMARK=OFF",
6464
"-DENABLE_DARTS=OFF",
6565
"-DUSE_SYSTEM_MARISA=ON",
66-
"-Dmarisa_DIR=" <> (buildEnvOut </> "marisa" </> buildEnvABI </> "lib" </> "cmake" </> "marisa"),
66+
"-DMarisa_DIR=" <> (buildEnvOut </> "marisa" </> buildEnvABI </> "lib" </> "cmake" </> "Marisa"),
6767
"-DUSE_SYSTEM_PYBIND11=OFF",
6868
"-DUSE_SYSTEM_RAPIDJSON=OFF",
6969
"-DUSE_SYSTEM_TCLAP=OFF"

0 commit comments

Comments
 (0)