[gnome-builder] build: modernize various meson deprecations



commit c1b94f1ed660a2aa1dd4356c6ffed2d32456c6d1
Author: Christian Hergert <chergert redhat com>
Date:   Thu Jan 27 12:57:34 2022 -0800

    build: modernize various meson deprecations

 data/gsettings/meson.build                                    |  2 +-
 meson.build                                                   |  8 ++++----
 po/meson.build                                                |  4 ++--
 src/plugins/meson-templates/resources/src/meson-cli.build     |  6 +++---
 src/plugins/meson-templates/resources/src/meson-rs-gtk4.build | 10 +++++-----
 src/plugins/meson-templates/resources/src/meson-rs.build      | 10 +++++-----
 src/tests/meson.build                                         |  8 ++++----
 7 files changed, 24 insertions(+), 24 deletions(-)
---
diff --git a/data/gsettings/meson.build b/data/gsettings/meson.build
index 49de09221..25c62eada 100644
--- a/data/gsettings/meson.build
+++ b/data/gsettings/meson.build
@@ -11,7 +11,7 @@ if ctags_path == ''
                        'ctags',
                        required: false)
   if ctags.found()
-    ctags_path = ctags.path()
+    ctags_path = ctags.full_path()
   endif
 endif
 
diff --git a/meson.build b/meson.build
index e07da93a3..bf77d0435 100644
--- a/meson.build
+++ b/meson.build
@@ -114,12 +114,12 @@ config_h.set('LOCALEDIR', 'PACKAGE_LOCALE_DIR')
 config_h.set10('ENABLE_NLS', true) # Always enabled
 
 # We should probably avoid using these
-config_h.set_quoted('SRCDIR', meson.source_root())
-config_h.set_quoted('BUILDDIR', meson.build_root())
+config_h.set_quoted('SRCDIR', meson.project_source_root())
+config_h.set_quoted('BUILDDIR', meson.project_build_root())
 
 add_global_arguments([
   '-DHAVE_CONFIG_H',
-  '-I' + meson.build_root(), # config.h
+  '-I' + meson.project_build_root(), # config.h
   '-D_GNU_SOURCE',
   '-DIDE_COMPILATION',
 ], language: 'c')
