Skip to content

Commit

Permalink
lua addon (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj authored Dec 9, 2024
1 parent 3477ae1 commit 1109806
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
[submodule "engines/libime"]
path = engines/libime
url = https://github.com/fcitx/libime
[submodule "engines/fcitx5-lua"]
path = engines/fcitx5-lua
url = https://github.com/fcitx/fcitx5-lua
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ git apply --directory=engines/fcitx5-rime patches/rime.patch # if building with
```sh
cmake -B build -G Xcode \
-DURL_SCHEME=fcitx \
-DCHINESE_ADDONS=ON \
-DHALLELUJAH=ON \
-DRIME=ON \
-DCMAKE_TOOLCHAIN_FILE=cmake/ios.cmake \
-DIOS_PLATFORM=SIMULATOR
cmake --build build --config Debug
```
Expand Down
11 changes: 8 additions & 3 deletions engines/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
set(DEFAULT_INPUT_METHODS)

if (CHINESE_ADDONS)
option(ENABLE_GUI OFF)
option(ENABLE_CLOUDPINYIN OFF)
option(ENABLE_DATA OFF)
add_definitions(-DCHINESE_ADDONS)
set(_Fcitx5Macro_SELF_DIR "${PROJECT_SOURCE_DIR}/fcitx5/src/lib/fcitx-utils")

option(USE_DLOPEN "" OFF)
add_subdirectory(fcitx5-lua)

option(ENABLE_DATA OFF)
set(HAS_STD_FILESYSTEM 1)
set(ENABLE_TOOLS OFF)
add_subdirectory(libime)
# suppress configure error
install(TARGETS kenlm EXPORT LibIMECoreTargets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib)

option(ENABLE_GUI OFF)
option(ENABLE_CLOUDPINYIN OFF)
add_subdirectory(fcitx5-chinese-addons)
list(APPEND DEFAULT_INPUT_METHODS pinyin shuangpin wbx)
endif()
Expand Down
1 change: 1 addition & 0 deletions engines/fcitx5-lua
Submodule fcitx5-lua added at 1d28eb
8 changes: 7 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,18 @@ copy_to_keyboard(copy "${FCITX5_MODULE_BINARY_DIR}/spell/spell.conf" "${ADDON_PR
copy_share_to_keyboard(copy fcitx5/spell/en_dict.fscd "share/fcitx5/spell/en_dict.fscd")

if (CHINESE_ADDONS)
set(LUA_BINARY_DIR "${PROJECT_BINARY_DIR}/engines/fcitx5-lua")
copy_to_keyboard(copy "${LUA_BINARY_DIR}/src/addonloader/luaaddonloader.conf" "${ADDON_PREFIX}/luaaddonloader.conf")
copy_to_keyboard(copy "${LUA_BINARY_DIR}/src/imeapi/imeapi.conf" "${ADDON_PREFIX}/imeapi.conf")
copy_to_keyboard(copy "${PROJECT_SOURCE_DIR}/engines/fcitx5-lua/src/imeapi/imeapi.lua" "share/fcitx5/lua/imeapi/imeapi.lua")

set(CHINESE_ADDONS_BINARY_DIR "${PROJECT_BINARY_DIR}/engines/fcitx5-chinese-addons")

# Pinyin addon and im
# Pinyin addon, im and lua
copy_to_keyboard(copy "${CHINESE_ADDONS_BINARY_DIR}/im/pinyin/pinyin-addon.conf" "${ADDON_PREFIX}/pinyin.conf")
copy_to_keyboard(copy "${CHINESE_ADDONS_BINARY_DIR}/im/pinyin/pinyin.conf" "${IM_PREFIX}/pinyin.conf")
copy_to_keyboard(copy "${CHINESE_ADDONS_BINARY_DIR}/im/pinyin/shuangpin.conf" "${IM_PREFIX}/shuangpin.conf")
copy_to_keyboard(copy "${PROJECT_SOURCE_DIR}/engines/fcitx5-chinese-addons/im/pinyin/pinyin.lua" "share/fcitx5/lua/imeapi/extensions/pinyin.lua")

# Table addon, im and dict
copy_to_keyboard(copy "${CHINESE_ADDONS_BINARY_DIR}/im/table/table.conf" "share/fcitx5/addon/table.conf")
Expand Down

0 comments on commit 1109806

Please sign in to comment.