summaryrefslogtreecommitdiff
path: root/recipes/opus.recipe
blob: 5917058240a9f4f1f10f3c959e529c3e8e355a2b (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
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
from cerbero.tools.libtool import LibtoolLibrary
from cerbero.tools.libtool import get_libtool_versions

class Recipe(recipe.Recipe):
    name = 'opus'
    version = '1.4'
    licenses = [{License.BSD_like: ['COPYING']}]
    stype = SourceType.TARBALL
    btype = BuildType.MESON
    url = 'xiph://.tar.gz'
    tarball_checksum = 'c9b32b4253be5ae63d1ff16eea06b94b5f0f2951b7a02aceef58e3a3ce49c51f'
    meson_options = {
        'rtcd': 'enabled',
        'intrinsics': 'enabled',
        'extra-programs': 'disabled',
        'tests': 'disabled',
        'docs': 'disabled',
    }

    patches = [
        'opus/0001-celt-Force-stack-alignment-for-functions-using-__m12.patch',
        # https://gitlab.xiph.org/xiph/opus/-/merge_requests/58
        'opus/0001-meson-fix-get_version.py-to-try-the-package_version-.patch',
        # https://gitlab.xiph.org/xiph/opus/-/merge_requests/59
        'opus/0001-meson-fix-build-on-arm64.patch',
    ]

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

    def prepare(self):
        # Always have NEON on ARM64, don't need to detect the CPU at runtime.
        if self.config.target_arch == Architecture.ARM64:
            self.meson_options['rtcd'] = 'disabled'

    def post_install(self):
        major, minor, micro = get_libtool_versions(self.version)
        LibtoolLibrary('opus', major, minor, micro,
                self.config.libdir, self.config.target_platform).save()
        super().post_install()