@@ -269,7 +269,7 @@ endif
 # Check if we can use version scripts for ABI exports
 ld_supports_version_script = cc.links('''
   int main (void) { return 0; }
-''', args: '-Wl,--version-script,' + join_paths(meson.source_root(), 'libide/ide.map'))
+''', args: '-Wl,--version-script,' + join_paths(meson.project_source_root(), 'libide/ide.map'))
 message('Linker supports --version-script: @0@'.format(ld_supports_version_script))
 
 # Commonly used deps
diff --git a/po/meson.build b/po/meson.build
index cfac44297..9ae292d35 100644
--- a/po/meson.build
+++ b/po/meson.build
@@ -4,7 +4,7 @@ i18n.gettext('gnome-builder',
     '--msgid-bugs-address=https://gitlab.gnome.org/GNOME/gnome-builder/issues',
   ],
   data_dirs: [
-    join_paths(meson.source_root(), 'src/gstyle/data'),
-    join_paths(meson.source_root(), 'data/style-schemes')
+    join_paths(meson.project_source_root(), 'src/gstyle/data'),
+    join_paths(meson.project_source_root(), 'data/style-schemes')
   ],
 )
diff --git a/src/plugins/meson-templates/resources/src/meson-cli.build 
b/src/plugins/meson-templates/resources/src/meson-cli.build
index b0afe09ba..6e4983397 100644
--- a/src/plugins/meson-templates/resources/src/meson-cli.build
+++ b/src/plugins/meson-templates/resources/src/meson-cli.build
@@ -27,7 +27,7 @@ executable('{{name}}', {{name_}}_sources,
   install: true,
 )
 {{else}}
-cargo_script = find_program(join_paths(meson.source_root(), 'build-aux/cargo.sh'))
+cargo_script = find_program(join_paths(meson.project_source_root(), 'build-aux/cargo.sh'))
 cargo_release = custom_target(
   'cargo-build',
   build_by_default: true,
@@ -38,8 +38,8 @@ cargo_release = custom_target(
   install_dir: get_option('bindir'),
   command: [
     cargo_script,
-    meson.build_root(),
-    meson.source_root(),
+    meson.project_build_root(),
+    meson.project_source_root(),
     '@OUTPUT@',
     get_option('buildtype'),
     meson.project_name(),
diff --git a/src/plugins/meson-templates/resources/src/meson-rs-gtk4.build 
b/src/plugins/meson-templates/resources/src/meson-rs-gtk4.build
index c3e937bb0..d47d2bd22 100644
--- a/src/plugins/meson-templates/resources/src/meson-rs-gtk4.build
+++ b/src/plugins/meson-templates/resources/src/meson-rs-gtk4.build
@@ -23,8 +23,8 @@ configure_file(
 # Copy the config.rs output to the source directory.
 run_command(
   'cp',
-  join_paths(meson.build_root(), 'src', 'config.rs'),
-  join_paths(meson.source_root(), 'src', 'config.rs'),
+  join_paths(meson.project_build_root(), 'src', 'config.rs'),
+  join_paths(meson.project_source_root(), 'src', 'config.rs'),
   check: true
 )
 
@@ -37,7 +37,7 @@ rust_sources = files(
 
 sources = [cargo_sources, rust_sources]
 
-cargo_script = find_program(join_paths(meson.source_root(), 'build-aux/cargo.sh'))
+cargo_script = find_program(join_paths(meson.project_source_root(), 'build-aux/cargo.sh'))
 cargo_release = custom_target(
   'cargo-build',
   build_by_default: true,
@@ -48,8 +48,8 @@ cargo_release = custom_target(
   install_dir: get_option('bindir'),
   command: [
     cargo_script,
-    meson.build_root(),
-    meson.source_root(),
+    meson.project_build_root(),
+    meson.project_source_root(),
     '@OUTPUT@',
     get_option('buildtype'),
     meson.project_name(),
diff --git a/src/plugins/meson-templates/resources/src/meson-rs.build 
b/src/plugins/meson-templates/resources/src/meson-rs.build
index a29405ba4..1877af471 100644
--- a/src/plugins/meson-templates/resources/src/meson-rs.build
+++ b/src/plugins/meson-templates/resources/src/meson-rs.build
@@ -22,8 +22,8 @@ configure_file(
 # Copy the config.rs output to the source directory.
 run_command(
   'cp',
-  join_paths(meson.build_root(), 'src', 'config.rs'),
-  join_paths(meson.source_root(), 'src', 'config.rs'),
+  join_paths(meson.project_build_root(), 'src', 'config.rs'),
+  join_paths(meson.project_source_root(), 'src', 'config.rs'),
   check: true
 )
 
@@ -35,7 +35,7 @@ rust_sources = files(
 
 sources = [cargo_sources, rust_sources]
 
-cargo_script = find_program(join_paths(meson.source_root(), 'build-aux/cargo.sh'))
+cargo_script = find_program(join_paths(meson.project_source_root(), 'build-aux/cargo.sh'))
 cargo_release = custom_target(
   'cargo-build',
   build_by_default: true,
@@ -46,8 +46,8 @@ cargo_release = custom_target(
   install_dir: get_option('bindir'),
   command: [
     cargo_script,
-    meson.build_root(),
-    meson.source_root(),
+    meson.project_build_root(),
+    meson.project_source_root(),
     '@OUTPUT@',
     get_option('buildtype'),
     meson.project_name(),
diff --git a/src/tests/meson.build b/src/tests/meson.build
index 89006c84f..8cef03345 100644
--- a/src/tests/meson.build
+++ b/src/tests/meson.build
@@ -3,8 +3,8 @@ dazzle_libdir = dependency('libdazzle-1.0').get_pkgconfig_variable('libdir')
 gsv_libdir = dependency('gtksourceview-4').get_pkgconfig_variable('libdir')
 
 typelib_dirs = [
-  '@0@/src/libide'.format(meson.build_root()),
-  '@0@/src/gstyle'.format(meson.build_root()),
+  '@0@/src/libide'.format(meson.project_build_root()),
+  '@0@/src/gstyle'.format(meson.project_build_root()),
   join_paths(template_libdir, 'girepository-1.0'),
   join_paths(dazzle_libdir, 'girepository-1.0'),
   join_paths(gsv_libdir, 'girepository-1.0'),
@@ -16,7 +16,7 @@ test_env = [
   'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
   'G_DEBUG=gc-friendly',
   'GSETTINGS_BACKEND=memory',
-  'GSETTINGS_SCHEMA_DIR=@0@/data/gsettings'.format(meson.build_root()),
+  'GSETTINGS_SCHEMA_DIR=@0@/data/gsettings'.format(meson.project_build_root()),
   'PYTHONDONTWRITEBYTECODE=yes',
   'MALLOC_CHECK_=2',
   'NO_AT_BRIDGE=1',
@@ -24,7 +24,7 @@ test_env = [
 
 test_cflags = [
   '-DTEST_DATA_DIR="@0@/data/"'.format(meson.current_source_dir()),
-  '-I' + join_paths(meson.source_root(), 'src'),
+  '-I' + join_paths(meson.project_source_root(), 'src'),
 ]
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]