Skip to content

Commit

Permalink
update fcitx5; switch prebuilder (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj authored Nov 22, 2024
1 parent de29375 commit 257744b
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
nlohmann-json \
extra-cmake-modules
IOS_PLATFORM=SIMULATOR ./scripts/install-deps.sh
wget https://github.com/fcitx-contrib/fcitx5-macos-prebuilder/releases/download/latest/marisa-$(uname -m).tar.bz2
wget https://github.com/fcitx-contrib/fcitx5-prebuilder/releases/download/macos/marisa-$(uname -m).tar.bz2
sudo tar xjvf marisa-$(uname -m).tar.bz2 -C /usr/local bin/marisa-build
- name: Build
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,11 @@ if (RIME)
"${PREBUILDER_LIB_DIR}/libmarisa.a"
"${PREBUILDER_LIB_DIR}/libopencc.a"
"${PREBUILDER_LIB_DIR}/libglog.a"
"${PREBUILDER_LIB_DIR}/liblua.a"
)
add_library(Rime_static STATIC IMPORTED)
set_target_properties(Rime_static PROPERTIES
IMPORTED_LOCATION "${PREBUILDER_LIB_DIR}/librime.a"
IMPORTED_LOCATION "-Wl,-force_load,${PREBUILDER_LIB_DIR}/librime.a" # plugins use __attribute__((constructor))
INTERFACE_INCLUDE_DIRECTORIES "${PREBUILDER_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${Rime_dependencies}"
)
Expand Down
20 changes: 8 additions & 12 deletions common/common.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "common.h"
#include "../engines/fcitx5-hallelujah/src/factory.h"
#include "../engines/fcitx5-rime/src/rimefactory.h"
#include "../fcitx5/src/modules/spell/spell.h"
#include "../fcitx5/src/lib/fcitx/addoninstance.h"
#include "../iosfrontend/iosfrontend.h"
#include "../iosnotifications/iosnotifications.h"
#include "../uipanel/uipanel.h"
Expand All @@ -12,10 +11,6 @@

#ifdef HALLELUJAH
fcitx::HallelujahFactory HallelujahFactory;
fcitx::SpellModuleFactory SpellModuleFactory;
#endif
#ifdef RIME
fcitx::RimeEngineFactory RimeFactory;
#endif

namespace fs = std::filesystem;
Expand All @@ -26,23 +21,24 @@ static fcitx::UIPanelFactory UIPanelFactory;

static fcitx::StaticAddonRegistry addons = {
#ifdef HALLELUJAH
std::make_pair<std::string, fcitx::AddonFactory *>("spell",
&SpellModuleFactory),
std::make_pair<std::string, fcitx::AddonFactory *>("hallelujah",
&HallelujahFactory),
#endif
std::make_pair<std::string, fcitx::AddonFactory *>("iosfrontend",
&IosFrontendFactory),
std::make_pair<std::string, fcitx::AddonFactory *>(
"notifications", &IosNotificationsFactory),
std::make_pair<std::string, fcitx::AddonFactory *>("uipanel",
&UIPanelFactory),
};

#ifdef HALLELUJAH
std::make_pair<std::string, fcitx::AddonFactory *>("hallelujah",
&HallelujahFactory),
FCITX_IMPORT_ADDON_FACTORY(addons, spell);
#endif

#ifdef RIME
std::make_pair<std::string, fcitx::AddonFactory *>("rime", &RimeFactory),
FCITX_IMPORT_ADDON_FACTORY(addons, rime);
#endif
};

