2019-03-30 21:58:45 +01:00
|
|
|
from pythonforandroid.recipe import PythonRecipe
|
|
|
|
from pythonforandroid.toolchain import current_directory, shprint
|
2017-08-13 03:24:00 +02:00
|
|
|
import sh
|
|
|
|
|
2019-03-30 21:58:45 +01:00
|
|
|
|
2017-08-13 03:24:00 +02:00
|
|
|
class ApswRecipe(PythonRecipe):
|
|
|
|
version = '3.15.0-r1'
|
|
|
|
url = 'https://github.com/rogerbinns/apsw/archive/{version}.tar.gz'
|
2022-12-02 21:15:34 +01:00
|
|
|
depends = ['sqlite3', 'setuptools']
|
2017-08-13 03:24:00 +02:00
|
|
|
call_hostpython_via_targetpython = False
|
|
|
|
site_packages_name = 'apsw'
|
|
|
|
|
|
|
|
def build_arch(self, arch):
|
|
|
|
env = self.get_recipe_env(arch)
|
|
|
|
with current_directory(self.get_build_dir(arch.arch)):
|
|
|
|
# Build python bindings
|
|
|
|
hostpython = sh.Command(self.hostpython_location)
|
|
|
|
shprint(hostpython,
|
|
|
|
'setup.py',
|
|
|
|
'build_ext',
|
2019-03-30 21:58:45 +01:00
|
|
|
'--enable=fts4', _env=env)
|
2017-08-13 03:24:00 +02:00
|
|
|
# Install python bindings
|
2022-12-02 21:15:34 +01:00
|
|
|
super().build_arch(arch)
|
2017-08-13 03:24:00 +02:00
|
|
|
|
|
|
|
def get_recipe_env(self, arch):
|
2022-12-02 21:15:34 +01:00
|
|
|
env = super().get_recipe_env(arch)
|
2019-03-30 21:58:45 +01:00
|
|
|
sqlite_recipe = self.get_recipe('sqlite3', self.ctx)
|
|
|
|
env['CFLAGS'] += ' -I' + sqlite_recipe.get_build_dir(arch.arch)
|
|
|
|
env['LDFLAGS'] += ' -L' + sqlite_recipe.get_lib_dir(arch)
|
|
|
|
env['LIBS'] = env.get('LIBS', '') + ' -lsqlite3'
|
2017-08-13 03:24:00 +02:00
|
|
|
return env
|
|
|
|
|
2019-03-30 21:58:45 +01:00
|
|
|
|
2017-08-13 03:24:00 +02:00
|
|
|
recipe = ApswRecipe()
|