summaryrefslogtreecommitdiff
path: root/recipes/soundtouch.recipe
blob: aafdd744072398894219066228c1f27a1dd983b4 (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
# -*- 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.1.0'
    btype = BuildType.MESON
    stype = SourceType.TARBALL
    url = 'https://gitlab.com/soundtouch/soundtouch/-/archive/%(version)s/soundtouch-%(version)s.tar.gz'
    tarball_checksum = '454712b08bf758f6a4c0df8821350c323e5b274443a20e21d193d17c5dc3d0d5'
    licenses = [License.LGPLv2_1Plus]

    patches = [
               'soundtouch/0008-Fix-compilation-with-clang.patch',
               'soundtouch/0001-Add-minimal-meson-build-system.patch',
               'soundtouch/0002-add-support-for-linking-with-gnustl-on-android.patch',
              ]

    files_libs = ['libSoundTouch']
    files_devel = ['include/soundtouch', 'lib/pkgconfig/soundtouch.pc']

    # FIXME: Meson port does not export symbols correctly for use with MSVC
    can_msvc = False

    def prepare (self):
      if self.config.target_platform == Platform.ANDROID:
        self.append_env('CXXFLAGS', '-fexceptions -DST_NO_EXCEPTION_HANDLING')

    def post_install (self):
        dependency_libs = []
        if self.config.target_platform == Platform.ANDROID:
            dependency_libs += ['gnustl', '-lm']

        lib = LibtoolLibrary('SoundTouch', None, None, None, self.config.libdir,
                self.config.target_platform, deps=dependency_libs)
        lib.save()
        super().post_install()