[calls] data: Add D-Bus service file



commit 654664799b0109d3faebd0df04b2b59f66f34122
Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
Date:   Mon Jun 20 05:26:16 2022 +0200

    data: Add D-Bus service file
    
    Heavily inspired by
    https://gitlab.com/mobian1/callaudiod/-/commit/cf329d0a050899f036f677d8d5e16a749c6a80ba
    
    Fixes #464

 data/meson.build                | 13 +++++++++++++
 data/org.gnome.Calls.service.in |  3 +++
 debian/gnome-calls.install      |  1 +
 meson.build                     |  2 ++
 4 files changed, 19 insertions(+)
---
diff --git a/data/meson.build b/data/meson.build
index 46b01816..d9a53cd4 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -20,6 +20,19 @@ desktop_file = i18n.merge_file(
   install_dir : join_paths(sysconfdir, 'xdg/autostart')
 )
 
+# DBus service
+service_data = configuration_data()
+service_data.set('bindir', full_bindir)
+service_file = 'org.gnome.Calls.service'
+
+configure_file(
+  input : service_file + '.in',
+  output : service_file,
+  configuration : service_data,
+  install : true,
+  install_dir : full_servicedir,
+)
+
 desktop_utils = find_program('desktop-file-validate', required: false)
 if desktop_utils.found()
   test('Validate desktop file', desktop_utils,
diff --git a/data/org.gnome.Calls.service.in b/data/org.gnome.Calls.service.in
new file mode 100644
index 00000000..7300b273
--- /dev/null
+++ b/data/org.gnome.Calls.service.in
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.gnome.Calls
+Exec=@bindir@/gnome-calls --daemon
diff --git a/debian/gnome-calls.install b/debian/gnome-calls.install
index ec79fad2..8c6e4163 100644
--- a/debian/gnome-calls.install
+++ b/debian/gnome-calls.install
@@ -2,6 +2,7 @@
 /usr/bin
 /usr/lib
 /usr/share/applications
+/usr/share/dbus-1
 /usr/share/glib-2.0
 /usr/share/icons
 /usr/share/locale
diff --git a/meson.build b/meson.build
index 6567c2b2..ae803e42 100644
--- a/meson.build
+++ b/meson.build
@@ -41,7 +41,9 @@ top_include = include_directories('.')
 
 prefix = get_option('prefix')
 builddir = meson.current_build_dir()
+full_bindir = join_paths(prefix, get_option('bindir'))
 libdir = get_option('libdir')
+full_servicedir = join_paths(prefix, get_option('datadir'), 'dbus-1', 'services')
 localedir = get_option('localedir')
 full_localedir = join_paths(prefix, localedir)
 full_calls_plugin_libdir = join_paths(prefix, libdir, calls_name, 'plugins')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]