From c06c9d2e263962d42d45eafaa82e9a60f9882d1b Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Wed, 24 Jul 2019 06:29:36 +0200 Subject: [PATCH] build: Simplify file substitution Since meson 0.50, configuration_data() can take a dictionary. --- docs/reference/libsecret/meson.build | 6 ++--- libsecret/meson.build | 34 +++++++++++++++------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/reference/libsecret/meson.build b/docs/reference/libsecret/meson.build index 81add38..69d3202 100644 --- a/docs/reference/libsecret/meson.build +++ b/docs/reference/libsecret/meson.build @@ -15,12 +15,10 @@ reference_ignore_headers = [ 'secret-private.h', ] -version_conf = configuration_data() -version_conf.set('VERSION', meson.project_version()) configure_file( input: 'version.xml.in', - output: 'version.xml', - configuration: version_conf, + output: '@BASENAME@', + configuration: {'VERSION': meson.project_version()}, ) gnome.gtkdoc('libsecret', diff --git a/libsecret/meson.build b/libsecret/meson.build index efb5d35..f7077cd 100644 --- a/libsecret/meson.build +++ b/libsecret/meson.build @@ -37,12 +37,13 @@ version_numbers = meson.project_version().split('.') version_major = version_numbers[0].to_int() version_minor = version_numbers[1].to_int() version_micro = version_numbers[2].to_int() -version_h_conf = configuration_data() -version_h_conf.set('SECRET_MAJOR_VERSION', version_major) -version_h_conf.set('SECRET_MINOR_VERSION', version_minor) -version_h_conf.set('SECRET_MICRO_VERSION', version_micro) +version_h_conf = configuration_data({ + 'SECRET_MAJOR_VERSION': version_major, + 'SECRET_MINOR_VERSION': version_minor, + 'SECRET_MICRO_VERSION': version_micro, +}) version_h = configure_file(input: 'secret-version.h.in', - output: 'secret-version.h', + output: '@BASENAME@', configuration: version_h_conf) libsecret_headers += version_h @@ -143,16 +144,17 @@ if with_vapi endif # pkg-config -pc_conf = configuration_data() -pc_conf.set('prefix', libsecret_prefix) -pc_conf.set('exec_prefix', '${prefix}') -pc_conf.set('libdir', '${prefix}' / get_option('libdir')) -pc_conf.set('includedir', '${prefix}' / get_option('includedir')) -pc_conf.set('datarootdir', '${prefix}' / get_option('datadir')) -pc_conf.set('datadir', '${datarootdir}') -pc_conf.set('sysconfdir', '${prefix}' / get_option('sysconfdir')) -pc_conf.set('SECRET_MAJOR', api_version_major) -pc_conf.set('VERSION', meson.project_version()) +pc_conf = configuration_data({ + 'prefix': libsecret_prefix, + 'exec_prefix': '${prefix}', + 'libdir': '${prefix}' / get_option('libdir'), + 'includedir': '${prefix}' / get_option('includedir'), + 'datarootdir': '${prefix}' / get_option('datadir'), + 'datadir': '${datarootdir}', + 'sysconfdir': '${prefix}' / get_option('sysconfdir'), + 'SECRET_MAJOR': api_version_major, + 'VERSION': meson.project_version(), +}) configure_file( input: 'libsecret.pc.in', @@ -163,7 +165,7 @@ configure_file( ) configure_file( input: 'libsecret-unstable.pc.in', - output: 'libsecret-unstable.pc', + output: '@BASENAME@', configuration: pc_conf, install: true, install_dir: libsecret_prefix / libdir / 'pkgconfig',