summaryrefslogtreecommitdiff
path: root/recipes/x264.recipe
blob: a12f15b501e71ce5f2477037b4fb69e2c5b97449 (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
40
41
42
43
44
45
46
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
from cerbero.tools.libtool import LibtoolLibrary


class Recipe(recipe.Recipe):
    version = '20120827-2245'
    name = 'x264'
    licenses = [License.GPL]
    stype = SourceType.TARBALL
    configure_tpl = "%(config-sh)s --prefix=%(prefix)s "\
                    "--libdir=%(libdir)s %(options)s"
    configure_options = '--enable-shared --enable-static --enable-pic --disable-strip'
    force_configure = True
    url = 'http://ftp.videolan.org/pub/x264/snapshots/x264-snapshot-20120827-2245-stable.tar.bz2'
    tarball_dirname= 'x264-snapshot-20120827-2245-stable'
    new_env = {'AS': 'yasm'}

    files_libs = ['libx264']
    files_bins = ['x264']
    files_devel = ['lib/pkgconfig/x264.pc', 'include/x264.h',
                   'include/x264_config.h']

    def prepare(self):
        arch = self.config.target_arch
        if self.config.target_arch == Architecture.X86:
            arch = 'i686'
        if self.config.target_platform == Platform.DARWIN:
            if self.config.target_arch == Architecture.X86:
                self.new_env = {'AS': 'yasm -O2 -f macho -DPREFIX'}
        if self.config.target_platform == Platform.WINDOWS:
            self.configure_options += ' --enable-win32thread'
        self.configure_options += ' --host=%s-pc-%s' % (arch, self.config.target_platform)
        if self.config.target_platform == Platform.ANDROID:
            if self.config.target_arch == Architecture.ARM:
                self.configure_options += ' --disable-asm'
            if self.config.target_arch == Architecture.ARMv7:
                self.new_env = {'AS': os.environ.get('CC', '')}
        if self.config.target_platform == Platform.IOS:
            if self.config.target_arch in [Architecture.ARM, Architecture.ARMv7]:
                self.new_env = {'AS': os.environ.get('GAS', '')}
                self.new_env['AS'] += ' -no-integrated-as '

    def post_install(self):
        libtool_la = LibtoolLibrary('x264', 125, None, None, self.config.libdir,
                self.config.target_platform)
        libtool_la.save()