summaryrefslogtreecommitdiff
path: root/recipes/srt.recipe
blob: 1c94fe761494c715d2fcb3bb600c33b814ab71ee (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 shutil

from cerbero.tools.libtool import LibtoolLibrary

class Recipe(recipe.Recipe):
    name = 'srt'
    version = '1.4.3'
    url = 'https://github.com/Haivision/srt/archive/v%(version)s.tar.gz'
    tarball_checksum = 'c06e05664c71d635c37207a2b5a444f2c4a95950a3548402b3e0c524f735b33d'
    licenses = [License.MPLv2]
    stype = SourceType.TARBALL
    btype = BuildType.CMAKE
    cmake_generator = 'ninja'
    can_msvc = False
    # CXX11 builds stuff we don't need, and causes a build failure on mingw
    configure_options = '-DUSE_ENCLIB=openssl -DENABLE_CXX11=OFF'
    # openssl on Linux
    use_system_libs = True

    files_libs = ['libsrt']
    files_devel = ['include/srt', '%(libdir)s/pkgconfig/srt.pc']

    def prepare(self):
        if self.config.target_platform != Platform.LINUX or self.config.cross_compiling():
            self.deps.append('openssl')
        if self.config.target_platform == Platform.ANDROID:
            self.append_env('CXXFLAGS', '-frtti', '-fexceptions')
            self.configure_options += ' -DUSE_GNUSTL=ON'
            self.deps.append('gnustl')

    def post_install(self):
        libtool_la = LibtoolLibrary('srt', None, None, None, self.config.libdir,
                self.config.target_platform, deps=['ssl', 'crypto'])
        libtool_la.save()
        super().post_install()