[gnome-tetravex] Make D-Bus activatable.



commit 1f1239d2ba812d5f7939b8704d226064a5cf29f4
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sat Oct 26 03:27:11 2019 +0200

    Make D-Bus activatable.

 data/meson.build                   | 20 ++++++++++++++++++++
 data/org.gnome.Tetravex.desktop.in |  1 +
 data/org.gnome.Tetravex.service.in |  3 +++
 meson.build                        |  7 ++++---
 4 files changed, 28 insertions(+), 3 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index c1df698..21be9fb 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -1,3 +1,4 @@
+# Install icons
 foreach size: [ '16x16', '22x22', '24x24', '32x32', '48x48']
     install_data (join_paths ('icons', 'hicolor', size, project_id + '.png'),
                   install_dir: join_paths (datadir, 'icons', 'hicolor', size, 'apps'))
@@ -7,10 +8,25 @@ install_data (join_paths ('icons', 'hicolor', 'scalable', project_id + '.svg'),
 install_data (join_paths ('icons', 'hicolor', 'scalable', project_id + '-symbolic.svg'),
               install_dir: join_paths (datadir, 'icons', 'hicolor', 'scalable', 'apps'))
 
+# Install gschema
 install_data (project_id + '.gschema.xml',
               install_dir: join_paths (datadir, 'glib-2.0', 'schemas'))
 
+# Make D-Bus activatable
+service_conf = configuration_data()
+service_conf.set('bindir', bindir)
 
+service = project_id + '.service'
+
+configure_file(
+  input: service + '.in',
+  output: service,
+  install: true,
+  install_dir: join_paths(datadir, 'dbus-1', 'services'),
+  configuration: service_conf
+)
+
+# Desktop file
 desktop_file = i18n.merge_file ('desktop-file',
                  input: project_id + '.desktop.in',
                  output: project_id + '.desktop',
@@ -19,6 +35,7 @@ desktop_file = i18n.merge_file ('desktop-file',
                  po_dir: '../po',
                  type: 'desktop')
 
+# Validate desktop file
 if desktop_file_validate.found()
   test(
     'validate-desktop',
@@ -29,6 +46,7 @@ if desktop_file_validate.found()
   )
 endif
 
+# AppData file
 appdata_file = i18n.merge_file ('appdata-file',
                  input: project_id + '.appdata.xml.in',
                  output: project_id + '.appdata.xml',
@@ -36,6 +54,7 @@ appdata_file = i18n.merge_file ('appdata-file',
                  install_dir: join_paths (datadir, 'metainfo'),
                  po_dir: '../po')
 
+# Validate AppData file
 if appstream_util.found()
   test(
     'validate-appdata', appstream_util,
@@ -45,4 +64,5 @@ if appstream_util.found()
   )
 endif
 
+# Install man page
 install_man ('gnome-tetravex.6')
diff --git a/data/org.gnome.Tetravex.desktop.in b/data/org.gnome.Tetravex.desktop.in
index b79982b..ff8ef80 100644
--- a/data/org.gnome.Tetravex.desktop.in
+++ b/data/org.gnome.Tetravex.desktop.in
@@ -13,3 +13,4 @@ Terminal=false
 Type=Application
 Categories=GNOME;GTK;Game;LogicGame;
 StartupNotify=true
+DBusActivatable=true
diff --git a/data/org.gnome.Tetravex.service.in b/data/org.gnome.Tetravex.service.in
new file mode 100644
index 0000000..6dba089
--- /dev/null
+++ b/data/org.gnome.Tetravex.service.in
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.gnome.Tetravex
+Exec=@bindir@/gnome-tetravex --gapplication-service
diff --git a/meson.build b/meson.build
index 19ac73f..b7680ea 100644
--- a/meson.build
+++ b/meson.build
@@ -15,9 +15,10 @@ gnome = import('gnome')
 i18n = import('i18n')
 
 # Paths
-mandir = join_paths (get_option ('prefix'), get_option ('mandir'))
-localedir = join_paths (get_option ('prefix'), get_option ('localedir'))
-datadir = join_paths (get_option ('prefix'), get_option ('datadir'))
+mandir      = join_paths (get_option ('prefix'), get_option ('mandir'))
+localedir   = join_paths (get_option ('prefix'), get_option ('localedir'))
+datadir     = join_paths (get_option ('prefix'), get_option ('datadir'))
+bindir      = join_paths (get_option ('prefix'), get_option ('bindir'))
 
 # Dependencies
 glib_dep = dependency ('glib-2.0', version: '>= 2.42.0')


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