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


class Recipe(recipe.Recipe):
    name = 'flac'
    version = '1.4.3'
    # only libraries are Xiph.org (aka BSD-like), tools are GPLv2+ and defined below
    licenses = [{License.BSD_like: ['COPYING.Xiph']}]
    stype = SourceType.TARBALL
    url = 'xiph://'
    tarball_checksum = '6c58e69cd22348f441b861092b825e591d0b822e106de6eb0ee4d05d27205b70'
    deps = ['libogg']

    btype = BuildType.MESON

    patches = [
        f'{name}/0001-Add-Meson-build.patch',
    ]

    files_libs = ['libFLAC']

    files_bins = ['flac', 'metaflac']
    licenses_bins = [License.GPLv2Plus]

    files_devel = [
        '%(libdir)s/pkgconfig/flac.pc',
        'include/FLAC',
    ]

    def prepare(self):
        if self.config.target_platform in [Platform.DARWIN, Platform.IOS]:
            if self.config.target_arch == Architecture.X86:
                self.append_env('CFLAGS', '-DFLAC__NO_ASM')
        if self.config.target_platform == Platform.WINDOWS:
            # Newer MinGW requires this define for sscanf in stdio.h
            self.append_env('CFLAGS', '-D__USE_MINGW_ANSI_STDIO=1')

    def post_install(self):
        # Meson does not generate la files
        LibtoolLibrary('libFLAC', None, None, None, self.config.libdir, self.config.target_platform).save()
        super().post_install()