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


class Recipe(recipe.Recipe):
    name = 'soundtouch'
    version = '2.3.2'
    btype = BuildType.MESON
    stype = SourceType.TARBALL
    url = 'https://codeberg.org/soundtouch/soundtouch/archive/%(version)s.tar.gz'
    tarball_dirname = 'soundtouch'
    tarball_checksum = 'ed714f84a3e748de87b24f385ec69d3bdc51ca47b7f4710d2048b84b2761e7ff'

    patches = [
        # https://wrapdb.mesonbuild.com/v2/soundtouch_2.3.2-1/get_patch
        f'{name}/0001-Add-Meson-build.patch',
    ]

    licenses = [License.LGPLv2_1Plus]

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

    def prepare(self):
        if self.config.platform == Platform.WINDOWS:
            # tar and bsdtar fail extracting the symbolic link in
            # source/SoundTouchDLL/LazarusTest/libSoundTouchDll.so
            # as it's a placeholder
            self.force_tarfile = True
        # FIXME: change to self.using_msvc() once the Windows cross
        # builds update their GCC
        if self.config.target_platform == Platform.WINDOWS:
            # This library doesn't use export macros except on SoundTouchDLL
            self.library_type = LibraryType.STATIC

    def post_install (self):
        dependency_libs = []
        if self.config.target_platform == Platform.ANDROID:
            dependency_libs += ['-lm', '-llog']
        elif self.config.target_platform == Platform.LINUX:
            dependency_libs += ['-lm']
        LibtoolLibrary('SoundTouch', 2, 3, 2, self.config.libdir,
                self.config.target_platform, deps=dependency_libs).save()
        super().post_install()