[eog: 5/11] build: Use format strings




commit 495627a0190f3f5ad2c28e730031e401f4f207b5
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Wed Oct 27 10:56:25 2021 +0200

    build: Use format strings
    
    Since meson 0.58, format strings are allowed in addition to the
    conventional method for formatting strings[0].
    
    Some strings have been changed to use this method as a
    non-positional clearer alternative.
    
    Required meson version has also been bumped to 0.58.
    
    [0] https://mesonbuild.com/Release-notes-for-0-58-0.html#introducing-format-strings-to-the-meson-language

 doc/reference/meson.build |  2 +-
 meson.build               |  6 +++---
 plugins/meson.build       |  6 +++---
 src/meson.build           | 12 ++++++------
 tests/meson.build         |  2 +-
 5 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/doc/reference/meson.build b/doc/reference/meson.build
index 8bbef69d..6b3b1dca 100644
--- a/doc/reference/meson.build
+++ b/doc/reference/meson.build
@@ -29,7 +29,7 @@ version_xml = configure_file(
 
 gnome.gtkdoc(
   eog_name,
-  main_xml: eog_name + '-docs.xml',
+  main_xml: f'@eog_name -docs xml',
   src_dir: src_inc,
   ignore_headers: private_headers,
   dependencies: libeog_dep,
diff --git a/meson.build b/meson.build
index 720d8635..9c41090a 100644
--- a/meson.build
+++ b/meson.build
@@ -3,7 +3,7 @@ project(
   version: '42.alpha',
   license: 'GPL2+',
   default_options: 'buildtype=debugoptimized',
-  meson_version: '>= 0.53.0',
+  meson_version: '>= 0.58.0',
 )
 
 eog_name = meson.project_name()
@@ -12,7 +12,7 @@ version_array = eog_version.split('.')
 eog_major_version = version_array[0].to_int()
 
 eog_api_version = '3.0'
-eog_api_name = '@0@-@1@'.format(eog_name, eog_api_version)
+eog_api_name = f'@eog_name@-@eog_api_version@'
 
 eog_gir_ns = 'Eog'
 eog_gir_version = '1.0'
@@ -46,7 +46,7 @@ config_h = configuration_data()
 if get_option('profile') != 'default'
   profile = 'Devel'
   name_suffix = ' (Nightly)'
-  application_id = 'org.gnome.eog.' + profile
+  application_id = f'org.gnome.eog.@profile@'
 else
   profile = ''
   name_suffix = ''
diff --git a/plugins/meson.build b/plugins/meson.build
index a4d6912d..18a25a56 100644
--- a/plugins/meson.build
+++ b/plugins/meson.build
@@ -20,20 +20,20 @@ endif
 foreach plugin: plugins
   shared_module(
     plugin,
-    sources: '@0@/eog-@0@-plugin.c'.format(plugin),
+    sources: f'@plugin@/eog-@plugin@-plugin.c',
     include_directories: top_inc,
     dependencies: libeog_dep,
     install: true,
     install_dir: eog_pluginsdir,
   )
 
-  plugin_data = plugin + '.plugin'
+  plugin_data = f'@plugin@.plugin'
 
   # FIXME: Move custom_target to i18n.merge_file when gettext acquires plugin support.
   #        http://lists.gnu.org/archive/html/bug-gettext/2017-06/msg00001.html
   custom_target(
     plugin_data,
-    input: '@0@/@1  desktop in'.format(plugin, plugin_data),
+    input: f'@plugin@/@plugin_data  desktop in',
     output: plugin_data,
     command: msgfmt_plugin_cmd,
     install: true,
diff --git a/src/meson.build b/src/meson.build
index ef398d22..8afe93b2 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -111,15 +111,15 @@ enum = 'eog-enum-types'
 sources += gnome.mkenums(
   enum,
   sources: headers,
-  c_template: enum + '.c.template',
-  h_template: enum + '.h.template',
+  c_template: f'@enum@.c.template',
+  h_template: f'@enum@.h.template',
 )
 
 marshal = 'eog-marshal'
 
 sources += gnome.genmarshal(
   marshal,
-  sources: marshal + '.list',
+  sources: f'@marshal@.list',
   prefix: 'eog_marshal',
   internal: true,
 )
@@ -140,7 +140,7 @@ cflags = [
 ]
 
 symbol_map = meson.current_source_dir() / 'symbol.map'
-ldflags = cc.get_supported_link_arguments('-Wl,--version-script,' + symbol_map)
+ldflags = cc.get_supported_link_arguments(f'-Wl,--version-script,@symbol_map@')
 
 if enable_introspection
   deps += gir_dep
@@ -216,7 +216,7 @@ if enable_introspection
     namespace: eog_gir_ns,
     includes: 'Gtk-3.0',
     install: true,
-    install_dir_gir: eog_pkgdatadir / 'gir-' + eog_gir_version,
-    install_dir_typelib: eog_pkglibdir / 'girepository-' + eog_gir_version,
+    install_dir_gir: eog_pkgdatadir / f'gir-@eog_gir_version@',
+    install_dir_typelib: eog_pkglibdir / f'girepository-@eog_gir_version@',
   )
 endif
diff --git a/tests/meson.build b/tests/meson.build
index 7caf2579..606085b0 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -37,7 +37,7 @@ foreach test_name: test_names
 
   configure_file(
     input: 'template.test.in',
-    output: test_name + '.test',
+    output: f'@test_name@.test',
     configuration: tests_conf,
     install: true,
     install_dir: tests_metadir,


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