summaryrefslogtreecommitdiff
path: root/recipes/glib-networking-static.recipe
blob: 2d12680d1ef12473c5b496cd2ea23de0cd36aaf2 (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
45
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
import shutil
import os
from cerbero.errors import FatalError

class Recipe(recipe.Recipe):
    name = 'glib-networking-static'
    version = '2.38.2'
    licenses = [License.LGPLv2Plus]
    stype = SourceType.TARBALL
    url = 'http://ftp.gnome.org/pub/gnome/sources/glib-networking/2.38/glib-networking-2.38.2.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-gnutls-add-initial-support-for-static-builds.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 = None
        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
          querymodule_path = os.path.join(self.config.prefix, arch, 'bin', 'gio-querymodules')
        else:
          querymodule_path = os.path.join(self.config.prefix, 'bin', 'gio-querymodules')

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

        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)