summaryrefslogtreecommitdiff
path: root/recipes/gettext.recipe
blob: 677aed5dacfc8c0fac337e3601b09b475418ebf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
import shutil

class Recipe(recipe.Recipe):
    name = 'gettext'
    version = '0.19.8.1'
    # only libraries are LGPLv2+, tools are GPLv3+ and defined below
    licenses = [License.LGPLv2Plus]
    stype = SourceType.TARBALL
    url = 'https://ftp.gnu.org/pub/gnu/%(name)s/%(name)s-%(version)s.tar.gz'
    tarball_checksum = 'ff942af0e438ced4a8b0ea4b0b6e0d6d657157c5e2364de57baa279c1c125c43'
    srcdir = 'gettext-runtime'
    patches = ['gettext/0001-Fix-linker-error-redefinition-of-vasprintf.patch',
               'gettext/0001-Undefine-__USE_MINGW_ANSI_STDIO-as-otherwise-stdio.h.patch',
               'gettext/0001-Fix-build-invalid-instruction-on-macOS-10.13.patch',
               'gettext/0001-Fix-linker-error-Cannot-export-rpl_printf' ]
    platform_deps = {
        Platform.WINDOWS:  ['mingw-runtime'],
            }

    files_libs = ['libintl']
    files_devel = ['include/libintl.h']

    def prepare (self):
        intl_path = os.path.join(self.make_dir, 'intl')
        self.make = 'cd %s && make' % intl_path
        self.make_install = 'cd %s && make PACKAGE=gettext-tools install' % intl_path
        if self.config.target_platform == Platform.WINDOWS:
            self.configure_options += ' --enable-threads=win32'
        self.append_env('CFLAGS', '-Dlocale_charset=intl_locale_charset')