summaryrefslogtreecommitdiff
path: root/recipes/glib-networking-static.recipe
blob: 5000c551bb094e8a272ea7ec3cf338ec1ac0d0c1 (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
41
42
43
44
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
import shutil
import os
from cerbero.errors import FatalError
from cerbero.utils.shell import which

class Recipe(recipe.Recipe):
    name = 'glib-networking-static'
    version = '2.54.1'
    licenses = [License.LGPLv2Plus]
    stype = SourceType.TARBALL
    url = 'http://ftp.gnome.org/pub/gnome/sources/glib-networking/2.54/glib-networking-%(version)s.tar.xz'
    tarball_dirname = 'glib-networking-%(version)s'
    autoreconf = True
    configure_options = "--without-ca-certificates --enable-static-modules --enable-static --enable-more-warnings"
    deps = ['glib', 'gnutls', 'glib-networking']
    patches = ['glib-networking/0001-Add-support-for-static-modules.patch',
               'glib-networking/0002-Get-the-CA-certificate-path-from-the-environment-var.patch',
               'glib-networking/0003-gnutls-Use-db-relative-to-libglib-2.0-if-needed.patch',
               'glib-networking/0004-gtlsbackend-gnutls-Get-anchor-file-relative-to-libgi.patch']


    files_devel = ['lib/gio/modules/static/libgiognutls.a',
                   'lib/gio/modules/static/libgiognutls.la']

    def prepare(self):
        self.tmp_destdir = os.path.join(self.build_dir, 'static-build')

        querymodule_path = which('true')

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

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

    def install(self):
        plugins_dir = os.path.join(self.config.prefix,
                                    os.path.dirname(self.files_devel[0]))
        if not os.path.exists(plugins_dir):
            os.makedirs(plugins_dir)
        shutil.copy(os.path.join(self.build_dir, 'tls', 'gnutls', '.libs',
            'libgiognutls.a'), plugins_dir)
        shutil.copy(os.path.join(self.build_dir, 'tls', 'gnutls', '.libs',
            'libgiognutls.la'), plugins_dir)