summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIñigo Martínez <inigomartinez@gmail.com>2018-03-19 19:47:25 +0100
committerIñigo Martínez <inigomartinez@gmail.com>2018-03-23 20:23:28 +0100
commitf3bc7a6e8000488dda6703a3ae65ff72cdb3bd80 (patch)
tree942407847814a7053fe731a4ee67739259ac0b33
parentb8216b7589c974877187b04eecb4ef57e0171248 (diff)
downloadgvfs-f3bc7a6e8000488dda6703a3ae65ff72cdb3bd80.tar.gz
build: Properly define giomoduledir and session_bus_services_dir
Following the recommendations[0], the `giomoduledir` and `session_bus_services_dir` use the information from the `pc` files where they are defined, gio-2.0.pc and dbus-1.pc. However, these variables are relative to some other variable which is set to be a directory under prefix, where the user should be able to write. On the other hand, systemd related paths, `systemduserunitdir` and `tmpfilesdir` can not use this approach because they use absolute paths, so there is no way to set those paths to directories under prefix. The `gio_module_dir` and `dbus_services_dir` have also been removed because they are not necessary anymore. https://bugzilla.gnome.org/show_bug.cgi?id=794365 [0] https://www.bassi.io/articles/2018/03/15/pkg-config-and-paths/
-rw-r--r--meson.build16
-rw-r--r--meson_options.txt2
2 files changed, 4 insertions, 14 deletions
diff --git a/meson.build b/meson.build
index 5a0bc5e3..9651d880 100644
--- a/meson.build
+++ b/meson.build
@@ -267,19 +267,13 @@ endif
config_h.set('HAVE_GCRYPT', enable_gcrypt)
# *** Check for dbus service dir ***
-dbus_service_dir = get_option('dbus_service_dir')
-if dbus_service_dir == ''
- dbus_dep = dependency('dbus-1', required: false)
- assert(dbus_dep.found(), 'dbus-1 required but not found, please provide a valid D-Bus service dir')
- dbus_service_dir = dbus_dep.get_pkgconfig_variable('session_bus_services_dir')
-endif
+dbus_dep = dependency('dbus-1')
+dbus_service_dir = dbus_dep.get_pkgconfig_variable('session_bus_services_dir', define_variable: ['datadir', gvfs_datadir])
dbus_service_in = files('dbus.service.in')
-gio_module_dir = get_option('gio_module_dir')
-if gio_module_dir == ''
- gio_module_dir = gio_dep.get_pkgconfig_variable('giomoduledir')
-endif
+# *** Check for gio module dir ***
+gio_module_dir = gio_dep.get_pkgconfig_variable('giomoduledir', define_variable: ['libdir', gvfs_libdir])
# *** Check for systemd options ***
systemd_user_unit_dir = get_option('systemduserunitdir')
@@ -518,8 +512,6 @@ meson.add_install_script(
output = gvfs_name + ' ' + gvfs_version + ' configuration summary:\n'
output += '\n'
-output += ' dbus_service_dir: ' + dbus_service_dir + '\n'
-output += ' gio_module_dir: ' + gio_module_dir + '\n'
output += ' systemduserunitdir: ' + systemd_user_unit_dir + '\n'
output += ' tmpfilesdir: ' + tmp_files_dir + '\n'
output += '\n'
diff --git a/meson_options.txt b/meson_options.txt
index 5f5041c9..2c116a5f 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,5 +1,3 @@
-option('dbus_service_dir', type: 'string', value: '', description: 'custom directory for dbus service files')
-option('gio_module_dir', type: 'string', value: '', description: 'custom directory for gio modules')
option('systemduserunitdir', type: 'string', value: '', description: 'custom directory for systemd user units, or \'no\' to disable')
option('tmpfilesdir', type: 'string', value: '', description: 'custom directory for tmpfiles.d config files, or \'no\' to disable')