From 456f5427dbe1e8c2bfe6b68b4ce43f652bc7e73e Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Sat, 27 Oct 2018 09:01:53 -0400 Subject: [PATCH] meson: add option to disable translation https://bugzilla.gnome.org/show_bug.cgi?id=797342 --- debug-viewer/meson.build | 45 +++++++++++++++++++++++++++------------------ meson_options.txt | 2 ++ 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/debug-viewer/meson.build b/debug-viewer/meson.build index 1b9d2c5..a077bb9 100644 --- a/debug-viewer/meson.build +++ b/debug-viewer/meson.build @@ -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'), -) - -# 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'), -) +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'), + ) +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'))) diff --git a/meson_options.txt b/meson_options.txt index 10718b5..6de411c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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)') -- 2.7.4