Skip to content
Merged

dev #32

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ jobs:
# which already attached its artifacts — the follow-up tag push must
# not rebuild everything (it would also strip the dev version suffix).
if: ${{ !contains(github.ref_name, '-dev.') }}
runs-on: ubuntu-22.04
# libei-dev is available starting with Ubuntu 24.04.
runs-on: ubuntu-24.04

steps:
- name: Checkout repository
Expand All @@ -32,7 +33,9 @@ jobs:
sudo apt-get update
sudo apt-get install -y cmake extra-cmake-modules libfcitx5core-dev \
fcitx5 pkg-config gettext dpkg-dev apt-utils librsvg2-bin libdbus-1-dev \
libgl1-mesa-dev libxkbcommon-dev libfontconfig1-dev libxcb1-dev qt6-base-dev
libgl1-mesa-dev libxkbcommon-dev libfontconfig1-dev libxcb1-dev libx11-dev libxtst-dev qt6-base-dev \
libei-dev libportal-dev
pkg-config --print-errors --exists x11 xtst 'libei-1.0 >= 1.0' 'libportal >= 0.7.1'

- name: Install Rust toolchain
run: |
Expand Down Expand Up @@ -77,8 +80,9 @@ jobs:
pre_install: dnf install -y tar git
install: |
dnf install -y cmake extra-cmake-modules fcitx5-devel fcitx5 \
dbus-devel libxcb-devel gettext gcc-c++ make \
dbus-devel libxcb-devel libX11-devel libXtst-devel gettext gcc-c++ make \
qt6-qtbase-devel librsvg2-tools \
'pkgconfig(libei-1.0)' 'pkgconfig(libportal)' \
rpm-build rpm-sign gpg createrepo_c
- distro: opensuse
image: opensuse/tumbleweed
Expand All @@ -87,8 +91,9 @@ jobs:
install: |
zypper --non-interactive install --force-resolution \
cmake extra-cmake-modules \
fcitx5-devel fcitx5 dbus-1-devel libxcb-devel gettext gcc-c++ make \
fcitx5-devel fcitx5 dbus-1-devel libxcb-devel libX11-devel libXtst-devel gettext gcc-c++ make \
qt6-base-devel rsvg-convert \
'pkgconfig(libei-1.0)' 'pkgconfig(libportal)' \
rpm-build gpg2 createrepo_c

container:
Expand All @@ -102,7 +107,9 @@ jobs:
uses: actions/checkout@v4

- name: Install build dependencies
run: ${{ matrix.install }}
run: |
${{ matrix.install }}
pkg-config --print-errors --exists x11 xtst 'libei-1.0 >= 1.0' 'libportal >= 0.7.1'

- name: Import GPG key
env:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y clang-18 clang-tools-18 cmake extra-cmake-modules \
libfcitx5core-dev fcitx5 pkg-config gettext libdbus-1-dev libxcb1-dev \
libfcitx5core-dev fcitx5 pkg-config gettext libdbus-1-dev libxcb1-dev libx11-dev libxtst-dev \
libei-dev libportal-dev \
qt6-base-dev libgl1-mesa-dev libxkbcommon-dev libfontconfig1-dev \
dbus-daemon python3
pkg-config --print-errors --exists x11 xtst 'libei-1.0 >= 1.0' 'libportal >= 0.7.1'
- name: Build, test, and audit includes
env:
CC: clang-18
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ppa-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
sudo sed -i 's|azure\.archive\.ubuntu\.com|archive.ubuntu.com|g' /etc/apt/sources.list /etc/apt/apt-mirrors.txt 2>/dev/null || true
sudo sed -i 's|azure\.archive\.ubuntu\.com|archive.ubuntu.com|g' /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources 2>/dev/null || true
sudo apt-get update
# This runner only prepares source packages. Launchpad installs
# Build-Depends from debian/control in each target series.
sudo apt-get install -y devscripts debhelper dpkg-dev git rsync dput

- name: Resolve version
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.16)
project(fcitx5-skey VERSION 0.8.8)
project(fcitx5-skey VERSION 0.8.9)

