[meld: 7/10] build: Use dictionaries in configuration_data objects




commit ee2790b513849e12d5ecf68ddfefe85e8f0fe66e
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Mon Feb 15 10:07:03 2021 +0100

    build: Use dictionaries in configuration_data objects
    
    Since 0.49.0[0], a dictionary could be used as a replacement for
    each key/value pair as if `set` method was called for each of them.
    
    All of the `configuration_data` objects have been changed to use a
    dictionary, and those that with only one key, value pair have been
    used directly.
    
    [0] http://mesonbuild.com/Reference-manual.html#configuration_data

 data/meson.build | 10 ++--------
 meld/meson.build | 15 ++++++++-------
 2 files changed, 10 insertions(+), 15 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index 2d8fbb99..c18d03e1 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -12,14 +12,11 @@ install_data(
 )
 
 # Install desktop file
-desktop_conf = configuration_data()
-desktop_conf.set('icon', application_id)
-
 desktop_file = i18n.merge_file(
   input: configure_file(
     input: '@0  desktop in in'.format(resource_base_id),
     output: '@0  desktop in'.format(application_id),
-    configuration: desktop_conf
+    configuration: {'icon': application_id},
   ),
   output: '@0@.desktop'.format(application_id),
   po_dir: podir,
@@ -38,15 +35,12 @@ if desktop_file_validate.found()
   )
 endif
 
-appdata_conf = configuration_data()
-appdata_conf.set('appid', application_id)
-
 appdata_file = i18n.merge_file(
   'appdata',
   input: configure_file(
     input: files('org.gnome.meld.appdata.xml.in.in'),
     output: 'org.gnome.meld.appdata.xml.in',
-    configuration: appdata_conf
+    configuration: {'appid': application_id},
   ),
   output: '@0  appdata xml'.format(application_id),
   po_dir: podir,
diff --git a/meld/meson.build b/meld/meson.build
index 1843945d..46f16cfb 100644
--- a/meld/meson.build
+++ b/meld/meson.build
@@ -83,13 +83,14 @@ foreach folder_name, sources : folders
 endforeach
 
 # Install the executable file
-app_config = configuration_data()
-app_config.set('profile', profile)
-app_config.set('application_id', application_id)
-app_config.set('resource_base_id', resource_base_id)
-app_config.set('localedir', prefix / localedir)
-app_config.set('pkgdatadir', prefix / pkgdatadir)
-app_config.set('configured', 'True')
+app_config = {
+  'profile': profile,
+  'application_id': application_id,
+  'resource_base_id': resource_base_id,
+  'localedir': prefix / localedir,
+  'pkgdatadir': prefix / pkgdatadir,
+  'configured': 'True',
+}
 
 configure_file(
     input: 'conf.py.in',


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