Skip to content

Commit

Permalink
src/services: Add org.freedesktop.IBus.session.generic.service
Browse files Browse the repository at this point in the history
Move bus/*.service.in & src/*.service.in into bus/services

BUG=#2381
  • Loading branch information
fujiwarat committed Feb 17, 2022
1 parent a076b38 commit b5423f0
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 53 deletions.
16 changes: 3 additions & 13 deletions bus/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# ibus - The Input Bus
#
# Copyright (c) 2007-2013 Peng Huang <shawn.p.huang@gmail.com>
# Copyright (c) 2013-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2007-2018 Red Hat, Inc.
# Copyright (c) 2013-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
# 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
Expand All @@ -22,6 +22,7 @@
# USA

NULL =
SUBDIRS = . services

libibus = $(top_builddir)/src/libibus-@IBUS_API_VERSION@.la

Expand Down Expand Up @@ -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
68 changes: 68 additions & 0 deletions bus/services/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# vim:set noet ts=4:
#
# ibus - The Input Bus
#
# Copyright (c) 2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
# 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
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Unit]
Description=IBus Daemon
Description=IBus Daemon for GNOME
CollectMode=inactive-or-failed

# Require GNOME session and specify startup ordering
Expand Down
15 changes: 15 additions & 0 deletions bus/services/org.freedesktop.IBus.session.generic.service.in
Original file line number Diff line number Diff line change
@@ -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
48 changes: 25 additions & 23 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# ibus - The Input Bus
#
# Copyright (c) 2007-2016 Peng Huang <shawn.p.huang@gmail.com>
# Copyright (c) 2015-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2007-2021 Red Hat, Inc.
# Copyright (c) 2015-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
# 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
Expand Down Expand Up @@ -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
Expand All @@ -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
ui/Makefile
ui/gtk3/Makefile
m4/Makefile
portal/Makefile
setup/Makefile
bindings/Makefile
bindings/pygobject/Makefile
bindings/vala/Makefile
conf/Makefile
conf/dconf/Makefile
conf/memconf/Makefile
src/Makefile
src/ibusversion.h
src/tests/Makefile
tools/Makefile
ui/Makefile
ui/gtk3/Makefile
util/Makefile
util/IMdkit/Makefile
Makefile
ibus-1.0.pc
ibus.spec
])

AC_OUTPUT
Expand Down
16 changes: 0 additions & 16 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand All @@ -408,7 +393,6 @@ EXTRA_DIST = \
$(NULL)

CLEANFILES += \
$(systemdservice_DATA) \
$(BUILT_SOURCES) \
stamp-ibusmarshalers.h \
stamp-ibusenumtypes.h \
Expand Down

0 comments on commit b5423f0

Please sign in to comment.