2019-03-30 21:58:45 +01:00
|
|
|
from pythonforandroid.recipe import Recipe, CythonRecipe
|
2017-08-13 03:24:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
class ShapelyRecipe(CythonRecipe):
|
|
|
|
version = '1.5'
|
|
|
|
url = 'https://github.com/Toblerity/Shapely/archive/master.zip'
|
2019-03-30 21:58:45 +01:00
|
|
|
depends = ['setuptools', 'libgeos']
|
2017-08-13 03:24:00 +02:00
|
|
|
call_hostpython_via_targetpython = False
|
2019-03-30 21:58:45 +01:00
|
|
|
|
|
|
|
patches = ['setup.patch'] # Patch to force setup to fail when C extention fails to build
|
|
|
|
|
2017-08-13 03:24:00 +02:00
|
|
|
# setup_extra_args = ['sdist'] # DontForce Cython
|
2019-03-30 21:58:45 +01:00
|
|
|
|
2017-08-13 03:24:00 +02:00
|
|
|
def get_recipe_env(self, arch, with_flags_in_cc=True):
|
|
|
|
""" Add libgeos headers to path """
|
2019-03-30 21:58:45 +01:00
|
|
|
env = super(ShapelyRecipe, self).get_recipe_env(arch, with_flags_in_cc)
|
2017-08-13 03:24:00 +02:00
|
|
|
libgeos_dir = Recipe.get_recipe('libgeos', self.ctx).get_build_dir(arch.arch)
|
|
|
|
env['CFLAGS'] += " -I{}/dist/include".format(libgeos_dir)
|
|
|
|
return env
|
2019-03-30 21:58:45 +01:00
|
|
|
|
|
|
|
|
2017-08-13 03:24:00 +02:00
|
|
|
recipe = ShapelyRecipe()
|