summaryrefslogtreecommitdiff
path: root/data/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'data/meson.build')
-rw-r--r--data/meson.build83
1 files changed, 83 insertions, 0 deletions
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..65ddc4b
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,83 @@
+data_config = configuration_data({
+ 'PROJECT_NAME': project_name,
+ 'APPLICATION_ID': application_id,
+ 'EXEC': application_name,
+ 'APPLICATION_PATH': application_path,
+ 'LICENSE': ', '.join(meson.project_license()),
+ 'PROJECT_INFO': description,
+ 'DESKTOP_NAME': desktop_name,
+})
+
+i18n_data += configure_file(
+ input: '@0@.desktop.in.in'.format(application_id),
+ output: '@BASENAME@',
+ configuration: data_config,
+)
+
+desktop_file = i18n.merge_file(
+ input: i18n_data[-1],
+ output: '@BASENAME@',
+ type: 'desktop',
+ po_dir: '../po',
+ install: true,
+ install_dir: join_paths(get_option('datadir'), 'applications')
+)
+
+desktop_utils = find_program('desktop-file-validate', required: false)
+if desktop_utils.found()
+ test('Validate desktop file', desktop_utils,
+ args: [desktop_file]
+ )
+endif
+
+i18n_data += configure_file(
+ input: '@0@.appdata.xml.in.in'.format(application_id),
+ output: '@BASENAME@',
+ configuration: data_config,
+)
+
+appstream_file = i18n.merge_file(
+ input: i18n_data[-1],
+ output: '@BASENAME@',
+ po_dir: '../po',
+ install: true,
+ install_dir: join_paths(get_option('datadir'), 'appdata')
+)
+
+appstream_util = find_program('appstream-util', required: false)
+if appstream_util.found()
+ test('Validate appstream file', appstream_util,
+ args: ['validate', appstream_file]
+ )
+endif
+
+i18n_data += configure_file(
+ input: '@0@.gschema.xml.in.in'.format(application_id),
+ output: '@BASENAME@',
+ configuration: data_config,
+)
+
+gscheme_file = i18n.merge_file(
+ input: i18n_data[-1],
+ output: '@BASENAME@',
+ po_dir: '../po',
+ install: true,
+ install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas')
+)
+
+compile_schemas = find_program('glib-compile-schemas', required: false)
+if compile_schemas.found()
+ test('Validate schema file', compile_schemas,
+ args: ['--strict', '--dry-run', meson.current_source_dir()]
+ )
+endif
+
+subdir('icons')
+subdir('ui')
+
+resources = gnome.compile_resources('@0@-resources'.format(project_name),
+ '@0@.gresource.xml'.format(project_name),
+ source_dir: meson.current_source_dir(),
+ c_name: project_name,
+ dependencies: ui_defs
+)