summaryrefslogtreecommitdiff
path: root/recipes/gst-android-1.0.recipe
blob: 779849a9bf948d4cee28534c539ffd3bb6c2bf67 (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
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
from cerbero.utils import shell
from custom import list_gstreamer_1_0_plugins_by_category

class Recipe(recipe.Recipe):
    name = 'gst-android-1.0'
    version = '0.1'
    licenses = [License.LGPLv2_1]
    stype = SourceType.CUSTOM
    btype = BuildType.CUSTOM

    files_devel = [
            'share/gst-android/ndk-build-1.0/gstreamer_android.c.in',
            'share/gst-android/ndk-build-1.0/gstreamer.mk',
            'share/gst-android/ndk-build-1.0/gstreamer_prebuilt.mk',
            'share/gst-android/ndk-build-1.0/tools.mk',
            'share/gst-android/ndk-build-1.0/plugins.mk',
            'share/gst-android/ndk-build-1.0/GStreamer.java',
            'share/gst-android/ndk-build-1.0/tools/windows',
            'share/gst-android/ndk-build-1.0/fontconfig',
            ]

    def install(self):
        ndk_build_dir = os.path.join(self.config.prefix, 'share', 'gst-android', 'ndk-build-1.0')
        shell.copy_dir(os.path.join(self.config.data_dir, 'ndk-build-1.0'),
                ndk_build_dir)

        plugins, replacements = list_gstreamer_1_0_plugins_by_category(self.config)
        f = open(os.path.join(ndk_build_dir, 'plugins.mk'), 'w')
        for c, p in plugins.iteritems():
            p = ' '.join(p)
            for k,v in replacements.iteritems():
                p = p.replace(k, v)
            f.write('GSTREAMER_PLUGINS_%s := %s\n' % (c.upper(), p))
        f.close()