mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-03 13:40:39 +01:00
meson: Use generators placeholders
Functions derived from generators as `configure_file`, `custom_target` and `i18n.merge_file` can use placeholders like `@BASENAME@` that removes the extension from the input filename string. The output string has been replaced by this placeholder that allows in some cases the use of less variables.
This commit is contained in:
parent
50f146f6e3
commit
bfbcf8f3fe
9 changed files with 23 additions and 32 deletions
|
|
@ -45,7 +45,7 @@ if enable_introspection
|
|||
else
|
||||
settings_docs_source = configure_file(
|
||||
input: settings_docs + '.in',
|
||||
output: settings_docs,
|
||||
output: '@BASENAME@',
|
||||
configuration: configuration_data(),
|
||||
)
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -6,31 +6,29 @@ data_conf.set('sysconfdir', nm_sysconfdir)
|
|||
data_conf.set('DISTRO_NETWORK_SERVICE', (enable_ifcfg_rh ? 'network.service' : ''))
|
||||
data_conf.set('NM_MODIFY_SYSTEM_POLICY', (enable_modify_system ? 'yes' : 'auth_admin_keep'))
|
||||
|
||||
server = 'server.conf'
|
||||
|
||||
configure_file(
|
||||
input: server + '.in',
|
||||
output: server,
|
||||
input: 'server.conf.in',
|
||||
output: '@BASENAME@',
|
||||
install_dir: join_paths(nm_datadir, 'doc', nm_name, 'examples'),
|
||||
configuration: data_conf,
|
||||
)
|
||||
|
||||
if install_systemd_unit_dir
|
||||
services = [
|
||||
'NetworkManager-dispatcher.service',
|
||||
'NetworkManager.service',
|
||||
'NetworkManager-dispatcher.service.in',
|
||||
'NetworkManager.service.in',
|
||||
]
|
||||
|
||||
if have_systemd_200
|
||||
services += ['NetworkManager-wait-online.service']
|
||||
services += ['NetworkManager-wait-online.service.in']
|
||||
else
|
||||
services += ['NetworkManager-wait-online-systemd-pre200.service']
|
||||
services += ['NetworkManager-wait-online-systemd-pre200.service.in']
|
||||
endif
|
||||
|
||||
foreach service: services
|
||||
configure_file(
|
||||
input: service + '.in',
|
||||
output: service,
|
||||
input: service,
|
||||
output: '@BASENAME@',
|
||||
install_dir: systemd_system_unit_dir,
|
||||
configuration: data_conf,
|
||||
)
|
||||
|
|
@ -62,14 +60,14 @@ if enable_polkit
|
|||
|
||||
policy_in = configure_file(
|
||||
input: policy + '.in.in',
|
||||
output: policy + '.in',
|
||||
output: '@BASENAME@',
|
||||
configuration: data_conf,
|
||||
)
|
||||
|
||||
custom_target(
|
||||
policy,
|
||||
input: policy_in,
|
||||
output: policy,
|
||||
output: '@BASENAME@',
|
||||
command: intltool_xml_cmd,
|
||||
install: true,
|
||||
install_dir: polkit_dir,
|
||||
|
|
|
|||
|
|
@ -8,11 +8,10 @@ service_conf.set('sysconfdir', nm_sysconfdir)
|
|||
service_conf.set('localstatedir', nm_localstatedir)
|
||||
service_conf.set('libexecdir', nm_libexecdir)
|
||||
|
||||
service = 'org.freedesktop.nm_dispatcher.service'
|
||||
|
||||
configure_file(
|
||||
input: service + '.in',
|
||||
output: service,
|
||||
input: 'org.freedesktop.nm_dispatcher.service.in',
|
||||
output: '@BASENAME@',
|
||||
install_dir: dbus_sys_dir,
|
||||
configuration: service_conf,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ if enable_introspection
|
|||
endif
|
||||
|
||||
configure_file(
|
||||
input: version_xml + '.in',
|
||||
output: version_xml,
|
||||
input: 'version.xml.in',
|
||||
output: '@BASENAME@',
|
||||
configuration: version_conf,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ private_headers = [
|
|||
]
|
||||
|
||||
configure_file(
|
||||
input: version_xml + '.in',
|
||||
output: version_xml,
|
||||
input: 'version.xml.in',
|
||||
output: '@BASENAME@',
|
||||
configuration: version_conf,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
version_conf = configuration_data()
|
||||
version_conf.set('VERSION', nm_version)
|
||||
|
||||
version_xml = 'version.xml'
|
||||
|
||||
subdir('libnm')
|
||||
subdir('api')
|
||||
|
||||
|
|
|
|||
|
|
@ -9,11 +9,9 @@ common_conf.set('NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT', config_default_logging_a
|
|||
common_conf.set('NM_CONFIG_DEFAULT_MAIN_RC_MANAGER', config_dns_rc_manager_default)
|
||||
common_conf.set('NM_CONFIG_DEFAULT_MAIN_DHCP', config_dhcp_default)
|
||||
|
||||
common = 'common.ent'
|
||||
|
||||
common_ent_file = configure_file(
|
||||
input: common + '.in',
|
||||
output: common,
|
||||
input: 'common.ent.in',
|
||||
output: '@BASENAME@',
|
||||
configuration: common_conf,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -847,11 +847,9 @@ if enable_docs
|
|||
subdir('docs')
|
||||
endif
|
||||
|
||||
config = 'config.h'
|
||||
|
||||
configure_file(
|
||||
input: config + '.meson',
|
||||
output: config,
|
||||
input: 'config.h.meson',
|
||||
output: '@BASENAME@',
|
||||
configuration: config_h,
|
||||
)
|
||||
|
||||
|
|
@ -879,7 +877,7 @@ config_extra_h.set_quoted('SYSCONFDIR', nm_sysconfdir)
|
|||
|
||||
configure_file(
|
||||
input: 'config-extra.h.meson',
|
||||
output: 'config-extra.h',
|
||||
output: '@BASENAME@',
|
||||
configuration: config_extra_h,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ version_conf.set('NM_MICRO_VERSION', nm_micro_version)
|
|||
|
||||
version_header = configure_file(
|
||||
input: 'nm-version-macros.h.in',
|
||||
output: 'nm-version-macros.h',
|
||||
output: '@BASENAME@',
|
||||
configuration: version_conf,
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue