networkAgent: Pick up VPN service dir from pkg-config

It turns out that NetworkManager does export the directory as pkg-config
variable after all, so use that instead of building the path ourselves
from the prefix.

https://bugzilla.gnome.org/show_bug.cgi?id=789811
This commit is contained in:
Florian Müllner 2018-01-21 21:04:37 +01:00
parent fed5657b40
commit 1d3154a89e
4 changed files with 7 additions and 10 deletions

View File

@ -14,6 +14,6 @@ var GETTEXT_PACKAGE = '@GETTEXT_PACKAGE@';
var LOCALEDIR = '@datadir@/locale'; var LOCALEDIR = '@datadir@/locale';
/* other standard directories */ /* other standard directories */
var LIBEXECDIR = '@libexecdir@'; var LIBEXECDIR = '@libexecdir@';
var NMPREFIXDIR = '@nmprefixdir@'; var VPNDIR = '@vpndir@';
/* g-i package versions */ /* g-i package versions */
var LIBMUTTER_API_VERSION = '@LIBMUTTER_API_VERSION@' var LIBMUTTER_API_VERSION = '@LIBMUTTER_API_VERSION@'

View File

@ -7,7 +7,7 @@ jsconf.set10('HAVE_BLUETOOTH', bt_dep.found())
jsconf.set10('HAVE_NETWORKMANAGER', have_networkmanager) jsconf.set10('HAVE_NETWORKMANAGER', have_networkmanager)
jsconf.set('datadir', datadir) jsconf.set('datadir', datadir)
jsconf.set('libexecdir', libexecdir) jsconf.set('libexecdir', libexecdir)
jsconf.set('nmprefixdir', nm_prefix) jsconf.set('vpndir', vpndir)
config_js = configure_file( config_js = configure_file(
input: 'config.js.in', input: 'config.js.in',

View File

@ -594,7 +594,7 @@ var NetworkAgent = new Lang.Class({
this._vpnRequests = { }; this._vpnRequests = { };
this._notifications = { }; this._notifications = { };
this._pluginDir = Gio.file_new_for_path(GLib.build_filenamev([Config.NMPREFIXDIR, 'lib/NetworkManager/VPN'])); this._pluginDir = Gio.file_new_for_path(Config.VPNDIR);
try { try {
let monitor = this._pluginDir.monitor(Gio.FileMonitorFlags.NONE, null); let monitor = this._pluginDir.monitor(Gio.FileMonitorFlags.NONE, null);
monitor.connect('changed', () => { this._vpnCacheBuilt = false; }); monitor.connect('changed', () => { this._vpnCacheBuilt = false; });

View File

@ -105,16 +105,13 @@ if get_option('networkmanager')
nm_deps += dependency('libnm', version: nm_req) nm_deps += dependency('libnm', version: nm_req)
nm_deps += dependency('libsecret-1', version: secret_req) nm_deps += dependency('libsecret-1', version: secret_req)
vpndir = nm_deps[0].get_pkgconfig_variable('vpnservicedir')
have_networkmanager = true have_networkmanager = true
else else
have_networkmanager = false vpndir = prefix
endif
networkmanager_dep = dependency('NetworkManager', required: false) have_networkmanager = false
if (networkmanager_dep.found())
nm_prefix = networkmanager_dep.get_pkgconfig_variable('prefix')
else
nm_prefix = prefix
endif endif
if get_option('systemd') if get_option('systemd')