build: Simplify pathname handling

This switches to using relative paths as much as possible, and the "/"
shorthand for join_paths.
This commit is contained in:
Daiki Ueno 2019-07-24 06:18:36 +02:00
parent 555407a448
commit a4ea97d6e6
3 changed files with 21 additions and 21 deletions

View File

@ -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',
)

View File

@ -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

View File

@ -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())