From 542c6473c7fbbe93edafa14b20a06c85d260506b Mon Sep 17 00:00:00 2001 From: Qijia Liu Date: Sun, 24 Dec 2023 22:40:28 -0500 Subject: [PATCH 1/2] fix fmt on macOS --- CMakeLists.txt | 5 ++++- src/CMakeLists.txt | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bba6312..02daeea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,10 @@ find_package(Gettext REQUIRED) find_package(Fcitx5Core 5.0.0 REQUIRED) find_package(Fcitx5Module REQUIRED COMPONENTS Spell TestFrontend) find_package(PkgConfig REQUIRED) -find_package(fmt REQUIRED) + +if (NOT TARGET fmt::fmt) + find_package(fmt REQUIRED) +endif() if (NOT DEFINED MARISA_TARGET) pkg_check_modules(Marisa REQUIRED IMPORTED_TARGET marisa) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4d1c5f6..dcbd627 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,5 @@ add_library(hallelujah MODULE hallelujah.cpp) -target_link_libraries(hallelujah Fcitx5::Core Fcitx5::Module::Spell fmt ${MARISA_TARGET} ${JSONC_TARGET}) +target_link_libraries(hallelujah Fcitx5::Core Fcitx5::Module::Spell fmt::fmt ${MARISA_TARGET} ${JSONC_TARGET}) install(TARGETS hallelujah DESTINATION "${FCITX_INSTALL_LIBDIR}/fcitx5") fcitx5_translate_desktop_file(hallelujah.conf.in hallelujah.conf) configure_file(hallelujah-addon.conf.in.in hallelujah-addon.conf.in) From f6b40405cc2b6a9140aee2694754b6a0f522ecf6 Mon Sep 17 00:00:00 2001 From: Qijia Liu Date: Sun, 24 Dec 2023 23:04:24 -0500 Subject: [PATCH 2/2] auto load spell --- src/hallelujah-addon.conf.in.in | 3 +++ src/hallelujah.cpp | 4 ---- src/hallelujah.h | 2 -- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/hallelujah-addon.conf.in.in b/src/hallelujah-addon.conf.in.in index 3907cdd..bd00222 100644 --- a/src/hallelujah-addon.conf.in.in +++ b/src/hallelujah-addon.conf.in.in @@ -5,3 +5,6 @@ Version=@PROJECT_VERSION@ Library=libhallelujah Type=SharedLibrary OnDemand=True + +[Addon/Dependencies] +0=spell diff --git a/src/hallelujah.cpp b/src/hallelujah.cpp index 9ae9ef5..396330b 100644 --- a/src/hallelujah.cpp +++ b/src/hallelujah.cpp @@ -234,10 +234,6 @@ HallelujahEngine::HallelujahEngine(Instance *instance) HallelujahEngine::~HallelujahEngine() { factory_.unregister(); } -void HallelujahEngine::activate(const InputMethodEntry &, InputContextEvent &) { - spell(); -} - void HallelujahEngine::reset(const InputMethodEntry &, InputContextEvent &event) { auto ic = event.inputContext(); diff --git a/src/hallelujah.h b/src/hallelujah.h index e959ed4..b5e5ae6 100644 --- a/src/hallelujah.h +++ b/src/hallelujah.h @@ -52,8 +52,6 @@ class HallelujahEngine final : public InputMethodEngine { HallelujahEngine(Instance *instance); ~HallelujahEngine(); - void activate(const InputMethodEntry &entry, - InputContextEvent &event) override; void keyEvent(const InputMethodEntry &entry, KeyEvent &keyEvent) override; void reset(const InputMethodEntry &, InputContextEvent &event) override; FCITX_ADDON_DEPENDENCY_LOADER(spell, instance_->addonManager());