summaryrefslogtreecommitdiff
path: root/recipes/libnice.recipe
blob: 95d333b63971ec75c53fd3747b7a9bd46c2446d8 (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
46
47
48
49
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
from cerbero.tools.libtool import LibtoolLibrary

class Recipe(recipe.Recipe):
    name = 'libnice'
    version = '0.1.22'
    stype = SourceType.TARBALL
    btype = BuildType.MESON
    url = 'https://nice.freedesktop.org/releases/%(name)s-%(version)s.tar.gz'
    tarball_checksum = 'a5f724cf09eae50c41a7517141d89da4a61ec9eaca32da4a0073faed5417ad7e'
    # Either LGPL-2.1+ or MPL-1.1
    licenses = [License.LGPLv2_1Plus, License.MPLv1_1]
    meson_options = {'tests' : 'disabled',
                     'gupnp' : 'disabled',
                     'gstreamer' : 'enabled',
                     'crypto-library' : 'openssl'}
    deps = ['glib', 'gstreamer-1.0']

    patches = []

    files_bins = ['stunbdc', 'stund']
    files_libs = ['libnice']
    files_devel = [
        'include/nice',
        'include/stun',
        '%(libdir)s/pkgconfig/nice.pc',
    ]
    files_plugins_net = ['%(libdir)s/gstreamer-1.0/libgstnice%(mext)s']
    files_plugins_net_devel = [
        '%(libdir)s/gstreamer-1.0/libgstnice.a', '%(libdir)s/gstreamer-1.0/libgstnice.la',
    ]
    # FIXME - if_arp.h? (iOS)

    def prepare(self):
        if self.config.target_platform != Platform.LINUX or self.config.cross_compiling():
            self.deps.append('openssl')
        else:
            # openssl on Linux
            self.use_system_libs = True

    def post_install (self):
        nice_deps = ['gio-2.0', 'gthread-2.0', 'ssl', 'crypto']
        lib = LibtoolLibrary('nice', None, None, None, self.config.libdir,
                self.config.target_platform, deps=nice_deps)
        lib.save()
        lib = LibtoolLibrary('gstnice', None, None, None, os.path.join(self.config.libdir, 'gstreamer-1.0'),
                self.config.target_platform, deps=(nice_deps + ['nice', 'gstbase-1.0']))
        lib.save()
        super().post_install()