Compare commits

...

No commits in common. "c8" and "c10s" have entirely different histories.
c8 ... c10s

14 changed files with 331 additions and 119 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

14
.gitignore vendored
View File

@ -1 +1,13 @@
SOURCES/ibus-hangul-1.5.1.tar.gz
ibus-hangul-1.2.0.20100102.tar.gz
ibus-hangul-1.3.0.20100329.tar.gz
/ibus-hangul-1.3.0.20100329.tar.gz
/ibus-hangul-1.3.1.tar.gz
/ibus-hangul-1.3.2.tar.gz
/ibus-hangul-1.4.0.tar.gz
/ibus-hangul-1.4.1.tar.gz
/ibus-hangul-1.4.2.tar.gz
/ibus-hangul-1.5.0.tar.gz
/ibus-hangul-1.5.1.tar.gz
/ibus-hangul-1.5.3.tar.gz
/ibus-hangul-1.5.4.tar.gz
/ibus-hangul-1.5.5.tar.xz

View File

@ -1 +0,0 @@
4257fee2e5bdf9251ef2d1d1f08f7b27ef624abb SOURCES/ibus-hangul-1.5.1.tar.gz

View File

@ -1,42 +0,0 @@
Index: ibus-hangul-1.5.1/src/engine.c
===================================================================
--- ibus-hangul-1.5.1.orig/src/engine.c
+++ ibus-hangul-1.5.1/src/engine.c
@@ -22,6 +22,7 @@
#include <config.h>
#endif
+#include <stdio.h>
#include <ibus.h>
#include <gio/gio.h>
#include <hangul.h>
@@ -217,6 +218,11 @@ static int initial_input_mode = INPUT_MO
* whether to use event forwarding workaround
*/
static gboolean use_event_forwarding = TRUE;
+/**
+ * whether to use client commit
+ * See: https://github.com/libhangul/ibus-hangul/pull/68
+ */
+static gboolean use_client_commit = TRUE;
static glong
ucschar_strlen (const ucschar* str)
@@ -1351,7 +1357,17 @@ ibus_hangul_engine_reset (IBusEngine *en
{
IBusHangulEngine *hangul = (IBusHangulEngine *) engine;
+ if (use_client_commit) {
+ // ibus-hangul uses
+ // ibus_engine_update_preedit_text_with_mode() function which makes
+ // the preedit string committed automatically when the reset is received
+ // So we don't need to commit the preedit here.
+ hangul_ic_reset (hangul->context);
+ ustring_clear (hangul->preedit);
+ }
+
ibus_hangul_engine_flush (hangul);
+
IBUS_ENGINE_CLASS (parent_class)->reset (engine);
}

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
--- !Policy
product_versions:
- rhel-10
decision_context: osci_compose_gate
rules:
# this is the testcase identifier, which OSCI pipeline uses
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

@ -0,0 +1,23 @@
From eaaf6aa222926835fa155d587b05c199107cb449 Mon Sep 17 00:00:00 2001
From: Peng Wu <alexepico@gmail.com>
Date: Tue, 10 Dec 2024 10:38:44 +0800
Subject: [PATCH] Support the key event from on screen keyboard
---
src/engine.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/engine.c b/src/engine.c
index faa3fb1..d23bd24 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -1505,7 +1505,8 @@ ibus_hangul_engine_process_key_event (IBusEngine *engine,
bool is_transliteration_mode =
hangul_ic_is_transliteration(hangul->context);
if (!is_transliteration_mode) {
- if (keymap != NULL)
+ // on screen keyboard will send key event without keycode.
+ if (keymap != NULL && keycode != 0)
keyval = ibus_keymap_lookup_keysym(keymap, keycode, modifiers);
}

View File

@ -0,0 +1,29 @@
From 705dd2553695e47b638cb79d52cfbff03136b227 Mon Sep 17 00:00:00 2001
From: Takao Fujiwara <tfujiwar@redhat.com>
Date: Fri, 16 Sep 2022 17:01:15 +0900
Subject: [PATCH] Change the definition of IBUS_CAP_SYNC_PROCESS_KEY
After the new proces key event is integrated in ibus-x11,
IBUS_CAP_SYNC_PROCESS_KEY capability is now set the sync mode only
since ibus-hangul requires forward-key-event for the sync mode only.
---
src/engine.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Index: ibus-hangul-1.5.4/src/engine.c
===================================================================
--- ibus-hangul-1.5.4.orig/src/engine.c
+++ ibus-hangul-1.5.4/src/engine.c
@@ -1577,7 +1577,11 @@ ibus_hangul_engine_process_key_event (IB
*
* See: https://github.com/choehwanjin/ibus-hangul/issues/40
*/
- if (use_event_forwarding) {
+ if (use_event_forwarding
+#if IBUS_CHECK_VERSION(1, 5, 27)
+ && (hangul->caps & IBUS_CAP_SYNC_PROCESS_KEY_V2)
+#endif
+ ) {
if (!retval) {
ibus_engine_forward_key_event (engine, orig_keyval, keycode, modifiers);
}

View File

@ -2,90 +2,61 @@
%global require_libhangul_version 0.1.0
Name: ibus-hangul
Version: 1.5.1
Release: 6%{?dist}
Version: 1.5.5
Release: 9%{?dist}
Summary: The Hangul engine for IBus input platform
License: GPLv2+
Group: System Environment/Libraries
License: GPL-2.0-or-later
URL: https://github.com/libhangul/ibus-hangul
Source0: https://github.com/libhangul/ibus-hangul/releases/download/%{version}/%{name}-%{version}.tar.gz
Source0: https://github.com/libhangul/ibus-hangul/releases/download/%{version}/%{name}-%{version}.tar.xz
# not upstreamed patches
Patch1: ibus-hangul-setup-abspath.patch
# patch from upstream
Patch2: ibus-hangul-fixes-reset-signal.patch
Patch2: ibus-hangul-fixes-osk.patch
BuildRequires: gettext-devel, automake, libtool
BuildRequires: intltool
BuildRequires: libtool
BuildRequires: libhangul-devel >= %{require_libhangul_version}
BuildRequires: pkgconfig
BuildRequires: ibus-devel >= %{require_ibus_version}
BuildRequires: desktop-file-utils
BuildRequires: python3-devel
BuildRequires: gnome-common
BuildRequires: gtk3-devel
BuildRequires: make
Requires: ibus >= %{require_ibus_version}
Requires: libhangul >= %{require_libhangul_version}
Requires: python3-gobject
Requires: %{__python3}
Requires: python3
%description
The Hangul engine for IBus platform. It provides Korean input method from
libhangul.
%prep
%setup -q
%patch1 -p1 -b .setup-abspath
%patch2 -p1 -b .reset
%package tests
Summary: Tests for the %{name} package
Requires: %{name}%{?_isa} = %{version}-%{release}
# autopoint -f
# AUTOPOINT='intltoolize --automake --copy' autoreconf -fi
%description tests
The %{name}-tests package contains tests that can be used to verify
the functionality of the installed %{name} package.
%prep
%autosetup -p1
%build
./autogen.sh
%configure --disable-static --with-python=python3 %{?_with_hotkeys}
# make -C po update-gmo
%configure \
--disable-static \
--with-python=python3 \
%{?_with_hotkeys} \
--enable-installed-tests \
%{nil}
make %{?_smp_mflags}
%install
make DESTDIR=${RPM_BUILD_ROOT} install INSTALL="install -p"
# Register as an AppStream component to be visible in the software center
#
# NOTE: It would be *awesome* if this file was maintained by the upstream
# project, translated and installed into the right place during `make install`.
#
# See http://www.freedesktop.org/software/appstream/docs/ for more details.
#
mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata
cat > $RPM_BUILD_ROOT%{_datadir}/appdata/hangul.appdata.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<component type="inputmethod">
<id>hangul.xml</id>
<metadata_license>CC0-1.0</metadata_license>
<name>Hangul</name>
<summary>Korean input method</summary>
<description>
<p>
The Hangul input method is designed for entering Korean text.
</p>
<p>
Input methods are typing systems allowing users to input complex languages.
They are necessary because these contain too many characters to simply be laid
out on a traditional keyboard.
</p>
</description>
<url type="homepage">http://code.google.com/p/ibus/</url>
<compulsory_for_desktop>GNOME</compulsory_for_desktop>
<project_group>GNOME</project_group>
<developer_name>The GNOME Project</developer_name>
<url type="bugtracker">https://code.google.com/p/ibus/issues/list</url>
<url type="donation">http://www.gnome.org/friends/</url>
<url type="help">https://code.google.com/p/ibus/wiki/FAQ</url>
<update_contact><!-- upstream-contact_at_email.com --></update_contact>
</component>
EOF
%py_byte_compile %{python3} $RPM_BUILD_ROOT%{_datadir}/ibus-hangul/setup
rm -f ${RPM_BUILD_ROOT}%{_bindir}/ibus-setup-hangul
sed -i 's!^Exec=ibus-setup-hangul!Exec=%{_libexecdir}/ibus-setup-hangul!' ${RPM_BUILD_ROOT}%{_datadir}/applications/ibus-setup-hangul.desktop
@ -94,43 +65,136 @@ desktop-file-validate ${RPM_BUILD_ROOT}%{_datadir}/applications/ibus-setup-hangu
%find_lang %{name}
%post
[ -x %{_bindir}/ibus ] && \
%{_bindir}/ibus write-cache --system &>/dev/null || :
%postun
[ -x %{_bindir}/ibus ] && \
%{_bindir}/ibus write-cache --system &>/dev/null || :
%check
make check \
DISABLE_GUI_TESTS="ibus-hangul" \
VERBOSE=1
%files -f %{name}.lang
%doc AUTHORS COPYING README
%{_libexecdir}/ibus-engine-hangul
%{_libexecdir}/ibus-setup-hangul
%{_datadir}/appdata/*.appdata.xml
%{_datadir}/metainfo/*.metainfo.xml
%{_datadir}/glib-2.0/schemas/*.gschema.xml
%{_datadir}/ibus-hangul
%{_datadir}/ibus/component/*
%{_datadir}/applications/ibus-setup-hangul.desktop
%{_datadir}/icons/hicolor/*/apps/*
%files tests
%dir %{_libexecdir}/installed-tests
%{_libexecdir}/installed-tests/ibus-hangul
%dir %{_datadir}/installed-tests
%{_datadir}/installed-tests/ibus-hangul
%changelog
* Mon Jun 8 2020 Peng Wu <pwu@redhat.com> - 1.5.1-6
- Rebuild for RHEL 8.3
- Resolves: #1661079
* Mon Dec 23 2024 Peng Wu <pwu@redhat.com> - 1.5.5-9
- Fix some issue with On Screen Keyboard
- Add ibus-hangul-fixes-osk.patch
- Resolves: RHEL-69510
* Tue Dec 3 2019 Peng Wu <pwu@redhat.com> - 1.5.1-5
- Fixes reset signal
- Add ibus-hangul-fixes-reset-signal.patch
- Resolves: #1661079
* Mon Dec 9 2024 Peng Wu <pwu@redhat.com> - 1.5.5-8
- Update CI tests
- Resolves: RHEL-70370
* Thu Sep 20 2018 Tomas Orsava <torsava@redhat.com> - 1.5.1-4
- Require the Python interpreter directly instead of using the package name
- Related: rhbz#1619153
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 1.5.5-7
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Mon Aug 13 2018 Troy Dawson <tdawson@redhat.com> - 1.5.1-3
- Add BuildRequest python3-devel
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1.5.5-6
- Bump release for June 2024 mass rebuild
* Mon Jul 30 2018 Florian Weimer <fweimer@redhat.com> - 1.5.1-2
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.5-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sat Jan 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue May 9 2023 Peng Wu <pwu@redhat.com> - 1.5.5-2
- Migrate to SPDX license
* Thu May 4 2023 Peng Wu <pwu@redhat.com> - 1.5.5-1
- Update to 1.5.5
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.4-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Nov 25 2022 Peng Wu <pwu@redhat.com> - 1.5.4-14
- Update ibus-hangul-gtk4-sync.patch
* Tue Aug 23 2022 Peng Wu <pwu@redhat.com> - 1.5.4-13
- Rebuild the package
* Fri Aug 19 2022 Peng Wu <pwu@redhat.com> - 1.5.4-12
- Fix forward key event issue with ibus-gtk4
- Add ibus-hangul-gtk4-sync.patch
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.4-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Jul 21 2022 Tomas Popela <tpopela@redhat.com> - 1.5.4-10
- Drop BR on gnome-common as the project was moved away from intltool
- Drop duplicated libtool BR
* Fri Jun 10 2022 Peng Wu <pwu@redhat.com> - 1.5.4-9
- Drop BuildRequires: intltool
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.4-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.4-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Jun 18 2021 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.4-6
- Delete ibus write-cache in scriptlet
* Wed Apr 21 2021 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.4-5
- Resolves: #1948197 Change post to posttrans
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Thu Sep 10 2020 Peng Wu <pwu@redhat.com> - 1.5.4-3
- Add tests sub package
* Wed Sep 2 2020 Peng Wu <pwu@redhat.com> - 1.5.4-2
- Clean up the spec file
* Mon Aug 24 2020 Peng Wu <pwu@redhat.com> - 1.5.4-1
- Update to 1.5.4
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jul 13 2020 Peng Wu <pwu@redhat.com> - 1.5.3-3
- Switch to use py_byte_compile rpm macro
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Dec 26 2019 Peng Wu <pwu@redhat.com> - 1.5.3-1
- Update to 1.5.3
* Tue Aug 6 2019 Peng Wu <pwu@redhat.com> - 1.5.1-7
- Change default mode to latin
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Apr 19 2019 Peng Wu <pwu@redhat.com> - 1.5.1-5
- Fixes double commit issue with web browser
- Add patch ibus-hangul-fixes-reset.patch
* Fri Mar 22 2019 Peng Wu <pwu@redhat.com> - 1.5.1-4
- Change default mode to hangul
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Tue Jul 31 2018 Florian Weimer <fweimer@redhat.com> - 1.5.1-2
- Rebuild with fixed binutils
* Mon Jul 30 2018 Peng Wu <pwu@redhat.com> - 1.5.1-1

5
plans/basic.fmf Normal file
View File

@ -0,0 +1,5 @@
summary: Basic smoke test
discover:
how: fmf
execute:
how: tmt

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (ibus-hangul-1.5.5.tar.xz) = c95900b8f47fc69dda04b6a41a1965a6d3a293727749b72bd234d6e899558dffce669df29a4e8c9dcc53d9f7b6cb18e84c4b0c55ef143731a894e0b5693c0722

39
tests/main.fmf Normal file
View File

@ -0,0 +1,39 @@
test: ./runtest.sh
duration: 50m
framework: beakerlib
require:
# This stuff is only needed if gnome-desktop-testing
# cannot be required as a package and needs to be cloned
# from the git repo and build from source:
# - git
# - make
# - gcc
# - diffutils
# - autoconf
# - automake
# - libtool
# - glib2-devel
# - systemd-devel
- gnome-session
- gnome-shell
- gnome-shell-extension-no-overview
- ibus
- ibus-devel
- ibus-desktop-testing
- gnome-desktop-testing
- ibus-hangul
- ibus-hangul-tests
- rsync
- xorg-x11-server-Xwayland
- xwayland-run
- appstream
- libappstream-glib
- desktop-file-utils
- python3-gobject
- python3-gobject-base
- glib2
- gtk3
- dconf
- dbus-x11
- python3-devel
- python3-pyxdg

43
tests/runtest.sh Executable file
View File

@ -0,0 +1,43 @@
#!/bin/bash
. /usr/share/beakerlib/beakerlib.sh || exit 1
NAME=ibus-hangul
XFWB_SCRIPT=$(pwd)/xwfb-script.sh
rlJournalStart
rlPhaseStartSetup
rlAssertRpm ${NAME}
rlAssertRpm gnome-desktop-testing
rlAssertRpm gnome-shell-extension-no-overview
rlAssertBinaryOrigin gnome-desktop-testing-runner gnome-desktop-testing
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
rlRun "pushd $tmp"
rlPhaseEnd
rlPhaseStartTest
rlRun -t -l "pushd /usr/libexec/installed-tests/ibus-hangul" \
0 "Change to directory of installed tests"
if [ -z "${DISPLAY:-}" ]; then
rlLogInfo "DISPLAY is empty or unset."
rlLogInfo "Therefore, use xfwb-run to run the graphical ibus-hangul test:"
rlRun -t -s "xwfb-run -c mutter -e $tmp/xwfb-run.log -n 99 $XFWB_SCRIPT" \
0 "Running ibus-hangul test in xfwb-run"
echo "==== START of `cat ${rlRun_LOG}`: log of xwfb-run ===="
cat ${rlRun_LOG}
echo "==== END of `cat ${rlRun_LOG}`: log of xwfb-run ===="
rlAssertNotGrep FAIL ${rlRun_LOG}
rlGetTestState
rlLog "Total number of failed asserts: ${ECODE}"
rlFileSubmit ${rlRun_LOG}
rlFileSubmit xwfb-run.log
fi
rlGetTestState
rlLog "Total number of failed asserts: ${ECODE}"
rlRun "popd" 0
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $tmp" 0 "Remove tmp directory"
rlPhaseEnd
rlJournalEnd

31
tests/xwfb-script.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
# Run this with `xwfb-run -e /tmp/xwfb-run.log -n 99 xwfb-script.sh`
# Redirect stderr to stdout:
exec 2>&1
# without setting GDK_BACKEND=x11, Gtk programs cannot open windows in xfwb-run:
export GDK_BACKEND=x11
export XDG_SESSION_TYPE=x11
echo "starting mutter ..."
mutter --x11 &
sleep 5
echo "mutter started"
ibus-daemon --verbose \
--replace \
--single \
--desktop=mutter \
--panel=disable \
--config=disable &
sleep 5
echo "ibus-daemon started."
/usr/libexec/installed-tests/ibus-hangul/ibus-hangul --tap &
TEST_PID=$!
# A screenshot for debugging can be made here:
#sleep 1
#import -window root /tmp/screenshot.png
#echo "screenshot done."
# Wait for ibus-hangul tests to finish and get its exit code
wait $TEST_PID
EXIT_CODE=$?
echo "The exit code of ibus-hangul: $EXIT_CODE"
exit $EXIT_CODE