Skip to content

Commit

Permalink
chore: 支持 charcode 插件
Browse files Browse the repository at this point in the history
  • Loading branch information
imfuxiao committed Oct 21, 2023
1 parent a40d927 commit c0c8ee1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
path: |
/Users/runner/work/LibrimeKit/LibrimeKit/boost-iosx/frameworks
/Users/runner/work/LibrimeKit/LibrimeKit/boost-iosx/dest
/Users/runner/work/LibrimeKit/LibrimeKit/boost-iosx/scripts
key: ${{ runner.os }}-boost

- name: Build Boost
Expand All @@ -37,6 +38,7 @@ jobs:
path: |
/Users/runner/work/LibrimeKit/LibrimeKit/boost-iosx/frameworks
/Users/runner/work/LibrimeKit/LibrimeKit/boost-iosx/dest
/Users/runner/work/LibrimeKit/LibrimeKit/boost-iosx/scripts
key: ${{ runner.os }}-boost

- name: Build Librime
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ mkfile_dir := $(dir $(mkfile_path))
COCOAPODS_EXISTS:=$(shell gem list -i cocoapods)

BOOST_FRAMEWORK_PATH=boost-iosx/frameworks
ICU_FRAMEWORK_PATH=boost-iosx/scripts/Pods/icu4c-iosx/product/frameworks

.PHONY: cocoapads boost-build boost-clean librime-check librime-build librime-clean

Expand All @@ -23,7 +24,13 @@ boost-build: cocoapods
cp -rf ${BOOST_FRAMEWORK_PATH}/boost_atomic.xcframework Frameworks && \
cp -rf ${BOOST_FRAMEWORK_PATH}/boost_filesystem.xcframework Frameworks && \
cp -rf ${BOOST_FRAMEWORK_PATH}/boost_regex.xcframework Frameworks && \
cp -rf ${BOOST_FRAMEWORK_PATH}/boost_system.xcframework Frameworks
cp -rf ${BOOST_FRAMEWORK_PATH}/boost_locale.xcframework Frameworks && \
cp -rf ${BOOST_FRAMEWORK_PATH}/boost_system.xcframework Frameworks && \
cp -rf ${ICU_FRAMEWORK_PATH}/icudata.xcframework Frameworks && \
cp -rf ${ICU_FRAMEWORK_PATH}/icui18n.xcframework Frameworks && \
cp -rf ${ICU_FRAMEWORK_PATH}/icuio.xcframework Frameworks && \
cp -rf ${ICU_FRAMEWORK_PATH}/icuuc.xcframework Frameworks


boost-clean:
${MAKE} -C boost-iosx clean
Expand Down
2 changes: 1 addition & 1 deletion boost-iosx
Submodule boost-iosx updated 1 files
+4 −4 scripts/build.sh
8 changes: 4 additions & 4 deletions librimeBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ rm -rf ${RIME_ROOT}/librime/plugins/lua
${RIME_ROOT}/librime/install-plugins.sh imfuxiao/librime-lua@main

# install charcode
# TODO: 需要依赖 boost_locale.xcframework 而 boost_locale 依赖 icu, 在 xcode下编译失败
# rm -rf ${RIME_ROOT}/librime/plugins/librime-charcode
# ${RIME_ROOT}/librime/install-plugins.sh rime/librime-charcode
# 下面记得添加 rime_require_module_charcode()
rm -rf ${RIME_ROOT}/librime/plugins/librime-charcode
${RIME_ROOT}/librime/install-plugins.sh rime/librime-charcode

# 添加lua模块依赖
sed -i "" '/#if RIME_BUILD_SHARED_LIBS/,/#endif/c\
Expand All @@ -34,13 +32,15 @@ extern void rime_require_module_dict();\
extern void rime_require_module_gears();\
extern void rime_require_module_levers();\
extern void rime_require_module_lua();\
extern void rime_require_module_charcode();\
// link to default modules explicitly when building static library.\
static void rime_declare_module_dependencies() {\
rime_require_module_core();\
rime_require_module_dict();\
rime_require_module_gears();\
rime_require_module_levers();\
rime_require_module_lua();\
rime_require_module_charcode();\
}\
#endif\
' ${RIME_ROOT}/librime/src/rime_api.cc
Expand Down

0 comments on commit c0c8ee1

Please sign in to comment.