diff options
author | Roman Stratiienko <r.stratiienko@gmail.com> | 2022-11-28 17:55:32 +0200 |
---|---|---|
committer | Roman Stratiienko <r.stratiienko@gmail.com> | 2022-11-28 19:57:59 +0200 |
commit | 20e1508e6e743b4a1b1f4a19ed015121c26ae21b (patch) | |
tree | 2068a2f66a49473f6513f892e76c3a5a354725ad | |
parent | 74afeca98b778ae7ea26b6600aa9c8c418d13d81 (diff) | |
download | glib-20e1508e6e743b4a1b1f4a19ed015121c26ae21b.tar.gz |
gdbusaddress: Form default system dbus path using meson definitions
This is useful for systems where rootfs doesn't contain /var directory,
e.g. on Android.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
-rw-r--r-- | gio/gdbusaddress.c | 5 | ||||
-rw-r--r-- | meson.build | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gio/gdbusaddress.c b/gio/gdbusaddress.c index 615722978..c8c432e09 100644 --- a/gio/gdbusaddress.c +++ b/gio/gdbusaddress.c @@ -1337,7 +1337,10 @@ g_dbus_address_get_for_bus_sync (GBusType bus_type, if (ret == NULL) { - ret = g_strdup ("unix:path=/var/run/dbus/system_bus_socket"); + /* While the D-Bus specification says this must be `/var/run/dbus/system_bus_socket`, + * a footnote allows it to use localstatedir: + * https://dbus.freedesktop.org/doc/dbus-specification.html#ftn.id-1.13.6.4.3.3 */ + ret = g_strdup ("unix:path=" GLIB_LOCALSTATEDIR "/run/dbus/system_bus_socket"); } break; diff --git a/meson.build b/meson.build index 422e30653..773cc7b05 100644 --- a/meson.build +++ b/meson.build @@ -2109,6 +2109,8 @@ glib_conf.set('HAVE_GETTEXT', 1) glib_conf.set_quoted('GLIB_LOCALE_DIR', join_paths(glib_datadir, 'locale')) +glib_conf.set_quoted('GLIB_LOCALSTATEDIR', glib_localstatedir) + # libmount is only used by gio, but we need to fetch the libs to generate the # pkg-config file below libmount_dep = [] |