aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-08-12 14:22:30 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-08-12 15:49:57 +0200
commitdcbc8a90b4caee1f57d185ef47d44818e67711f5 (patch)
treeb6ffa5cf2583fcefd452b8d437c16144dd1657d6
parent7cbd24dd2f99c160b0e4c9765783b2294caca6dc (diff)
downloadfiv-dcbc8a90b4caee1f57d185ef47d44818e67711f5.tar.gz
fiv-dcbc8a90b4caee1f57d185ef47d44818e67711f5.tar.xz
fiv-dcbc8a90b4caee1f57d185ef47d44818e67711f5.zip
meson.build: add a bunch of validating tests
-rw-r--r--meson.build41
1 files changed, 34 insertions, 7 deletions
diff --git a/meson.build b/meson.build
index 93c982c..1e211a4 100644
--- a/meson.build
+++ b/meson.build
@@ -172,13 +172,44 @@ if get_option('tools').enabled()
endif
gsettings_schemas = ['fiv.gschema.xml']
-install_data(gsettings_schemas,
- rename : [application_ns + gsettings_schemas[0]],
- install_dir : get_option('datadir') / 'glib-2.0' / 'schemas')
+foreach schema : gsettings_schemas
+ install_data(schema,
+ rename : [application_ns + schema],
+ install_dir : get_option('datadir') / 'glib-2.0' / 'schemas')
+endforeach
# For the purposes of development: make the program find its GSettings schemas.
gnome.compile_schemas(depend_files : files(gsettings_schemas))
+# Validate various files, if there are tools around to do it.
+xmls = ['fiv.svg', 'fiv.manifest', 'resources/resources.gresource.xml'] + \
+ gsettings_schemas
+xmls += run_command(find_program('sed', required : false, disabler : true),
+ '-n', 's@.*>\([^<>]*[.]svg\)<.*@resources/\\1@p',
+ configure_file(
+ input : 'resources/resources.gresource.xml',
+ output : 'resources.gresource.xml.stamp',
+ copy : true,
+ ), capture : true, check : true).stdout().strip().split('\n')
+
+xmlwf = find_program('xmlwf', required : false, disabler : true)
+xmllint = find_program('xmllint', required : false, disabler : true)
+foreach xml : xmls
+ test('xmlwf ' + xml, xmlwf, args : files(xml))
+ test('xmllint ' + xml, xmllint, args : ['--noout', files(xml)])
+endforeach
+
+dfv = find_program('desktop-file-validate', required : false, disabler : true)
+foreach desktop : desktops
+ test(desktop, dfv, args : files(desktop))
+endforeach
+
+# Finish the installation.
+install_data('fiv.svg',
+ install_dir : get_option('datadir') / 'icons/hicolor/scalable/apps')
+install_subdir('docs',
+ install_dir : docdir, strip_directory : true)
+
if host_machine.system() != 'windows'
foreach desktop : desktops
install_data(desktop,
@@ -213,7 +244,3 @@ elif meson.is_cross_build()
'XDG_DATA_DIRS' : msys2_root / 'share',
})
endif
-
-install_data('fiv.svg',
- install_dir : get_option('datadir') / 'icons/hicolor/scalable/apps')
-install_subdir('docs', install_dir : docdir, strip_directory : true)