Migrate some upstream patches

This commit is contained in:
Takao Fujiwara 2023-05-02 07:39:38 +09:00
parent a6e3421b45
commit 3755855b20
2 changed files with 455 additions and 1 deletions

View File

@ -1,3 +1,47 @@
From a140924e437346ebb7cd30c6e4d316ab5d447871 Mon Sep 17 00:00:00 2001
From: Simon Deziel <simon@sdeziel.info>
Date: Wed, 22 Feb 2023 19:05:17 +0900
Subject: [PATCH] src/services: use a shell exec in systemd service files
exec sub-command avoids keeping the parent shell around. Refer sh(1)
Fedora sh is bash.
BUG=https://github.com/ibus/ibus/pull/2453
---
bus/services/org.freedesktop.IBus.session.GNOME.service.in | 2 +-
bus/services/org.freedesktop.IBus.session.generic.service.in | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/bus/services/org.freedesktop.IBus.session.GNOME.service.in b/bus/services/org.freedesktop.IBus.session.GNOME.service.in
index 7f718e3c..858cf10d 100644
--- a/bus/services/org.freedesktop.IBus.session.GNOME.service.in
+++ b/bus/services/org.freedesktop.IBus.session.GNOME.service.in
@@ -18,7 +18,7 @@ Conflicts=gnome-session@gnome-login.target
[Service]
Type=dbus
# Only pull --xim in X11 session, it is done via Xwayland-session.d on Wayland
-ExecStart=sh -c '@bindir@/ibus-daemon --panel disable $([ "$XDG_SESSION_TYPE" = "x11" ] && echo "--xim")'
+ExecStart=sh -c 'exec @bindir@/ibus-daemon --panel disable $([ "$XDG_SESSION_TYPE" = "x11" ] && echo "--xim")'
Restart=on-abnormal
BusName=org.freedesktop.IBus
TimeoutStopSec=5
diff --git a/bus/services/org.freedesktop.IBus.session.generic.service.in b/bus/services/org.freedesktop.IBus.session.generic.service.in
index 9d493159..e7b7ce4f 100644
--- a/bus/services/org.freedesktop.IBus.session.generic.service.in
+++ b/bus/services/org.freedesktop.IBus.session.generic.service.in
@@ -7,8 +7,7 @@ Conflicts=gnome-session-initialized.target
[Service]
Type=dbus
-# Only pull --xim in X11 session, it is done via Xwayland-session.d on Wayland
-ExecStart=sh -c '@bindir@/ibus-daemon $IBUS_DAEMON_ARGS'
+ExecStart=sh -c 'exec @bindir@/ibus-daemon $IBUS_DAEMON_ARGS'
Restart=on-abnormal
BusName=org.freedesktop.IBus
TimeoutStopSec=5
--
2.39.2
From 7da18d08ce85405e41ba7bf363661292bc97ca39 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Wed, 22 Feb 2023 23:53:35 +0900
@ -35,6 +79,186 @@ index 340168c8..bb59f3cb 100644
--
2.38.1
From ce5e2bb43ea4c2f5780f4a3bfd7509f812b60afa Mon Sep 17 00:00:00 2001
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Date: Tue, 28 Feb 2023 18:05:29 +0900
Subject: [PATCH] src: Define X11_LOCALEDATADIR for BSD Compose data
FreeBSD and NetBSD have X11 locale Compose data directories in
${X11_PREFIX}/lib/X11/locale instead of ${X11_PREFIX}/share/X11/locale:
https://github.com/freedesktop/xorg-lib-libX11/blob/20a3f99/configure.ac#L336-L340
BUG=https://github.com/ibus/ibus/pull/2478
---
configure.ac | 8 ++++++++
src/Makefile.am | 2 +-
src/gencomposetable.c | 6 ++----
src/ibuscomposetable.c | 5 ++---
src/ibusenginesimple.c | 5 ++---
src/tests/Makefile.am | 2 +-
src/tests/ibus-compose.c | 3 +--
7 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/configure.ac b/configure.ac
index f446ae92..ece1d9ee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -349,6 +349,14 @@ else
fi
AC_SUBST(X11_PREFIX)
+# Check locale dir for Compose files.
+AC_CHECK_FILE($X11_PREFIX/share/X11/locale/locale.dir,
+ X11_LOCALEDATADIR="$X11_PREFIX/share/X11/locale",
+ [AC_CHECK_FILE($X11_PREFIX/lib/X11/locale/locale.dir,
+ X11_LOCALEDATADIR="$X11_PREFIX/lib/X11/locale",
+ X11_LOCALEDATADIR="$(datadir)/X11/locale")])
+AC_SUBST(X11_LOCALEDATADIR)
+
if test x"$enable_wayland" = x"yes"; then
# Check for wayland
PKG_CHECK_MODULES(WAYLAND, [
diff --git a/src/Makefile.am b/src/Makefile.am
index 426376dd..c2e8daa6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -54,7 +54,7 @@ AM_CPPFLAGS = \
-DIBUS_DISABLE_DEPRECATION_WARNINGS \
-DIBUS_COMPILATION \
-DISOCODES_PREFIX=\"$(ISOCODES_PREFIX)\" \
- -DX11_DATA_PREFIX=\"$(X11_PREFIX)\" \
+ -DX11_LOCALEDATADIR=\"$(X11_LOCALEDATADIR)\" \
$(NULL)
# ibus library
diff --git a/src/gencomposetable.c b/src/gencomposetable.c
index 3fe6ff86..6e52d6a6 100644
--- a/src/gencomposetable.c
+++ b/src/gencomposetable.c
@@ -28,8 +28,6 @@
#include "ibuscomposetable.h"
#include "ibusenginesimpleprivate.h"
-#define X11_DATADIR X11_DATA_PREFIX "/share/X11/locale"
-
static void
save_compose_table_endianness (IBusComposeTableEx *compose_table,
@@ -84,7 +82,7 @@ main (int argc, char *argv[])
if (!path || !g_file_test (path, G_FILE_TEST_EXISTS)) {
g_clear_pointer (&path, g_free);
for (sys_lang = sys_langs; *sys_lang; sys_lang++) {
- path = g_build_filename (X11_DATADIR, *sys_lang,
+ path = g_build_filename (X11_LOCALEDATADIR, *sys_lang,
"Compose", NULL);
if (!path)
continue;
@@ -93,7 +91,7 @@ main (int argc, char *argv[])
}
}
if (!path) {
- g_warning ("en_US compose file is not found in %s.", X11_DATADIR);
+ g_warning ("en_US compose file is not found in %s.", X11_LOCALEDATADIR);
return 1;
} else {
g_debug ("Create a cache of %s", path);
diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
index 3e7b0f41..fc486692 100644
--- a/src/ibuscomposetable.c
+++ b/src/ibuscomposetable.c
@@ -39,7 +39,6 @@
#define IBUS_COMPOSE_TABLE_MAGIC "IBusComposeTable"
#define IBUS_COMPOSE_TABLE_VERSION (4)
-#define X11_DATADIR X11_DATA_PREFIX "/share/X11/locale"
#define IBUS_MAX_COMPOSE_ALGORITHM_LEN 9
typedef struct {
@@ -285,7 +284,7 @@ expand_include_path (const char *include_path) {
case 'S': /* system compose dir */
o = out;
former = g_strndup (head, i - head);
- out = g_strdup_printf ("%s%s%s", o, former, X11_DATADIR);
+ out = g_strdup_printf ("%s%s%s", o, former, X11_LOCALEDATADIR);
head = i + 2;
g_free (o);
g_free (former);
@@ -397,7 +396,7 @@ get_en_compose_file (void)
char * const *sys_lang = NULL;
char *path = NULL;
for (sys_lang = sys_langs; *sys_lang; sys_lang++) {
- path = g_build_filename (X11_DATADIR, *sys_lang, "Compose", NULL);
+ path = g_build_filename (X11_LOCALEDATADIR, *sys_lang, "Compose", NULL);
if (g_file_test (path, G_FILE_TEST_EXISTS))
break;
g_clear_pointer (&path, g_free);
diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c
index 409d5a56..585d7870 100644
--- a/src/ibusenginesimple.c
+++ b/src/ibusenginesimple.c
@@ -37,7 +37,6 @@
#include <memory.h>
#include <stdlib.h>
-#define X11_DATADIR X11_DATA_PREFIX "/share/X11/locale"
#define IBUS_ENGINE_SIMPLE_GET_PRIVATE(o) \
((IBusEngineSimplePrivate *)ibus_engine_simple_get_instance_private (o))
@@ -1440,7 +1439,7 @@ ibus_engine_simple_add_table_by_locale (IBusEngineSimple *simple,
for (sys_lang = sys_langs; *sys_lang; sys_lang++) {
if (g_ascii_strncasecmp (*lang, *sys_lang,
strlen (*sys_lang)) == 0) {
- path = g_build_filename (X11_DATADIR,
+ path = g_build_filename (X11_LOCALEDATADIR,
*lang, "Compose", NULL);
break;
}
@@ -1462,7 +1461,7 @@ ibus_engine_simple_add_table_by_locale (IBusEngineSimple *simple,
ibus_engine_simple_add_compose_file (simple, path);
g_clear_pointer(&path, g_free);
} else {
- path = g_build_filename (X11_DATADIR, locale, "Compose", NULL);
+ path = g_build_filename (X11_LOCALEDATADIR, locale, "Compose", NULL);
do {
if (g_file_test (path, G_FILE_TEST_EXISTS))
break;
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index ca5285bd..8d1d16e3 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -30,7 +30,7 @@ AM_CPPFLAGS = \
@GLIB2_CFLAGS@ \
@GIO2_CFLAGS@ \
-DIBUS_DISABLE_DEPRECATION_WARNINGS \
- -DX11_DATA_PREFIX=\"$(X11_PREFIX)\" \
+ -DX11_LOCALEDATADIR=\"$(X11_LOCALEDATADIR)\" \
-I$(top_srcdir)/src \
-I$(top_builddir)/src \
$(NULL)
diff --git a/src/tests/ibus-compose.c b/src/tests/ibus-compose.c
index 0be01d27..da1a1298 100644
--- a/src/tests/ibus-compose.c
+++ b/src/tests/ibus-compose.c
@@ -6,7 +6,6 @@
#define GREEN "\033[0;32m"
#define RED "\033[0;31m"
#define NC "\033[0m"
-#define X11_DATADIR X11_DATA_PREFIX "/share/X11/locale"
IBusBus *m_bus;
gchar *m_compose_file;
@@ -36,7 +35,7 @@ get_compose_path ()
break;
if (g_strcmp0 (*l, "C") == 0)
break;
- compose_path = g_build_filename (X11_DATADIR,
+ compose_path = g_build_filename (X11_LOCALEDATADIR,
*l,
"Compose",
NULL);
--
2.39.2
From 9d9dca9e103e88b33e786c4a46f44123a6cf11c6 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Wed, 8 Mar 2023 19:44:16 +0900
@ -409,3 +633,229 @@ index 8dc52714..ec20e322 100644
--
2.39.2
From f82140b1368c5ec4c0b70e5caea2931ceed5589c Mon Sep 17 00:00:00 2001
From: Sibo Dong <46512211+dongsibo@users.noreply.github.com>
Date: Tue, 21 Feb 2023 16:38:03 -0500
Subject: [PATCH] ui/gtk3: Update Emoji shortcut key in ibus-emoji(7)
The default Emoji shortcut key was changed but not updated in the
ibus-emoji.7 man page.
Fixes: https://github.com/ibus/ibus/commit/1520c39
BUG=https://github.com/ibus/ibus/pull/2475
---
ui/gtk3/ibus-emoji.7.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/gtk3/ibus-emoji.7.in b/ui/gtk3/ibus-emoji.7.in
index b4d941ec..31074300 100644
--- a/ui/gtk3/ibus-emoji.7.in
+++ b/ui/gtk3/ibus-emoji.7.in
@@ -51,7 +51,7 @@ E.g. "Noto Color Emoji", "Android Emoji" font.
.SH "KEYBOARD OPERATIONS"
.TP
-\fBControl-Period or Control-Semicolon\fR
+\fBSuper-Period\fR
Launch IBus Emojier. The shortcut key can be customized by
.B ibus\-setup (1).
.TP
--
2.40.0
From 9553dbf12ec42a58beb671a7039827fbd652e14d Mon Sep 17 00:00:00 2001
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Date: Mon, 27 Mar 2023 19:45:37 +0900
Subject: [PATCH] Portability fixes for preparation of NetBSD CI
- Makefile: Ignore errors on $(RM) -r "`uname -i`"
- autogen: Replace make with $MAKE
- data/dconf: BSD does not support the --tmpdir long option
in mktemp. Also add the cleanup function.
BUG=https://github.com/ibus/ibus/pull/2482
---
Makefile.am | 2 +-
autogen.sh | 7 ++++---
data/dconf/make-dconf-override-db.sh | 11 ++++++++---
3 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 17e56b38..16548d25 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -139,7 +139,7 @@ srpm: dist @PACKAGE_NAME@.spec
@PACKAGE_NAME@.spec
clean-rpm:
- $(RM) -r "`uname -i`"
+ -$(RM) -r "`uname -i`"
clean-local: clean-rpm
diff --git a/autogen.sh b/autogen.sh
index 9b1d8342..4ea8d757 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -4,6 +4,7 @@
: ${srcdir=$(dirname $0)}
: ${srcdir:=.}
: ${SAVE_DIST_FILES:=0}
+: ${MAKE:=make}
olddir=$(pwd)
# shellcheck disable=SC2016
@@ -73,7 +74,7 @@ cd "$olddir"
(test "$1" = "--help" ) && {
exit 0
} || {
- echo "Now type 'make' to compile $PKG_NAME" || exit 1
+ echo "Now type '$MAKE' to compile $PKG_NAME" || exit 1
}
} || {
echo "Skipping configure process."
@@ -83,8 +84,8 @@ cd "$srcdir"
(test "x$SAVE_DIST_FILES" = "x0" ) && {
# rm engine/simple.xml.in src/ibusemojigen.h src/ibusunicodegen.h
for d in engine src src/compose; do
- echo "make -C $d maintainer-clean-generic"
- make -C $d maintainer-clean-generic
+ echo "$MAKE -C $d maintainer-clean-generic"
+ $MAKE -C $d maintainer-clean-generic
done
} || :
cd "$olddir"
diff --git a/data/dconf/make-dconf-override-db.sh b/data/dconf/make-dconf-override-db.sh
index 601c1c3f..32cb1530 100755
--- a/data/dconf/make-dconf-override-db.sh
+++ b/data/dconf/make-dconf-override-db.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
set -e
@@ -6,7 +6,7 @@ set -e
# breaks dbus-launch. There's dbus-run-session which is
# better, but not everyone has it yet.
export DBUS_FATAL_WARNINGS=0
-export TMPDIR=$(mktemp -d --tmpdir="$PWD")
+export TMPDIR=$(mktemp -d -p "$PWD")
export XDG_CONFIG_HOME="$TMPDIR/config"
export XDG_CACHE_HOME="$TMPDIR/cache"
export GSETTINGS_SCHEMA_DIR="$TMPDIR/schemas"
@@ -14,7 +14,12 @@ mkdir -p $XDG_CONFIG_HOME $XDG_CACHE_HOME $GSETTINGS_SCHEMA_DIR
eval `dbus-launch --sh-syntax`
-trap 'rm -rf $TMPDIR; kill $DBUS_SESSION_BUS_PID' ERR
+trap cleanup EXIT
+
+cleanup() {
+ test $? -eq 0 && exit
+ rm -rf $TMPDIR; kill $DBUS_SESSION_BUS_PID
+}
# in case that schema is not installed on the system
glib-compile-schemas --targetdir "$GSETTINGS_SCHEMA_DIR" "$PWD"
--
2.39.2
From 630f3f73f62a121abb1af5b215d193aec4e0053c Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Wed, 5 Apr 2023 14:28:49 +0900
Subject: [PATCH] configure: Use AC_C_BIGENDIAN for BSD systems
NetBSD does not define __BYTE_ORDER and use AC_C_BIGENDIAN instead.
BUG=https://github.com/ibus/ibus/pull/2477
---
configure.ac | 31 ++++---------------------------
1 file changed, 4 insertions(+), 27 deletions(-)
diff --git a/configure.ac b/configure.ac
index ece1d9ee..b3eacbcb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -152,35 +152,12 @@ AC_CHECK_LIB(c, dlclose, LIBDL="", [AC_CHECK_LIB(dl, dlclose, LIBDL="-ldl")])
AC_SUBST(LIBDL)
# Check endianness.
-AC_MSG_CHECKING([build system endianness])
-ENDIAN=unknown
-AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[
- #include <endian.h>
- #if __BYTE_ORDER != __LITTLE_ENDIAN
- #error
- #endif
- ]]
- )],
- [ENDIAN=little]
-)
-AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[
- #include <endian.h>
- #if __BYTE_ORDER != __BIG_ENDIAN
- #error
- #endif
- ]]
- )],
- [ENDIAN=big]
-)
+AC_C_BIGENDIAN([ENDIAN=big], [ENDIAN=little], [ENDIAN=unknown], [ENDIAN=big])
if test x"$ENDIAN" != xlittle -a x"$ENDIAN" != xbig; then
- AC_MSG_ERROR([Cannot deermine endianness without endian.h])
+ AC_MSG_ERROR([Cannot determine endianness. Use ac_cv_c_bigendian to yes or no])
fi
-AC_MSG_RESULT($ENDIAN)
AC_SUBST(ENDIAN)
+ENDIAN_MSG="$ENDIAN (ac_cv_c_bigendian=$ac_cv_c_bigendian)"
# Check packages.
# Check glib2.
@@ -902,7 +879,7 @@ Build options:
Install prefix $prefix
Build shared libs $enable_shared
Build static libs $enable_static
- Build endianness $ENDIAN
+ Build endianness $ENDIAN_MSG
CFLAGS $CFLAGS
PYTHON $PYTHON
PYTHON2 $PYTHON2
--
2.39.2
From 67a0f36de029fe3adc21c90c7fb8669d0d68cbe2 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Thu, 13 Apr 2023 12:22:50 +0900
Subject: [PATCH] src: Generate ibusenumtypes.h for gen-internal-compose-table
`make clean` deletes ibusenumtypes.h and ibus.h incudes ibusenumtypes.h
and it's required by the gen-internal-compose-table build.
BUG=https://github.com/ibus/ibus/issues/2501
---
src/Makefile.am | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/Makefile.am b/src/Makefile.am
index c2e8daa6..adc7f04a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -194,6 +194,7 @@ gen_internal_compose_table_SOURCES = \
ibuserror.c \
ibuskeynames.c \
ibuskeyuni.c \
+ ibusenumtypes.h \
$(NULL)
gen_internal_compose_table_CFLAGS = $(AM_CFLAGS)
gen_internal_compose_table_LDADD = \
--
2.39.2

View File

@ -50,7 +50,7 @@
Name: ibus
Version: 1.5.28
Release: 3%{?dist}
Release: 4%{?dist}
Summary: Intelligent Input Bus for Linux OS
License: LGPL-2.0-or-later
URL: https://github.com/ibus/%name/wiki
@ -322,6 +322,7 @@ fi
#make -C ui/gtk3 maintainer-clean-generic
#make -C tools maintainer-clean-generic
#make -C src/compose maintainer-clean-generic
autoreconf -f -i -v
%configure \
--disable-static \
%if %{with gtk2}
@ -559,6 +560,9 @@ dconf update || :
%{_datadir}/installed-tests/ibus
%changelog
* Tue May 02 2023 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.28-4
- Migrate some upstream patches
* Fri Mar 17 2023 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.28-3
- Resolves: #2178178 Fix emoji lookup table only but emojier GUI left