[totem/wip/inigomartinez/meson-improve: 14/14] build: Check D-Bus session bus services directory



commit 8559245b81d95cc5ba7befeb2d1eecb400d864c6
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Mon Feb 19 22:16:04 2018 +0100

    build: Check D-Bus session bus services directory
    
    Totem install a session bus service file. This file is installed in
    the `dbus-1/services` directory under `datadir`. However, the real
    directory can be checked from the `dbus-1.pc` pkg-config file.
    
    A new option has also been added to set as a different session bus
    services directory, so the user can install the file in it.

 data/meson.build  |    4 ++--
 meson.build       |    7 +++++++
 meson_options.txt |    1 +
 3 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index 1a4f567..21b1f9b 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -86,9 +86,9 @@ service = 'org.gnome.Totem.service'
 configure_file(
   input: service + '.in',
   output: service,
-  install: true,
-  install_dir: join_paths(totem_datadir, 'dbus-1', 'services'),
   configuration: service_conf
+  install: true,
+  install_dir: dbus_session_dir
 )
 
 r = run_command(thumbnailer_sh, mime_type_list)
diff --git a/meson.build b/meson.build
index 70b4886..544f467 100644
--- a/meson.build
+++ b/meson.build
@@ -149,6 +149,13 @@ libgd = subproject(
 )
 libgd_dep = libgd.get_variable('libgd_dep')
 
+dbus_session_dir = get_option('dbus_session_dir')
+if dbus_session_dir == ''
+  dbus_dep = dependency('dbus-1', required: false)
+  assert(dbus_dep.found(), 'D-Bus required but not found, please provide a valid session bus services dir')
+  dbus_session_dir = dbus_dep.get_pkgconfig_variable('session_bus_services_dir')
+endif
+
 '''
 FIXME:
   libtotem adds plugins/totem-plugins-engine.c inconditionally, which includes
diff --git a/meson_options.txt b/meson_options.txt
index 4b8797b..656f3a0 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,3 +1,4 @@
+option('dbus_session_dir', type: 'string', value: '', description: 'where D-Bus session service directory 
is')
 option('easy_codec_installation', type: 'boolean', value: true, description: 'Whether to enable easy codec 
installation support for GStreamer')
 option('python', type: 'boolean', value: true, description: 'Enable python support')
 option('vapi', type: 'boolean', value: true, description: 'whether Vala plugin support is requested')


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