summaryrefslogtreecommitdiff
path: root/recipes/glib-networking.recipe
blob: c5152cf6ffbce257adfb8024397593c324df0124 (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
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
import os
from cerbero.utils.shell import which

class Recipe(recipe.Recipe):
    name = 'glib-networking'
    version = '2.44.0'
    licenses = [License.LGPLv2Plus]
    stype = SourceType.TARBALL
    url = 'http://ftp.gnome.org/pub/gnome/sources/glib-networking/2.44/glib-networking-%(version)s.tar.xz'
    autoreconf = True
    configure_options = "--without-ca-certificates --enable-more-warnings"
    deps = ['glib', 'gnutls']
    patches = ['glib-networking/0001-Add-support-for-static-modules.patch',
               'glib-networking/0002-Get-the-CA-certificate-path-from-the-environment-var.patch']

    files_misc = ['lib/gio/modules/libgiognutls%(mext)s']
    files_lang = ['glib-networking']

    def prepare(self):
        querymodule_path = os.path.join(self.config.prefix, 'bin', 'gio-querymodules')
        if self.config.target_platform in [Platform.DARWIN, Platform.IOS]:
          # For the universal build we need to use the right gio-querymodules
          arch = self.config.target_arch
          arch_path = os.path.join(self.config.prefix, arch, 'bin', 'gio-querymodules')
          # Only for the universal builds
          if os.path.exists(arch_path):
              querymodule_path = arch_path

        if not self.config.prefix_is_executable():
          querymodule_path = which('true')

        if self.config.target_platform in [Platform.ANDROID]:
          self.append_env['CFLAGS'] = ' -DGST_CA_CERTIFICATES_FROM_ENV'

        self.config_sh = 'GIO_QUERYMODULES=%s %s' % (querymodule_path, self.config_sh)