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

class Recipe(recipe.Recipe):
    name = 'zbar'
    version = '0.23'
    stype = SourceType.TARBALL
    url = 'https://linuxtv.org/downloads/zbar/zbar-%(version)s.tar.gz'
    tarball_checksum = 'ac52763a7dd6ddc53ca6cd75ccee14f7abf6ae46ecb31137d025af123edd33bf'
    configure_options = '--disable-pthread --disable-video --without-imagemagick --without-gtk --without-qt --with-python=no --with-jpeg=no --with-x=no'
    files_libs = ['libzbar']
    files_devel = ['include/zbar.h', '%(libdir)s/pkgconfig/zbar.pc']

    def prepare(self):
        if self.config.target_platform in (Platform.WINDOWS, Platform.ANDROID):
            self.deps.append('libiconv')
        if self.config.target_platform == Platform.WINDOWS:
            # This flag should be removed in 0.24
            self.append_env('CFLAGS', '-std=c99')
            # zbar incorrectly passes CPPFLAGS to WINDRES, which then barfs on
            # args it can't understand
            self.set_env('CPPFLAGS', '')
        if self.config.target_platform in [Platform.IOS, Platform.DARWIN]:
            self.autoreconf = True
        # since MacOS 14.0 (sonoma), we can't seem to successfully find the iconv library so add it manually
        if self.config.target_platform in [Platform.DARWIN]:
            self.set_env('LDFLAGS', self.get_env('LDFLAGS') + ' -liconv')