build script: add gettext target, and use it as base for intl

gettext target is not registered intentionally to avoid conflicts with intl, its lightweight version
This commit is contained in:
alexey.lysiuk 2020-12-07 10:36:21 +02:00
parent 99fd9f240a
commit eb7436c028

View file

@ -661,6 +661,24 @@ class FlacTarget(ConfigureMakeStaticDependencyTarget):
return os.path.exists(builder.source_path + 'FLAC/flac.pc.in')
class GettextTarget(ConfigureMakeStaticDependencyTarget):
def __init__(self, name='gettext'):
super().__init__(name)
opts = self.options
opts['--enable-csharp'] = 'no'
opts['--enable-java'] = 'no'
opts['--enable-libasprintf'] = 'no'
def prepare_source(self, builder: 'Builder'):
builder.download_source(
'https://ftp.gnu.org/gnu/gettext/gettext-0.21.tar.xz',
'd20fcbb537e02dcf1383197ba05bd0734ef7bf5db06bdb241eb69b7d16b73192')
def detect(self, builder: 'Builder') -> bool:
return os.path.exists(builder.source_path + 'gettext-runtime')
class IconvTarget(ConfigureMakeStaticDependencyTarget):
def __init__(self, name='iconv'):
super().__init__(name)
@ -675,25 +693,12 @@ class IconvTarget(ConfigureMakeStaticDependencyTarget):
return os.path.exists(builder.source_path + 'include/iconv.h.in')
class IntlTarget(ConfigureMakeStaticDependencyTarget):
class IntlTarget(GettextTarget):
def __init__(self, name='intl'):
super().__init__(name)
self.src_root = 'gettext-runtime'
self.make.src_root += self.src_root + os.sep + 'intl'
opts = self.options
opts['--enable-csharp'] = 'no'
opts['--enable-java'] = 'no'
opts['--enable-libasprintf'] = 'no'
def prepare_source(self, builder: 'Builder'):
builder.download_source(
'https://ftp.gnu.org/gnu/gettext/gettext-0.21.tar.xz',
'd20fcbb537e02dcf1383197ba05bd0734ef7bf5db06bdb241eb69b7d16b73192')
def detect(self, builder: 'Builder') -> bool:
return os.path.exists(builder.source_path + 'gettext-runtime')
def post_build(self, builder: 'Builder'):
# Do install of intl only, avoid complete gettext runtime
self.src_root = self.make.src_root