1
0
Fork 0

build: Use / operator instead of join_paths everywhere

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2985>
This commit is contained in:
Jonas Ådahl 2023-05-04 13:49:59 +02:00 committed by Marge Bot
parent dcaca398f1
commit 61b42e5303
12 changed files with 59 additions and 66 deletions

View file

@ -1,5 +1,5 @@
clutter_clutter_includesubdir = join_paths(clutter_includesubdir, 'clutter') clutter_clutter_includesubdir = clutter_includesubdir / 'clutter'
clutter_clutter_includedir = join_paths(clutter_includedir, 'clutter') clutter_clutter_includedir = clutter_includedir / 'clutter'
clutter_headers = [ clutter_headers = [
'clutter.h', 'clutter.h',
@ -338,7 +338,7 @@ libmutter_clutter_dep = declare_dependency(
if have_introspection if have_introspection
clutter_introspection_args = introspection_args + [ clutter_introspection_args = introspection_args + [
'-DCLUTTER_SYSCONFDIR="@0@"'.format(join_paths(prefix, sysconfdir)), '-DCLUTTER_SYSCONFDIR="@0@"'.format(prefix / sysconfdir),
'-DCLUTTER_COMPILATION=1', '-DCLUTTER_COMPILATION=1',
'-DCOGL_DISABLE_DEPRECATION_WARNINGS', '-DCOGL_DISABLE_DEPRECATION_WARNINGS',
'-DG_LOG_DOMAIN="Clutter"' '-DG_LOG_DOMAIN="Clutter"'
@ -395,17 +395,17 @@ install_headers(clutter_headers,
subdir: clutter_clutter_includesubdir) subdir: clutter_clutter_includesubdir)
install_headers(cally_headers, install_headers(cally_headers,
subdir: join_paths(clutter_includesubdir, 'cally')) subdir: clutter_includesubdir / 'cally')
install_headers(clutter_deprecated_headers, install_headers(clutter_deprecated_headers,
subdir: join_paths(clutter_clutter_includesubdir, 'deprecated')) subdir: clutter_clutter_includesubdir / 'deprecated')
pkg.generate(libmutter_clutter, pkg.generate(libmutter_clutter,
name: 'Mutters Clutter', name: 'Mutters Clutter',
filebase: libmutter_clutter_name, filebase: libmutter_clutter_name,
description: 'Mutters Clutter Private Library', description: 'Mutters Clutter Private Library',
libraries: [m_dep], libraries: [m_dep],
subdirs: join_paths(pkgname, 'clutter'), subdirs: pkgname / 'clutter',
requires: [clutter_pkg_deps, libmutter_cogl_name], requires: [clutter_pkg_deps, libmutter_cogl_name],
version: meson.project_version(), version: meson.project_version(),
variables: [ variables: [

View file

@ -1,11 +1,11 @@
clutter_includesubdir = join_paths(pkgname, 'clutter') clutter_includesubdir = pkgname / 'clutter'
clutter_includedir = join_paths(includedir, clutter_includesubdir) clutter_includedir = includedir / clutter_includesubdir
clutter_includepath = include_directories('.', 'clutter') clutter_includepath = include_directories('.', 'clutter')
clutter_includes = [clutter_includepath, cogl_includepath] clutter_includes = [clutter_includepath, cogl_includepath]
clutter_c_args = [ clutter_c_args = [
'-DCLUTTER_SYSCONFDIR="@0@"'.format(join_paths(prefix, sysconfdir)), '-DCLUTTER_SYSCONFDIR="@0@"'.format(prefix / sysconfdir),
'-DCLUTTER_COMPILATION=1', '-DCLUTTER_COMPILATION=1',
'-DCOGL_DISABLE_DEPRECATION_WARNINGS', '-DCOGL_DISABLE_DEPRECATION_WARNINGS',
'-DCOGL_ENABLE_MUTTER_API', '-DCOGL_ENABLE_MUTTER_API',

View file

@ -64,14 +64,14 @@ if have_introspection
) )
endif endif
cogl_pango_includesubdir = join_paths(cogl_includesubdir, 'cogl-pango') cogl_pango_includesubdir = cogl_includesubdir / 'cogl-pango'
install_headers(cogl_pango_public_headers, subdir: cogl_pango_includesubdir) install_headers(cogl_pango_public_headers, subdir: cogl_pango_includesubdir)
pkg.generate(libmutter_cogl_pango, pkg.generate(libmutter_cogl_pango,
name: 'CoglPango', name: 'CoglPango',
filebase: 'mutter-cogl-pango-' + libmutter_api_version, filebase: 'mutter-cogl-pango-' + libmutter_api_version,
description: 'A text rendering for Cogl in mutter', description: 'A text rendering for Cogl in mutter',
subdirs: join_paths(pkgname, 'cogl'), subdirs: pkgname / 'cogl',
requires: [cogl_pkg_deps, libmutter_cogl_name, pango_dep, pangocairo_dep], requires: [cogl_pkg_deps, libmutter_cogl_name, pango_dep, pangocairo_dep],
version: meson.project_version(), version: meson.project_version(),
variables: [ variables: [

View file

@ -1,5 +1,5 @@
cogl_cogl_includesubdir = join_paths(cogl_includesubdir, 'cogl') cogl_cogl_includesubdir = cogl_includesubdir / 'cogl'
cogl_cogl_includedir = join_paths(cogl_includedir, 'cogl') cogl_cogl_includedir = cogl_includedir / 'cogl'
cdata = configuration_data() cdata = configuration_data()
cdata.set('COGL_HAS_GL', have_gl) cdata.set('COGL_HAS_GL', have_gl)
@ -475,17 +475,17 @@ install_headers([
install_headers([ install_headers([
cogl_deprecated_headers, cogl_deprecated_headers,
], ],
subdir: join_paths(cogl_cogl_includesubdir, 'deprecated')) subdir: cogl_cogl_includesubdir / 'deprecated')
install_headers(cogl_gl_prototype_headers, install_headers(cogl_gl_prototype_headers,
subdir: join_paths(cogl_cogl_includesubdir, 'gl-prototypes')) subdir: cogl_cogl_includesubdir / 'gl-prototypes')
pkg.generate(libmutter_cogl, pkg.generate(libmutter_cogl,
name: 'Cogl', name: 'Cogl',
filebase: libmutter_cogl_name, filebase: libmutter_cogl_name,
description: 'An object oriented GL/GLES Abstraction/Utility Layer in mutter', description: 'An object oriented GL/GLES Abstraction/Utility Layer in mutter',
libraries: [m_dep], libraries: [m_dep],
subdirs: join_paths(pkgname, 'cogl'), subdirs: pkgname / 'cogl',
requires: [cogl_pkg_deps], requires: [cogl_pkg_deps],
version: meson.project_version(), version: meson.project_version(),
variables: [ variables: [

View file

@ -1,5 +1,5 @@
cogl_includesubdir = join_paths(pkgname, 'cogl') cogl_includesubdir = pkgname / 'cogl'
cogl_includedir = join_paths(includedir, cogl_includesubdir) cogl_includedir = includedir / cogl_includesubdir
cogl_srcdir = meson.current_source_dir() cogl_srcdir = meson.current_source_dir()
cogl_includepath = include_directories('.', 'cogl') cogl_includepath = include_directories('.', 'cogl')

View file

@ -1,7 +1,7 @@
msgfmt = find_program('msgfmt') msgfmt = find_program('msgfmt')
# Unconditionally use this dir to avoid a circular dep with gnomecc # Unconditionally use this dir to avoid a circular dep with gnomecc
gnome_keybindings_keysdir = join_paths(datadir, 'gnome-control-center/keybindings') gnome_keybindings_keysdir = datadir / 'gnome-control-center/keybindings'
keybinding_xml_files = [ keybinding_xml_files = [
'50-mutter-navigation.xml', '50-mutter-navigation.xml',
@ -26,7 +26,7 @@ gschema_config.set('GETTEXT_DOMAIN', meson.project_name())
gschema_config.set('XWAYLAND_GRAB_DEFAULT_ACCESS_RULES', gschema_config.set('XWAYLAND_GRAB_DEFAULT_ACCESS_RULES',
xwayland_grab_default_access_rules) xwayland_grab_default_access_rules)
schemadir = join_paths(datadir, 'glib-2.0', 'schemas') schemadir = datadir / 'glib-2.0' / 'schemas'
configure_file( configure_file(
input: 'org.gnome.mutter.gschema.xml.in', input: 'org.gnome.mutter.gschema.xml.in',
output: 'org.gnome.mutter.gschema.xml', output: 'org.gnome.mutter.gschema.xml',
@ -42,12 +42,12 @@ configure_file(
) )
install_data(['mutter-schemas.convert'], install_data(['mutter-schemas.convert'],
install_dir: join_paths(datadir, 'GConf/gsettings'), install_dir: datadir / 'GConf/gsettings',
) )
if have_libgudev if have_libgudev
install_data(['61-mutter.rules'], install_data(['61-mutter.rules'],
install_dir: join_paths(udev_dir, 'rules.d'), install_dir: udev_dir / 'rules.d',
) )
endif endif

View file

@ -80,30 +80,28 @@ add_project_link_arguments(
prefix = get_option('prefix') prefix = get_option('prefix')
bindir = join_paths(prefix, get_option('bindir')) bindir = prefix / get_option('bindir')
datadir = join_paths(prefix, get_option('datadir')) datadir = prefix / get_option('datadir')
libdir = join_paths(prefix, get_option('libdir')) libdir = prefix / get_option('libdir')
libexecdir = join_paths(prefix, get_option('libexecdir')) libexecdir = prefix / get_option('libexecdir')
includedir = join_paths(prefix, get_option('includedir')) includedir = prefix / get_option('includedir')
sysconfdir = get_option('sysconfdir') sysconfdir = get_option('sysconfdir')
pkgname = '@0@-@1@'.format(meson.project_name(), libmutter_api_version) pkgname = '@0@-@1@'.format(meson.project_name(), libmutter_api_version)
pkgdatadir = join_paths(datadir, pkgname) pkgdatadir = datadir / pkgname
pkglibdir = join_paths(libdir, pkgname) pkglibdir = libdir / pkgname
pkgincludedir = join_paths(includedir, pkgname) pkgincludedir = includedir / pkgname
pcdir = join_paths(libdir, 'pkgconfig') pcdir = libdir / 'pkgconfig'
gettext_package = meson.project_name() gettext_package = meson.project_name()
localedir = join_paths(datadir, 'locale') localedir = datadir / 'locale'
libmutter_name = 'mutter-' + libmutter_api_version libmutter_name = 'mutter-' + libmutter_api_version
mutter_installed_tests_datadir = join_paths( mutter_installed_tests_datadir = datadir / 'installed-tests' / libmutter_name
datadir, 'installed-tests', libmutter_name) mutter_installed_tests_libexecdir = libexecdir / 'installed-tests' / libmutter_name
mutter_installed_tests_libexecdir = join_paths(
libexecdir, 'installed-tests', libmutter_name)
m_dep = cc.find_library('m', required: true) m_dep = cc.find_library('m', required: true)
graphene_dep = dependency('graphene-gobject-1.0', version: graphene_req) graphene_dep = dependency('graphene-gobject-1.0', version: graphene_req)
@ -433,9 +431,9 @@ if have_profiler
if libsysprof_capture_dep.type_name() == 'pkgconfig' if libsysprof_capture_dep.type_name() == 'pkgconfig'
sysprof_dep = dependency('sysprof-4') sysprof_dep = dependency('sysprof-4')
sysprof_dbus_interfaces_dir = join_paths(sysprof_dep.get_variable('datadir'), 'dbus-1', 'interfaces') sysprof_dbus_interfaces_dir = sysprof_dep.get_variable('datadir') / 'dbus-1' / 'interfaces'
else else
sysprof_dbus_interfaces_dir = join_paths(mutter_srcdir, 'subprojects', 'sysprof', 'src') sysprof_dbus_interfaces_dir = mutter_srcdir / 'subprojects' / 'sysprof' / 'src'
endif endif
endif endif
@ -642,7 +640,7 @@ xwayland_grab_default_access_rules = get_option('xwayland_grab_default_access_ru
cdata.set_quoted('XWAYLAND_GRAB_DEFAULT_ACCESS_RULES', cdata.set_quoted('XWAYLAND_GRAB_DEFAULT_ACCESS_RULES',
xwayland_grab_default_access_rules) xwayland_grab_default_access_rules)
cdata.set_quoted('MUTTER_PLUGIN_DIR', join_paths(pkglibdir, 'plugins')) cdata.set_quoted('MUTTER_PLUGIN_DIR', pkglibdir / 'plugins')
cdata.set_quoted('MUTTER_LOCALEDIR', localedir) cdata.set_quoted('MUTTER_LOCALEDIR', localedir)
cdata.set_quoted('MUTTER_LIBEXECDIR', libexecdir) cdata.set_quoted('MUTTER_LIBEXECDIR', libexecdir)
cdata.set_quoted('MUTTER_PKGDATADIR', pkgdatadir) cdata.set_quoted('MUTTER_PKGDATADIR', pkgdatadir)

View file

@ -14,6 +14,6 @@ default_plugin = shared_module('default',
gsettings_desktop_schemas_dep, gsettings_desktop_schemas_dep,
libmutter_clutter_dep, libmutter_clutter_dep,
], ],
install_dir: join_paths(pkglibdir, 'plugins'), install_dir: pkglibdir / 'plugins',
install: true, install: true,
) )

View file

@ -1,5 +1,5 @@
mutter_includesubdir = join_paths(pkgname, 'meta') mutter_includesubdir = pkgname / 'meta'
mutter_includedir = join_paths(includedir, mutter_includesubdir) mutter_includedir = includedir / mutter_includesubdir
mutter_includes = [ mutter_includes = [
include_directories('.'), include_directories('.'),
@ -980,7 +980,7 @@ foreach dbus_interface: dbus_interfaces
else else
directory = dbus_interfaces_dir directory = dbus_interfaces_dir
endif endif
interface_file = join_paths(directory, interface) interface_file = directory / interface
prefix = dbus_interface['prefix'] prefix = dbus_interface['prefix']
@ -1055,33 +1055,30 @@ if have_wayland
if protocol_type == 'stable' if protocol_type == 'stable'
output_base = protocol_name output_base = protocol_name
input = join_paths(protocols_dir, input = protocols_dir / '@0@/@1@/@2@.xml'.format(protocol_type,
'@0@/@1@/@2@.xml'.format(protocol_type, protocol_name,
protocol_name, output_base)
output_base))
elif protocol_type == 'staging' elif protocol_type == 'staging'
protocol_version = p.get(2) protocol_version = p.get(2)
output_base = '@0@-@1@'.format(protocol_name, protocol_version) output_base = '@0@-@1@'.format(protocol_name, protocol_version)
input = join_paths(protocols_dir, input = protocols_dir / '@0@/@1@/@2@.xml'.format(protocol_type,
'@0@/@1@/@2@.xml'.format(protocol_type, protocol_name,
protocol_name, output_base)
output_base))
elif protocol_type == 'private' elif protocol_type == 'private'
output_base = protocol_name output_base = protocol_name
input = 'wayland/protocol/@0@.xml'.format(protocol_name) input = 'wayland/protocol/@0@.xml'.format(protocol_name)
elif protocol_type == 'third-party' elif protocol_type == 'third-party'
output_base = protocol_name output_base = protocol_name
protocol_dir = p.get(2) protocol_dir = p.get(2)
input = join_paths(protocol_dir, '@0@.xml'.format(protocol_name)) input = protocol_dir / '@0@.xml'.format(protocol_name)
else else
protocol_version = p.get(2) protocol_version = p.get(2)
output_base = '@0@-@1@-@2@'.format(protocol_name, output_base = '@0@-@1@-@2@'.format(protocol_name,
protocol_type, protocol_type,
protocol_version) protocol_version)
input = join_paths(protocols_dir, input = protocols_dir / '@0@/@1@/@2@.xml'.format(protocol_type,
'@0@/@1@/@2@.xml'.format(protocol_type, protocol_name,
protocol_name, output_base)
output_base))
endif endif
server_header = custom_target('@0@ server header'.format(output_base), server_header = custom_target('@0@ server header'.format(output_base),

View file

@ -128,16 +128,16 @@ subdir('drm-mock')
subdir('wayland-test-clients') subdir('wayland-test-clients')
if have_installed_tests if have_installed_tests
stacking_files_datadir = join_paths(pkgdatadir, 'tests') stacking_files_datadir = pkgdatadir / 'tests'
install_subdir('stacking', install_dir: stacking_files_datadir) install_subdir('stacking', install_dir: stacking_files_datadir)
endif endif
test_env = environment() test_env = environment()
test_env_variables = { test_env_variables = {
'G_TEST_SRCDIR': join_paths(mutter_srcdir, 'src'), 'G_TEST_SRCDIR': mutter_srcdir / 'src',
'G_TEST_BUILDDIR': mutter_builddir, 'G_TEST_BUILDDIR': mutter_builddir,
'XDG_CONFIG_HOME': join_paths(mutter_builddir, '.config'), 'XDG_CONFIG_HOME': mutter_builddir / '.config',
'MUTTER_TEST_PLUGIN_PATH': '@0@'.format(default_plugin.full_path()), 'MUTTER_TEST_PLUGIN_PATH': '@0@'.format(default_plugin.full_path()),
} }
@ -183,7 +183,7 @@ test_runner = executable('mutter-test-runner',
meta_dbus_runner = find_program('meta-dbus-runner.py') meta_dbus_runner = find_program('meta-dbus-runner.py')
tests_datadir = join_paths(pkgdatadir, 'tests') tests_datadir = pkgdatadir / 'tests'
install_data('mutter_dbusrunner.py', install_data('mutter_dbusrunner.py',
install_dir: tests_datadir, install_dir: tests_datadir,
@ -560,7 +560,7 @@ foreach stacking_test: stacking_tests
suite: ['core', 'mutter/stacking'], suite: ['core', 'mutter/stacking'],
env: test_env, env: test_env,
args: [ args: [
files(join_paths('stacking', stacking_test + '.metatest')), files('stacking' / stacking_test + '.metatest'),
], ],
is_parallel: false, is_parallel: false,
timeout: 60, timeout: 60,

View file

@ -1,4 +1,4 @@
mutter_test_includesubdir = join_paths(pkgname, 'meta-test') mutter_test_includesubdir = pkgname / 'meta-test'
mutter_test_public_headers = files([ mutter_test_public_headers = files([
'meta-context-test.h', 'meta-context-test.h',

View file

@ -1,7 +1,5 @@
wayland_test_client_installed_tests_libexecdir = join_paths( wayland_test_client_installed_tests_libexecdir = \
mutter_installed_tests_libexecdir, mutter_installed_tests_libexecdir / 'wayland-test-clients'
'wayland-test-clients',
)
wayland_test_client_sources = files([ wayland_test_client_sources = files([
'wayland-test-client-utils.c', 'wayland-test-client-utils.c',