diff options
Diffstat (limited to 'meta/classes/gettext.bbclass')
| -rw-r--r-- | meta/classes/gettext.bbclass | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/meta/classes/gettext.bbclass b/meta/classes/gettext.bbclass index a1e00e72c..95818c677 100644 --- a/meta/classes/gettext.bbclass +++ b/meta/classes/gettext.bbclass @@ -1,16 +1,21 @@ -def gettext_after_parse(d): - import bb +def gettext_dependencies(d): + if d.getVar('USE_NLS', True) == 'no' and not oe.utils.inherits(d, 'native', 'nativesdk', 'cross'): + return "" + if d.getVar('INHIBIT_DEFAULT_DEPS', True) and not oe.utils.inherits(d, 'cross-canadian'): + return "" + if oe.utils.inherits(d, 'native', 'cross'): + return "gettext-minimal-native" + return d.getVar('DEPENDS_GETTEXT', False) + +def gettext_oeconf(d): + if oe.utils.inherits(d, 'native', 'cross'): + return '--disable-nls' # Remove the NLS bits if USE_NLS is no. - if bb.data.getVar('USE_NLS', d, 1) == 'no': - cfg = oe_filter_out('^--(dis|en)able-nls$', bb.data.getVar('EXTRA_OECONF', d, 1) or "", d) - cfg += " --disable-nls" - depends = bb.data.getVar('DEPENDS', d, 1) or "" - bb.data.setVar('DEPENDS', oe_filter_out('^(virtual/libiconv|virtual/libintl)$', depends, d), d) - bb.data.setVar('EXTRA_OECONF', cfg, d) + if d.getVar('USE_NLS', True) == 'no' and not oe.utils.inherits(d, 'nativesdk', 'cross-canadian'): + return '--disable-nls' + return "--enable-nls" -python () { - gettext_after_parse(d) -} +DEPENDS_GETTEXT ??= "virtual/gettext gettext-native" -DEPENDS =+ "gettext-native" -EXTRA_OECONF += "--enable-nls" +BASEDEPENDS =+ "${@gettext_dependencies(d)}" +EXTRA_OECONF_append = " ${@gettext_oeconf(d)}" |
