summaryrefslogtreecommitdiff
path: root/recipes/zlib.recipe
blob: 24e61ec3a44f5cb9003f9064267459e406d2ba55 (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.tools.libtool import LibtoolLibrary


class Recipe(recipe.Recipe):
    name = 'zlib'
    version = '1.2.7'
    licenses = [License.BSD_like]
    force_configure = True
    add_host_build_target = False
    can_use_configure_cache = False


    files_libs = ['libz']
    files_devel = ['include/zlib.h', 'include/zconf.h', 'lib/pkgconfig/zlib.pc']


    def prepare(self):
        if self.config.target_platform == Platform.WINDOWS:
            self.make = 'make -f win32/Makefile.gcc PREFIX=%s- ' % self.config.host
            self.make_install = 'make install -f win32/Makefile.gcc '\
                                'INCLUDE_PATH=%(prefix)s/include '\
                                'LIBRARY_PATH=%(prefix)s/lib ' \
                                'BINARY_PATH=%(prefix)s/bin ' % {'prefix':self.config.prefix}
            self._remove_steps ([BuildSteps.CONFIGURE])

    def post_install(self):
        libtool_la = LibtoolLibrary('z', 1, 2, 7, self.config.libdir,
                self.config.target_platform)
        libtool_la.save()
        # FIXME This is to workaround a build issue trying to ld to libz.so
        if self.config.target_platform == Platform.IOS:
            try:
                os.symlink(os.path.join (self.config.prefix, 'lib', 'libz.dylib'),
                        os.path.join (self.config.prefix, 'lib', 'libz.so'))
            except OSError:
                pass