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


class Recipe(recipe.Recipe):
    name = 'libpng'
    version = '1.6.37'
    stype = SourceType.TARBALL
    url = 'sf://'
    tarball_checksum = '505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca'
    licenses = [{License.LibPNG: ['LICENSE']}]
    deps = ['zlib']
    patches = [name + '/0001-neon-fix-function-export-names-for-iOS-armv7.patch',
               name + '/0002-Fix-build-in-native-Windows-do-to-incorrect-r-insert.patch',
              ]

    files_libs = ['libpng16']
    files_devel = ['include/libpng16', 'bin/libpng16-config',
                   '%(libdir)s/pkgconfig/libpng16.pc', '%(libdir)s/pkgconfig/libpng.pc']

    def prepare(self):
        if self.config.target_platform == Platform.IOS:
            gas = self.get_env('GAS')
            if gas:
                self.set_env('CCAS', gas, '-no-integrated-as')
        if self.config.target_arch == Architecture.ARM64:
            self.configure_options += ' --disable-arm-neon '
        # Needs zlib include flags in CPPFLAGS to generate pnglibconf.h with
        # the right PNG_ZLIB_VERNUM
        self.append_env('CPPFLAGS', self.get_env('CFLAGS'))