Validate both appdata and desktop files
Use same approach as https://gitlab.gnome.org/GNOME/nautilus/blob/master/data/meson.build#L112-138
This commit is contained in:
parent
383557f852
commit
b605ddc409
2 changed files with 43 additions and 7 deletions
|
|
@ -1,5 +1,14 @@
|
|||
foreach desktop_file: [ 'org.gnome.Geary.desktop', 'geary-autostart.desktop' ]
|
||||
i18n.merge_file(
|
||||
#
|
||||
# Desktop files
|
||||
#
|
||||
|
||||
desktop_src = [
|
||||
'org.gnome.Geary.desktop',
|
||||
'geary-autostart.desktop'
|
||||
]
|
||||
|
||||
foreach desktop_file: desktop_src
|
||||
desktop_merged = i18n.merge_file(
|
||||
input: desktop_file + '.in',
|
||||
output: desktop_file,
|
||||
type: 'desktop',
|
||||
|
|
@ -7,19 +16,44 @@ foreach desktop_file: [ 'org.gnome.Geary.desktop', 'geary-autostart.desktop' ]
|
|||
install: true,
|
||||
install_dir: join_paths(datadir, 'applications')
|
||||
)
|
||||
if desktop_file_validate.found()
|
||||
test(
|
||||
desktop_file + '-validate',
|
||||
desktop_file_validate,
|
||||
args: [ desktop_merged.full_path() ]
|
||||
)
|
||||
endif
|
||||
endforeach
|
||||
|
||||
# The appdata file
|
||||
i18n.merge_file(
|
||||
input: 'org.gnome.Geary.appdata.xml.in',
|
||||
output: 'org.gnome.Geary.appdata.xml',
|
||||
#
|
||||
# Appdata file
|
||||
#
|
||||
|
||||
appdata_file = 'org.gnome.Geary.appdata.xml'
|
||||
|
||||
appdata_merged = i18n.merge_file(
|
||||
input: appdata_file + '.in',
|
||||
output: appdata_file,
|
||||
type: 'xml',
|
||||
po_dir: po_dir,
|
||||
install: true,
|
||||
install_dir: join_paths(datadir, 'metainfo')
|
||||
)
|
||||
|
||||
if appstream_util.found()
|
||||
test(
|
||||
appdata_file + '-validate',
|
||||
appstream_util,
|
||||
args: [
|
||||
'validate-relax', '--nonet', appdata_merged.full_path()
|
||||
]
|
||||
)
|
||||
endif
|
||||
|
||||
#
|
||||
# Contractor file (Elementary OS)
|
||||
#
|
||||
|
||||
if install_contractor_file
|
||||
# Call msgfmt manually since gettext won't otherwise translate the
|
||||
# Description field. See merge req !50.
|
||||
|
|
|
|||
|
|
@ -99,7 +99,9 @@ if libunwind_dep.found()
|
|||
)
|
||||
endif
|
||||
|
||||
# Optional libraries
|
||||
# Optional dependencies
|
||||
appstream_util = find_program('appstream-util', required: false)
|
||||
desktop_file_validate = find_program('desktop-file-validate', required: false)
|
||||
libunity = dependency('unity', version: '>= 5.12.0', required: false)
|
||||
libmessagingmenu = meson.get_compiler('c').find_library('libmessaging-menu', required: false)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue