diff --git a/js/misc/config.js.in b/js/misc/config.js.in index e8ad9d9e4..f296275ca 100644 --- a/js/misc/config.js.in +++ b/js/misc/config.js.in @@ -14,6 +14,6 @@ var GETTEXT_PACKAGE = '@GETTEXT_PACKAGE@'; var LOCALEDIR = '@datadir@/locale'; /* other standard directories */ var LIBEXECDIR = '@libexecdir@'; -var SYSCONFDIR = '@sysconfdir@'; +var NMPREFIXDIR = '@nmprefixdir@'; /* g-i package versions */ var LIBMUTTER_API_VERSION = '@LIBMUTTER_API_VERSION@' diff --git a/js/misc/meson.build b/js/misc/meson.build index 20489496c..bbdc0411e 100644 --- a/js/misc/meson.build +++ b/js/misc/meson.build @@ -7,7 +7,7 @@ jsconf.set10('HAVE_BLUETOOTH', bt_dep.found()) jsconf.set10('HAVE_NETWORKMANAGER', have_networkmanager) jsconf.set('datadir', datadir) jsconf.set('libexecdir', libexecdir) -jsconf.set('sysconfdir', sysconfdir) +jsconf.set('nmprefixdir', nm_prefix) config_js = configure_file( input: 'config.js.in', diff --git a/js/ui/components/networkAgent.js b/js/ui/components/networkAgent.js index fd59c11ca..1086483f1 100644 --- a/js/ui/components/networkAgent.js +++ b/js/ui/components/networkAgent.js @@ -587,7 +587,7 @@ var NetworkAgent = new Lang.Class({ this._vpnRequests = { }; this._notifications = { }; - this._pluginDir = Gio.file_new_for_path(GLib.build_filenamev([Config.SYSCONFDIR, 'NetworkManager/VPN'])); + this._pluginDir = Gio.file_new_for_path(GLib.build_filenamev([Config.NMPREFIXDIR, 'lib/NetworkManager/VPN'])); try { let monitor = this._pluginDir.monitor(Gio.FileMonitorFlags.NONE, null); monitor.connect('changed', () => { this._vpnCacheBuilt = false; }); diff --git a/meson.build b/meson.build index 988fcb749..e9854e3a9 100644 --- a/meson.build +++ b/meson.build @@ -43,7 +43,6 @@ datadir = join_paths(prefix, get_option('datadir')) libdir = join_paths(prefix, get_option('libdir')) libexecdir = join_paths(prefix, get_option('libexecdir')) mandir = join_paths(prefix, get_option('mandir')) -sysconfdir = join_paths(prefix, get_option('sysconfdir')) pkgdatadir = join_paths(datadir, meson.project_name()) pkglibdir = join_paths(libdir, meson.project_name()) @@ -113,6 +112,13 @@ else have_networkmanager = false endif +networkmanager_dep = dependency('NetworkManager', required: false) +if (networkmanager_dep.found()) + nm_prefix = networkmanager_dep.get_pkgconfig_variable('prefix') +else + nm_prefix = prefix +endif + if get_option('systemd') systemd_dep = dependency('libsystemd') have_systemd = systemd_dep.found() diff --git a/src/meson.build b/src/meson.build index 3e5557351..ff7e0662d 100644 --- a/src/meson.build +++ b/src/meson.build @@ -13,7 +13,6 @@ script_data.set('libdir', libdir) script_data.set('libexecdir', libexecdir) script_data.set('pkgdatadir', pkgdatadir) script_data.set('pkglibdir', pkglibdir) -script_data.set('sysconfdir', sysconfdir) script_data.set('PYTHON', python.path()) script_data.set('VERSION', meson.project_version())