From fbd6beea2c514f9b8f49aec95bcd9e0c8f0cd9fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 1 Apr 2020 06:18:05 +0200 Subject: [PATCH] extensions-app: Validate .desktop file during meson test ... if desktop-file-validate is available. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1160 --- subprojects/extensions-app/data/meson.build | 15 ++++++++++++--- subprojects/extensions-app/meson.build | 1 + 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/subprojects/extensions-app/data/meson.build b/subprojects/extensions-app/data/meson.build index 0568fafc8..e7bfa9965 100644 --- a/subprojects/extensions-app/data/meson.build +++ b/subprojects/extensions-app/data/meson.build @@ -6,6 +6,7 @@ gnome.compile_resources( install_dir: pkgdatadir ) +desktop_file = app_id + '.desktop' desktopconf = configuration_data() # We substitute in bindir so it works as an autostart # file when built in a non-system prefix @@ -15,17 +16,25 @@ desktopconf.set('prgname', prgname) i18n.merge_file('desktop', input: configure_file( - input: app_id + '.desktop.in.in', - output: app_id + '.desktop.in', + input: desktop_file + '.in.in', + output: desktop_file + '.in', configuration: desktopconf ), - output: app_id + '.desktop', + output: desktop_file, po_dir: po_dir, install: true, install_dir: desktopdir, type: 'desktop' ) +if (desktop_file_validate.found()) + test('Validating ' + desktop_file, + desktop_file_validate, + args: [desktop_file], + workdir: meson.current_build_dir() + ) +endif + configure_file( input: app_id + '.service.in', output: app_id + '.service', diff --git a/subprojects/extensions-app/meson.build b/subprojects/extensions-app/meson.build index e26b5b20d..2c1c5de6e 100644 --- a/subprojects/extensions-app/meson.build +++ b/subprojects/extensions-app/meson.build @@ -37,6 +37,7 @@ servicedir = join_paths(datadir, 'dbus-1', 'services') gjs = find_program('gjs') appstream_util = find_program('appstream-util', required: false) +desktop_file_validate = find_program('desktop-file-validate', required: false) subdir('data') subdir('js')