meson: add option to disable translation

https://bugzilla.gnome.org/show_bug.cgi?id=797342
This commit is contained in:
Xavier Claessens 2018-10-27 09:01:53 -04:00 committed by Tim-Philipp Müller
parent 955fc5fcce
commit 456f5427db
2 changed files with 28 additions and 17 deletions

View file

@ -2,24 +2,33 @@ install_subdir('GstDebugViewer', install_dir: python3.sysconfig_path('purelib'),
exclude_files: ['__init__.py'])
message('Installing in ' + python3.sysconfig_path('purelib'))
# Desktop launcher and description file.
desktop_file = i18n.merge_file(
input: 'org.freedesktop.GstDebugViewer.desktop.in',
output: 'org.freedesktop.GstDebugViewer.desktop',
type: 'desktop',
po_dir: 'po',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications'),
)
if find_program('msgfmt', required : get_option('nls')).found()
# Desktop launcher and description file.
desktop_file = i18n.merge_file(
input: 'org.freedesktop.GstDebugViewer.desktop.in',
output: 'org.freedesktop.GstDebugViewer.desktop',
type: 'desktop',
po_dir: 'po',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications'),
)
# Appdata file.
appdata_file = i18n.merge_file(
input: 'org.freedesktop.GstDebugViewer.appdata.xml.in',
output: 'org.freedesktop.GstDebugViewer.appdata.xml',
po_dir: 'po',
install: true,
install_dir: join_paths(get_option('datadir'), 'metainfo'),
)
# Appdata file.
appdata_file = i18n.merge_file(
input: 'org.freedesktop.GstDebugViewer.appdata.xml.in',
output: 'org.freedesktop.GstDebugViewer.appdata.xml',
po_dir: 'po',
install: true,
install_dir: join_paths(get_option('datadir'), 'metainfo'),
)
else
install_data('org.freedesktop.GstDebugViewer.desktop.in',
rename: 'org.freedesktop.GstDebugViewer.desktop',
install_dir: join_paths(get_option('datadir'), 'applications'))
install_data('org.freedesktop.GstDebugViewer.appdata.xml.in',
rename: 'org.freedesktop.GstDebugViewer.appdata.xml',
install_dir: join_paths(get_option('datadir'), 'metainfo'))
endif
cdata = configuration_data()
cdata.set('LIBDIR', join_paths(get_option('prefix'), get_option('libdir')))

View file

@ -8,3 +8,5 @@ option('introspection', type : 'feature', value : 'auto', yield : true,
description : 'Generate gobject-introspection bindings')
option('tests', type : 'feature', value : 'auto', yield : true,
description : 'Build and enable unit tests')
option('nls', type : 'feature', value : 'auto', yield: true,
description : 'Enable native language support (translations)')