blob: f11cb04456586c4ea259e63e7e203e6aab049533 [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"
Brad Bishop316dfdd2018-06-25 12:45:53 -04006 return "gettext-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05007
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
Patrick Williams213cb262021-08-07 19:21:33 -050016BASEDEPENDS:append = " ${@gettext_dependencies(d)}"
17EXTRA_OECONF:append = " ${@gettext_oeconf(d)}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050018
19# Without this, msgfmt from gettext-native will not find ITS files
20# provided by target recipes (for example, polkit.its).
Patrick Williams213cb262021-08-07 19:21:33 -050021GETTEXTDATADIRS:append:class-target = ":${STAGING_DATADIR}/gettext"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050022export GETTEXTDATADIRS