MCPcopy Index your code
hub / github.com/kivy/python-for-android / build_recipes

Function build_recipes

pythonforandroid/build.py:488–557  ·  view source on GitHub ↗
(build_order, python_modules, ctx, project_dir,
                  ignore_project_setup_py=False
                 )

Source from the content-addressed store, hash-verified

486
487
488def build_recipes(build_order, python_modules, ctx, project_dir,
489 ignore_project_setup_py=False
490 ):
491 # Put recipes in correct build order
492 info_notify("Recipe build order is {}".format(build_order))
493 if python_modules:
494 python_modules = sorted(set(python_modules))
495 info_notify(
496 ('The requirements ({}) were not found as recipes, they will be '
497 'installed with pip.').format(', '.join(python_modules)))
498
499 recipes = [Recipe.get_recipe(name, ctx) for name in build_order]
500
501 # download is arch independent
502 info_main('# Downloading recipes ')
503 for recipe in recipes:
504 recipe.download_if_necessary()
505
506 for arch in ctx.archs:
507 info_main('# Building all recipes for arch {}'.format(arch.arch))
508
509 info_main('# Unpacking recipes')
510 for recipe in recipes:
511 ensure_dir(recipe.get_build_container_dir(arch.arch))
512 recipe.prepare_build_dir(arch.arch)
513
514 info_main('# Prebuilding recipes')
515 # ensure we have `ctx.python_recipe` and `ctx.hostpython`
516 Recipe.get_recipe("python3", ctx).prebuild_arch(arch)
517 ctx.hostpython = Recipe.get_recipe("hostpython3", ctx).python_exe
518
519 # 2) prebuild packages
520 for recipe in recipes:
521 info_main('Prebuilding {} for {}'.format(recipe.name, arch.arch))
522 recipe.prebuild_arch(arch)
523 recipe.apply_patches(arch)
524
525 # 3) build packages
526 info_main('# Building recipes')
527 for recipe in recipes:
528 info_main('Building {} for {}'.format(recipe.name, arch.arch))
529 if recipe.should_build(arch):
530 recipe.build_arch(arch)
531 else:
532 info('{} said it is already built, skipping'
533 .format(recipe.name))
534 recipe.install_libraries(arch)
535
536 # 4) biglink everything
537 info_main('# Biglinking object files')
538 if not ctx.python_recipe:
539 biglink(ctx, arch)
540 else:
541 warning(
542 "Context's python recipe found, "
543 "skipping biglink (will this work?)"
544 )
545

Callers 1

build_dist_from_argsFunction · 0.90

Calls 15

info_notifyFunction · 0.90
info_mainFunction · 0.90
ensure_dirFunction · 0.90
biglinkFunction · 0.85
run_pymodules_installFunction · 0.85
formatMethod · 0.80
get_recipeMethod · 0.80
download_if_necessaryMethod · 0.45
prepare_build_dirMethod · 0.45
prebuild_archMethod · 0.45
apply_patchesMethod · 0.45

Tested by

no test coverage detected