Skip to content

Commit

Permalink
chore(linux): improve compatibility with Gentoo Linux
Browse files Browse the repository at this point in the history
Gentoo doesn't use systemd. `libelogind` implements some aspects of
systemd, so we use that on Gentoo (or rather when `libsystemd` is not
available but `libelogind` is).

Patch from https://forums.gentoo.org/viewtopic.php?p=8850566.
See also https://community.software.sil.org/t/keyman-for-gentoo-linux/9615.
  • Loading branch information
ermshiperete committed Jan 14, 2025
1 parent 356e38d commit 4f65a41
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion linux/ibus-keyman/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ conf = configuration_data()
ibus = dependency('ibus-1.0', version: '>= 1.2.0')
gtk = dependency('gtk+-3.0', version: '>= 2.4')
json_glib = dependency('json-glib-1.0', version: '>= 1.0')
systemd = dependency('libsystemd')
systemd = dependency('libsystemd', 'libelogind')
icu = dependency('icu-i18n')

core_dir = meson.current_source_dir() / '../../core'
Expand Down
2 changes: 1 addition & 1 deletion linux/keyman-system-service/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project('keyman-system-service', 'c', 'cpp',
meson_version: '>=0.61')

evdev = dependency('libevdev', version: '>= 1.9')
systemd = dependency('libsystemd')
systemd = dependency('libsystemd', 'libelogind')

subdir('resources')
subdir('src')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# /usr/share/dbus-1/system-services/com.keyman.SystemService1.service
# This version used with elogind (e.g. on Gentoo)

[D-BUS Service]
Name=com.keyman.SystemService1
Exec=/usr/libexec/systemd-keyman.service
User=root
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# /usr/share/dbus-1/system-services/com.keyman.SystemService1.service
# This version used with systemd (e.g. on Debian)

[D-BUS Service]
Name=com.keyman.SystemService1
Expand Down
2 changes: 1 addition & 1 deletion linux/keyman-system-service/resources/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
install_data('com.keyman.SystemService1.conf', install_dir: get_option('datadir') / 'dbus-1/system.d/')
install_data('com.keyman.SystemService1.service', install_dir: get_option('datadir') / 'dbus-1/system-services/')
install_data('com.keyman.SystemService1.service.' + systemd.name(), install_dir: get_option('datadir') / 'dbus-1/system-services/', rename: ['com.keyman.SystemService1.service'])
install_data('systemd-keyman.service', install_dir: get_option('prefix') / 'lib/systemd/system/')

0 comments on commit 4f65a41

Please sign in to comment.