From 027af6b064381a1a48f7fe76d3b54162e5d095e7 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Tue, 3 Jan 2017 21:18:51 +0200 Subject: [PATCH] Error out if trying to do gettext without appropriate tools. --- mesonbuild/modules/i18n.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mesonbuild/modules/i18n.py b/mesonbuild/modules/i18n.py index c4e4814e6..097eedd92 100644 --- a/mesonbuild/modules/i18n.py +++ b/mesonbuild/modules/i18n.py @@ -16,6 +16,7 @@ from os import path from .. import coredata, mesonlib, build from ..mesonlib import MesonException import sys +import shutil PRESET_ARGS = { 'glib': [ @@ -63,6 +64,8 @@ class I18nModule: def gettext(self, state, args, kwargs): if len(args) != 1: raise coredata.MesonException('Gettext requires one positional argument (package name).') + if not shutil.which('xgettext'): + raise coredata.MesonException('Can not do gettext because xgettext is not installed.') packagename = args[0] languages = mesonlib.stringlistify(kwargs.get('languages', [])) datadirs = mesonlib.stringlistify(kwargs.get('data_dirs', []))