diff --git a/.gitmodules b/.gitmodules index bdc33c8..37d59fb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "entry/src/main/cpp/fcitx5-chinese-addons"] path = entry/src/main/cpp/fcitx5-chinese-addons url = https://github.com/fcitx/fcitx5-chinese-addons +[submodule "entry/src/main/cpp/fcitx5-lua"] + path = entry/src/main/cpp/fcitx5-lua + url = https://github.com/fcitx/fcitx5-lua diff --git a/entry/src/main/cpp/CMakeLists.txt b/entry/src/main/cpp/CMakeLists.txt index 1aa2561..b893b56 100644 --- a/entry/src/main/cpp/CMakeLists.txt +++ b/entry/src/main/cpp/CMakeLists.txt @@ -41,6 +41,10 @@ option(ENABLE_DATA "" OFF) option(ENABLE_TOOLS "" OFF) add_subdirectory(libime) +option(USE_DLOPEN "" OFF) +add_subdirectory(fcitx5-lua) +target_link_libraries(luaaddonloader "-L${PREBUILT_DIR}/lib" lua) + option(ENABLE_CLOUDPINYIN "" OFF) option(ENABLE_GUI "" OFF) set(OPENCC_INCLUDE_DIR "${PREBUILT_DIR}/include/opencc") diff --git a/entry/src/main/cpp/fcitx5-lua b/entry/src/main/cpp/fcitx5-lua new file mode 160000 index 0000000..3652f5f --- /dev/null +++ b/entry/src/main/cpp/fcitx5-lua @@ -0,0 +1 @@ +Subproject commit 3652f5f0c38488fe420fb09aac35ff53f72c0389 diff --git a/scripts/install-deps.sh b/scripts/install-deps.sh index a7caa44..3f19f16 100755 --- a/scripts/install-deps.sh +++ b/scripts/install-deps.sh @@ -1,7 +1,10 @@ +set -e + deps=( boost ecm fmt + lua libintl marisa opencc @@ -21,6 +24,13 @@ done RES_EXTRACT_DIR=entry/src/main/resources/resfile/usr mkdir -p $RES_EXTRACT_DIR -file=chinese-addons-any.tar.bz2 -[[ -f cache/$file ]] || wget -P cache https://github.com/fcitx-contrib/fcitx5-plugins/releases/download/macos/$file -tar xf cache/$file -C $RES_EXTRACT_DIR lib share +addons=( + chinese-addons + lua +) +for addon in "${addons[@]}"; do + file=$addon-any.tar.bz2 + [[ -f cache/$file ]] || wget -P cache https://github.com/fcitx-contrib/fcitx5-plugins/releases/download/macos/$file + tar xf cache/$file -C $RES_EXTRACT_DIR lib || true + tar xf cache/$file -C $RES_EXTRACT_DIR share +done