From 6d7270e222cce3edaf95c463bec9f3212f5e5c73 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 21 Nov 2019 15:27:21 +0100 Subject: [PATCH] build/meson: cleanup configuration_data() for paths We don't need such data duplicated. The build setup should have only one configuration_data() for patching such values. Now we only have one global, immutable data_conf dictionary with configuration values. Note that none of the users of data_conf uses all entries, but as the entries are basically only dependent on the meson/configure option and valid for the entire project, this simplifies to handling. --- data/meson.build | 8 -------- dispatcher/meson.build | 8 +------- docs/api/meson.build | 2 +- docs/libnm/meson.build | 2 +- docs/meson.build | 3 --- man/meson.build | 13 +------------ meson.build | 21 +++++++++++++++++++++ shared/meson.build | 7 +------ 8 files changed, 26 insertions(+), 38 deletions(-) diff --git a/data/meson.build b/data/meson.build index c317877070..b572d27da2 100644 --- a/data/meson.build +++ b/data/meson.build @@ -1,11 +1,3 @@ -data_conf = configuration_data() -data_conf.set('bindir', nm_bindir) -data_conf.set('libexecdir', nm_libexecdir) -data_conf.set('sbindir', nm_sbindir) -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')) - configure_file( input: 'server.conf.in', output: '@BASENAME@', diff --git a/dispatcher/meson.build b/dispatcher/meson.build index a7e555702a..7feb9597fc 100644 --- a/dispatcher/meson.build +++ b/dispatcher/meson.build @@ -2,17 +2,11 @@ dispatcher_inc = include_directories('.') name = 'nm-dispatcher' -service_conf = configuration_data() -service_conf.set('sbindir', nm_sbindir) -service_conf.set('sysconfdir', nm_sysconfdir) -service_conf.set('localstatedir', nm_localstatedir) -service_conf.set('libexecdir', nm_libexecdir) - configure_file( input: 'org.freedesktop.nm_dispatcher.service.in', output: '@BASENAME@', install_dir: dbus_system_bus_services_dir, - configuration: service_conf, + configuration: data_conf, ) install_data( diff --git a/docs/api/meson.build b/docs/api/meson.build index dde1eecb03..30f82188f9 100644 --- a/docs/api/meson.build +++ b/docs/api/meson.build @@ -19,7 +19,7 @@ endif content_files += configure_file( input: 'version.xml.in', output: '@BASENAME@', - configuration: version_conf, + configuration: data_conf, ) filecopier = find_program('cp') diff --git a/docs/libnm/meson.build b/docs/libnm/meson.build index 43a13f498a..9bbd9d9807 100644 --- a/docs/libnm/meson.build +++ b/docs/libnm/meson.build @@ -39,7 +39,7 @@ scan_args = [ version_xml = configure_file( input: 'version.xml.in', output: '@BASENAME@', - configuration: version_conf, + configuration: data_conf, ) gnome.gtkdoc( diff --git a/docs/meson.build b/docs/meson.build index e9768e5275..53fcc96082 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -1,6 +1,3 @@ -version_conf = configuration_data() -version_conf.set('VERSION', nm_version) - subdir('libnm') subdir('api') diff --git a/man/meson.build b/man/meson.build index 8ba6f4d8a1..f9130535c9 100644 --- a/man/meson.build +++ b/man/meson.build @@ -1,18 +1,7 @@ -common_conf = configuration_data() -common_conf.set('NM_VERSION', nm_version) -common_conf.set('sysconfdir', nm_sysconfdir) -common_conf.set('nmrundir', nm_pkgrundir) -common_conf.set('nmstatedir', nm_pkgstatedir) -common_conf.set('NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT_TEXT', config_default_main_auth_polkit) -common_conf.set('NM_CONFIG_DEFAULT_LOGGING_BACKEND_TEXT', config_logging_backend_default) -common_conf.set('NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT', config_default_logging_audit) -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_ent_file = configure_file( input: 'common.ent.in', output: '@BASENAME@', - configuration: common_conf, + configuration: data_conf, ) xsltproc_options = [ diff --git a/meson.build b/meson.build index 9d4e2cd34d..29da0b0504 100644 --- a/meson.build +++ b/meson.build @@ -774,6 +774,27 @@ if python.found() config_h.set_quoted('TEST_NM_PYTHON', python.path()) endif +data_conf = configuration_data() +data_conf.set('DISTRO_NETWORK_SERVICE', (enable_ifcfg_rh ? 'network.service' : '')) +data_conf.set('NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT', config_default_logging_audit) +data_conf.set('NM_CONFIG_DEFAULT_LOGGING_BACKEND_TEXT', config_logging_backend_default) +data_conf.set('NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT_TEXT', config_default_main_auth_polkit) +data_conf.set('NM_CONFIG_DEFAULT_MAIN_DHCP', config_dhcp_default) +data_conf.set('NM_CONFIG_DEFAULT_MAIN_RC_MANAGER', config_dns_rc_manager_default) +data_conf.set('NM_MAJOR_VERSION', nm_major_version) +data_conf.set('NM_MICRO_VERSION', nm_micro_version) +data_conf.set('NM_MINOR_VERSION', nm_minor_version) +data_conf.set('NM_MODIFY_SYSTEM_POLICY', (enable_modify_system ? 'yes' : 'auth_admin_keep')) +data_conf.set('NM_VERSION', nm_version) +data_conf.set('VERSION', nm_version) +data_conf.set('bindir', nm_bindir) +data_conf.set('libexecdir', nm_libexecdir) +data_conf.set('localstatedir', nm_localstatedir) +data_conf.set('nmrundir', nm_pkgrundir) +data_conf.set('nmstatedir', nm_pkgstatedir) +data_conf.set('sbindir', nm_sbindir) +data_conf.set('sysconfdir', nm_sysconfdir) + # check if we can build setting property documentation ''' build_docs=no diff --git a/shared/meson.build b/shared/meson.build index 7a9dbaac48..e87d9a3b66 100644 --- a/shared/meson.build +++ b/shared/meson.build @@ -99,15 +99,10 @@ libn_dhcp4_dep = declare_dependency( link_with: libn_dhcp4, ) -nm_version_macro_conf = configuration_data() -nm_version_macro_conf.set('NM_MAJOR_VERSION', nm_major_version) -nm_version_macro_conf.set('NM_MINOR_VERSION', nm_minor_version) -nm_version_macro_conf.set('NM_MICRO_VERSION', nm_micro_version) - nm_version_macro_header = configure_file( input: 'nm-version-macros.h.in', output: '@BASENAME@', - configuration: nm_version_macro_conf, + configuration: data_conf, ) nm_ethtool_utils_source = files('nm-libnm-core-intern/nm-ethtool-utils.c')