From b5423f0cff78e627fec12378bfcc70efa79e9379 Mon Sep 17 00:00:00 2001 From: fujiwarat Date: Thu, 17 Feb 2022 20:15:38 +0900 Subject: [PATCH] src/services: Add org.freedesktop.IBus.session.generic.service Move bus/*.service.in & src/*.service.in into bus/services BUG=https://github.com/ibus/ibus/pull/2381 --- bus/Makefile.am | 16 +---- bus/services/Makefile.am | 68 +++++++++++++++++++ .../org.freedesktop.IBus.service.in | 0 ....freedesktop.IBus.session.GNOME.service.in | 2 +- ...reedesktop.IBus.session.generic.service.in | 15 ++++ configure.ac | 48 ++++++------- src/Makefile.am | 16 ----- 7 files changed, 112 insertions(+), 53 deletions(-) create mode 100644 bus/services/Makefile.am rename bus/{ => services}/org.freedesktop.IBus.service.in (100%) rename {src => bus/services}/org.freedesktop.IBus.session.GNOME.service.in (95%) create mode 100644 bus/services/org.freedesktop.IBus.session.generic.service.in diff --git a/bus/Makefile.am b/bus/Makefile.am index 4383a874..e173ee25 100644 --- a/bus/Makefile.am +++ b/bus/Makefile.am @@ -3,8 +3,8 @@ # ibus - The Input Bus # # Copyright (c) 2007-2013 Peng Huang -# Copyright (c) 2013-2018 Takao Fujiwara -# Copyright (c) 2007-2018 Red Hat, Inc. +# Copyright (c) 2013-2022 Takao Fujiwara +# Copyright (c) 2007-2022 Red Hat, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -22,6 +22,7 @@ # USA NULL = +SUBDIRS = . services libibus = $(top_builddir)/src/libibus-@IBUS_API_VERSION@.la @@ -190,15 +191,4 @@ man_onedir = $(mandir)/man1 %.1.gz: %.1 $(AM_V_GEN) gzip -c $< > $@.tmp && mv $@.tmp $@ - -dbusservice_in_files = org.freedesktop.IBus.service.in -dbusservice_DATA = $(dbusservice_in_files:.service.in=.service) -dbusservicedir=${datadir}/dbus-1/services - -org.freedesktop.IBus.service: org.freedesktop.IBus.service.in - $(AM_V_GEN) sed -e "s|\@bindir\@|$(bindir)|" -e "s|\@xim_cli_arg\@|$(XIM_CLI_ARG)|" $< > $@.tmp && mv $@.tmp $@ - -EXTRA_DIST += $(dbusservice_in_files) -CLEANFILES += $(dbusservice_DATA) - -include $(top_srcdir)/git.mk diff --git a/bus/services/Makefile.am b/bus/services/Makefile.am new file mode 100644 index 00000000..9cc42153 --- /dev/null +++ b/bus/services/Makefile.am @@ -0,0 +1,68 @@ +# vim:set noet ts=4: +# +# ibus - The Input Bus +# +# Copyright (c) 2022 Takao Fujiwara +# Copyright (c) 2022 Red Hat, Inc. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 +# USA + +NULL = + +# Originally this D-Bus service file was added for GNOME but seems not to +# be used at present. +# +# TODO: Check if flatpack uses this file and we could delete +# org.freedesktop.IBus.service file in the future. +dbusservice_in_files = org.freedesktop.IBus.service.in +dbusservice_DATA = $(dbusservice_in_files:.service.in=.service) +dbusservicedir=${datadir}/dbus-1/services + +systemdservice_in_files = \ + org.freedesktop.IBus.session.generic.service.in \ + org.freedesktop.IBus.session.GNOME.service.in \ + $(NULL) + +%.service: %.service.in + $(AM_V_GEN) sed -e "s|\@bindir\@|$(bindir)|" \ + -e "s|\@xim_cli_arg\@|$(XIM_CLI_ARG)|" $< > $@.tmp && \ + mv $@.tmp $@ + +if ENABLE_SYSTEMD +systemdservice_DATA = $(systemdservice_in_files:.service.in=.service) +systemdservicedir = $(SYSTEMD_USER_UNIT_DIR) + +# in install-data-hook. +install-data-hook: + $(MKDIR_P) "$(DESTDIR)$(SYSTEMD_USER_UNIT_DIR)/gnome-session.target.wants/" + ( \ + cd "$(DESTDIR)$(SYSTEMD_USER_UNIT_DIR)/gnome-session.target.wants" ; \ + $(LN_S) -f "../org.freedesktop.IBus.session.GNOME.service" .; \ + ) + $(NULL) +endif + +EXTRA_DIST = \ + $(dbusservice_in_files) \ + $(systemdservice_in_files) \ + $(NULL) + +CLEANFILES = \ + $(dbusservice_DATA) \ + $(systemdservice_DATA) \ + $(NULL) + +-include $(top_srcdir)/git.mk diff --git a/bus/org.freedesktop.IBus.service.in b/bus/services/org.freedesktop.IBus.service.in similarity index 100% rename from bus/org.freedesktop.IBus.service.in rename to bus/services/org.freedesktop.IBus.service.in diff --git a/src/org.freedesktop.IBus.session.GNOME.service.in b/bus/services/org.freedesktop.IBus.session.GNOME.service.in similarity index 95% rename from src/org.freedesktop.IBus.session.GNOME.service.in rename to bus/services/org.freedesktop.IBus.session.GNOME.service.in index 76444dbd..a99370fa 100644 --- a/src/org.freedesktop.IBus.session.GNOME.service.in +++ b/bus/services/org.freedesktop.IBus.session.GNOME.service.in @@ -1,5 +1,5 @@ [Unit] -Description=IBus Daemon +Description=IBus Daemon for GNOME CollectMode=inactive-or-failed # Require GNOME session and specify startup ordering diff --git a/bus/services/org.freedesktop.IBus.session.generic.service.in b/bus/services/org.freedesktop.IBus.session.generic.service.in new file mode 100644 index 00000000..9d493159 --- /dev/null +++ b/bus/services/org.freedesktop.IBus.session.generic.service.in @@ -0,0 +1,15 @@ +[Unit] +Description=IBus Daemon for generic sessions +CollectMode=inactive-or-failed + +# Never run in GNOME +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' +Restart=on-abnormal +BusName=org.freedesktop.IBus +TimeoutStopSec=5 +Slice=session.slice diff --git a/configure.ac b/configure.ac index 73c5e429..4137e6cc 100644 --- a/configure.ac +++ b/configure.ac @@ -3,8 +3,8 @@ # ibus - The Input Bus # # Copyright (c) 2007-2016 Peng Huang -# Copyright (c) 2015-2021 Takao Fujiwara -# Copyright (c) 2007-2021 Red Hat, Inc. +# Copyright (c) 2015-2022 Takao Fujiwara +# Copyright (c) 2007-2022 Red Hat, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -791,24 +791,22 @@ AC_SUBST(XKBCONFIG_BASE) AC_SUBST([GDBUS_CODEGEN], [`$PKG_CONFIG --variable gdbus_codegen gio-2.0`]) # OUTPUT files -AC_CONFIG_FILES([ po/Makefile.in -Makefile -ibus-1.0.pc -ibus.spec +AC_CONFIG_FILES([ +po/Makefile.in +bindings/Makefile +bindings/pygobject/Makefile +bindings/vala/Makefile +bus/Makefile +bus/services/Makefile client/Makefile client/gtk2/Makefile client/gtk3/Makefile client/gtk4/Makefile client/x11/Makefile client/wayland/Makefile -src/Makefile -src/ibusversion.h -src/tests/Makefile -bus/Makefile -portal/Makefile -engine/Makefile -util/Makefile -util/IMdkit/Makefile +conf/Makefile +conf/dconf/Makefile +conf/memconf/Makefile data/Makefile data/annotations/Makefile data/icons/Makefile @@ -819,20 +817,24 @@ docs/Makefile docs/reference/Makefile docs/reference/ibus/ibus-docs.sgml docs/reference/ibus/Makefile -m4/Makefile +engine/Makefile ibus/_config.py ibus/Makefile ibus/interface/Makefile +m4/Makefile +portal/Makefile +setup/Makefile +src/Makefile +src/ibusversion.h +src/tests/Makefile +tools/Makefile ui/Makefile ui/gtk3/Makefile -setup/Makefile -bindings/Makefile -bindings/pygobject/Makefile -bindings/vala/Makefile -conf/Makefile -conf/dconf/Makefile -conf/memconf/Makefile -tools/Makefile +util/Makefile +util/IMdkit/Makefile +Makefile +ibus-1.0.pc +ibus.spec ]) AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am index bbaa6c90..578694b5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -317,11 +317,6 @@ install-data-hook: rm "$(DESTDIR)$(dictdir)/$$file" || exit $$?; \ fi; \ done - $(MKDIR_P) "$(DESTDIR)$(SYSTEMD_USER_UNIT_DIR)/gnome-session.target.wants/" - ( \ - cd "$(DESTDIR)$(SYSTEMD_USER_UNIT_DIR)/gnome-session.target.wants" ; \ - $(LN_S) -f "../org.freedesktop.IBus.session.GNOME.service" .; \ - ) emoji_parser_SOURCES = \ emoji-parser.c \ @@ -388,17 +383,7 @@ clean-local: $(NULL) endif -if ENABLE_SYSTEMD -systemdservice_in_files = org.freedesktop.IBus.session.GNOME.service.in -systemdservice_DATA = $(systemdservice_in_files:.service.in=.service) -systemdservicedir=$(SYSTEMD_USER_UNIT_DIR) - -org.freedesktop.IBus.session.GNOME.service: org.freedesktop.IBus.session.GNOME.service.in - $(AM_V_GEN) sed -e "s|\@bindir\@|$(bindir)|" $< > $@.tmp && mv $@.tmp $@ -endif - EXTRA_DIST = \ - org.freedesktop.IBus.session.GNOME.service.in \ emoji-parser.c \ ibusversion.h.in \ ibusmarshalers.list \ @@ -408,7 +393,6 @@ EXTRA_DIST = \ $(NULL) CLEANFILES += \ - $(systemdservice_DATA) \ $(BUILT_SOURCES) \ stamp-ibusmarshalers.h \ stamp-ibusenumtypes.h \