summaryrefslogtreecommitdiff
path: root/recipes/libmpeg2.recipe
blob: 1d3b1d4514d83bcab38de84aae094e9e3df82416 (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
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
from cerbero.utils import shell

class Recipe(recipe.Recipe):
    name = 'libmpeg2'
    version = '0.5.1'
    licenses = [License.GPLv2Plus]
    autoreconf = True

    files_libs = ['libmpeg2', 'libmpeg2convert']
    files_bins = ['mpeg2dec', 'extract_mpeg2', 'corrupt_mpeg2']
    files_devel = ['include/mpeg2dec', 'lib/pkgconfig/libmpeg2.pc',
                   'lib/pkgconfig/libmpeg2convert.pc']

    def prepare(self):
        if self.config.target_platform in [Platform.WINDOWS, Platform.DARWIN,
                Platform.ANDROID, Platform.IOS]:
            self.configure_options = ' --disable-sdl --without-x'
        if self.config.target_platform == Platform.IOS:
            if self.config.target_arch in [Architecture.ARM, Architecture.ARMv7]:
                self.new_env = {'CCAS': os.environ['GAS']}
                self.append_env = {'LDFLAGS': ' -Wl,-read_only_relocs,suppress'}

    def compile(self):
        if self.config.target_platform == Platform.IOS:
            if self.config.target_arch in [Architecture.ARM, Architecture.ARMv7]:
                arm_f = os.path.join(self.build_dir, 'libmpeg2', 'motion_comp_arm_s.S')
                shell.replace(arm_f,
                    {'.global MC_put_o_16_arm\nMC_put_o_16_arm:': '.global _MC_put_o_16_arm\n_MC_put_o_16_arm:',
                     '.global MC_put_o_8_arm\nMC_put_o_8_arm:': '.global _MC_put_o_8_arm\n_MC_put_o_8_arm:',
                     '.global MC_put_x_16_arm\nMC_put_x_16_arm:': '.global _MC_put_x_16_arm\n_MC_put_x_16_arm:',
                     '.global MC_put_x_8_arm\nMC_put_x_8_arm:': '.global _MC_put_x_8_arm\n_MC_put_x_8_arm:',
                    })
        super(recipe.Recipe, self).compile()