Skip to content

Commit 5910c2c

Browse files
committed
Added call_ndk_build to ndk recipe
1 parent 180db28 commit 5910c2c

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

pythonforandroid/recipe.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,8 @@ class NDKRecipe(Recipe):
562562

563563
dir_name = None # The name of the recipe build folder in the jni dir
564564

565+
call_ndk_build = False # If True, call ndk-build with this target
566+
565567
def get_build_container_dir(self, arch):
566568
return self.get_jni_dir()
567569

@@ -574,6 +576,14 @@ def get_build_dir(self, arch):
574576
def get_jni_dir(self):
575577
return join(self.ctx.bootstrap.build_dir, 'jni')
576578

579+
def build_arch(self, arch):
580+
if not self.call_ndk_build:
581+
return
582+
583+
env = self.get_recipe_env(arch)
584+
with current_directory(self.get_build_container_dir(arch)):
585+
shprint(sh.ndk_build, "V=1", self.dir_name, _env=env)
586+
577587

578588
class PythonRecipe(Recipe):
579589
site_packages_name = None
@@ -674,7 +684,7 @@ def build_compiled_components(self, arch):
674684
hostpython = sh.Command(self.hostpython_location)
675685
if self.call_hostpython_via_targetpython:
676686
shprint(hostpython, 'setup.py', 'build_ext', '-v',
677-
*self.setup_extra_args)
687+
*self.setup_extra_args, _env=env)
678688
else:
679689
hppath = join(dirname(self.hostpython_location), 'Lib',
680690
'site-packages')

pythonforandroid/recipes/freetype_ndk/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ class Freetype(NDKRecipe):
1010

1111
patches = []
1212

13+
call_ndk_build = True
14+
1315

1416
recipe = Freetype()

pythonforandroid/recipes/png/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@ class Libpng(NDKRecipe):
99

1010
patches = []
1111

12+
call_ndk_build = True
13+
1214

1315
recipe = Libpng()

0 commit comments

Comments
 (0)