diff options
author | Thomas Haller <thaller@redhat.com> | 2021-02-12 10:17:41 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2021-02-12 11:34:24 +0100 |
commit | 801c41a11c2cd37dc1271c026edc0a3292cc69b8 (patch) | |
tree | 5d19243026b53d77c834da407d78a927ad491139 /meson.build | |
parent | 2e334f54b27f91f40c3aa8bdba3254e2284d30bd (diff) | |
download | NetworkManager-801c41a11c2cd37dc1271c026edc0a3292cc69b8.tar.gz |
build: make path to polkit-agent-helper-1 binary configurable
Add new configure option to set the path to "polkit-agent-helper-1".
The path cannot be obtained from pkg-config and `pkg-config
--variable=prefix polkit-agent-1` is not good enough.
On Fedora, the path is "/usr/lib/polkit-1/polkit-agent-helper-1".
On Debian Buster, the path is "/usr/lib/policykit-1/polkit-agent-helper-1"
On Debian Sid, the path is "/usr/libexec/polkit-agent-helper-1" (but
currently it is also symlinked from "/usr/lib/policykit-1/polkit-agent-helper-1".
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/meson.build b/meson.build index 0ea0592419..9d3d08c4f6 100644 --- a/meson.build +++ b/meson.build @@ -514,12 +514,18 @@ config_h.set_quoted('NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT', config_auth_polkit_def enable_modify_system = get_option('modify_system') -polkit_agent_dep = dependency('polkit-agent-1', version: '>= 0.97', required : false) -if polkit_agent_dep.found() - config_h.set_quoted('POLKIT_PACKAGE_PREFIX', polkit_agent_dep.get_pkgconfig_variable('prefix')) -else - config_h.set_quoted('POLKIT_PACKAGE_PREFIX', '/usr') +polkit_agent_helper_1_path = get_option('polkit_agent_helper_1_path') +foreach p : [ '/usr/libexec/polkit-agent-helper-1', + '/usr/lib/polkit-1/polkit-agent-helper-1', + '/usr/lib/policykit-1/polkit-agent-helper-1' ] + if polkit_agent_helper_1_path == '' and run_command('test', '-f', p).returncode() == 0 + polkit_agent_helper_1_path = p + endif +endforeach +if polkit_agent_helper_1_path == '' + polkit_agent_helper_1_path = '/usr/lib/polkit-1/polkit-agent-helper-1' endif +config_h.set_quoted('POLKIT_AGENT_HELPER_1_PATH', polkit_agent_helper_1_path) crypto = get_option('crypto') @@ -1016,6 +1022,7 @@ if enable_polkit output += ' modify.system)' endif output += '\n' +output += ' polkit-agent-helper-1: ' + polkit_agent_helper_1_path + '\n' output += ' selinux: ' + enable_selinux.to_string() + '\n' output += ' systemd-journald: ' + enable_systemd_journal.to_string() + ' (default: logging.backend=' + config_logging_backend_default + ')\n' output += ' hostname persist: ' + hostname_persist + '\n' |