Skip to content

Commit ba7e83a

Browse files
authored
rime (#13)
1 parent 841d15e commit ba7e83a

File tree

14 files changed

+218
-23
lines changed

14 files changed

+218
-23
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ jobs:
4545
run: |
4646
git apply --directory=fcitx5 patches/fcitx5.patch
4747
git apply --directory=engines/fcitx5-hallelujah patches/hallelujah.patch
48+
git apply --directory=engines/fcitx5-rime patches/rime.patch
4849
PKG_CONFIG_PATH=build/sysroot/usr/lib/pkgconfig cmake -B build -G Xcode \
49-
-DENGINE=hallelujah \
50+
-DHALLELUJAH=ON \
51+
-DRIME=ON \
5052
-DCMAKE_TOOLCHAIN_FILE=cmake/ios.cmake \
5153
-DIOS_PLATFORM=SIMULATOR
5254
cmake --build build --config Release

.gitmodules

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,18 @@
44
[submodule "engines/fcitx5-hallelujah"]
55
path = engines/fcitx5-hallelujah
66
url = https://github.com/fcitx-contrib/fcitx5-hallelujah
7+
[submodule "engines/fcitx5-rime"]
8+
path = engines/fcitx5-rime
9+
url = https://github.com/fcitx/fcitx5-rime
10+
[submodule "data/rime-essay"]
11+
path = data/rime-essay
12+
url = https://github.com/rime/rime-essay
13+
[submodule "data/rime-prelude"]
14+
path = data/rime-prelude
15+
url = https://github.com/rime/rime-prelude
16+
[submodule "data/rime-luna-pinyin"]
17+
path = data/rime-luna-pinyin
18+
url = https://github.com/rime/rime-luna-pinyin
19+
[submodule "data/rime-stroke"]
20+
path = data/rime-stroke
21+
url = https://github.com/rime/rime-stroke

CMakeLists.txt

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,12 @@ include(AddSwift)
2626
set(KEYBOARD_NAME "Keyboard")
2727
set(KEYBOARD_LANGUAGE "zh-Hans")
2828

29-
set(ENGINE "" CACHE STRING "fcitx5 engine to bundle")
30-
31-
if (ENGINE STREQUAL "hallelujah")
32-
add_definitions(-DHALLELUJAH)
33-
endif()
29+
set(PREBUILDER_LIB_DIR "${PROJECT_BINARY_DIR}/sysroot/usr/lib")
3430

3531
# For dependencies not to be find via pkg-config
36-
set(LibIntl_DIR "build/sysroot/usr/lib/cmake")
32+
set(LibIntl_DIR "${PREBUILDER_LIB_DIR}/cmake")
3733
find_package(LibIntl)
38-
set(fmt_DIR "build/sysroot/usr/lib/cmake/fmt")
34+
set(fmt_DIR "${PREBUILDER_LIB_DIR}/cmake/fmt")
3935
find_package(fmt)
4036

4137
option(ENABLE_TEST "" OFF)
@@ -62,7 +58,25 @@ add_subdirectory(protocol)
6258
add_subdirectory(iosfrontend)
6359
add_subdirectory(uipanel)
6460

65-
add_subdirectory(engines)
61+
option(HALLELUJAH "" OFF)
62+
option(RIME "" OFF)
63+
64+
set(ENGINES)
65+
66+
if (HALLELUJAH)
67+
add_definitions(-DHALLELUJAH)
68+
add_subdirectory(engines/fcitx5-hallelujah)
69+
list(APPEND ENGINES hallelujah)
70+
endif()
71+
if (RIME)
72+
# RIME_DATA_DIR is not actually used but must exist.
73+
set(RIME_DATA_DIR "/usr/share/rime-data")
74+
set(RIME_TARGET "${PREBUILDER_LIB_DIR}/librime.a" "-L${PREBUILDER_LIB_DIR}" leveldb yaml-cpp marisa opencc glog)
75+
set(Rime_VERSION "1.11.2")
76+
add_definitions(-DRIME)
77+
add_subdirectory(engines/fcitx5-rime)
78+
list(APPEND ENGINES rime)
79+
endif()
6680

6781
add_subdirectory(keyboard)
6882
add_subdirectory(src)

data/default.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Rime default settings
2+
# encoding: utf-8
3+
4+
config_version: '0.40'
5+
6+
schema_list:
7+
- schema: luna_pinyin
8+
- schema: luna_pinyin_tw
9+
- schema: luna_pinyin_simp
10+
- schema: luna_pinyin_fluency
11+
- schema: stroke
12+
13+
switcher:
14+
caption: 〔方案選單〕
15+
hotkeys:
16+
- Control+grave
17+
- Control+Shift+grave
18+
- F4
19+
save_options:
20+
- full_shape
21+
- ascii_punct
22+
- simplification
23+
- extended_charset
24+
- zh_hant
25+
- zh_hans
26+
- zh_hant_tw
27+
fold_options: true
28+
abbreviate_options: true
29+
option_list_separator: ''
30+
31+
menu:
32+
page_size: 5
33+
34+
punctuator:
35+
full_shape:
36+
__include: punctuation:/full_shape
37+
half_shape:
38+
__include: punctuation:/half_shape
39+
40+
key_binder:
41+
bindings:
42+
__patch:
43+
- key_bindings:/emacs_editing
44+
- key_bindings:/move_by_word_with_tab
45+
- key_bindings:/paging_with_minus_equal
46+
- key_bindings:/paging_with_comma_period
47+
- key_bindings:/numbered_mode_switch
48+
49+
recognizer:
50+
patterns:
51+
email: "^[A-Za-z][-_.0-9A-Za-z]*@.*$"
52+
uppercase: "[A-Z][-_+.'0-9A-Za-z]*$"
53+
url: "^(www[.]|https?:|ftp[.:]|mailto:|file:).*$|^[a-z]+[.].+$"
54+
55+
ascii_composer:
56+
good_old_caps_lock: true
57+
switch_key:
58+
Shift_L: inline_ascii
59+
Shift_R: commit_text
60+
Control_L: noop
61+
Control_R: noop
62+
Caps_Lock: clear
63+
Eisu_toggle: clear

data/rime-essay

Submodule rime-essay added at e0519d0

data/rime-luna-pinyin

Submodule rime-luna-pinyin added at ce5c828

data/rime-prelude

Submodule rime-prelude added at 3803f09

data/rime-stroke

Submodule rime-stroke added at 65fdbbf

engines/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

engines/fcitx5-rime

Submodule fcitx5-rime added at fd8bf83

0 commit comments

Comments
 (0)