Search code examples
dbusmeson-build

meson `get_option()` to find `/etc/dbus-1/system.d/` directory


Meson uses get_option('bindir') to find the binary directory, which should be /usr/bin in most cases.

I have configuration file for d-bus, the file should be like /etc/dbus-1/system.d/<file>.conf, how can I use the similar method to find the path of etc/dbus-1/system.d/ in meson.build file?


Solution

  • The usual way you would do this is with:

    dbus_dir = get_option('sysconfdir') / 'dbus-1' / 'system.d'
    dbus_file = dbus_dir / '<file>.conf'
    

    sysconfigdir is the name of the directory that is usually /etc, and then you'd build the rest of the string yourself.

    The directory names are documented here