summaryrefslogtreecommitdiff
path: root/recipes/glib-networking.recipe
blob: 1759ca6a6bfd4eccc568976024f5505d1ec86882 (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
31
32
33
34
35
36
37
38
39
40
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
import os
from cerbero.utils.shell import which
from cerbero.tools.libtool import LibtoolLibrary

class Recipe(recipe.Recipe):
    name = 'glib-networking'
    version = '2.74.0'
    licenses = [{License.LGPLv2Plus: None, License.Misc: ['LICENSE_EXCEPTION']}]
    stype = SourceType.TARBALL
    btype = BuildType.MESON
    url = 'gnome://'
    tarball_checksum = '1f185aaef094123f8e25d8fa55661b3fd71020163a0174adb35a37685cda613b'

    meson_options = {'libproxy': 'disabled', 'gnome_proxy': 'disabled',
                     'gnutls': 'disabled', 'openssl': 'enabled',
                     # Also build static modules on all platforms
                     'static_modules': 'true'}
    deps = ['glib']
    # openssl on Linux
    use_system_libs = True

    # https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/229
    patches = [name + '/0001-Don-t-try-to-use-keychain-CA-certificates-on-iOS.patch']

    files_misc = ['lib/gio/modules/libgioopenssl%(mext)s']
    files_lang = ['glib-networking']
    files_devel = ['lib/gio/modules/libgioopenssl.a']

    def prepare(self):
        # Pick system openssl if on Linux and not cross-compiling
        if self.config.target_platform != Platform.LINUX or self.config.cross_compiling():
            self.deps.append('openssl')

    def post_install(self):
        # Meson does not generate la files
        LibtoolLibrary('gioopenssl', None, None, None,
                os.path.join(self.config.libdir, 'gio', 'modules'),
                self.config.target_platform, deps=['ssl', 'crypto']).save()
        super().post_install()