summaryrefslogtreecommitdiff
path: root/recipes/libvpx.recipe
blob: 2e4b0a9807de4a224c22deef0819d08a84531bb7 (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
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python


class Recipe(recipe.Recipe):
    name = 'libvpx'
    version = 'v1.0.0'
    license = 'BSD'
    configure_tpl = "%(config-sh)s --prefix=%(prefix)s "\
                    "--libdir=%(libdir)s %(options)s"
    configure_options = "--enable-pic --as=yasm "
    add_host_build_target = False

    files_libs = ['libvpx']
    files_bins = ['vpxenc', 'vpxdec']
    files_devel = ['include/vpx', 'lib/pkgconfig/vpx.pc']


    def prepare (self):
        if self.config.target_arch == Architecture.X86_64:
            arch = 'x86_64'
        else:
            arch = 'x86'

        if self.config.target_platform == Platform.DARWIN:
            if self.config.target_distro_version in [DistroVersion.OS_X_MOUNTAIN_LION, DistroVersion.OS_X_LION] and arch != 'x86':
                platform = 'darwin11'
            else:
                platform = 'darwin10'
        elif self.config.target_platform == Platform.WINDOWS:
            self.config_sh = 'LD=$CC ./configure'
            if self.config.target_arch == Architecture.X86_64:
                platform = 'win64'
            else:
                platform = 'win32'
        else:
            self.configure_options += '--enable-shared '
            platform = 'linux'

        self.configure_options += '--target=%s-%s-gcc ' % (arch, platform)