From 555407a448d78057e3b9b2b2d8fcc83a2275d377 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Wed, 24 Jul 2019 06:10:13 +0200 Subject: [PATCH 1/3] build: Bump meson_version to 0.50 To suppress the warning: WARNING: Project targetting '>= 0.48' but tried to use feature introduced in '0.50.0': install arg in configure_file --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 0d59799..8a6874e 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('libsecret', 'c', version: '0.18.8', license: 'GPL2+', - meson_version: '>= 0.48', + meson_version: '>= 0.50', ) gnome = import('gnome') From a4ea97d6e688f18d92b17fc9ab9d730672997baf Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Wed, 24 Jul 2019 06:18:36 +0200 Subject: [PATCH 2/3] build: Simplify pathname handling This switches to using relative paths as much as possible, and the "/" shorthand for join_paths. --- docs/man/meson.build | 2 +- libsecret/meson.build | 18 +++++++++--------- meson.build | 22 +++++++++++----------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/man/meson.build b/docs/man/meson.build index 37cabc4..8370d2b 100644 --- a/docs/man/meson.build +++ b/docs/man/meson.build @@ -14,5 +14,5 @@ secret_tool_man = custom_target('secret-tool.1', ], build_by_default: true, install: true, - install_dir: join_paths(libsecret_prefix, get_option('mandir'), 'man1'), + install_dir: libsecret_prefix / get_option('mandir') / 'man1', ) diff --git a/libsecret/meson.build b/libsecret/meson.build index 60fa11e..efb5d35 100644 --- a/libsecret/meson.build +++ b/libsecret/meson.build @@ -1,4 +1,4 @@ -installed_headers_subdir = join_paths('libsecret-@0@'.format(api_version_major), 'libsecret') +installed_headers_subdir = 'libsecret-@0@'.format(api_version_major) / 'libsecret' libsecret_sources = [ 'secret-attributes.c', @@ -57,7 +57,7 @@ _enums_generated = gnome.mkenums('secret-enum-types', c_template: 'secret-enum-types.c.template', h_template: 'secret-enum-types.h.template', install_header: true, - install_dir: join_paths(includedir, installed_headers_subdir), + install_dir: libsecret_prefix / includedir / installed_headers_subdir, ) libsecret_dependencies = [ @@ -136,7 +136,7 @@ libsecret_gir = gnome.generate_gir(libsecret, if with_vapi libsecret_vapi = gnome.generate_vapi('libsecret-@0@'.format(api_version_major), sources: libsecret_gir[0], - metadata_dirs: join_paths(meson.source_root(), 'libsecret'), + metadata_dirs: meson.source_root() / 'libsecret', packages: [ 'gobject-2.0', 'gio-2.0' ], install: true, ) @@ -146,11 +146,11 @@ endif pc_conf = configuration_data() pc_conf.set('prefix', libsecret_prefix) pc_conf.set('exec_prefix', '${prefix}') -pc_conf.set('libdir', join_paths('${prefix}', get_option('libdir'))) -pc_conf.set('includedir', join_paths('${prefix}', get_option('includedir'))) -pc_conf.set('datarootdir', join_paths('${prefix}', get_option('datadir'))) +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', join_paths('${prefix}', get_option('sysconfdir'))) +pc_conf.set('sysconfdir', '${prefix}' / get_option('sysconfdir')) pc_conf.set('SECRET_MAJOR', api_version_major) pc_conf.set('VERSION', meson.project_version()) @@ -159,14 +159,14 @@ configure_file( output: 'libsecret-@0@.pc'.format(api_version_major), configuration: pc_conf, install: true, - install_dir: join_paths(libdir, 'pkgconfig'), + install_dir: libsecret_prefix / libdir / 'pkgconfig', ) configure_file( input: 'libsecret-unstable.pc.in', output: 'libsecret-unstable.pc', configuration: pc_conf, install: true, - install_dir: join_paths(libdir, 'pkgconfig'), + install_dir: libsecret_prefix / libdir / 'pkgconfig', ) # Tests diff --git a/meson.build b/meson.build index 8a6874e..4f2305c 100644 --- a/meson.build +++ b/meson.build @@ -25,16 +25,16 @@ with_gtkdoc = get_option('gtk_doc') # Some variables config_h_dir = include_directories('.') libsecret_prefix = get_option('prefix') -datadir = join_paths(libsecret_prefix, get_option('datadir')) -includedir = join_paths(libsecret_prefix, get_option('includedir')) -bindir = join_paths(libsecret_prefix, get_option('bindir')) -libdir = join_paths(libsecret_prefix, get_option('libdir')) -libexecdir = join_paths(libsecret_prefix, get_option('libexecdir')) -locale_dir = join_paths(libsecret_prefix, get_option('localedir')) -pkgdatadir = join_paths(datadir, meson.project_name()) -pkglibdir = join_paths(libdir, meson.project_name()) -sysconfdir = join_paths(libsecret_prefix, get_option('sysconfdir')) -po_dir = join_paths(meson.source_root(), 'po') +datadir = get_option('datadir') +includedir = get_option('includedir') +bindir = get_option('bindir') +libdir = get_option('libdir') +libexecdir = get_option('libexecdir') +locale_dir = get_option('localedir') +pkgdatadir = datadir / meson.project_name() +pkglibdir = libdir / meson.project_name() +sysconfdir = get_option('sysconfdir') +po_dir = meson.source_root() / 'po' # Dependencies min_glib_version = '2.44' @@ -68,7 +68,7 @@ math = meson.get_compiler('c').find_library('m') conf = configuration_data() conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) conf.set_quoted('G_LOG_DOMAIN', meson.project_name()) -conf.set_quoted('LOCALEDIR', locale_dir) +conf.set_quoted('LOCALEDIR', libsecret_prefix / locale_dir) conf.set_quoted('PACKAGE_NAME', meson.project_name()) conf.set_quoted('PACKAGE_STRING', meson.project_name()) conf.set_quoted('PACKAGE_VERSION', meson.project_version()) From c06c9d2e263962d42d45eafaa82e9a60f9882d1b Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Wed, 24 Jul 2019 06:29:36 +0200 Subject: [PATCH 3/3] 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',