glib-tools.recipe 1.99 KB
Newer Older
1
2
3
4
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python

class Recipe(recipe.Recipe):
    name = 'glib-tools'
5
    version = '2.56.1'
6
    stype = SourceType.TARBALL
7
8
    maj_ver = '.'.join(version.split('.')[0:2])
    url = 'https://download.gnome.org/sources/glib/{}/glib-%(version)s.tar.xz'.format(maj_ver)
9
    tarball_dirname = 'glib-%(version)s'
10
    tarball_checksum = '40ef3f44f2c651c7a31aedee44259809b6f03d3d20be44545cd7d177221c0b8d'
11
    licenses = [License.LGPLv2Plus]
12
13
14
    btype = BuildType.MESON
    meson_options = {'gtk_doc': 'false', 'internal_pcre': 'true', 'libmount': 'false',
                     'dtrace': 'false', 'iconv': 'libc'}
15
    deps = ['libffi', 'zlib']
Matthew Waters's avatar
Matthew Waters committed
16
    patches = ['../glib/glib-2.57-meson-backported-fixes.patch',
17
               '../glib/0001-DO-NOT-UPSTREAM-Prototypes-missing-in-Cerbero-s-anci.patch',
18
               '../glib/0001-gengiotypefuncs.py-Read-and-parse-files-in-binary-mo.patch',
19
              ]
20
21
22

    def prepare(self):
        if self.config.target_platform != Platform.LINUX:
23
24
            # Disable valgrind code on non-Linux, in the best case it just
            # gives us compiler errors :)
25
            self.append_env('CFLAGS', '-DNVALGRIND=1')
26
27
28
29
30
31
32
33
34
35
36
37
38
            self.meson_options.update({'xattr': 'false'})
        # macOS provides libiconv as a separate library
        if self.config.target_platform == Platform.DARWIN:
            self.meson_options.update({'iconv': 'native'})
        # linux and BSD provide iconv as a part of libc
        elif self.config.target_platform == Platform.LINUX:
            self.meson_options.update({'iconv': 'libc'})
        # Other platforms don't provide libiconv, so we build it
        else:
            self.meson_options.update({'iconv': 'gnu'})
        if self.config.target_platform == Platform.WINDOWS:
            # Want secure versions of stdlib functions. Glib already defines
            # _WIN32_WINNT, so undefine it on the cmdline to avoid warnings
39
            self.append_env('CFLAGS', '-DMINGW_HAS_SECURE_API=1', '-U_WIN32_WINNT')