blob: da68e63242464b05498d2fb65197c48d4960a256 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001def gettext_dependencies(d):
Brad Bishop6e60e8b2018-02-01 10:27:11 -05002 if d.getVar('INHIBIT_DEFAULT_DEPS') and not oe.utils.inherits(d, 'cross-canadian'):
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003 return ""
Brad Bishop6e60e8b2018-02-01 10:27:11 -05004 if d.getVar('USE_NLS') == 'no':
Patrick Williamsc124f4f2015-09-15 14:41:29 -05005 return "gettext-minimal-native"
6 return d.getVar('DEPENDS_GETTEXT', False)
7
8def gettext_oeconf(d):
Brad Bishop6e60e8b2018-02-01 10:27:11 -05009 if d.getVar('USE_NLS') == 'no':
Patrick Williamsc124f4f2015-09-15 14:41:29 -050010 return '--disable-nls'
11 # Remove the NLS bits if USE_NLS is no or INHIBIT_DEFAULT_DEPS is set
Brad Bishop6e60e8b2018-02-01 10:27:11 -050012 if d.getVar('INHIBIT_DEFAULT_DEPS') and not oe.utils.inherits(d, 'cross-canadian'):
Patrick Williamsc124f4f2015-09-15 14:41:29 -050013 return '--disable-nls'
14 return "--enable-nls"
15
Brad Bishopd7bf8c12018-02-25 22:55:05 -050016DEPENDS_GETTEXT ??= "gettext-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050017
Brad Bishopd7bf8c12018-02-25 22:55:05 -050018BASEDEPENDS_append = " ${@gettext_dependencies(d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050019EXTRA_OECONF_append = " ${@gettext_oeconf(d)}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050020
21# Without this, msgfmt from gettext-native will not find ITS files
22# provided by target recipes (for example, polkit.its).
23GETTEXTDATADIRS_append_class-target = ":${STAGING_DATADIR}/gettext"
24export GETTEXTDATADIRS