[gnome-mahjongg/arnaudb/wip/gtk4: 4/23] Make D-Bus activatable.



commit 6b95c62b7002bf3bf5f145e998a72169c6dcc331
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sun May 3 18:19:48 2020 +0200

    Make D-Bus activatable.

 data/meson.build                   | 14 ++++++++++++++
 data/org.gnome.Mahjongg.desktop.in |  1 +
 data/org.gnome.Mahjongg.service.in |  3 +++
 meson.build                        |  9 +++++----
 4 files changed, 23 insertions(+), 4 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index 8142127..8325c1b 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -78,3 +78,17 @@ if get_option('update-icon-cache').enabled()
   meson.add_install_script(updateiconcache.path(), '-t', '-f', get_option('prefix') / hicolordir / 
'scalable')
   meson.add_install_script(updateiconcache.path(), '-t', '-f', get_option('prefix') / hicolordir / 
'symbolic')
 endif
+
+# Make D-Bus activatable
+service_conf = configuration_data()
+service_conf.set('bindir', bindir)
+
+service = 'org.gnome.Mahjongg.service'
+
+configure_file (
+  input: service + '.in',
+  output: service,
+  install: true,
+  install_dir: join_paths (datadir, 'dbus-1', 'services'),
+  configuration: service_conf
+)
diff --git a/data/org.gnome.Mahjongg.desktop.in b/data/org.gnome.Mahjongg.desktop.in
index 483ae02..410d69d 100644
--- a/data/org.gnome.Mahjongg.desktop.in
+++ b/data/org.gnome.Mahjongg.desktop.in
@@ -10,3 +10,4 @@ Terminal=false
 Type=Application
 Categories=GNOME;GTK;Game;BoardGame;
 StartupNotify=true
+DBusActivatable=true
diff --git a/data/org.gnome.Mahjongg.service.in b/data/org.gnome.Mahjongg.service.in
new file mode 100644
index 0000000..983a524
--- /dev/null
+++ b/data/org.gnome.Mahjongg.service.in
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.gnome.Mahjongg
+Exec=@bindir@/gnome-mahjongg --gapplication-service
diff --git a/meson.build b/meson.build
index 975660c..4f8e0d3 100644
--- a/meson.build
+++ b/meson.build
@@ -11,10 +11,11 @@ gnome = import ('gnome')
 i18n = import ('i18n')
 
 # Paths
-mandir     = get_option ('prefix') / get_option ('mandir')
-localedir  = get_option ('prefix') / get_option ('localedir')
-datadir    = get_option ('prefix') / get_option ('datadir')
-pkgdatadir = datadir / 'gnome-mahjongg'
+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'))
+pkgdatadir  = join_paths (datadir, 'gnome-mahjongg')
+bindir      = join_paths (get_option ('prefix'), get_option ('bindir'))
 
 # Dependencies
 glib_dep    = dependency ('glib-2.0', version: '>= 2.40.0')


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