From 6fbec4a187f40dcb8d4146d1fd1681ce3d5acc2a470114ca51089d71068a038a Mon Sep 17 00:00:00 2001 From: Hillwood Yang Date: Thu, 9 Sep 2021 14:12:11 +0000 Subject: [PATCH] Accepting request 917700 from home:predivan:branches:M17N - Refresh ibus-socket-name-compatibility.patch - Add ibus-missing-include.patch to fix build on Leap - Add ibus-fix-wrong-cursor-location.patch (based on https://github.com/ibus/ibus/commit/936a0e76df79d92a8bdc03e9205330fb84a2083e.patch) (gh#ibus/ibus#2337) - Drop ibus-python-install-dir.patch Two reasons: it's for, disabled in .spec, python2, and patch forces the re-generation of configure, which requires aclocal-1.16, unavailable on Leap-15.3, and that breaks the build. OBS-URL: https://build.opensuse.org/request/show/917700 OBS-URL: https://build.opensuse.org/package/show/M17N/ibus?expand=0&rev=256 --- ibus-fix-wrong-cursor-location.patch | 30 ++++++++++ ibus-missing-include.patch | 88 ++++++++++++++++++++++++++++ ibus-socket-name-compatibility.patch | 31 ++++++---- ibus.changes | 13 ++++ ibus.spec | 7 ++- 5 files changed, 155 insertions(+), 14 deletions(-) create mode 100644 ibus-fix-wrong-cursor-location.patch create mode 100644 ibus-missing-include.patch diff --git a/ibus-fix-wrong-cursor-location.patch b/ibus-fix-wrong-cursor-location.patch new file mode 100644 index 0000000..a133ddb --- /dev/null +++ b/ibus-fix-wrong-cursor-location.patch @@ -0,0 +1,30 @@ +diff -Naur ibus-1.5.25/client/gtk2/ibusimcontext.c ibus-1.5.25.new/client/gtk2/ibusimcontext.c +--- ibus-1.5.25/client/gtk2/ibusimcontext.c 2021-08-20 02:48:40.000000000 +0200 ++++ ibus-1.5.25.new/client/gtk2/ibusimcontext.c 2021-09-08 14:58:40.500448136 +0200 +@@ -1497,7 +1497,10 @@ + + #if GTK_CHECK_VERSION (3, 98, 4) + #elif GTK_CHECK_VERSION (2, 91, 0) +- area.y += gdk_window_get_height (ibusimcontext->client_window); ++ if (area.x == -1 && area.y == -1 && area.width == 0 && area.height == 0) { ++ area.x = 0; ++ area.y += gdk_window_get_height (ibusimcontext->client_window); ++ } + #else + if (area.x == -1 && area.y == -1 && area.width == 0 && area.height == 0) { + gint w, h; +diff -Naur ibus-1.5.25/client/gtk3/ibusimcontext.c ibus-1.5.25.new/client/gtk3/ibusimcontext.c +--- ibus-1.5.25/client/gtk3/ibusimcontext.c 2021-08-20 02:48:40.000000000 +0200 ++++ ibus-1.5.25.new/client/gtk3/ibusimcontext.c 2021-09-08 14:59:39.992371070 +0200 +@@ -1497,7 +1497,10 @@ + + #if GTK_CHECK_VERSION (3, 98, 4) + #elif GTK_CHECK_VERSION (2, 91, 0) +- area.y += gdk_window_get_height (ibusimcontext->client_window); ++ if (area.x == -1 && area.y == -1 && area.width == 0 && area.height == 0) { ++ area.x = 0; ++ area.y += gdk_window_get_height (ibusimcontext->client_window); ++ } + #else + if (area.x == -1 && area.y == -1 && area.width == 0 && area.height == 0) { + gint w, h; diff --git a/ibus-missing-include.patch b/ibus-missing-include.patch new file mode 100644 index 0000000..56ebe37 --- /dev/null +++ b/ibus-missing-include.patch @@ -0,0 +1,88 @@ +diff -Naur ibus-1.5.25/conf/dconf/main.c ibus-1.5.25.new/conf/dconf/main.c +--- ibus-1.5.25/conf/dconf/main.c 2021-08-20 02:48:40.000000000 +0200 ++++ ibus-1.5.25.new/conf/dconf/main.c 2021-09-08 13:53:17.833396607 +0200 +@@ -21,6 +21,7 @@ + * USA + */ + ++#include + #include + #include + #include +diff -Naur ibus-1.5.25/conf/memconf/main.c ibus-1.5.25.new/conf/memconf/main.c +--- ibus-1.5.25/conf/memconf/main.c 2021-08-20 02:48:40.000000000 +0200 ++++ ibus-1.5.25.new/conf/memconf/main.c 2021-09-08 13:53:43.513361844 +0200 +@@ -19,6 +19,7 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ ++#include + #include + #include + #include +diff -Naur ibus-1.5.25/portal/portal.c ibus-1.5.25.new/portal/portal.c +--- ibus-1.5.25/portal/portal.c 2021-08-20 02:48:40.000000000 +0200 ++++ ibus-1.5.25.new/portal/portal.c 2021-09-08 14:07:36.300242490 +0200 +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + + #include "ibus-portal-dbus.h" + +diff -Naur ibus-1.5.25/src/ibuscomposetable.c ibus-1.5.25.new/src/ibuscomposetable.c +--- ibus-1.5.25/src/ibuscomposetable.c 2021-08-20 02:48:40.000000000 +0200 ++++ ibus-1.5.25.new/src/ibuscomposetable.c 2021-09-08 13:15:25.184529800 +0200 +@@ -19,6 +19,7 @@ + * USA + */ + ++#include + #include + #include + #include +diff -Naur ibus-1.5.25/src/ibusemoji.c ibus-1.5.25.new/src/ibusemoji.c +--- ibus-1.5.25/src/ibusemoji.c 2021-08-20 02:48:40.000000000 +0200 ++++ ibus-1.5.25.new/src/ibusemoji.c 2021-09-08 13:22:14.227971403 +0200 +@@ -23,6 +23,7 @@ + #include + #endif + ++#include + #include + #include + #include "ibusemoji.h" +diff -Naur ibus-1.5.25/src/ibusregistry.c ibus-1.5.25.new/src/ibusregistry.c +--- ibus-1.5.25/src/ibusregistry.c 2021-08-20 02:48:40.000000000 +0200 ++++ ibus-1.5.25.new/src/ibusregistry.c 2021-09-08 13:25:08.191728353 +0200 +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + #include "ibusinternal.h" + #include "ibusmarshalers.h" +diff -Naur ibus-1.5.25/src/ibusshare.c ibus-1.5.25.new/src/ibusshare.c +--- ibus-1.5.25/src/ibusshare.c 2021-08-20 02:48:40.000000000 +0200 ++++ ibus-1.5.25.new/src/ibusshare.c 2021-09-08 13:29:17.527380024 +0200 +@@ -32,6 +32,7 @@ + #include + #include + #include ++#include + + static gchar *_display = NULL; + +diff -Naur ibus-1.5.25/src/ibusunicode.c ibus-1.5.25.new/src/ibusunicode.c +--- ibus-1.5.25/src/ibusunicode.c 2021-08-20 02:48:40.000000000 +0200 ++++ ibus-1.5.25.new/src/ibusunicode.c 2021-09-08 13:32:06.475144580 +0200 +@@ -23,6 +23,7 @@ + #include + #endif + ++#include + #include + #include + #include "ibusinternal.h" diff --git a/ibus-socket-name-compatibility.patch b/ibus-socket-name-compatibility.patch index 7b712e8..d949e56 100644 --- a/ibus-socket-name-compatibility.patch +++ b/ibus-socket-name-compatibility.patch @@ -1,11 +1,6 @@ -This writes ~/.config/ibus/bus/SOCKETPATH with the old name. -Author: Changwoo Ryu -Last-Update: 2020-05-01 -Bug: https://bugreports.qt.io/browse/QTBUG-82910 -Forwarded: not-needed, workaround - ---- a/src/ibusshare.c -+++ b/src/ibusshare.c +diff -Naur ibus-1.5.25/src/ibusshare.c ibus-1.5.25.new/src/ibusshare.c +--- ibus-1.5.25/src/ibusshare.c 2021-08-20 02:48:40.000000000 +0200 ++++ ibus-1.5.25.new/src/ibusshare.c 2021-09-08 19:41:27.233077477 +0200 @@ -90,79 +90,132 @@ return g_getenv("IBUS_SESSION_ID"); } @@ -193,7 +188,7 @@ Forwarded: not-needed, workaround return path; } -@@ -248,19 +301,45 @@ +@@ -243,14 +296,42 @@ return address; } @@ -202,6 +197,8 @@ Forwarded: not-needed, workaround void ibus_write_address (const gchar *address) { ++ ++ + const gchar *socket_path; + const gchar *socket_path_compat; + @@ -215,7 +212,7 @@ Forwarded: not-needed, workaround + if (g_getenv ("GNOME_SETUP_DISPLAY") != NULL && + strcmp (g_getenv ("GNOME_SETUP_DISPLAY"), g_getenv ("DISPLAY")) == 0) { + /* Running from gnome-shell with the setup display; write the socket -+ * address to an additional path for X11 clients */ +++ * address to an additional path for X11 clients */ + socket_path_compat = ibus_get_socket_path_gnome_xwayland_compat (); + if (socket_path_compat != NULL) + ibus_write_address_internal (address, socket_path_compat); @@ -232,12 +229,20 @@ Forwarded: not-needed, workaround - path = g_path_get_dirname (ibus_get_socket_path ()); + path = g_path_get_dirname (socket_path); - g_mkdir_with_parents (path, 0700); + errno = 0; + if (g_mkdir_with_parents (path, 0700)) { + g_warning ("Failed to mkdir %s: %s", path, g_strerror (errno)); +@@ -260,11 +341,11 @@ g_free (path); -- g_unlink (ibus_get_socket_path ()); + errno = 0; +- if (g_unlink (ibus_get_socket_path ())) { ++ if (g_unlink (socket_path)) { + g_warning ("Failed to unlink %s: %s", +- ibus_get_socket_path (), g_strerror (errno)); ++ socket_path, g_strerror (errno)); + } - pf = fopen (ibus_get_socket_path (), "w"); -+ g_unlink (socket_path); + pf = fopen (socket_path, "w"); g_return_if_fail (pf != NULL); diff --git a/ibus.changes b/ibus.changes index a26847a..bb33463 100644 --- a/ibus.changes +++ b/ibus.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Wed Sep 8 13:04:55 UTC 2021 - Predrag Ivanović + +- Refresh ibus-socket-name-compatibility.patch +- Add ibus-missing-include.patch to fix build on Leap +- Add ibus-fix-wrong-cursor-location.patch + (based on https://github.com/ibus/ibus/commit/936a0e76df79d92a8bdc03e9205330fb84a2083e.patch) + (gh#ibus/ibus#2337) +- Drop ibus-python-install-dir.patch + Two reasons: it's for, disabled in .spec, python2, and patch forces + the re-generation of configure, which requires aclocal-1.16, + unavailable on Leap-15.3, and that breaks the build. + ------------------------------------------------------------------- Mon Sep 6 13:36:21 UTC 2021 - Hillwood Yang diff --git a/ibus.spec b/ibus.spec index 348eeb2..7e8d5e9 100644 --- a/ibus.spec +++ b/ibus.spec @@ -64,6 +64,9 @@ Patch12: ibus-disable-engines-preload-in-GNOME.patch # Qt5 does not be update to the new version and patch for ibus on Leap 15, # it still needs this patch on leap 15. (boo#1187202) Patch15: ibus-socket-name-compatibility.patch +Patch16: ibus-missing-include.patch +# PATCH-FIX-UPSTREAM ibus-fix-wrong-cursor-location.patch gh#ibus/ibus#2337 +Patch17: ibus-fix-wrong-cursor-location.patch BuildRequires: fdupes BuildRequires: gettext-devel BuildRequires: gobject-introspection-devel >= 0.9.6 @@ -181,7 +184,7 @@ docs for ibus. %prep %setup -q -%patch0 -p1 +#%patch0 -p1 %patch4 -p1 %patch8 -p1 %if 0%{?sle_version} < 150200 && 0%{?suse_version} <=1500 @@ -200,7 +203,9 @@ cp -r %{SOURCE11} . %patch12 -p1 %if 0%{?suse_version} <= 1500 %patch15 -p1 +%patch16 -p1 %endif +%patch17 -p1 %build %configure --disable-static \