# Version compiled into the settings GUI / updater. Dev builds append a
# suffix (e.g. 0.7.5~dev.123) — project() VERSION must stay purely numeric,
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Version: $PKG_VERSION
Section: utils
Priority: optional
Architecture: $PKG_ARCH
Depends: fcitx5, systemd, hicolor-icon-theme, libqt6widgets6, libqt6svg6, libxcb1
Depends: fcitx5, systemd, hicolor-icon-theme, libqt6widgets6, libqt6svg6, libxcb1, libx11-6, libxtst6, libei1, libportal1
Maintainer: Huy
Description: Vietnamese SKey input method addon for Fcitx5
This package provides the skey input method engine for fcitx5,
Expand Down
8 changes: 7 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Build-Depends: debhelper-compat (= 13),
libfontconfig-dev,
librsvg2-bin,
libdbus-1-dev,
libx11-dev,
libxtst-dev,
libei-dev,
libportal-dev (>= 0.7.1),
cargo,
rustc,
libstd-rust-dev,
Expand All @@ -32,7 +36,9 @@ Depends: ${shlibs:Depends},
# without it the Icons tab (and system tray icon) render blank.
libqt6svg6,
acl,
udev
udev,
libei1,
libportal1
Description: Vietnamese SKey input method addon for Fcitx5
Skey is a Vietnamese input method engine for the Fcitx5
input method framework, supporting Telex, Telex W, and VNI
Expand Down
4 changes: 2 additions & 2 deletions packaging/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ pkgdesc="Vietnamese SKey input method addon for Fcitx5 (skey-engine)"
arch=('x86_64')
url="https://github.com/collyn/skey"
license=('GPL-3.0-or-later')
depends=('fcitx5' 'hicolor-icon-theme' 'qt6-base' 'qt6-svg' 'systemd' 'acl')
makedepends=('cmake' 'extra-cmake-modules' 'gettext' 'dbus' 'rust' 'gcc' 'libxcb' 'librsvg')
depends=('fcitx5' 'hicolor-icon-theme' 'qt6-base' 'qt6-svg' 'systemd' 'acl' 'libx11' 'libxtst' 'libei' 'libportal')
makedepends=('cmake' 'extra-cmake-modules' 'gettext' 'dbus' 'rust' 'gcc' 'libxcb' 'libx11' 'libxtst' 'librsvg' 'libei' 'libportal')
# source is the git checkout itself — CI populates src/ before invoking makepkg -e
source=()
install=packaging/fcitx5-skey.install
Expand Down
6 changes: 6 additions & 0 deletions packaging/fcitx5-skey.spec
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ BuildRequires: gcc-c++
BuildRequires: make
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(xcb)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xtst)
BuildRequires: pkgconfig(libei-1.0) >= 1.0
BuildRequires: pkgconfig(libportal) >= 0.7.1
# rust + cargo provided by rustup in CI; use distro packages for local builds:
# BuildRequires: rust
# BuildRequires: cargo
Expand All @@ -51,6 +55,8 @@ Requires: fcitx5
Requires: hicolor-icon-theme
Requires: systemd
Requires: acl
# RPM generates shared-library requirements automatically, including the
# correct providers on openSUSE (libei1 / libportal1).

