Skip to content

Commit fc9acde

Browse files
committed
Add zbarlight recipe (also compatible with python2 and python3)
1 parent 49bffd5 commit fc9acde

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from os.path import join
2+
from pythonforandroid.recipe import PythonRecipe
3+
4+
5+
class ZBarLightRecipe(PythonRecipe):
6+
7+
version = '2.1'
8+
9+
url = 'https://github.com/Polyconseil/zbarlight/archive/{version}.tar.gz' # noqa
10+
11+
call_hostpython_via_targetpython = False
12+
13+
depends = ['setuptools', 'libzbar']
14+
15+
def get_recipe_env(self, arch=None, with_flags_in_cc=True):
16+
env = super(ZBarLightRecipe, self).get_recipe_env(arch, with_flags_in_cc)
17+
libzbar = self.get_recipe('libzbar', self.ctx)
18+
libzbar_dir = libzbar.get_build_dir(arch.arch)
19+
env['PYTHON_ROOT'] = self.ctx.get_python_install_dir()
20+
env['CFLAGS'] += ' -I' + join(libzbar_dir, 'include')
21+
env['LDFLAGS'] += ' -L' + join(libzbar_dir, 'zbar', '.libs')
22+
env['LIBS'] = env.get('LIBS', '') + ' -landroid -lzbar'
23+
return env
24+
25+
26+
recipe = ZBarLightRecipe()

0 commit comments

Comments
 (0)