# -*- 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()