%description
SKey (Simple Key) is a Vietnamese input method engine for Fcitx5,
Expand Down
8 changes: 8 additions & 0 deletions packaging/nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
librsvg, # rsvg-convert for PNG tray icons
dbus,
libxcb, # X11 WM_CLASS detection
libX11,
libXtst,
libei,
libportal,
fcitx5,
qt6, # settings GUI (qtbase/qtwayland/qtsvg) + wrapQtAppsHook
rustPlatform,
Expand Down Expand Up @@ -119,6 +123,10 @@ stdenv.mkDerivation (finalAttrs: {
fcitx5
dbus
libxcb
libX11
libXtst
libei
libportal
qt6.qtbase
qt6.qtwayland # runtime platform plugin for the settings GUI on Wayland
qt6.qtsvg # QIcon SVG loading at runtime
Expand Down
18 changes: 18 additions & 0 deletions po/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -1095,3 +1095,21 @@ msgstr "Update successful! The system has been rebuilt with nixos-rebuild."
#: src/settings/updater.cpp:580
msgid "Cập nhật thất bại (mã %1): %2"
msgstr "Update failed (code %1): %2"

msgid "Thay thế Uinput bằng Native"
msgstr "Replace Uinput with Native"

msgid "Khi bật, Native thay thế Uinput trong Auto và trong menu chọn mode."
msgstr "When enabled, Native replaces Uinput in Auto mode and the mode menu."

msgid "Native"
msgstr "Native"

msgid "Native (XTest/Libei)"
msgstr "Native (XTest/Libei)"

msgid "Loại trừ ứng dụng"
msgstr "Exclude application"

msgid "Output Mode: Native"
msgstr "Output Mode: Native"
18 changes: 18 additions & 0 deletions po/fcitx5-skey.pot
Original file line number Diff line number Diff line change
Expand Up @@ -986,3 +986,21 @@ msgstr ""
#: src/settings/updater.cpp:580
msgid "Cập nhật thất bại (mã %1): %2"
msgstr ""

msgid "Thay thế Uinput bằng Native"
msgstr ""

msgid "Khi bật, Native thay thế Uinput trong Auto và trong menu chọn mode."
msgstr ""

msgid "Native"
msgstr ""

msgid "Native (XTest/Libei)"
msgstr ""

msgid "Loại trừ ứng dụng"
msgstr ""

msgid "Output Mode: Native"
msgstr ""
18 changes: 18 additions & 0 deletions po/vi.po
Original file line number Diff line number Diff line change
Expand Up @@ -1094,3 +1094,21 @@ msgstr "Cập nhật thành công! Hệ thống đã được build lại bằng
#: src/settings/updater.cpp:580
msgid "Cập nhật thất bại (mã %1): %2"
msgstr "Cập nhật thất bại (mã %1): %2"

msgid "Thay thế Uinput bằng Native"
msgstr "Thay thế Uinput bằng Native"

msgid "Khi bật, Native thay thế Uinput trong Auto và trong menu chọn mode."
msgstr "Khi bật, Native thay thế Uinput trong Auto và trong menu chọn mode."

msgid "Native"
msgstr "Native"

msgid "Native (XTest/Libei)"
msgstr "Native (XTest/Libei)"

msgid "Loại trừ ứng dụng"
msgstr "Loại trừ ứng dụng"

msgid "Output Mode: Native"
msgstr "Output Mode: Native"
23 changes: 22 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set(CMAKE_AUTORCC OFF)

set(SKEY_SOURCES
engine.cpp
native_injector.cpp
vietnamese.cpp
viet_recompose.cpp
viet_undo.cpp
Expand All @@ -20,13 +21,15 @@ set(SKEY_SOURCES
find_package(PkgConfig REQUIRED)
pkg_check_modules(DBUS REQUIRED dbus-1)
pkg_check_modules(XCB REQUIRED xcb)
pkg_check_modules(NATIVE_X11 REQUIRED IMPORTED_TARGET x11 xtst)

add_library(skey MODULE ${SKEY_SOURCES})
target_link_libraries(skey
Fcitx5::Core
skey_engine
${DBUS_LIBRARIES}
${XCB_LIBRARIES}
PkgConfig::NATIVE_X11
pthread
dl
m
Expand Down Expand Up @@ -66,11 +69,13 @@ target_include_directories(test_a11y_monitor PRIVATE ${DBUS_INCLUDE_DIRS})
target_compile_features(test_a11y_monitor PRIVATE cxx_std_17)
add_test(NAME A11yMonitor COMMAND test_a11y_monitor)
add_executable(test_engine_performance test_engine_performance.cpp ${SKEY_SOURCES})
target_link_libraries(test_engine_performance Fcitx5::Core skey_engine ${DBUS_LIBRARIES} ${XCB_LIBRARIES} pthread dl m)
target_link_libraries(test_engine_performance Fcitx5::Core skey_engine ${DBUS_LIBRARIES} ${XCB_LIBRARIES} PkgConfig::NATIVE_X11 pthread dl m)
target_include_directories(test_engine_performance PRIVATE ${SKEY_ENGINE_DIR} ${DBUS_INCLUDE_DIRS} ${XCB_INCLUDE_DIRS})
target_compile_features(test_engine_performance PRIVATE cxx_std_17)
target_compile_definitions(test_engine_performance PRIVATE FCITX_SKEY_ICON_PATH="/tmp/skey-test.svg" FCITX_SKEY_ICON_DIR="/tmp")
add_test(NAME EnginePerformance COMMAND test_engine_performance)
add_test(NAME InjectedBackspaceContract COMMAND ${CMAKE_COMMAND} -E env
SKEY_TEST_BACKSPACE_ONLY=1 $<TARGET_FILE:test_engine_performance>)
set_tests_properties(EnginePerformance PROPERTIES TIMEOUT 15)
find_program(DBUS_RUN_SESSION dbus-run-session)
if(DBUS_RUN_SESSION)
Expand Down Expand Up @@ -103,3 +108,19 @@ configure_file(
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/skey-im.conf"
DESTINATION "${FCITX_INSTALL_PKGDATADIR}/inputmethod")

# Optional experimental portal keyboard backend. Ordinary builds keep working.
pkg_check_modules(LIBEI QUIET IMPORTED_TARGET libei-1.0>=1.0)
pkg_check_modules(LIBPORTAL QUIET IMPORTED_TARGET libportal>=0.7.1)
if(LIBEI_FOUND AND LIBPORTAL_FOUND)
message(STATUS "Libei backend enabled (libei ${LIBEI_VERSION}, libportal ${LIBPORTAL_VERSION})")
foreach(target skey test_engine_performance)
target_compile_definitions(${target} PRIVATE SKEY_HAVE_LIBEI=1)
if(LIBPORTAL_VERSION VERSION_GREATER_EQUAL 0.8)
target_compile_definitions(${target} PRIVATE SKEY_LIBPORTAL_PERSIST=1)
endif()
target_link_libraries(${target} PkgConfig::LIBEI PkgConfig::LIBPORTAL)
endforeach()
else()
message(WARNING "Libei backend disabled: requires libei >= 1.0 and libportal >= 0.7.1")
endif()
10 changes: 7 additions & 3 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@ enum class SKeyInputMethod { Telex, VNI };
FCITX_CONFIG_ENUM_NAME_WITH_I18N(SKeyInputMethod, N_("Telex"), N_("VNI"));

// Output mode
enum class SKeyOutputMode { Uinput, SurroundingText, Preedit, Auto };
enum class SKeyOutputMode { Uinput, SurroundingText, Preedit, Auto, Native };
FCITX_CONFIG_ENUM_NAME_WITH_I18N(SKeyOutputMode, N_("Uinput"),
N_("Surrounding Text"),
N_("Preedit"),
N_("Auto"));
N_("Auto"), N_("Native"));

// Output mode used only in Chromium-family browser address bars.
enum class SKeyChromiumAddressBarMode {
Auto, Uinput, SurroundingText, Preedit, NoVietnamese
Auto, Uinput, SurroundingText, Preedit, Native, NoVietnamese
};
FCITX_CONFIG_ENUM_NAME_WITH_I18N(SKeyChromiumAddressBarMode, N_("Auto"),
N_("Uinput"),
N_("Surrounding Text"),
N_("Preedit"),
N_("Native"),
N_("No Vietnamese"));

// Character set / encoding — IDs match skey-engine VietCharset enum
Expand All @@ -52,6 +53,9 @@ FCITX_CONFIGURATION(
SKeyCharset::Unicode};
Option<SKeyOutputMode> outputMode{this, "OutputMode", _("Chế độ xuất"),
SKeyOutputMode::Auto};
// Keep the on-disk key for compatibility with existing installations.
Option<bool> replaceUinputWithNative{this, "PreferLibeiAuto",
_("Thay thế Uinput bằng Native"), false};
Option<bool> freeMarking{this, "FreeMarking", _("Đánh dấu tự do"), false};
Option<bool> autoRestore{this, "AutoRestore",
_("Tự động khôi phục"), true};
Expand Down
Loading
Loading