summaryrefslogtreecommitdiff
path: root/recipes/taglib.recipe
blob: 4a8675dda29a13cb12638d0b74c51ebc06f06a6e (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
import shutil

from cerbero.tools.libtool import LibtoolLibrary

class Recipe(recipe.Recipe):
    name = 'taglib'
    version = '1.7.2'
    # either LGPLv2.1 or MPLv1.1
    licenses = [License.LGPLv2_1]
    configure_options = '-DWITH_MP4=ON -DWITH_ASF=ON -DENABLE_STATIC=1'
    btype = BuildType.CMAKE
    platform_deps = {Platform.ANDROID: ['gnustl']}

    files_libs = ['libtag', 'libtag_c']
    files_devel = ['include/taglib', 'lib/pkgconfig/taglib.pc', 'lib/pkgconfig/taglib_c.pc']

    def prepare(self):
        if self.config.target_platform == Platform.WINDOWS:
            self.configure_options += ' -DWIN32=1'
        if self.config.target_platform == Platform.ANDROID:
            # configure for android
            self.configure_options += ' -DANDROID_NDK=1 '
        self.configure_options += ' -DZLIB_ROOT=%s ' % self.config.prefix

    def install(self):
        super(recipe.Recipe, self).install()
        shutil.move(
                os.path.join(self.config.prefix, 'lib', 'libtag_static.a'),
                os.path.join(self.config.prefix, 'lib', 'libtag.a'))

    def post_install(self):
        deps = ['z']
        if self.config.target_platform == Platform.ANDROID:
            deps.append('gnustl')
        libtool_la = LibtoolLibrary('tag', 1, 7, None, self.config.libdir,
                self.config.target_platform, deps)
        libtool_la.save()