std::unique_ptr<fcitx::Instance> instance;
std::unique_ptr<fcitx::EventDispatcher> dispatcher;
Expand Down
2 changes: 1 addition & 1 deletion fcitx5
Submodule fcitx5 updated 66 files
+52 −19 CMakeLists.txt
+5 −0 cmake/Fcitx5CompilerSettings.cmake
+2 −2 src/frontend/dbusfrontend/dbusfrontend.conf.in.in
+1 −1 src/frontend/dbusfrontend/dbusfrontend.cpp
+2 −1 src/frontend/fcitx4frontend/fcitx4frontend.conf.in.in
+1 −1 src/frontend/fcitx4frontend/fcitx4frontend.cpp
+2 −1 src/frontend/ibusfrontend/ibusfrontend.conf.in.in
+1 −1 src/frontend/ibusfrontend/ibusfrontend.cpp
+2 −1 src/frontend/waylandim/waylandim.conf.in.in
+1 −1 src/frontend/waylandim/waylandim.cpp
+2 −1 src/frontend/xim/xim.conf.in.in
+1 −1 src/frontend/xim/xim.cpp
+0 −1 src/im/keyboard/CMakeLists.txt
+3 −0 src/im/keyboard/keyboard.conf.in.in
+3 −0 src/im/keyboard/keyboard.cpp
+21 −31 src/lib/fcitx-utils/CMakeLists.txt
+10 −3 src/lib/fcitx-utils/dbus/sdbus/bus.cpp
+19 −2 src/lib/fcitx-utils/event.cpp
+20 −0 src/lib/fcitx-utils/event.h
+8 −3 src/lib/fcitx-utils/event_libuv.cpp
+16 −0 src/lib/fcitx-utils/event_none.cpp
+27 −0 src/lib/fcitx/addoninstance.h
+13 −3 src/lib/fcitx/addonloader.cpp
+4 −4 src/lib/fcitx/addonloader.h
+18 −2 src/lib/fcitx/addonloader_p.h
+3 −2 src/modules/clipboard/clipboard.conf.in.in
+1 −1 src/modules/clipboard/clipboard.cpp
+2 −1 src/modules/dbus/dbus.conf.in.in
+1 −1 src/modules/dbus/dbusmodule.cpp
+3 −0 src/modules/emoji/emoji.conf.in.in
+1 −1 src/modules/emoji/emoji.cpp
+3 −0 src/modules/imselector/imselector.conf.in.in
+1 −1 src/modules/imselector/imselector.cpp
+2 −2 src/modules/notificationitem/notificationitem.conf.in.in
+2 −1 src/modules/notificationitem/notificationitem.cpp
+2 −1 src/modules/notifications/notifications.conf.in.in
+1 −1 src/modules/notifications/notifications.cpp
+1 −1 src/modules/quickphrase/quickphrase.cpp
+3 −0 src/modules/spell/spell.conf.in.in
+1 −1 src/modules/spell/spell.cpp
+3 −0 src/modules/unicode/unicode.conf.in.in
+1 −1 src/modules/unicode/unicode.cpp
+3 −0 src/modules/wayland/wayland.conf.in.in
+1 −1 src/modules/wayland/waylandmodule.cpp
+3 −0 src/modules/xcb/xcb.conf.in.in
+1 −1 src/modules/xcb/xcbmodule.cpp
+3 −11 src/server/main.cpp
+1 −1 src/ui/classic/classicui.cpp
+1 −1 src/ui/kimpanel/kimpanel.cpp
+3 −1 src/ui/virtualkeyboard/virtualkeyboard.cpp
+6 −1 test/CMakeLists.txt
+1 −1 test/addon/dummyaddon.cpp
+3 −0 test/addon/fcitx5/addon/testfrontend.conf
+3 −0 test/addon/fcitx5/addon/testim.conf
+192 −0 test/eventlooptests.cpp
+13 −0 test/eventlooptests.h
+12 −4 test/testcompose.cpp
+376 −0 test/testcustomeventloop.cpp
+4 −178 test/testevent.cpp
+10 −7 test/testspell.cpp
+2 −0 testing/testfrontend/testfrontend.conf
+1 −1 testing/testfrontend/testfrontend.cpp
+2 −1 testing/testim/testim.conf
+1 −1 testing/testim/testim.cpp
+3 −0 testing/testui/testui.conf
+2 −1 testing/testui/testui.cpp
2 changes: 1 addition & 1 deletion patches/fcitx5.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3c7bc877..12612326 100644
index 0d219a51..21695937 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -224,9 +224,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DI
Expand Down
6 changes: 3 additions & 3 deletions patches/rime.patch
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ index 78ef79b..c4abccd 100644
install(TARGETS rime DESTINATION "${CMAKE_INSTALL_LIBDIR}/fcitx5")
fcitx5_translate_desktop_file(rime.conf.in rime.conf)
diff --git a/src/rimeengine.cpp b/src/rimeengine.cpp
index 49fc5b8..b3212fa 100644
index b335069..a65a123 100644
--- a/src/rimeengine.cpp
+++ b/src/rimeengine.cpp
@@ -47,6 +47,8 @@
Expand All @@ -23,9 +23,9 @@ index 49fc5b8..b3212fa 100644

+#include "fcitxipc-swift.h"
+
FCITX_DEFINE_LOG_CATEGORY(rime, "rime");
FCITX_DEFINE_LOG_CATEGORY(rime_log, "rime");

namespace fcitx {
namespace fcitx::rime {
@@ -197,11 +199,17 @@ RimeEngine::RimeEngine(Instance *instance)
deployAction_.setIcon("fcitx_rime_deploy");
deployAction_.setShortText(_("Deploy"));
Expand Down
3 changes: 2 additions & 1 deletion scripts/install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ deps=(
libintl
librime
libuv
lua
marisa
opencc
yaml-cpp
Expand All @@ -22,7 +23,7 @@ fi

for dep in "${deps[@]}"; do
file=$dep$POSTFIX.tar.bz2
[[ -f cache/$file ]] || wget -P cache https://github.com/fcitx-contrib/fcitx5-ios-prebuilder/releases/download/latest/$file
[[ -f cache/$file ]] || wget -P cache https://github.com/fcitx-contrib/fcitx5-prebuilder/releases/download/ios/$file
tar xjvf cache/$file -C $EXTRACT_DIR
done

Expand Down

0 comments on commit 257744b

Please sign in to comment.