8b2694efb7
* fix build for openssl 1.1.1b required for sdk (cherry picked from commit aa49e3b2755b97b6331cdbbb89efc954de8d5977) * use js code from master * fix openssl recipe and tweak build (cherry picked from commit 6e94c27021c7bd7b1e880c2fc314850e36a5a38e) * remove unused build recipes (cherry picked from commit f5c0577bdb175bfc0990602936bbc9e2052e1f25)
34 lines
1.3 KiB
Python
34 lines
1.3 KiB
Python
from pythonforandroid.recipe import NDKRecipe
|
|
from pythonforandroid.toolchain import shprint, shutil, current_directory
|
|
from os.path import join, exists
|
|
import sh
|
|
|
|
class Sqlite3Recipe(NDKRecipe):
|
|
version = '3.24.0'
|
|
# Don't forget to change the URL when changing the version
|
|
url = 'https://www.sqlite.org/2018/sqlite-amalgamation-3240000.zip'
|
|
generated_libraries = ['sqlite3']
|
|
|
|
def should_build(self, arch):
|
|
return not self.has_libs(arch, 'libsqlite3.so')
|
|
|
|
def prebuild_arch(self, arch):
|
|
super(Sqlite3Recipe, self).prebuild_arch(arch)
|
|
# Copy the Android make file
|
|
|
|
sh.mkdir('-p', join(self.get_build_dir(arch.arch), 'jni'))
|
|
shutil.copyfile(join(self.get_recipe_dir(), 'Android.mk'),
|
|
join(self.get_build_dir(arch.arch), 'jni/Android.mk'))
|
|
|
|
def build_arch(self, arch, *extra_args):
|
|
super(Sqlite3Recipe, self).build_arch(arch)
|
|
# Copy the shared library
|
|
shutil.copyfile(join(self.get_build_dir(arch.arch), 'libs', arch.arch, 'libsqlite3.so'),
|
|
join(self.ctx.get_libs_dir(arch.arch), 'libsqlite3.so'))
|
|
|
|
def get_recipe_env(self, arch):
|
|
env = super(Sqlite3Recipe, self).get_recipe_env(arch)
|
|
env['NDK_PROJECT_PATH'] = self.get_build_dir(arch.arch)
|
|
return env
|
|
|
|
recipe = Sqlite3Recipe()
|